detail.vue 146 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898
  1. <template>
  2. <view class="polyv_detail">
  3. <!-- <nav-bar
  4. :title="detail.courseName || '课程详情'"
  5. v-show="navShow"
  6. ></nav-bar> -->
  7. <uni-nav-bar
  8. left-icon="back"
  9. :statusBar="true"
  10. fixed="true"
  11. :title="detail.courseName || '课程详情'"
  12. @clickLeft="clickLeft"
  13. ></uni-nav-bar>
  14. <view id="top">
  15. <view class="video_box" v-if="!startStatus">
  16. <image
  17. :src="$method.splitImgHost(goodsData.coverUrl)"
  18. mode="widthFix"
  19. style="width: 100%; height: 421rpx"
  20. ></image>
  21. <image
  22. v-if="false"
  23. class="video_play"
  24. src="/static/play.png"
  25. @click="startVideo"
  26. ></image>
  27. </view>
  28. <view v-else>
  29. <!-- v-if="playVID" -->
  30. <!-- #ifdef MP-WEIXIN -->
  31. <view class="video_box" style="width: 100%; height: 421rpx">
  32. <polyv-player
  33. v-if="playVID"
  34. id="playerVideo"
  35. playerId="playerVideo"
  36. height="421rpx"
  37. :vid="vid"
  38. :showSettingBtn="true"
  39. :enablePlayGesture="true"
  40. :custom-cache="false"
  41. :object-fit="'contain'"
  42. @statechange="onStateChange"
  43. @fullscreenchange="fullscreenchange"
  44. @error="playError"
  45. :autoplay="autoplay"
  46. :page-gesture="true"
  47. :vslide-gesture="true"
  48. :vslide-gesture-in-fullscreen="true"
  49. :isAllowSeek="isAllowSeek"
  50. :playbackRate="playbackRate"
  51. :enableAutoRotation="enableAutoRotation"
  52. @loadedmetadata="loadedmetadata"
  53. ></polyv-player>
  54. <!-- :startTime="startTime" -->
  55. <cover-view
  56. class="video-toast__close"
  57. v-if="videoToastShow"
  58. @click="closeToast()"
  59. >X</cover-view
  60. >
  61. <cover-view class="video-toast" v-if="videoToastShow">
  62. <cover-view class="video-toast__text"
  63. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  64. >
  65. <cover-view class="video-toast__btn" @click="restart()"
  66. >从头播放</cover-view
  67. >
  68. </cover-view>
  69. </view>
  70. <!-- #endif -->
  71. <!-- #ifdef H5 -->
  72. <view class="video_box" style="width: 100%; height: 421rpx">
  73. <view v-show="vid" id="player"></view>
  74. <cover-view
  75. class="video-toast__close"
  76. v-if="videoToastShow"
  77. @click="closeToast()"
  78. >X</cover-view
  79. >
  80. <cover-view class="video-toast" v-if="videoToastShow">
  81. <cover-view class="video-toast__text"
  82. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  83. >
  84. <cover-view class="video-toast__btn" @click="restart()"
  85. >从头播放</cover-view
  86. >
  87. </cover-view>
  88. </view>
  89. <!-- #endif -->
  90. <view
  91. class="video_box"
  92. style="width: 100%; height: 421rpx"
  93. v-if="playChannelId > 0"
  94. >
  95. <player
  96. class="plv-mp-demo-player"
  97. :videoOption="videoOption"
  98. :page-gesture="true"
  99. :vslide-gesture="true"
  100. :vslide-gesture-in-fullscreen="true"
  101. @onLiveStatusChange="playerLiveStatusChange"
  102. />
  103. </view>
  104. </view>
  105. <view class="course_name">
  106. <view class="course_titles">
  107. <view class="video_t1" :class="{ one: !goodsData.buyNote }">{{
  108. detail.courseName
  109. }}</view>
  110. <view class="notice_wrap" v-if="goodsData.buyNote">
  111. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  112. </view>
  113. <view
  114. class="toggle_course"
  115. v-if="goodsTeacher.length > 1"
  116. @click="changeCourses()"
  117. >
  118. <image
  119. class="img"
  120. src="/pages3/static/imgs/toggle.png"
  121. mode="widthFix"
  122. ></image>
  123. <view class="toggle_name">切换课程</view>
  124. <!-- courseTotal -->
  125. <view class="numbers">共{{ goodsTeacher.length }}门</view>
  126. </view>
  127. </view>
  128. </view>
  129. <u-line color="#D6D6DB" />
  130. <view>
  131. <view>
  132. <u-tabs
  133. :item-width="itemWidth()"
  134. :list="list"
  135. font-size="32"
  136. bar-width="24"
  137. :current="current"
  138. @change="change"
  139. active-color="#007AFF"
  140. ></u-tabs>
  141. </view>
  142. </view>
  143. <u-line color="#D6D6DB" />
  144. </view>
  145. <view class="box" :class="{ first_ml: current == 0 }">
  146. <scroll-view class="box_in" scroll-y="true">
  147. <!--目录 -->
  148. <view v-show="current == 0">
  149. <view
  150. class="top__header"
  151. v-if="livingItem"
  152. @click="goLive(livingItem)"
  153. >
  154. <image
  155. class="img"
  156. src="/pages3/static/imgs/live.png"
  157. mode="widthFix"
  158. ></image>
  159. <view class="note">正在直播中</view>
  160. <view class="title">{{ livingItem.sectionName }}</view>
  161. </view>
  162. <view
  163. v-if="teacherList && teacherList.length > 0"
  164. class="teacher_names"
  165. >
  166. <view
  167. v-for="(tea, index) in teacherList"
  168. :key="index"
  169. class="names"
  170. :class="{ nactive: teacherIndex == index }"
  171. @click="activeFunc(tea, index)"
  172. >
  173. {{ tea.aliasName }}
  174. </view>
  175. </view>
  176. <view
  177. class="menuBox onessss"
  178. v-for="(item, index) in menuList"
  179. :key="index"
  180. >
  181. <template v-if="!$method.isEmptyObject(sectionItem)">
  182. <!--模块 -->
  183. <view v-if="item.type == 1"
  184. ><courseModule
  185. v-if="reStart"
  186. :orderGoodsId="orderGoodsId"
  187. :sectionMaxNum="goodsData.sectionMaxNum"
  188. :needOpen="sectionItem.moduleId == item.menuId"
  189. :courseId="courseId"
  190. :preItem="menuList[index - 1]"
  191. :learningOrder="orderNum"
  192. :goodsId="goodsId"
  193. :gradeId="gradeId"
  194. :isBuy="true"
  195. :menuItem="item"
  196. :levelId="item.menuId"
  197. :goodsType="1"
  198. :menuAllList="menuAllList"
  199. :sectionItem="sectionItem"
  200. ></courseModule
  201. ></view>
  202. <!--章 -->
  203. <view v-if="item.type == 2"
  204. ><courseChapter
  205. v-if="reStart"
  206. :orderGoodsId="orderGoodsId"
  207. :sectionMaxNum="goodsData.sectionMaxNum"
  208. :needOpen="
  209. !sectionItem.moduleId &&
  210. sectionItem.chapterId == item.menuId
  211. "
  212. :courseId="courseId"
  213. :preItem="menuList[index - 1]"
  214. @playEnd="sectionPlayEnd($event, index)"
  215. :learningOrder="orderNum"
  216. :goodsId="goodsId"
  217. :gradeId="gradeId"
  218. :isBuy="true"
  219. :menuItem="item"
  220. :levelId="'0-' + item.menuId"
  221. :goodsType="1"
  222. :menuAllList="menuAllList"
  223. :sectionItem="sectionItem"
  224. ></courseChapter
  225. ></view>
  226. <!--节 -->
  227. <view v-if="item.type == 3"
  228. ><courseSection
  229. ref="MoudleSection"
  230. v-if="reStart"
  231. :orderGoodsId="orderGoodsId"
  232. :sectionMaxNum="goodsData.sectionMaxNum"
  233. @playEnd="sectionPlayEnd($event, index)"
  234. :courseId="courseId"
  235. :preItem="menuList[index - 1]"
  236. :learningOrder="orderNum"
  237. :goodsId="goodsId"
  238. :gradeId="gradeId"
  239. :isBuy="true"
  240. :menuItem="item"
  241. :levelId="'0-0-' + item.menuId"
  242. :goodsType="1"
  243. :testType="3"
  244. :menuAllList="menuAllList"
  245. ></courseSection
  246. ></view>
  247. </template>
  248. <!-- @togoBack="togoBack($event)" -->
  249. </view>
  250. </view>
  251. <!--讲义 -->
  252. <view v-show="current == 1">
  253. <handouts-box
  254. :handoutsId="goodsData.handoutsId"
  255. v-if="goodsData.handoutsId"
  256. ></handouts-box>
  257. </view>
  258. <!--笔记 -->
  259. <view v-show="current == 2">
  260. <view v-if="noteList.length == 0" style="text-align: center"
  261. >暂无笔记</view
  262. >
  263. <view v-for="(item, index) in noteList" :key="index">
  264. <view class="dateBox">{{
  265. $method.timestampToTime(item.dateNote)
  266. }}</view>
  267. <view class="noteBox">
  268. <view
  269. v-for="(item1, index1) in item.userNotes"
  270. :key="index1"
  271. style="margin-top: 30rpx"
  272. @click="jumpNote(item1)"
  273. >
  274. <view style="display: flex">
  275. <view class="left_ti">
  276. <view>
  277. <image
  278. src="/static/icon/note2.png"
  279. v-if="noteId != item1.noteId"
  280. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  281. ></image>
  282. <image
  283. src="/static/icon/note1.png"
  284. v-if="noteId == item1.noteId"
  285. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  286. ></image>
  287. </view>
  288. <view
  289. class="title"
  290. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  291. >{{ $method.secondToDate(item1.noteSecond) }}</view
  292. >
  293. </view>
  294. <view style="margin-left: 10rpx">
  295. <view class="t2Content leftPadding">{{
  296. item1.sectionName
  297. }}</view>
  298. <view class="tBox2">{{ item1.noteText }}</view>
  299. </view>
  300. </view>
  301. </view>
  302. </view>
  303. </view>
  304. </view>
  305. <!--答疑 -->
  306. <view v-show="current == 3" class="Answering">
  307. <view
  308. v-for="(item, index) in answerList"
  309. :key="index"
  310. style="background-color: #ffffff"
  311. class="answer_item"
  312. >
  313. <view class="chat_box" @click.stop="clearCtx">
  314. <view style="display: flex; flex: 1">
  315. <view
  316. ><image
  317. :src="
  318. item.assignUserId > 0 && !item.realname
  319. ? '/static/logo_xcx.png'
  320. : $method.splitImgHost(item.avatar)
  321. "
  322. style="width: 64rpx; height: 64rpx"
  323. ></image
  324. ></view>
  325. <view style="margin-left: 15rpx">
  326. <view class="chat1">{{
  327. item.assignUserId > 0 && !item.realname
  328. ? "祥粤老师"
  329. : item.realname
  330. }}</view>
  331. <view class="chat2">{{
  332. $method.timestampToTime(item.createTime, false)
  333. }}</view>
  334. <view class="chat3">
  335. <text v-if="item.assignUserId > 0">回复</text>
  336. <text v-if="item.assignUserId > 0" style="color: #007aff"
  337. >@{{ item.assignRealname }}</text
  338. >
  339. <view style="word-break: break-all">{{
  340. item.answerText
  341. }}</view>
  342. </view>
  343. </view>
  344. </view>
  345. <view
  346. class="btnReply"
  347. @click.stop="replyContent(item)"
  348. v-if="item.userId != userInfo.userId"
  349. >回复</view
  350. >
  351. <view v-else class="btnDel" @click.stop="delContent(item)"
  352. >删除</view
  353. >
  354. </view>
  355. <u-line color="#D6D6DB" />
  356. </view>
  357. <view v-if="answerList.length == 0" style="text-align: center"
  358. >暂无记录</view
  359. >
  360. </view>
  361. <!--目录 -->
  362. <view v-show="current == 4">
  363. <view
  364. class="menuBox"
  365. v-for="(item, index) in reMenuList"
  366. :key="index"
  367. >
  368. <!--模块 -->
  369. <view v-if="item.type == 1"
  370. ><courseModule
  371. :orderGoodsId="orderGoodsId"
  372. :sectionMaxNum="goodsData.sectionMaxNum"
  373. :courseId="courseId"
  374. :learningOrder="orderNum"
  375. :goodsId="goodsId"
  376. :gradeId="gradeId"
  377. :isRebuild="true"
  378. :isBuy="true"
  379. :menuItem="item"
  380. :levelId="item.menuId"
  381. :goodsType="1"
  382. :menuAllList="menuAllList"
  383. :sectionItem="sectionItem"
  384. ></courseModule
  385. ></view>
  386. <!--章 -->
  387. <view v-if="item.type == 2">
  388. <courseChapter
  389. :orderGoodsId="orderGoodsId"
  390. :courseId="courseId"
  391. :learningOrder="orderNum"
  392. :sectionMaxNum="goodsData.sectionMaxNum"
  393. @playEnd="sectionPlayEnd($event, index)"
  394. :gradeId="gradeId"
  395. :goodsId="goodsId"
  396. :isRebuild="true"
  397. :isBuy="true"
  398. :menuItem="item"
  399. :levelId="'0-' + item.menuId"
  400. :goodsType="1"
  401. :menuAllList="menuAllList"
  402. ></courseChapter>
  403. </view>
  404. <!--节 -->
  405. <view v-if="item.type == 3">
  406. <courseSection
  407. :orderGoodsId="orderGoodsId"
  408. :courseId="courseId"
  409. :learningOrder="orderNum"
  410. :sectionMaxNum="goodsData.sectionMaxNum"
  411. @playEnd="sectionPlayEnd($event, index)"
  412. :gradeId="gradeId"
  413. :goodsId="goodsId"
  414. :isRebuild="true"
  415. :isBuy="true"
  416. :nextMenuItem="findMenuNextSection(index)"
  417. :menuItem="item"
  418. :levelId="'0-0-' + item.menuId"
  419. :goodsType="1"
  420. :testType="3"
  421. :menuAllList="menuAllList"
  422. ></courseSection>
  423. </view>
  424. </view>
  425. </view>
  426. </scroll-view>
  427. <!-- 底部固定按钮 -->
  428. <!-- 笔记的输入框 -->
  429. <template v-if="current == 2">
  430. <view
  431. class="inputBottom"
  432. v-if="!(isPlayRebuild > 0) && playChannelId == 0"
  433. :style="{ bottom: bottomHeight + 'px' }"
  434. >
  435. <view style="width: 10%"
  436. ><image
  437. src="/static/icon/note3.png"
  438. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  439. ></image
  440. ></view>
  441. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  442. <input
  443. v-model="noteValue"
  444. height="60"
  445. fixed="true"
  446. placeholder="您可以在这里输入笔记内容"
  447. type="text"
  448. :custom-style="inputStyle"
  449. :adjust-position="false"
  450. class="input"
  451. @focus="focusNote"
  452. @blur="blurNote"
  453. />
  454. </view>
  455. <view
  456. style="
  457. color: #007aff;
  458. font-size: 30rpx;
  459. font-weight: bold;
  460. width: 15%;
  461. text-align: center;
  462. "
  463. @click="postNote"
  464. >提交</view
  465. >
  466. </view>
  467. </template>
  468. <!-- 答疑的输入框 -->
  469. <view
  470. v-if="current == 3"
  471. class="inputBottom"
  472. :style="{ bottom: bottomHeight + 'px' }"
  473. >
  474. <view class="flex_auto">
  475. <input
  476. v-model="ctxValue"
  477. height="60"
  478. fixed="true"
  479. :focus="isFocus"
  480. :placeholder="placeholder"
  481. type="text"
  482. :custom-style="inputStyle"
  483. :adjust-position="false"
  484. class="input"
  485. @focus="focusNote"
  486. @blur="blur"
  487. />
  488. </view>
  489. <view class="btn" @click="postContent">提交</view>
  490. </view>
  491. </view>
  492. <!-- 播放前拍照end -->
  493. <u-popup
  494. v-model="showSet"
  495. :mask-close-able="false"
  496. mode="center"
  497. border-radius="24"
  498. >
  499. <view
  500. style="
  501. align-items: center;
  502. padding: 0 40rpx;
  503. display: flex;
  504. flex-direction: column;
  505. justify-content: center;
  506. "
  507. >
  508. <view
  509. style="
  510. font-weight: bold;
  511. color: #333333;
  512. font-size: 30rpx;
  513. margin-top: 30rpx;
  514. "
  515. >温馨提示</view
  516. >
  517. <view
  518. style="
  519. width: 457rpx;
  520. color: #666666;
  521. font-size: 30rpx;
  522. margin-top: 30rpx;
  523. "
  524. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  525. 是否授权使用?</view
  526. >
  527. <view style="margin: 40rpx 0">
  528. <button
  529. open-type="openSetting"
  530. @bindopensetting="openSetting"
  531. class="btnSet"
  532. >
  533. 去授权
  534. </button>
  535. </view>
  536. </view>
  537. </u-popup>
  538. <u-popup
  539. v-model="photoPopup"
  540. mode="bottom"
  541. border-radius="40"
  542. :mask-close-able="false"
  543. >
  544. <!-- 播放前拍照start -->
  545. <!-- :mask-close-able="false" -->
  546. <!-- style="bottom: 0; position: fixed; width: 100%; z-index: 999" -->
  547. <view v-if="photoPopup">
  548. <view class="photoBox">
  549. <view class="photoTop">
  550. <view class="sqzz" v-if="false"
  551. ><u-icon
  552. name="close"
  553. color="#333333"
  554. size="30"
  555. @click="closePhoto"
  556. ></u-icon
  557. ></view>
  558. <view class="centersq">请正视手机屏幕</view>
  559. <view class="sqzz"></view>
  560. </view>
  561. <view class="photoCenter">
  562. <view class="center_camera" v-if="photoPopup && isTaking">
  563. <!-- #ifdef MP-WEIXIN -->
  564. <camera
  565. device-position="front"
  566. flash="off"
  567. @error="error"
  568. style="width: 100%; height: 100%"
  569. >
  570. <!-- 加人脸框 -->
  571. <cover-view class="head_take">
  572. <cover-view class="headTake_up color"></cover-view>
  573. <cover-view class="headTake_minddle">
  574. <cover-view class="min_left color"></cover-view>
  575. <cover-view class="min_img"></cover-view>
  576. <cover-view class="min_right color"></cover-view>
  577. </cover-view>
  578. <cover-view class="headTake_down color"></cover-view>
  579. </cover-view>
  580. </camera>
  581. <!-- #endif -->
  582. <!-- #ifdef H5 -->
  583. <video
  584. :controls="false"
  585. id="video"
  586. width="400"
  587. height="300"
  588. class="photo_v"
  589. ></video>
  590. <view class="mask"></view>
  591. <!-- #endif -->
  592. </view>
  593. <view class="custom" v-if="!isTaking">
  594. <!-- #ifdef MP-WEIXIN -->
  595. <image :src="avatarUrl" mode=""></image>
  596. <!-- #endif -->
  597. <!-- #ifdef H5 -->
  598. <image :src="faceUrl" mode=""></image>
  599. <!-- #endif -->
  600. </view>
  601. </view>
  602. <view class="btns">
  603. <!-- <view class="btnResult" v-if="isTaking" @click="takePhoto"
  604. >拍照</view
  605. > -->
  606. <view v-if="isTaking" class="takePhoto_btn">
  607. <view style="width: 100rpx; height: 2rpx"></view>
  608. <view class="middle_btn" @click="takePhoto">
  609. <view class="square"></view>
  610. </view>
  611. <view class="rights" @click="takePhTips()">
  612. <text>拍照提示</text>
  613. <u-icon name="arrow-right" color="#FFFFFF" size="30"></u-icon>
  614. </view>
  615. </view>
  616. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  617. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  618. </view>
  619. </view>
  620. </view>
  621. </u-popup>
  622. <u-popup
  623. v-model="noticeShow"
  624. class="notice_modal"
  625. mode="center"
  626. border-radius="28"
  627. width="650rpx"
  628. height="622rpx"
  629. :mask-close-able="false"
  630. @close="closeNotice"
  631. >
  632. <view class="content">
  633. <view class="title">学员须知</view>
  634. <scroll-view scroll-y="true">
  635. <view
  636. class="text"
  637. v-html="
  638. goodsData.buyNote && goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  639. "
  640. >
  641. </view>
  642. </scroll-view>
  643. <view
  644. class="had_read"
  645. :class="{ gray: CountTo >= 0 }"
  646. @click="noticeConfirm()"
  647. >
  648. <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
  649. <text v-else>我已阅读学员须知</text>
  650. <text v-if="CountTo >= 0">{{ " " + CountTo + "s" }}</text>
  651. </view>
  652. </view>
  653. </u-popup>
  654. <!-- 倒计时提交 -->
  655. <u-popup
  656. v-model="noticeShow1"
  657. class="notice_modal"
  658. mode="center"
  659. border-radius="28"
  660. width="650rpx"
  661. height="262rpx"
  662. :mask-close-able="false"
  663. >
  664. <view class="content">
  665. <view class="title">提示</view>
  666. <view class="had_read">
  667. <text v-if="CountTo1 >= 0">视频学习时长不达标,请等待</text>
  668. <text v-if="CountTo1 >= 0">{{ " " + CountTo1 + "s" }}</text>
  669. </view>
  670. </view>
  671. </u-popup>
  672. <u-modal
  673. v-model="showMark"
  674. title="提示"
  675. @confirm="markConfirm"
  676. @cancel="markCancel"
  677. confirm-text="复制学习网址"
  678. :show-cancel-button="true"
  679. cancel-text="关闭"
  680. >
  681. <view class="slot-content">
  682. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  683. <view>1.复制学习地址:{{ markContent }}</view>
  684. <view>2.在【浏览器中】打开复制的学习网址</view>
  685. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  686. <view>(1)账号:您个人的身份证号码</view>
  687. <view>(2)密码:身份证号码,再加111111</view>
  688. </view>
  689. </u-modal>
  690. <!-- 切换课程弹窗 -->
  691. <u-popup
  692. v-model="toggleCourseShow"
  693. mode="bottom"
  694. border-radius="40"
  695. :mask-close-able="false"
  696. >
  697. <view class="popup_box">
  698. <view class="check_head">
  699. <view class="headers">
  700. <view class="grade">切换课程</view>
  701. <u-icon
  702. name="close"
  703. color="#9C9C9C"
  704. size="40"
  705. @click="closePop()"
  706. ></u-icon>
  707. </view>
  708. <view class="coruse_num">共{{ goodsTeacher.length }}门</view>
  709. <view class="menuSel">
  710. <scroll-view class="sub_sliper" scroll-x="true">
  711. <view
  712. v-for="(item, index) in subList"
  713. :key="index"
  714. style="margin-right: 50rpx; display: inline-block"
  715. >
  716. <view
  717. class="r_t1"
  718. :class="{ nactive: subIndex == index }"
  719. @click="cMenu(item, index)"
  720. >
  721. {{ item.subjectName }}
  722. </view>
  723. </view>
  724. </scroll-view>
  725. </view>
  726. </view>
  727. <view class="check_con">
  728. <scroll-view scroll-y="true" style="height: 700rpx">
  729. <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
  730. <view
  731. v-for="(item, index) in courseItem.courseList"
  732. :key="index"
  733. v-show="
  734. item.subjectId === newActiveSubjectId || !newActiveSubjectId
  735. "
  736. >
  737. <view class="course_items" v-if="item.show && item.show == 1">
  738. <view class="course_lefts">
  739. <view class="course_title">
  740. {{ item.courseName }}
  741. </view>
  742. <view
  743. v-if="courseItem.teaList && courseItem.teaList.length > 0"
  744. class="teacher_names"
  745. >
  746. <view
  747. v-for="(tea, tindex) in courseItem.teaList"
  748. :key="tindex"
  749. class="names"
  750. >{{ tea.aliasName }}</view
  751. >
  752. </view>
  753. <view class="course_pros">
  754. 学习进度
  755. <text>
  756. {{ item.stuAllNum + item.recordNum }}/{{
  757. item.secAllNum + item.examNum
  758. }}</text
  759. >
  760. </view>
  761. </view>
  762. <view
  763. class="course_rights"
  764. @click="jump(item, gTindex, 'jump')"
  765. >
  766. <view class="cicles">
  767. <u-icon
  768. name="arrow-right"
  769. color="#498AFE"
  770. size="20"
  771. ></u-icon>
  772. </view>
  773. <view class="intoStudy">进入学习</view>
  774. </view>
  775. </view>
  776. </view>
  777. </view>
  778. </scroll-view>
  779. </view>
  780. </view>
  781. </u-popup>
  782. <!-- 拍照提示 -->
  783. <popup-photo
  784. :popupPhotoShow.sync="popupPhotoShow"
  785. @takePhoto="toTakePhoto()"
  786. ></popup-photo>
  787. </view>
  788. </template>
  789. <script>
  790. import plv from "../static/polyv-sdk/index";
  791. import courseModule from "@/components/course/courseModule.vue";
  792. import courseChapter from "@/components/course/courseChapter.vue";
  793. import courseSection from "@/components/course/courseSection.vue";
  794. import handoutsBox from "@/components/course/handoutsBox.vue";
  795. import PopupPhoto from "@/components/popup/index.vue";
  796. import { mapGetters, mapMutations } from "vuex";
  797. var polyvPlayerContext = null;
  798. export default {
  799. components: {
  800. courseModule,
  801. courseChapter,
  802. courseSection,
  803. PopupPhoto,
  804. handoutsBox,
  805. },
  806. data() {
  807. return {
  808. markContent: "http://admin.zhujianpeixun.com/",
  809. showMark: false,
  810. hasStart: false,
  811. channelItem: null,
  812. lockTimer: null,
  813. orderGoodsId: 0,
  814. noticeShow: false,
  815. navShow: true,
  816. enableAutoRotation: true,
  817. seekTime: "",
  818. toastTimer: null,
  819. videoToastShow: false,
  820. initLiveOk: false,
  821. livePlay: false, //是否正在播放直播,不含暂停
  822. liveDuration: 0, //直播观看时长
  823. videoOption: {
  824. mode: "live",
  825. uid: "",
  826. cid: "",
  827. openId: "",
  828. isAutoChange: false,
  829. forceVideo: false,
  830. },
  831. liveDetail: {},
  832. showSet: false,
  833. startStatus: false,
  834. detail: {},
  835. courseId: 0,
  836. placeholder:
  837. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  838. inputStyle: {
  839. background: "rgba(244, 244, 244, 0.98)",
  840. borderRadius: "24rpx",
  841. padding: "8rpx",
  842. marginBottom: "10rpx",
  843. },
  844. list: [],
  845. menuList: [],
  846. current: 0,
  847. vid: "",
  848. goodsId: 0,
  849. goodsData: {},
  850. photoPopup: false,
  851. goodsPlayConfig: null,
  852. autoplay: false,
  853. isAllowSeek: "no",
  854. playbackRate: [1.0],
  855. timer: null,
  856. goodsPhotographConfig: null,
  857. intervalTimeList: [], // 间隔拍照时长
  858. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  859. playTime: 0, //页面播放时长,不含暂停
  860. currentTime: 0,
  861. avatarUrl: "",
  862. ossAvatarUrl: "",
  863. studyDuration: 0, // 当前视频时长
  864. gradeId: 0,
  865. chapterId: 0,
  866. moduleId: 0,
  867. reMenuList: [],
  868. answerList: [],
  869. assignUserId: 0,
  870. placeholder: "您可以在这里输入答疑内容",
  871. ctxValue: "",
  872. noteList: [],
  873. noteValue: "",
  874. noteId: 0,
  875. recordObj: 0,
  876. gradeDetail: {},
  877. isTaking: true, //是否正在拍照
  878. needSeek: false, //第一次播放是否需要跳转
  879. needProfileModal: false, //是否需要资料审核弹框
  880. liveObj: {},
  881. photoNum: 0,
  882. photoList: [], //拍照的时间点
  883. photoConfig: false, //是否配置好拍照次数
  884. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  885. photoHistoryList: [], //已拍照历史的下标点
  886. sectionItem: {},
  887. businessData: {},
  888. showNotes: true,
  889. menuIndex: [],
  890. uploadLock: false, //上传图片
  891. isPlayRebuild: false, //是否正在播放重修视频
  892. isRebuild: false, //视频是否从重修目录点击
  893. isFocus: false,
  894. clearTimer: null,
  895. livingItem: "",
  896. option: null,
  897. muluStyle: false, //显示和隐藏目录样式
  898. bottomHeight: 0,
  899. toggleCourseShow: false, // 切换课程弹窗
  900. courseList: [], // 课程列表
  901. reStart: false, // 是否显示模块/章/节
  902. subList: [],
  903. subIndex: 0,
  904. goodsTeacher: [],
  905. teacherList: [],
  906. teacherIndex: 0,
  907. newActiveSubjectId: "", //当前选中ID
  908. compareFaceData: 0, // 拍照匹配相似度
  909. prendreAutoCarme: false, // 是否发起授权相机
  910. studyTimer: null, // 学习记录定时器
  911. CountTo: 30, // 倒计时
  912. CountTo1: 0,
  913. handoutTipLength: 0,
  914. menuAllList: [],
  915. popupPhotoShow: false,
  916. curPlayIndex: 0, // 正在播放的节的下标
  917. // h5
  918. vodPlayerJs: "https://player.polyv.net/resp/vod-player/latest/player.js",
  919. player: "",
  920. H5isAllowSeek: "on",
  921. // stream: null,
  922. faceUrl: "",
  923. erJianErZao: false,
  924. pauseTime: 0,
  925. pauseTimer: null,
  926. barTimer: null,
  927. isReach: false,
  928. noticeShow1: false,
  929. };
  930. },
  931. computed: {
  932. ...mapGetters([
  933. "userInfo",
  934. "playSectionId",
  935. "playChannelId",
  936. "playVID",
  937. "config",
  938. ]),
  939. playSecIsLearn() {
  940. return this.sectionItem.learning != 1;
  941. },
  942. orderNum() {
  943. return this.businessData.goodsLearningOrder;
  944. },
  945. },
  946. watch: {
  947. showSet(n) {
  948. if (n) {
  949. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  950. if (polyvPlayerContext) {
  951. // #ifdef MP-WEIXIN
  952. polyvPlayerContext.pause();
  953. // #endif
  954. // #ifdef H5
  955. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  956. // #endif
  957. }
  958. }
  959. },
  960. photoPopup(n) {
  961. if (n) {
  962. if (this.prendreAutoCarme) {
  963. this.photoPopup = false;
  964. }
  965. this.showSet && (this.photoPopup = false);
  966. }
  967. },
  968. },
  969. onLoad(option) {
  970. if (option.isOther) {
  971. this.showMark = true;
  972. return;
  973. }
  974. !this.userInfo && this.$api.refreshUserInfo();
  975. this.courseId = Number(option.id) || "";
  976. this.goodsId = Number(option.goodsId);
  977. this.orderGoodsId = Number(option.orderGoodsId) || "";
  978. this.gradeId = option.gradeId;
  979. this.option = option;
  980. // 公众号模板消息的数据埋点
  981. option.informId && this.clickOfficial(option.informId);
  982. },
  983. async onShow() {
  984. if (uni.getStorageSync("nofresh")) {
  985. uni.removeStorageSync("nofresh");
  986. return;
  987. }
  988. if (this.option.skipPort) {
  989. await this.$method.skipLogin(this.option.skipPort);
  990. }
  991. if (this.$method.isGoLogin()) {
  992. return;
  993. }
  994. this.closePhoto()
  995. this.courseCourseList();
  996. },
  997. onUnload() {
  998. console.log("onUnloadonUnloadonUnloadonUnload");
  999. this.originUnload();
  1000. this.clears();
  1001. },
  1002. onHide() {
  1003. this.originUnload();
  1004. },
  1005. mounted() {},
  1006. methods: {
  1007. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  1008. // 新增微信公众号模板消息点击数据
  1009. clickOfficial(informId) {
  1010. this.$http({
  1011. url: "/data/click",
  1012. method: "post",
  1013. data: { informId },
  1014. });
  1015. },
  1016. // 点击课程目录
  1017. cMenu(item, index) {
  1018. this.subIndex = index;
  1019. this.newActiveSubjectId = item.subjectId;
  1020. },
  1021. courseCourseList() {
  1022. // /course/courseList查询商品下的课程列表
  1023. this.courseList = [];
  1024. this.menuList = [];
  1025. this.photoConfig = false;
  1026. this.$api
  1027. .courseCourseList({
  1028. pageNum: 1,
  1029. pageSize: 200,
  1030. goodsId: this.goodsId,
  1031. gradeId: this.gradeId,
  1032. orderGoodsId: this.orderGoodsId,
  1033. })
  1034. .then((res) => {
  1035. if (res.data.code == 200) {
  1036. this.courseList.push.apply(this.courseList, res.data.rows);
  1037. // 科目
  1038. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  1039. let ids = [];
  1040. const newArr = [];
  1041. this.courseList.forEach((item) => {
  1042. if (ids.indexOf(item.subjectId) == -1) {
  1043. ids.push(item.subjectId);
  1044. newArr.push(item);
  1045. }
  1046. });
  1047. this.subList = [...allItem, ...newArr];
  1048. if (res.data.rows.length) {
  1049. this.courseBusiness(res.data.rows[0].businessId);
  1050. }
  1051. if (res.data.total > 1) {
  1052. this.getUserWatchLast();
  1053. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1054. } else if (res.data.total == 1) {
  1055. this.originOnShow();
  1056. this.originMounted();
  1057. }
  1058. }
  1059. });
  1060. },
  1061. /**
  1062. * 获取业务层次详情
  1063. */
  1064. courseBusiness(businessId) {
  1065. // '/app/common/course/business/'+data,
  1066. this.$api.courseBusiness(businessId).then((res) => {
  1067. this.businessData = res.data.data;
  1068. });
  1069. },
  1070. // 查询用户最后一次看的录播的信息
  1071. getUserWatchLast() {
  1072. this.$http({
  1073. url: "/study/record/getUserWatchLast",
  1074. method: "get",
  1075. data: {
  1076. orderGoodsId: this.orderGoodsId,
  1077. },
  1078. }).then((res) => {
  1079. if (res.data.code == 200) {
  1080. this.sectionItem = res.data.data || {};
  1081. if (res.data.data && Object.keys(res.data.data).length) {
  1082. //有最后一次看的录播的信息
  1083. this.courseId = res.data.data.courseId;
  1084. // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
  1085. } else {
  1086. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1087. // this.toggleCourseShow = true
  1088. }
  1089. } else {
  1090. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1091. }
  1092. this.originOnShow();
  1093. this.originMounted();
  1094. //获取商品双师资模板
  1095. this.getCourseTeacher(this.courseList);
  1096. });
  1097. },
  1098. getCourseTeacher(rows) {
  1099. this.goodsTeacher = [];
  1100. //获取商品双师资模板
  1101. this.$api
  1102. .courseTeacherList({
  1103. goodsId: this.goodsId,
  1104. })
  1105. .then((res1) => {
  1106. if (res1.data.data && res1.data.data.length > 0) {
  1107. //课程老师模板
  1108. let teacherTel = res1.data.data;
  1109. //商品课程
  1110. let courses = rows;
  1111. teacherTel.forEach((tea) => {
  1112. let dataList = [];
  1113. let teacherList = [];
  1114. courses.forEach((item) => {
  1115. let data = tea.courseList.filter(
  1116. (x) => x.courseId == item.courseId
  1117. );
  1118. if (data && data.length > 0) {
  1119. dataList.push(item);
  1120. teacherList = tea.courseList;
  1121. }
  1122. });
  1123. let result = {
  1124. teaList: teacherList,
  1125. courseList: dataList,
  1126. };
  1127. this.goodsTeacher.push(result);
  1128. });
  1129. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  1130. let courseIds = [];
  1131. this.goodsTeacher.forEach((item) => {
  1132. item.courseList.forEach((course) => {
  1133. courseIds.push(course.courseId);
  1134. });
  1135. });
  1136. if (courseIds.length > 0) {
  1137. courses.forEach((item) => {
  1138. if (!courseIds.includes(item.courseId)) {
  1139. let data = {
  1140. teaList: [],
  1141. courseList: [],
  1142. };
  1143. data.courseList.push(item);
  1144. this.goodsTeacher.push(data);
  1145. }
  1146. });
  1147. }
  1148. this.goodsTeacher.forEach((item) => {
  1149. if (item.courseList && item.courseList.length > 0) {
  1150. item.courseList[0].show = 1;
  1151. }
  1152. });
  1153. }
  1154. } else {
  1155. //没有双师资模板
  1156. rows.forEach((item) => {
  1157. item.show = 1;
  1158. let data = {
  1159. teaList: [],
  1160. courseList: [],
  1161. };
  1162. data.courseList.push(item);
  1163. this.goodsTeacher.push(data);
  1164. });
  1165. }
  1166. // console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
  1167. this.goodsTeacher.forEach((item) => {
  1168. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  1169. this.teacherList = item.teaList;
  1170. }
  1171. });
  1172. });
  1173. },
  1174. erJianErZaoPauseTip() {
  1175. if (this.playSecIsLearn && this.erJianErZao) {
  1176. if (this.pauseTimer) {
  1177. return;
  1178. }
  1179. this.pauseTime = Date.now();
  1180. console.log("开启定时器");
  1181. this.pauseTimer = setInterval(() => {
  1182. console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
  1183. if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
  1184. // 5 * 60 * 1000
  1185. let text = this.photoPopup ? "拍照停留" : "暂停";
  1186. this.photoPopup = false;
  1187. uni.showModal({
  1188. title: "提示",
  1189. showCancel: false,
  1190. content: `检测${text}时间过长,刷新当前页面`,
  1191. cancelText: "取消",
  1192. confirmText: "确定",
  1193. success: (res) => {
  1194. if (res.confirm) {
  1195. // #ifdef H5
  1196. location.reload();
  1197. // #endif
  1198. // #ifdef MP-WEIXIN
  1199. this.courseCourseList();
  1200. // #endif
  1201. }
  1202. },
  1203. });
  1204. this.clearPauseTimer();
  1205. }
  1206. }, 5000);
  1207. }
  1208. },
  1209. // 原来onshow里面的内容
  1210. originOnShow() {
  1211. this.getbaseprofiletplists().then(async (res) => {
  1212. this.courseDetail();
  1213. this.getGoodsDetail();
  1214. this.getAnswerList();
  1215. await this.studyRecordMenuAllList();
  1216. // this.answerTimer = setInterval(() => {
  1217. // this.getAnswerList();
  1218. // }, 5000);
  1219. let noteSecond = Number(this.option.noteSecond);
  1220. // console.log('noteSecondnoteSecond:', noteSecond, this.option)
  1221. if (noteSecond > 0) {
  1222. //我的消息跳过来,播放节
  1223. let item = {
  1224. sectionId: Number(this.option.sectionId),
  1225. recordingUrl: this.option.recordingUrl,
  1226. noteSecond: noteSecond,
  1227. studyDuration: noteSecond,
  1228. };
  1229. let playNextId = `moduleId${this.option.moduleId}chapterId${
  1230. this.option.chapterId
  1231. }sectionId${this.option.sectionId}${
  1232. this.option.isRebuild ? "isRebuild" : ""
  1233. }`;
  1234. this.$store.commit("setPlaySectionId", {
  1235. playSectionId: item.sectionId || item.menuId,
  1236. });
  1237. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1238. this.$store.commit("updatePlayNextId", playNextId);
  1239. this.playNoteVideo(item);
  1240. } else {
  1241. this.studyRecordQueryLiveLast();
  1242. }
  1243. });
  1244. },
  1245. // 原来的mouted内容
  1246. originMounted() {
  1247. uni.$on("changeSection", (oldSectionId) => {
  1248. console.log(
  1249. "切换课程-originMounted->playVID:",
  1250. this.playVID,
  1251. oldSectionId
  1252. );
  1253. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  1254. this.clearPauseTimer();
  1255. this.hasStart = false;
  1256. this.photoConfig = false;
  1257. this.photoIndex = 0;
  1258. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1259. if (polyvPlayerContext) {
  1260. //解决同个节视频切换问题
  1261. // #ifdef MP-WEIXIN
  1262. polyvPlayerContext.seek(0);
  1263. polyvPlayerContext.pause();
  1264. // #endif
  1265. // #ifdef H5
  1266. polyvPlayerContext.j2s_seekVideo(0);
  1267. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  1268. // #endif
  1269. }
  1270. //清除直播
  1271. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1272. this.postStudyRecord(0, oldSectionId);
  1273. });
  1274. uni.$on("getSection", (item) => {
  1275. //清除直播
  1276. this.studyTimer && clearInterval(this.studyTimer);
  1277. this.hasStart = false;
  1278. this.isPlayRebuild = item.rebuild;
  1279. this.photoConfig = false;
  1280. this.photoIndex = 0;
  1281. this.sectionItem = item;
  1282. this.moduleId = item.moduleId || null;
  1283. this.chapterId = item.chapterId || null;
  1284. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1285. this.$store.commit("setPlaySectionId", {
  1286. playSectionId: item.sectionId || item.menuId,
  1287. });
  1288. //获取拍照历史
  1289. this.getPhotoLastRecord();
  1290. this.playVideo(item);
  1291. });
  1292. uni.$on("levelId", (item) => {
  1293. let arr = item.split("-");
  1294. //点击节获取的各层级ID
  1295. this.moduleId = arr[0];
  1296. this.chapterId = arr[1];
  1297. });
  1298. uni.$on("getChannel", (item) => {
  1299. //清除录播
  1300. this.studyTimer && clearInterval(this.studyTimer);
  1301. this.hasStart = false;
  1302. this.$store.commit("setPlayVID", { playVID: null });
  1303. this.moduleId = item.moduleId;
  1304. this.chapterId = item.chapterId;
  1305. this.$store.commit("setPlaySectionId", {
  1306. playSectionId: item.sectionId || item.menuId,
  1307. });
  1308. this.getPhotoLastRecord();
  1309. this.playChannel(item);
  1310. this.channelItem = item;
  1311. });
  1312. uni.$on("isRebuild", (item) => {
  1313. this.isRebuild = item;
  1314. });
  1315. this.updateChapterOpen(true);
  1316. },
  1317. clearPauseTimer() {
  1318. if (this.pauseTimer) {
  1319. this.pauseTime = 0;
  1320. clearInterval(this.pauseTimer);
  1321. this.pauseTimer = null;
  1322. }
  1323. },
  1324. clearBarTimer() {
  1325. if (this.barTimer) {
  1326. clearInterval(this.barTimer);
  1327. this.barTimer = null;
  1328. }
  1329. },
  1330. // 原来onUnload里面的内容
  1331. originUnload() {
  1332. if (this.playSectionId > 0 && this.hasStart) {
  1333. //退出提交记录
  1334. this.postStudyRecord();
  1335. }
  1336. //清除正在播放的节ID
  1337. // this.$store.commit('setPlayObj',null)
  1338. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  1339. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1340. this.$store.commit("setPlayVID", { playVID: null });
  1341. this.closePlv();
  1342. //移除所有的事件监听器
  1343. uni.$off();
  1344. this.clearTimer && clearTimeout(this.clearTimer);
  1345. this.toastTimer && clearTimeout(this.toastTimer);
  1346. if (this.studyTimer) {
  1347. clearInterval(this.studyTimer);
  1348. this.hasStart = false;
  1349. }
  1350. this.clearPauseTimer();
  1351. this.clearBarTimer();
  1352. this.timer && clearInterval(this.timer);
  1353. if (this.lockTimer) {
  1354. clearInterval(this.lockTimer);
  1355. this.$api
  1356. .lockDelLock({
  1357. action: "jxjy",
  1358. uuid: this.$method.getUuid(),
  1359. })
  1360. .then((res) => {
  1361. uni.hideLoading();
  1362. });
  1363. }
  1364. },
  1365. changeCourses() {
  1366. this.toggleCourseShow = true;
  1367. },
  1368. closePop() {
  1369. this.toggleCourseShow = false;
  1370. },
  1371. async activeFunc(item, index) {
  1372. this.teacherIndex = index;
  1373. let findResult = "";
  1374. this.goodsTeacher.forEach((citem, index) => {
  1375. citem.courseList.forEach((e, e_index) => {
  1376. if (e.courseId == item.courseId) {
  1377. findResult = e;
  1378. }
  1379. });
  1380. });
  1381. this.jump(findResult, 1);
  1382. },
  1383. // 进入学习
  1384. async jump(item, index, type) {
  1385. // console.log('item------>', index,item,this.goodsTeacher)
  1386. if (index == 0) {
  1387. await this.nextCourses(item, type);
  1388. if (item.rebuild === 0) {
  1389. //未重修
  1390. this.$navTo.togo("/pages2/learn/details", {
  1391. id: item.courseId,
  1392. gradeId: item.gradeId,
  1393. goodsId: this.goodsId,
  1394. orderGoodsId: this.orderGoodsId,
  1395. });
  1396. return;
  1397. }
  1398. this.$api.courseDetail(item.courseId).then((res) => {
  1399. if (res.data.code == 200) {
  1400. // if (res.data.data.educationName == "继续教育") {
  1401. this.$method.checkLock().then((res) => {
  1402. this.courseId = item.courseId;
  1403. this.originOnShow();
  1404. this.originMounted();
  1405. });
  1406. }
  1407. });
  1408. } else {
  1409. if (this.orderNum == 2) {
  1410. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  1411. let prevItem = this.courseList[index - 1]; //上一课
  1412. if (prevItem.stuAllNum == prevItem.secAllNum) {
  1413. await this.nextCourses(item, type);
  1414. if (item.rebuild === 0) {
  1415. //未重修
  1416. this.$navTo.togo("/pages2/learn/details", {
  1417. id: item.courseId,
  1418. gradeId: item.gradeId,
  1419. goodsId: this.goodsId,
  1420. orderGoodsId: this.orderGoodsId,
  1421. });
  1422. return;
  1423. }
  1424. this.$api.courseDetail(item.courseId).then((res) => {
  1425. if (res.data.code == 200) {
  1426. // if (res.data.data.educationName == "继续教育") {
  1427. this.$method.checkLock().then((res) => {
  1428. this.courseId = item.courseId;
  1429. this.originOnShow();
  1430. this.originMounted();
  1431. });
  1432. }
  1433. });
  1434. } else {
  1435. uni.showToast({
  1436. icon: "none",
  1437. title: "请按顺序学完上一课再学习这一课",
  1438. });
  1439. }
  1440. } else {
  1441. await this.nextCourses(item, type);
  1442. if (item.rebuild === 0) {
  1443. //未重修
  1444. this.$navTo.togo("/pages2/learn/details", {
  1445. id: item.courseId,
  1446. gradeId: item.gradeId,
  1447. goodsId: this.goodsId,
  1448. orderGoodsId: this.orderGoodsId,
  1449. });
  1450. return;
  1451. }
  1452. this.$api.courseDetail(item.courseId).then((res) => {
  1453. if (res.data.code == 200) {
  1454. // if (res.data.data.educationName == "继续教育") {
  1455. this.$method.checkLock().then((res) => {
  1456. this.courseId = item.courseId;
  1457. this.originOnShow();
  1458. this.originMounted();
  1459. });
  1460. }
  1461. });
  1462. }
  1463. }
  1464. },
  1465. async nextCourses(item, type) {
  1466. this.vid = "";
  1467. this.hasStart = true;
  1468. await this.originUnload();
  1469. if (type) {
  1470. this.teacherIndex = 0;
  1471. this.goodsTeacher.forEach((citem) => {
  1472. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  1473. this.teacherList = citem.teaList;
  1474. }
  1475. });
  1476. }
  1477. this.reStart = false;
  1478. this.courseId = item.courseId;
  1479. this.gradeId = item.gradeId;
  1480. this.toggleCourseShow = false;
  1481. },
  1482. clickLeft() {
  1483. // uni.navigateBack()
  1484. uni.switchTab({
  1485. url: "/pages/learn/index",
  1486. });
  1487. },
  1488. markCancel() {
  1489. uni.navigateBack({
  1490. delta: 1,
  1491. });
  1492. },
  1493. markConfirm() {
  1494. uni.setClipboardData({
  1495. data: this.markContent,
  1496. success: function () {
  1497. setTimeout(() => {
  1498. uni.navigateBack({
  1499. delta: 1,
  1500. });
  1501. }, 1000);
  1502. },
  1503. });
  1504. },
  1505. closeNotice() {
  1506. this.$api
  1507. .baseHandoutTip({
  1508. orderGoodsId: this.orderGoodsId,
  1509. })
  1510. .then((res) => {});
  1511. },
  1512. noticeConfirm() {
  1513. if (this.CountTo < 0) {
  1514. this.noticeShow = false;
  1515. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1516. this.autoplay = true;
  1517. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  1518. // #ifdef MP-WEIXIN
  1519. polyvPlayerContext.play();
  1520. // #endif
  1521. // #ifdef H5
  1522. polyvPlayerContext.j2s_resumeVideo();
  1523. // #endif
  1524. }
  1525. }
  1526. },
  1527. baseHandoutTipList() {
  1528. this.$api
  1529. .baseHandoutTipList({
  1530. orderGoodsId: this.orderGoodsId,
  1531. })
  1532. .then((res) => {
  1533. this.handoutTipLength = res.data.rows.length;
  1534. if (res.data.rows.length == 0) {
  1535. this.noticeShow = true;
  1536. if (this.CountTo == 30) {
  1537. var timer = setInterval(() => {
  1538. this.CountTo--;
  1539. if (this.CountTo < 0) {
  1540. clearInterval(timer);
  1541. }
  1542. }, 1000);
  1543. }
  1544. } else {
  1545. this.CountTo = -1;
  1546. if (this.goodsPlayConfig && this.goodsPlayConfig.autoPlay > 0) {
  1547. // #ifdef MP-WEIXIN
  1548. this.autoplay = true;
  1549. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1550. polyvPlayerContext.play();
  1551. // #endif
  1552. // #ifdef H5
  1553. // polyvPlayerContext.j2s_resumeVideo()
  1554. // #endif
  1555. }
  1556. }
  1557. });
  1558. },
  1559. /**
  1560. * 获取上次观看的直播
  1561. */
  1562. studyRecordGetLastLive() {
  1563. this.$api
  1564. .studyRecordGetLastLive({
  1565. orderGoodsId: this.orderGoodsId,
  1566. courseId: this.courseId,
  1567. })
  1568. .then((res) => {
  1569. this.updateLiveLast(res.data.data);
  1570. });
  1571. },
  1572. async initPlayVideo(sectionItem) {
  1573. console.log(sectionItem, "this.sectionItem", this.menuList);
  1574. this.moduleId = sectionItem.moduleId;
  1575. this.chapterId = sectionItem.chapterId;
  1576. this.sectionItem = sectionItem;
  1577. if (sectionItem.sectionType == 1) {
  1578. //录播
  1579. this.$store.commit("setPlaySectionId", {
  1580. playSectionId: sectionItem.sectionId,
  1581. });
  1582. this.$store.commit("setPlayVID", {
  1583. playVID: sectionItem.recordingUrl,
  1584. });
  1585. await this.getPhotoLastRecord(); // 获取拍照历史
  1586. this.playVideo(sectionItem);
  1587. } else if (sectionItem.sectionType == 2) {
  1588. //直播
  1589. this.studyRecordGetLastLive();
  1590. } else if (sectionItem.sectionType == 3) {
  1591. //回放
  1592. this.$store.commit("setPlaySectionId", {
  1593. playSectionId: sectionItem.sectionId,
  1594. });
  1595. this.$store.commit("setPlayVID", {
  1596. playVID: sectionItem.recordingUrl,
  1597. });
  1598. this.playVideo(sectionItem);
  1599. } else if (sectionItem.doType == 2) {
  1600. uni.showModal({
  1601. title: "温馨提示",
  1602. content: "当前节视频已学完,是否进入考试?",
  1603. success: (res) => {
  1604. if (res.confirm) {
  1605. this.toQuestionBank(sectionItem);
  1606. }
  1607. },
  1608. });
  1609. return;
  1610. }
  1611. },
  1612. toQuestionBank(sectionItem) {
  1613. uni.navigateTo({
  1614. url:
  1615. "/pages2/class/questionBank?courseId=" +
  1616. this.courseId +
  1617. "&gradeId=" +
  1618. this.gradeId +
  1619. "&isFromVideo=1&id=" +
  1620. sectionItem.id +
  1621. "&goodsid=" +
  1622. this.goodsId +
  1623. "&moduleId=" +
  1624. (sectionItem.moduleId || 0) +
  1625. "&chapterId=" +
  1626. (sectionItem.chapterId || 0) +
  1627. "&orderGoodsId=" +
  1628. this.orderGoodsId +
  1629. "&type=" +
  1630. (sectionItem.type == 4 ? 1 : 3) +
  1631. "&learning=" +
  1632. sectionItem.studyStatus +
  1633. "&isBackVideo=" +
  1634. 1,
  1635. });
  1636. },
  1637. studyRecordQueryLiveLast() {
  1638. // /study/record/queryLiveLast
  1639. this.$api
  1640. .studyRecordQueryLiveLast({
  1641. gradeId: this.gradeId,
  1642. orderGoodsId: this.orderGoodsId,
  1643. courseId: this.courseId,
  1644. })
  1645. .then((res) => {
  1646. let { data } = res.data;
  1647. console.log(data, 789);
  1648. if (!data.sectionId) {
  1649. data = this.menuAllList[0];
  1650. } else {
  1651. if (data.learning == 1 && this.orderNum == 2) {
  1652. let next = this.menuAllList.find((e) => e.studyStatus != 1);
  1653. console.log(next, 789);
  1654. next && (data = next);
  1655. }
  1656. }
  1657. this.initPlayVideo(data);
  1658. // if (res.data.data) {
  1659. // this.moduleId = res.data.data.moduleId;
  1660. // this.chapterId = res.data.data.chapterId;
  1661. // if (res.data.data.sectionType == 1) {
  1662. // //录播
  1663. // this.$store.commit("setPlaySectionId", {
  1664. // playSectionId: res.data.data.sectionId,
  1665. // });
  1666. // this.$store.commit("setPlayVID", {
  1667. // playVID: res.data.data.recordingUrl,
  1668. // });
  1669. // this.sectionItem = res.data.data;
  1670. // await this.getPhotoLastRecord(); // 获取拍照历史
  1671. // this.playVideo(res.data.data);
  1672. // } else if (res.data.data.sectionType == 2) {
  1673. // //直播
  1674. // this.studyRecordGetLastLive();
  1675. // } else if (res.data.data.sectionType == 3) {
  1676. // //回放
  1677. // this.$store.commit("setPlaySectionId", {
  1678. // playSectionId: res.data.data.sectionId,
  1679. // });
  1680. // this.$store.commit("setPlayVID", {
  1681. // playVID: res.data.data.recordingUrl,
  1682. // });
  1683. // this.sectionItem = res.data.data;
  1684. // this.playVideo(res.data.data);
  1685. // }
  1686. // // 查询用户最后一次看的录播的信息
  1687. // this.$http({
  1688. // url: "/study/record/getUserWatchLast",
  1689. // method: "get",
  1690. // data: {
  1691. // orderGoodsId: this.orderGoodsId,
  1692. // },
  1693. // }).then((res) => {
  1694. // if (res.data.code == 200) {
  1695. // let { data } = res.data;
  1696. // if (!data) {
  1697. // const sectionItem = this.menuAllList[0];
  1698. // sectionItem.sectionType == 1 && (data = sectionItem);
  1699. // // initPlayVideo
  1700. // }
  1701. // this.sectionItem = data;
  1702. // }
  1703. // });
  1704. // }
  1705. });
  1706. },
  1707. /**
  1708. * 模块大节播放完毕,刷新列表
  1709. */
  1710. sectionPlayEnd(isRebuild, index) {
  1711. if (this.reMenuList.length > 0) {
  1712. //有重修目录
  1713. if (isRebuild.isRebuild) {
  1714. //从重修点击
  1715. this.$api
  1716. .reMenuList({
  1717. orderGoodsId: this.orderGoodsId,
  1718. courseId: this.courseId,
  1719. rebuild: 1,
  1720. gradeId: this.gradeId,
  1721. })
  1722. .then((res) => {
  1723. if (res.data.code == 200) {
  1724. if (res.data.rows.length) {
  1725. res.data.rows[index].name = res.data.rows[index].menuName;
  1726. this.$set(this.reMenuList, index, res.data.rows[index]);
  1727. for (let i = 0; i < res.data.rows.length; i++) {
  1728. let item = res.data.rows[i];
  1729. item.down = true;
  1730. item.id = item.menuId;
  1731. item.name = item.menuName;
  1732. }
  1733. this.reMenuList = [];
  1734. this.$nextTick(() => {
  1735. this.reMenuList = res.data.rows;
  1736. // console.log(this.reMenuList,'this.reMenuList1')
  1737. });
  1738. } else {
  1739. this.reMenuList = [];
  1740. }
  1741. this.$nextTick(() => {
  1742. if (this.reMenuList.length > 0) {
  1743. this.list = [
  1744. {
  1745. name: "目录",
  1746. },
  1747. {
  1748. name: "讲义",
  1749. },
  1750. {
  1751. name: "笔记",
  1752. },
  1753. {
  1754. name: "答疑",
  1755. },
  1756. { name: "重修目录" },
  1757. ];
  1758. } else {
  1759. this.list = [
  1760. {
  1761. name: "目录",
  1762. },
  1763. {
  1764. name: "讲义",
  1765. },
  1766. {
  1767. name: "笔记",
  1768. },
  1769. {
  1770. name: "答疑",
  1771. },
  1772. ];
  1773. if (this.current == 4) {
  1774. this.current = 0;
  1775. }
  1776. }
  1777. });
  1778. }
  1779. });
  1780. this.$api
  1781. .reMenuList({
  1782. courseId: this.courseId,
  1783. gradeId: this.gradeId,
  1784. orderGoodsId: this.orderGoodsId,
  1785. })
  1786. .then((res) => {
  1787. if (res.data.code == 200) {
  1788. for (let i = 0; i < res.data.rows.length; i++) {
  1789. let item = res.data.rows[i];
  1790. item.down = true;
  1791. item.id = item.menuId;
  1792. item.name = item.menuName;
  1793. item.menuType = item.type;
  1794. }
  1795. this.menuList = [];
  1796. this.$nextTick(() => {
  1797. this.menuList = res.data.rows;
  1798. });
  1799. }
  1800. });
  1801. } else {
  1802. //从普通目录点击
  1803. this.$api
  1804. .reMenuList({
  1805. courseId: this.courseId,
  1806. gradeId: this.gradeId,
  1807. orderGoodsId: this.orderGoodsId,
  1808. })
  1809. .then((res) => {
  1810. if (res.data.code == 200) {
  1811. res.data.rows[index].name = res.data.rows[index].menuName;
  1812. res.data.rows[index].id = res.data.rows[index].menuId;
  1813. this.$set(this.menuList, index, res.data.rows[index]);
  1814. }
  1815. });
  1816. this.$api
  1817. .reMenuList({
  1818. orderGoodsId: this.orderGoodsId,
  1819. courseId: this.courseId,
  1820. rebuild: 1,
  1821. gradeId: this.gradeId,
  1822. })
  1823. .then((res) => {
  1824. if (res.data.code == 200) {
  1825. if (res.data.rows.length) {
  1826. // for (let i = 0; i < res.data.rows.length; i++) {
  1827. // let item = res.data.rows[i];
  1828. // item.down = true;
  1829. // item.id = item.menuId;
  1830. // item.name = item.menuName;
  1831. // }
  1832. // this.reMenuList = res.data.rows;
  1833. } else {
  1834. this.reMenuList = [];
  1835. }
  1836. this.$nextTick(() => {
  1837. if (this.reMenuList.length > 0) {
  1838. this.list = [
  1839. {
  1840. name: "目录",
  1841. },
  1842. {
  1843. name: "讲义",
  1844. },
  1845. {
  1846. name: "笔记",
  1847. },
  1848. {
  1849. name: "答疑",
  1850. },
  1851. { name: "重修目录" },
  1852. ];
  1853. } else {
  1854. this.list = [
  1855. {
  1856. name: "目录",
  1857. },
  1858. {
  1859. name: "讲义",
  1860. },
  1861. {
  1862. name: "笔记",
  1863. },
  1864. {
  1865. name: "答疑",
  1866. },
  1867. ];
  1868. if (this.current == 4) {
  1869. this.current = 0;
  1870. }
  1871. }
  1872. });
  1873. }
  1874. });
  1875. }
  1876. } else {
  1877. console.log("--模块大节播放完毕,刷新列表-");
  1878. //没有重修目录
  1879. this.$api
  1880. .reMenuList({
  1881. courseId: this.courseId,
  1882. gradeId: this.gradeId,
  1883. orderGoodsId: this.orderGoodsId,
  1884. })
  1885. .then((res) => {
  1886. if (res.data.code == 200) {
  1887. res.data.rows[index].name = res.data.rows[index].menuName;
  1888. res.data.rows[index].id = res.data.rows[index].menuId;
  1889. this.$set(this.menuList, index, res.data.rows[index]);
  1890. }
  1891. });
  1892. }
  1893. },
  1894. goLive(item) {
  1895. let moduleId = item.moduleId || 0;
  1896. let chapterId = item.chapterId || 0;
  1897. let sectionId = item.sectionId || item.menuId;
  1898. let uuid = new Date().valueOf() + "";
  1899. // buyCourse 是否购买课程:1是 0否
  1900. let encode = encodeURIComponent(
  1901. this.config.hostLive +
  1902. "/pages/live/index?token=" +
  1903. uni.getStorageSync("token") +
  1904. "&userInfo=" +
  1905. JSON.stringify(this.userInfo) +
  1906. "&channelId=" +
  1907. item.liveUrl +
  1908. "&gradeId=" +
  1909. this.gradeId +
  1910. "&courseId=" +
  1911. this.courseId +
  1912. "&goodsId=" +
  1913. this.goodsId +
  1914. "&orderGoodsId=" +
  1915. this.orderGoodsId +
  1916. "&sectionId=" +
  1917. sectionId +
  1918. "&chapterId=" +
  1919. chapterId +
  1920. "&moduleId=" +
  1921. moduleId +
  1922. "&buyCourse=1" +
  1923. "&ident=" +
  1924. uuid
  1925. );
  1926. uni.navigateTo({
  1927. url: `../../pages/webview/index?url=` + encode,
  1928. });
  1929. },
  1930. studyRecordMenuAllList() {
  1931. // study/record/menuAllList
  1932. return this.$api
  1933. .studMenuAllList({
  1934. courseId: this.courseId,
  1935. gradeId: this.gradeId,
  1936. goodsId: this.goodsId,
  1937. })
  1938. .then((res) => {
  1939. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1940. if (res.data.data) {
  1941. this.menuAllList = res.data.data.filter(
  1942. (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
  1943. );
  1944. this.livingItem = res.data.data.find(
  1945. (item) =>
  1946. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1947. );
  1948. }
  1949. return Promise.resolve();
  1950. });
  1951. },
  1952. async getbaseprofiletplists() {
  1953. // #ifdef MP-WEIXIN
  1954. this.getCameraSetting();
  1955. // #endif
  1956. let {
  1957. data: { code, rows },
  1958. } = await this.$api.getbaseprofiletplists({
  1959. goodsId: this.goodsId,
  1960. orderGoodsId: this.orderGoodsId,
  1961. });
  1962. if (code === 200 && rows.length && rows[0].keyValue) {
  1963. let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
  1964. if (baseRes.data.code === 200 && baseRes.data.data) {
  1965. let {
  1966. data: { code, data },
  1967. } = await this.$api.getbaseprofiletpgetInfo({
  1968. goodsId: this.goodsId,
  1969. orderGoodsId: this.orderGoodsId,
  1970. });
  1971. if (
  1972. code === 200 &&
  1973. (!data || (data.status === 3 && data.changeStatus === 1))
  1974. ) {
  1975. this.needProfileModal = true;
  1976. uni.showModal({
  1977. content: !data
  1978. ? "请前往填写资料"
  1979. : "资料审核不通过,请前往重新填写",
  1980. cancelText: "返回",
  1981. success: (resultst) => {
  1982. if (resultst.confirm) {
  1983. this.$navTo.togo("/pages2/verify/input", {
  1984. id: this.goodsId,
  1985. orderGoodsId: this.orderGoodsId,
  1986. });
  1987. }
  1988. if (resultst.cancel) {
  1989. uni.navigateBack();
  1990. }
  1991. },
  1992. });
  1993. return Promise.reject();
  1994. } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
  1995. let {
  1996. data: { code, data },
  1997. } = await this.$api.getbaseprofileStampgetInfo({
  1998. goodsId: this.goodsId,
  1999. orderGoodsId: this.orderGoodsId,
  2000. });
  2001. if (
  2002. code === 200 &&
  2003. (!data || (data.status === 3 && data.changeStatus === 1))
  2004. ) {
  2005. this.needProfileModal = true;
  2006. uni.showModal({
  2007. content: !data
  2008. ? "请前往填写盖章资料"
  2009. : "资料盖章审核不通过,请前往重新填写",
  2010. cancelText: "返回",
  2011. success: (resultst) => {
  2012. if (resultst.confirm) {
  2013. this.$navTo.togo("/pages2/verify/input2", {
  2014. id: this.goodsId,
  2015. orderGoodsId: this.orderGoodsId,
  2016. });
  2017. }
  2018. if (resultst.cancel) {
  2019. uni.navigateBack();
  2020. }
  2021. },
  2022. });
  2023. return Promise.reject();
  2024. }
  2025. }
  2026. }
  2027. }
  2028. let detail = await this.$api.goodsDetail(this.goodsId);
  2029. if (detail.data.data.erJianErZao) {
  2030. let info = await this.$api.userConfirmInfoDetail({
  2031. orderGoodsId: this.orderGoodsId,
  2032. });
  2033. if (!info.data.data || info.data.data.pushInfo !== 1) {
  2034. uni.showModal({
  2035. showCancel: false,
  2036. title: "提示",
  2037. content: "开通信息推送不成功,无法进入学习!",
  2038. success: (resultst) => {
  2039. uni.navigateBack();
  2040. },
  2041. });
  2042. return Promise.reject();
  2043. }
  2044. }
  2045. return Promise.resolve();
  2046. },
  2047. getbaseprofiletplists1() {
  2048. return new Promise((resolve) => {
  2049. let self = this;
  2050. // #ifdef MP-WEIXIN
  2051. this.getCameraSetting();
  2052. // #endif
  2053. this.$api
  2054. .getbaseprofiletplists({
  2055. goodsId: self.goodsId,
  2056. orderGoodsId: this.orderGoodsId,
  2057. })
  2058. .then((res) => {
  2059. if (res.data.code === 200 && res.data.rows.length) {
  2060. console.log(res.data.rows[0], 987);
  2061. if (res.data.rows[0].keyValue) {
  2062. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  2063. if (baseRes.data.code === 200) {
  2064. if (baseRes.data.data) {
  2065. // base/profile/tp/getInfo
  2066. self.$api
  2067. .getbaseprofiletpgetInfo({
  2068. goodsId: self.goodsId,
  2069. orderGoodsId: self.orderGoodsId,
  2070. })
  2071. .then((result) => {
  2072. if (result.data.code === 200) {
  2073. // status 1通过 2是待审 3是不通过
  2074. if (
  2075. !result.data.data ||
  2076. (result.data.data.status === 3 &&
  2077. result.data.data.changeStatus === 1)
  2078. ) {
  2079. if (!result.data.data) {
  2080. self.needProfileModal = true;
  2081. uni.showModal({
  2082. content: "请前往填写资料",
  2083. cancelText: "返回",
  2084. success: function (resultst) {
  2085. if (resultst.confirm) {
  2086. self.$navTo.togo("/pages2/verify/input", {
  2087. id: self.goodsId,
  2088. orderGoodsId: self.orderGoodsId,
  2089. });
  2090. }
  2091. if (resultst.cancel) {
  2092. uni.navigateBack();
  2093. }
  2094. },
  2095. });
  2096. } else {
  2097. self.needProfileModal = true;
  2098. uni.showModal({
  2099. content: "资料审核不通过,请前往重新填写",
  2100. cancelText: "返回",
  2101. success: function (resultst) {
  2102. if (resultst.confirm) {
  2103. self.$navTo.togo("/pages2/verify/input", {
  2104. id: self.goodsId,
  2105. orderGoodsId: self.orderGoodsId,
  2106. });
  2107. }
  2108. if (resultst.cancel) {
  2109. uni.navigateBack();
  2110. }
  2111. },
  2112. });
  2113. }
  2114. } else if (
  2115. result.data.data.status === 1 &&
  2116. JSON.parse(res.data.rows[0].keyValue2)[0]
  2117. ) {
  2118. self.$api
  2119. .getbaseprofileStampgetInfo({
  2120. goodsId: self.goodsId,
  2121. orderGoodsId: self.orderGoodsId,
  2122. })
  2123. .then((k) => {
  2124. if (k.data.code === 200) {
  2125. if (
  2126. !k.data.data ||
  2127. (k.data.data.status === 3 &&
  2128. k.data.data.changeStatus === 1)
  2129. ) {
  2130. if (!k.data.data) {
  2131. self.needProfileModal = true;
  2132. uni.showModal({
  2133. cancelText: "返回",
  2134. content: "请前往填写盖章资料",
  2135. success: function (resultst) {
  2136. if (resultst.confirm) {
  2137. self.$navTo.togo(
  2138. "/pages2/verify/input2",
  2139. {
  2140. id: self.goodsId,
  2141. orderGoodsId:
  2142. self.orderGoodsId,
  2143. }
  2144. );
  2145. }
  2146. if (resultst.cancel) {
  2147. uni.navigateBack();
  2148. }
  2149. },
  2150. });
  2151. } else {
  2152. self.needProfileModal = true;
  2153. uni.showModal({
  2154. cancelText: "返回",
  2155. content:
  2156. "资料盖章审核不通过,请前往重新填写",
  2157. success: function (resultst) {
  2158. if (resultst.confirm) {
  2159. self.$navTo.togo(
  2160. "/pages2/verify/input2",
  2161. {
  2162. id: self.goodsId,
  2163. orderGoodsId:
  2164. self.orderGoodsId,
  2165. }
  2166. );
  2167. }
  2168. if (resultst.cancel) {
  2169. uni.navigateBack();
  2170. }
  2171. },
  2172. });
  2173. }
  2174. } else {
  2175. resolve();
  2176. }
  2177. }
  2178. });
  2179. } else {
  2180. resolve();
  2181. }
  2182. }
  2183. });
  2184. } else {
  2185. resolve();
  2186. }
  2187. }
  2188. });
  2189. } else {
  2190. resolve();
  2191. }
  2192. } else {
  2193. // 调用推送是否成功
  2194. resolve();
  2195. }
  2196. });
  2197. if (this.gradeId > 0) {
  2198. //提交完资料返回判断是否已开班
  2199. this.getGradeInfo();
  2200. }
  2201. });
  2202. },
  2203. /**
  2204. * 计算tabs宽度
  2205. */
  2206. itemWidth() {
  2207. return 100 / this.list.length + "%";
  2208. },
  2209. findMenuNextSection(index) {
  2210. for (let i = index + 1; i < this.reMenuList.length; i++) {
  2211. let item = this.reMenuList[i];
  2212. if (item.type == 3) {
  2213. return item;
  2214. }
  2215. }
  2216. return {};
  2217. },
  2218. loadedmetadata(event) {
  2219. if (this.hasStart) {
  2220. // 防止loadedmetadata事件第二次触发
  2221. return;
  2222. }
  2223. // #ifdef MP-WEIXIN
  2224. polyvPlayerContext = this.selectComponent("#playerVideo");
  2225. // #endif
  2226. this.hasStart = true;
  2227. uni.$off("playPause");
  2228. uni.$on("playPause", () => {
  2229. // #ifdef MP-WEIXIN
  2230. polyvPlayerContext.pause();
  2231. // #endif
  2232. // #ifdef H5
  2233. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  2234. // #endif
  2235. });
  2236. if (!this.recordObj.videoCurrentTime) {
  2237. //新视频直接提交一条观看记录
  2238. this.postStudyRecord(0);
  2239. }
  2240. this.studyTimer && clearInterval(this.studyTimer);
  2241. this.studyTimer = setInterval(() => {
  2242. this.postStudyRecord(0);
  2243. }, 15000);
  2244. },
  2245. getPhotoLastRecord() {
  2246. if (this.erJianErZao) {
  2247. return;
  2248. }
  2249. let self = this;
  2250. let data = {
  2251. sectionId: parseInt(self.playSectionId),
  2252. goodsId: parseInt(self.goodsId),
  2253. courseId: parseInt(self.courseId),
  2254. gradeId: parseInt(self.gradeId),
  2255. chapterId: parseInt(self.chapterId),
  2256. moduleId: parseInt(self.moduleId),
  2257. orderGoodsId: this.orderGoodsId,
  2258. };
  2259. // /course/photo/log/getLastInfo'
  2260. this.$api.getPhotoLastRecord(data).then((res) => {
  2261. if (res.data.code == 200) {
  2262. //清空历史数据
  2263. self.photoHistoryList = [];
  2264. this.photoIndex = 0;
  2265. self.photoList = [];
  2266. for (let i = 0; i < res.data.data.length; i++) {
  2267. //-2存储随机拍照数组
  2268. if (res.data.data[i].photoIndex == -2) {
  2269. self.photoList =
  2270. res.data.data[i].timeInterval &&
  2271. res.data.data[i].timeInterval.split(",");
  2272. } else {
  2273. self.photoHistoryList.push(res.data.data[i].photoIndex);
  2274. }
  2275. }
  2276. // console.log('7777', this.photoHistoryList, this.photoList);
  2277. }
  2278. });
  2279. },
  2280. //postTime 只提交随机时间
  2281. postCoursePhotoRecord(postTime = false) {
  2282. return new Promise((resolve, reject) => {
  2283. let currentTime = 0;
  2284. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2285. if (polyvPlayerContext) {
  2286. // #ifdef MP-WEIXIN
  2287. currentTime = polyvPlayerContext.getCurrentTime();
  2288. // #endif
  2289. // #ifdef H5
  2290. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  2291. // #endif
  2292. }
  2293. let self = this;
  2294. let photoIndex = self.photoIndex;
  2295. let data = {
  2296. photo: self.ossAvatarUrl,
  2297. sectionId: parseInt(self.playSectionId),
  2298. goodsId: parseInt(self.goodsId),
  2299. courseId: parseInt(self.courseId),
  2300. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  2301. gradeId: parseInt(self.gradeId),
  2302. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  2303. photoNum: parseInt(self.photoNum),
  2304. chapterId: parseInt(self.chapterId),
  2305. moduleId: parseInt(self.moduleId),
  2306. timeInterval: postTime ? self.photoList.join(",") : "",
  2307. orderGoodsId: this.orderGoodsId,
  2308. };
  2309. // console.log("提交接口", data);
  2310. this.$api
  2311. .coursePhotoRecord(data)
  2312. .then((res) => {
  2313. if (res.data.code == 200) {
  2314. resolve();
  2315. } else {
  2316. reject();
  2317. }
  2318. })
  2319. .catch((err) => {
  2320. reject();
  2321. });
  2322. });
  2323. },
  2324. randomNum(minNum, maxNum) {
  2325. switch (arguments.length) {
  2326. case 1:
  2327. return parseInt(Math.random() * minNum + 1, 10);
  2328. break;
  2329. case 2:
  2330. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  2331. break;
  2332. default:
  2333. return 0;
  2334. break;
  2335. }
  2336. },
  2337. //配置随机拍照时间
  2338. configPhoto() {
  2339. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2340. let totalVideoTime = 0;
  2341. let duration = 0;
  2342. // #ifdef MP-WEIXIN
  2343. totalVideoTime = polyvPlayerContext.getDuration();
  2344. duration = polyvPlayerContext.getCurrentTime();
  2345. // #endif
  2346. // #ifdef H5
  2347. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  2348. duration = polyvPlayerContext.j2s_getCurrentTime();
  2349. // #endif
  2350. let photoNum = this.photoNum;
  2351. if (!this.photoConfig) {
  2352. this.photoConfig = true;
  2353. if (this.erJianErZao) {
  2354. this.photoList = this.randomConfig(totalVideoTime, duration);
  2355. return;
  2356. }
  2357. //没有历史拍照间隔数据
  2358. if (this.photoList.length == 0) {
  2359. if (totalVideoTime >= 900) {
  2360. //大于15分钟
  2361. if (photoNum == 1) {
  2362. //开头拍1张
  2363. this.photoList.push(0);
  2364. } else if (photoNum == 3) {
  2365. //拍3张
  2366. this.photoList.push(0); //开头拍一张
  2367. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2368. let centerMinTime = centerTime - 300; //前后5分钟
  2369. let centerMaxTime = centerTime + 300;
  2370. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2371. this.photoList.push(centerTakeTime); //中间拍一张
  2372. let endMaxTime = totalVideoTime - 60;
  2373. let endMinTime = totalVideoTime - 300;
  2374. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2375. this.photoList.push(endTakeTime); //最后拍一张
  2376. }
  2377. } else {
  2378. //小于15分钟,只拍前后各一张
  2379. if (photoNum == 1) {
  2380. //开头拍1张
  2381. this.photoList.push(0);
  2382. } else if (photoNum == 3) {
  2383. this.photoList.push(1);
  2384. let centerTime = this.randomNum(
  2385. (1 / 3) * totalVideoTime,
  2386. (2 / 3) * totalVideoTime
  2387. );
  2388. this.photoList.push(centerTime);
  2389. let endTakeTime = this.randomNum(
  2390. (2 / 3) * totalVideoTime,
  2391. totalVideoTime
  2392. );
  2393. this.photoList.push(endTakeTime);
  2394. }
  2395. }
  2396. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2397. }
  2398. //兼容已有观看历史
  2399. for (let i = 0; i < this.photoList.length - 1; i++) {
  2400. if (
  2401. this.photoList[i] < duration &&
  2402. this.photoList[i + 1] > duration
  2403. ) {
  2404. this.photoIndex = i + 1;
  2405. break;
  2406. }
  2407. if (duration > this.photoList[this.photoList.length - 1]) {
  2408. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2409. break;
  2410. }
  2411. }
  2412. }
  2413. },
  2414. // 随机拍摄时间
  2415. randomConfig(totalVideoTime, duration) {
  2416. this.photoHistoryList = [];
  2417. let photoList = [duration];
  2418. let pre = duration;
  2419. if (totalVideoTime > 300) {
  2420. while (pre <= totalVideoTime) {
  2421. pre += this.randomNum(780, 900);
  2422. pre <= totalVideoTime && photoList.push(pre);
  2423. }
  2424. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  2425. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  2426. }
  2427. }
  2428. return photoList;
  2429. },
  2430. getLiveUid(channelId) {
  2431. let self = this;
  2432. return new Promise((resolve) => {
  2433. let data = {
  2434. channelId: channelId,
  2435. orderGoodsId: this.orderGoodsId,
  2436. };
  2437. self.$api.polyvSign(data).then((res) => {
  2438. resolve(res.data.data);
  2439. });
  2440. });
  2441. },
  2442. timeEventLiving() {
  2443. if (plv != null) {
  2444. if (this.livePlay) {
  2445. this.liveDuration = this.liveDuration + 1; //每隔1秒
  2446. if (this.liveDuration == 2) {
  2447. //直播第2秒拍照
  2448. if (
  2449. this.goodsPhotographConfig &&
  2450. this.goodsPhotographConfig.livephotograph == 1 &&
  2451. this.channelItem.learning != 1 &&
  2452. this.photoHistoryList.length == 0
  2453. ) {
  2454. //开启直播拍照
  2455. this.openPhoto();
  2456. } else {
  2457. this.postStudyRecord(0);
  2458. }
  2459. }
  2460. }
  2461. }
  2462. },
  2463. playerLiveStatusChange(e) {
  2464. const status = e.detail.status;
  2465. if (status === "live") {
  2466. //开始播放
  2467. if (this.timer) {
  2468. clearInterval(this.timer);
  2469. }
  2470. this.livePlay = true;
  2471. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2472. }
  2473. if (status === "end") {
  2474. this.hasStart = false;
  2475. if (this.livePlay) {
  2476. //只有播放过的结束才提交,避免未开播触发结束
  2477. this.postStudyRecord(1);
  2478. }
  2479. this.livePlay = false;
  2480. // 未开始
  2481. }
  2482. },
  2483. closePlv() {
  2484. if (plv) {
  2485. plv.destroy();
  2486. }
  2487. },
  2488. playChannel(item) {
  2489. if (this.timer) {
  2490. clearInterval(this.timer);
  2491. }
  2492. this.startStatus = true;
  2493. this.initLive();
  2494. },
  2495. setLiveOption(status) {
  2496. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2497. this.detail;
  2498. const playRecordFile =
  2499. playbackEnabled && recordFileSimpleModel && status === "end";
  2500. this.videoOption = {
  2501. mode: "live",
  2502. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2503. cid: this.playChannelId,
  2504. openId: this.userInfo.userAccount,
  2505. isAutoChange: false,
  2506. forceVideo: false,
  2507. };
  2508. },
  2509. async initLive() {
  2510. this.liveObj = await this.getLiveUid(this.playChannelId);
  2511. this.initLiveOk = true;
  2512. let optionsData = {};
  2513. optionsData.mode = "live";
  2514. optionsData.forceVideo = false;
  2515. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2516. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2517. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2518. let self = this;
  2519. this.closePlv();
  2520. plv.init(optionsData).then(({ detail, chat }) => {
  2521. self.liveDetail = detail;
  2522. // 设置mode为live的videoOption
  2523. this.setLiveOption();
  2524. if (detail.isPPT) {
  2525. chat.on(chat.events.SLICESTART, () => {
  2526. // 开始直播
  2527. });
  2528. } else {
  2529. plv.api.getOrdinaryLiveStatus(detail.stream);
  2530. }
  2531. });
  2532. },
  2533. openSetting(res) {
  2534. console.log(res, 98);
  2535. },
  2536. getCameraSetting() {
  2537. const self = this;
  2538. // 不支持h5
  2539. wx.getSetting({
  2540. success: (res) => {
  2541. if (res.authSetting["scope.camera"]) {
  2542. // 用户已经授权
  2543. self.showSet = false;
  2544. this.prendreAutoCarme = false;
  2545. } else {
  2546. this.prendreAutoCarme = true;
  2547. // 用户还没有授权,向用户发起授权请求
  2548. wx.authorize({
  2549. scope: "scope.camera",
  2550. success: () => {
  2551. // 用户同意授权
  2552. self.showSet = false;
  2553. this.prendreAutoCarme = false;
  2554. },
  2555. fail: () => {
  2556. // 用户不同意授权
  2557. self.showSet = true;
  2558. },
  2559. });
  2560. }
  2561. },
  2562. fail: (res) => {},
  2563. });
  2564. },
  2565. studyNotice() {
  2566. this.noticeShow = true;
  2567. },
  2568. //播放笔记视频
  2569. async playNoteVideo(item) {
  2570. if (this.timer) {
  2571. clearInterval(this.timer);
  2572. }
  2573. if (this.vid) {
  2574. //切换视频
  2575. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2576. polyvPlayerContext.changeVid(item.recordingUrl);
  2577. } else {
  2578. this.vid = item.recordingUrl;
  2579. }
  2580. this.recordObj = { videoCurrentTime: item.noteSecond };
  2581. if (this.recordObj.videoCurrentTime) {
  2582. this.needSeek = true; //需要跳转到播放记录
  2583. }
  2584. this.startStatus = true;
  2585. //获取节笔记
  2586. this.getNoteList();
  2587. },
  2588. //正常播放视频
  2589. async playVideo(item) {
  2590. if (this.timer) {
  2591. clearInterval(this.timer);
  2592. }
  2593. // #ifdef H5
  2594. await this.clears();
  2595. // #endif
  2596. if (this.vid) {
  2597. //切换视频
  2598. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2599. } else {
  2600. this.vid = item.recordingUrl;
  2601. }
  2602. this.recordObj = null;
  2603. this.recordObj = await this.getRecordLast();
  2604. this.needSeek = true; //跳转到播放记录
  2605. this.startStatus = true;
  2606. // #ifdef H5
  2607. await this.loadPlayerScript(this.loadPlayer);
  2608. // #endif
  2609. // 提交学习记录
  2610. // #ifdef MP-WEIXIN
  2611. this.postStudyRecord(0);
  2612. // #endif
  2613. //获取节笔记
  2614. this.getNoteList();
  2615. },
  2616. getRecordLast() {
  2617. return new Promise((resolve) => {
  2618. let data = {
  2619. gradeId:
  2620. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2621. goodsId:
  2622. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2623. sectionId: this.playSectionId || 0,
  2624. courseId:
  2625. this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2626. chapterId: this.chapterId || 0,
  2627. moduleId: this.moduleId || 0,
  2628. orderGoodsId: this.orderGoodsId,
  2629. };
  2630. this.$api.recordLast(data).then((res) => {
  2631. resolve(res.data.data);
  2632. });
  2633. });
  2634. },
  2635. jumpNote(item) {
  2636. this.noteId = item.noteId;
  2637. //没视频播放
  2638. if (this.playSectionId == 0) {
  2639. this.$u.toast("即将跳到笔记位置");
  2640. this.$store.commit("setPlaySectionId", {
  2641. playSectionId: item.sectionId || item.menuId,
  2642. });
  2643. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2644. this.playNoteVideo(item);
  2645. } else {
  2646. //正在看当前笔记视频
  2647. this.$u.toast("即将跳到笔记位置");
  2648. //跳到笔记时刻
  2649. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2650. // #ifdef MP-WEIXIN
  2651. polyvPlayerContext.seek(item.noteSecond);
  2652. polyvPlayerContext.play();
  2653. // #endif
  2654. // #ifdef H5
  2655. polyvPlayerContext.j2s_seekVideo(0);
  2656. polyvPlayerContext.j2s_resumeVideo();
  2657. // #endif
  2658. }
  2659. },
  2660. postNote() {
  2661. let self = this;
  2662. if (!(this.playSectionId > 0)) {
  2663. this.$u.toast("目前无播放视频");
  2664. return;
  2665. }
  2666. if (!this.noteValue) {
  2667. this.$u.toast("请输入内容");
  2668. return;
  2669. }
  2670. if (!this.gradeId) {
  2671. this.$u.toast("暂无班级数据");
  2672. return;
  2673. }
  2674. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2675. let noteDate = this.$method.getZeroTime();
  2676. let noteSecond = 0;
  2677. // #ifdef MP-WEIXIN
  2678. noteSecond = polyvPlayerContext.getCurrentTime();
  2679. // #endif
  2680. // #ifdef H5
  2681. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2682. // #endif
  2683. if (!noteSecond) {
  2684. if (noteSecond == 0) {
  2685. //播放结束
  2686. // #ifdef MP-WEIXIN
  2687. noteSecond = polyvPlayerContext.getDuration();
  2688. // #endif
  2689. // #ifdef H5
  2690. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2691. // #endif
  2692. }
  2693. if (!noteSecond) {
  2694. this.$u.toast("视频暂未开始");
  2695. return;
  2696. }
  2697. }
  2698. let data = {
  2699. gradeId: this.gradeId,
  2700. goodsId: this.goodsId,
  2701. sectionId: this.playSectionId,
  2702. courseId: this.courseId,
  2703. noteText: this.noteValue,
  2704. noteDate: noteDate,
  2705. noteSecond: noteSecond,
  2706. orderGoodsId: this.orderGoodsId,
  2707. };
  2708. this.$api.postNote(data).then((res) => {
  2709. if (res.data.code == 200) {
  2710. this.$u.toast("发布成功");
  2711. self.getNoteList();
  2712. this.noteValue = "";
  2713. }
  2714. });
  2715. },
  2716. getGradeInfo() {
  2717. let self = this;
  2718. this.$store.state.allowLoading = false;
  2719. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2720. if (res.data.code == 200) {
  2721. self.gradeDetail = res.data.data;
  2722. if (self.needProfileModal) {
  2723. return;
  2724. }
  2725. if (self.gradeDetail.learningStatus == 2) {
  2726. uni.showModal({
  2727. showCancel: false,
  2728. confirmText: "确定",
  2729. content:
  2730. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2731. success: function (resultst) {
  2732. uni.navigateBack();
  2733. },
  2734. });
  2735. }
  2736. if (
  2737. self.gradeDetail.learningStatus == 3 &&
  2738. Number(self.gradeDetail.learningTimeStart) >
  2739. Number(new Date() / 1000)
  2740. ) {
  2741. uni.showModal({
  2742. showCancel: false,
  2743. cancelText: "返回",
  2744. content:
  2745. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2746. success: function (resultst) {
  2747. uni.navigateBack();
  2748. },
  2749. });
  2750. }
  2751. }
  2752. });
  2753. this.$store.state.allowLoading = true;
  2754. },
  2755. getNoteList() {
  2756. let self = this;
  2757. self.noteList = [];
  2758. let data = {
  2759. courseId: this.courseId,
  2760. gradeId: this.gradeId,
  2761. goodsId: this.goodsId,
  2762. orderGoodsId: this.orderGoodsId,
  2763. };
  2764. if (this.playSectionId > 0) {
  2765. data.sectionId = this.playSectionId;
  2766. }
  2767. this.$api.noteList(data).then((res) => {
  2768. if (res.data.code == 200) {
  2769. self.noteList = res.data.rows;
  2770. }
  2771. });
  2772. },
  2773. delAnswer(answerId) {
  2774. let self = this;
  2775. let data = {
  2776. answerId: answerId,
  2777. status: -1,
  2778. orderGoodsId: this.orderGoodsId,
  2779. };
  2780. this.$api.delAnswer(data).then((res) => {
  2781. if (res.data.code == 200) {
  2782. self.getAnswerList();
  2783. }
  2784. });
  2785. },
  2786. clearCtx() {
  2787. this.placeholder = "您可以在这里输入答疑内容";
  2788. this.ctxValue = "";
  2789. this.assignUserId = 0;
  2790. },
  2791. focusNote(event) {
  2792. this.bottomHeight = event.detail.height;
  2793. },
  2794. blurNote() {
  2795. this.bottomHeight = 0;
  2796. },
  2797. blur() {
  2798. this.bottomHeight = 0;
  2799. this.clearTimer = setTimeout(() => {
  2800. this.ctxValue = "";
  2801. this.isFocus = false;
  2802. this.assignUserId = 0;
  2803. this.placeholder = "您可以在这里输入答疑内容";
  2804. }, 2000);
  2805. },
  2806. replyContent(item) {
  2807. this.isFocus = true;
  2808. this.assignUserId = item.userId;
  2809. this.placeholder = "@" + item.realname;
  2810. },
  2811. delContent(item) {
  2812. this.delAnswer(item.answerId);
  2813. },
  2814. postAnswer() {
  2815. let self = this;
  2816. let data = {
  2817. courseId: this.courseId,
  2818. answerText: this.ctxValue,
  2819. goodsId: this.goodsId,
  2820. orderGoodsId: this.orderGoodsId,
  2821. };
  2822. if (this.assignUserId > 0) {
  2823. data.assignUserId = this.assignUserId;
  2824. }
  2825. this.$api.postAnswer(data).then((res) => {
  2826. if (res.data.code == 200) {
  2827. this.$u.toast("发布成功");
  2828. self.getAnswerList();
  2829. this.isFocus = false;
  2830. this.placeholder = "您可以在这里输入答疑内容";
  2831. this.ctxValue = "";
  2832. this.assignUserId = 0;
  2833. }
  2834. });
  2835. },
  2836. postContent() {
  2837. if (!this.ctxValue || this.ctxValue == "") {
  2838. this.$u.toast("请输入内容");
  2839. return;
  2840. }
  2841. this.postAnswer();
  2842. },
  2843. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2844. let currentTime = 0;
  2845. let PlayDuration = 0;
  2846. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2847. if (polyvPlayerContext) {
  2848. // #ifdef MP-WEIXIN
  2849. currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
  2850. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2851. // #endif
  2852. // #ifdef H5
  2853. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2854. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2855. // #endif
  2856. }
  2857. // if (currentTime < 15 && !this.ossAvatarUrl) {
  2858. // return;
  2859. // }
  2860. if (this.playChannelId > 0) {
  2861. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2862. }
  2863. let self = this;
  2864. let data = {
  2865. fromPlat: 1, //来源平台 1小程序 2网站
  2866. photo: self.ossAvatarUrl,
  2867. sectionId: sectionId || 0,
  2868. goodsId: parseInt(self.goodsId),
  2869. courseId: parseInt(self.courseId),
  2870. orderGoodsId: this.orderGoodsId,
  2871. studyDuration: parseInt(
  2872. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2873. ),
  2874. gradeId: parseInt(self.gradeId),
  2875. chapterId: this.chapterId || 0,
  2876. moduleId: this.moduleId || 0,
  2877. videoCurrentTime: parseInt(
  2878. currentTime > 0 ? currentTime : self.studyDuration
  2879. ),
  2880. erJianErZao: this.erJianErZao,
  2881. };
  2882. if (this.ossAvatarUrl) {
  2883. data.similarity = this.compareFaceData; // 相似度
  2884. }
  2885. if (status > 0) {
  2886. data.status = status;
  2887. }
  2888. console.log(data, "记录参数");
  2889. return new Promise((resolve, reject) => {
  2890. this.$api
  2891. .studyRecord(data)
  2892. .then((res) => {
  2893. console.log(res, "记录返回");
  2894. let { code, msg } = res.data;
  2895. if (code == 200) {
  2896. if (status > 0) {
  2897. this.studyRecordMenuAllList();
  2898. let moduleId = this.moduleId || 0;
  2899. let chapterId = this.chapterId || 0;
  2900. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2901. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2902. uni.$emit("playNext" + playNextIdisRebuild, {
  2903. fromRebuild: this.isRebuild,
  2904. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2905. uni.$emit("playNext" + playNextId); //通知播放结束
  2906. }
  2907. self.ossAvatarUrl = "";
  2908. } else if (code == 600) {
  2909. uni.showModal({
  2910. showCancel: false,
  2911. title: "提示",
  2912. content: msg,
  2913. success: (resultst) => {
  2914. uni.navigateBack();
  2915. },
  2916. });
  2917. } else if (code == 558) {
  2918. this.CountTo1 = msg.split(",")[1];
  2919. this.noticeShow1 = true;
  2920. var timer = setInterval(() => {
  2921. this.CountTo1--;
  2922. if (this.CountTo1 < 0) {
  2923. this.noticeShow1 = false;
  2924. clearInterval(timer);
  2925. this.postStudyRecord(1);
  2926. }
  2927. }, 1000);
  2928. reject("中断执行");
  2929. } else {
  2930. this.uploadLock = false;
  2931. uni.showToast({
  2932. icon: "none",
  2933. title: res.data.msg,
  2934. duration: 2000,
  2935. });
  2936. if (this.erJianErZao && code == 559) {
  2937. this.isReach = true;
  2938. this.openPhoto();
  2939. }
  2940. if (code == 559 || code == 588) {
  2941. reject("中断执行");
  2942. }
  2943. }
  2944. resolve();
  2945. })
  2946. .catch((err) => {
  2947. this.studyRecordMenuAllList();
  2948. });
  2949. });
  2950. },
  2951. uploadFile(options, int) {
  2952. var self = this;
  2953. return new Promise((resolve, reject) => {
  2954. var data = {
  2955. imageStatus: int,
  2956. gradeId: this.gradeId,
  2957. orderGoodsId: this.orderGoodsId,
  2958. };
  2959. self.$api.aliyunpolicy(data).then((res) => {
  2960. if (res.data.code != 200) {
  2961. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2962. return;
  2963. }
  2964. var ossToken = res.data.data.resultContent;
  2965. if (ossToken.host == null || ossToken.host == undefined) {
  2966. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2967. return;
  2968. }
  2969. let filePath = "";
  2970. // #ifdef H5
  2971. var localData = options; //dataUrl为base64位
  2972. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2973. let length = base.length;
  2974. let url = new Uint8Array(length);
  2975. while (length--) {
  2976. url[length] = base.charCodeAt(length);
  2977. }
  2978. filePath = new File([url], "a.jpg", {
  2979. type: "image/jpg",
  2980. });
  2981. uni.uploadFile({
  2982. url: ossToken.host,
  2983. name: "file",
  2984. file: filePath,
  2985. fileType: "image",
  2986. header: {
  2987. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2988. },
  2989. formData: {
  2990. key: ossToken.dir,
  2991. OSSAccessKeyId: ossToken.accessid,
  2992. policy: ossToken.policy,
  2993. Signature: ossToken.signature,
  2994. callback: ossToken.callback,
  2995. success_action_status: 200,
  2996. },
  2997. success: (result) => {
  2998. this.$u.toast("上传成功");
  2999. self.ossAvatarUrl = ossToken.dir;
  3000. resolve();
  3001. },
  3002. fail: (error) => {
  3003. uni.showToast({
  3004. title: "上传接口报错,请重新拍照上传" + error,
  3005. icon: "none",
  3006. });
  3007. this.openPhoto();
  3008. return;
  3009. },
  3010. });
  3011. // #endif
  3012. // #ifdef MP-WEIXIN
  3013. uni.uploadFile({
  3014. url: ossToken.host,
  3015. name: "file",
  3016. filePath: options,
  3017. fileType: "image",
  3018. header: {
  3019. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  3020. },
  3021. formData: {
  3022. key: ossToken.dir,
  3023. OSSAccessKeyId: ossToken.accessid,
  3024. policy: ossToken.policy,
  3025. Signature: ossToken.signature,
  3026. callback: ossToken.callback,
  3027. success_action_status: 200,
  3028. },
  3029. success: (result) => {
  3030. // if (result.statusCode === 200) {
  3031. this.$u.toast("上传成功");
  3032. self.ossAvatarUrl = ossToken.dir;
  3033. resolve();
  3034. },
  3035. fail: (error) => {
  3036. uni.showToast({
  3037. title: "上传接口报错,请重新拍照上传" + error,
  3038. icon: "none",
  3039. });
  3040. this.openPhoto();
  3041. return;
  3042. },
  3043. });
  3044. // #endif
  3045. });
  3046. });
  3047. },
  3048. imageInfos() {
  3049. var self = this;
  3050. return new Promise(async (resolve, reject) => {
  3051. // #ifdef MP-WEIXIN
  3052. uni.getImageInfo({
  3053. src: self.avatarUrl,
  3054. success: async (res) => {
  3055. let canvasWidth = res.width; //图片原始长宽
  3056. let canvasHeight = res.height;
  3057. if (canvasWidth > 2000 || canvasHeight > 2000) {
  3058. // h5不支持
  3059. uni.compressImage({
  3060. src: self.avatarUrl,
  3061. quality: 75,
  3062. width: "35%",
  3063. height: "35%",
  3064. success: async (rest) => {
  3065. const waitUpload = await self.uploadFile(
  3066. rest.tempFilePath,
  3067. 0
  3068. );
  3069. resolve(waitUpload);
  3070. },
  3071. });
  3072. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  3073. uni.compressImage({
  3074. src: self.avatarUrl,
  3075. quality: 75,
  3076. width: "50%",
  3077. height: "50%",
  3078. success: async (rest) => {
  3079. const waitUpload = await self.uploadFile(
  3080. rest.tempFilePath,
  3081. 0
  3082. );
  3083. resolve(waitUpload);
  3084. },
  3085. });
  3086. } else {
  3087. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  3088. resolve(waitUpload);
  3089. }
  3090. },
  3091. fail: (err) => {
  3092. this.$u.toast("图片上传失败");
  3093. },
  3094. });
  3095. // #endif
  3096. // #ifdef H5
  3097. const waitUpload = await this.uploadFile(this.faceUrl, 0);
  3098. resolve(waitUpload);
  3099. // #endif
  3100. });
  3101. },
  3102. timeEvent() {
  3103. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3104. if (polyvPlayerContext != null) {
  3105. // #ifdef MP-WEIXIN
  3106. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  3107. // #endif
  3108. // #ifdef H5
  3109. this.playTime = polyvPlayerContext.j2s_getCurrentTime();
  3110. // #endif
  3111. this.configPhoto();
  3112. console.info(this.photoList, "photoList");
  3113. let photoTime = 0; //获取拍照秒数
  3114. for (let i = 0; i < this.photoList.length; i++) {
  3115. photoTime = Number(this.photoList[i]); //获取拍照秒数
  3116. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  3117. //3秒区间内才触发拍照,避免拉动滚动条
  3118. if (this.photoHistoryList.indexOf(i) < 0) {
  3119. //不存在拍照历史,没有重修过,没有学过,则拍照
  3120. //启动拍照
  3121. //暂停
  3122. console.log("去拍照");
  3123. // #ifdef MP-WEIXIN
  3124. polyvPlayerContext.exitFullScreen();
  3125. polyvPlayerContext.pause();
  3126. // #endif
  3127. // #ifdef H5
  3128. polyvPlayerContext.j2s_pauseVideo();
  3129. polyvPlayerContext.toggleFullscreen();
  3130. // #endif
  3131. this.photoIndex = i;
  3132. if (
  3133. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  3134. this.goodsId
  3135. ) {
  3136. this.openPhoto();
  3137. } else {
  3138. this.popupPhotoShow = true;
  3139. uni.setStorageSync(
  3140. `tabkePhotoShow${this.goodsId}`,
  3141. this.goodsId
  3142. ); // 本地缓存用来判断是否已经弹出过弹窗
  3143. }
  3144. }
  3145. }
  3146. }
  3147. }
  3148. },
  3149. closeToast() {
  3150. clearTimeout(this.toastTimer);
  3151. this.videoToastShow = false;
  3152. },
  3153. restart() {
  3154. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3155. // #ifdef MP-WEIXIN
  3156. polyvPlayerContext.seek(0);
  3157. // #endif
  3158. // #ifdef H5
  3159. polyvPlayerContext.j2s_seekVideo(0);
  3160. // #endif
  3161. clearTimeout(this.toastTimer);
  3162. this.videoToastShow = false;
  3163. },
  3164. // 新增用户视频学习日志
  3165. studyLog() {
  3166. this.$http({
  3167. url: "/user/study/log",
  3168. method: "post",
  3169. data: {
  3170. goodsId: this.goodsId,
  3171. courseId: this.courseId,
  3172. moduleId: this.moduleId || 0,
  3173. chapterId: this.chapterId || 0,
  3174. sectionId: this.playSectionId || 0,
  3175. fromPlat: 1, //来源平台 1小程序 2PC网站
  3176. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  3177. orderGoodsId: this.orderGoodsId,
  3178. },
  3179. }).then((res) => {});
  3180. },
  3181. async onStateChange(newstate, oldstate) {
  3182. polyvPlayerContext = this.selectComponent("#playerVideo");
  3183. if (newstate.detail.newstate == "playing") {
  3184. console.log("播放");
  3185. if (this.needSeek) {
  3186. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3187. if (this.recordObj.videoCurrentTime) {
  3188. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  3189. this.seekTime = this.$method.secondToDate(
  3190. this.recordObj.videoCurrentTime
  3191. );
  3192. this.videoToastShow = true;
  3193. this.toastTimer = setTimeout(() => {
  3194. this.videoToastShow = false;
  3195. }, 3000);
  3196. } else {
  3197. polyvPlayerContext.seek(1); //避免相同节继续播放
  3198. }
  3199. polyvPlayerContext.play();
  3200. this.needSeek = false;
  3201. // 新增用户视频学习日志
  3202. this.studyLog();
  3203. // 提交学习记录
  3204. }
  3205. //开始播放
  3206. this.timer && clearInterval(this.timer);
  3207. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3208. this.clearPauseTimer();
  3209. this.isReach = false;
  3210. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3211. }
  3212. }
  3213. if (newstate.detail.newstate == "pause") {
  3214. console.log("暂停");
  3215. this.erJianErZaoPauseTip();
  3216. clearInterval(this.timer);
  3217. //暂停提交记录
  3218. }
  3219. if (newstate.detail.newstate == "ended") {
  3220. clearInterval(this.timer);
  3221. uni.showToast({
  3222. icon: "none",
  3223. title: "播放完毕",
  3224. });
  3225. this.hasStart = false;
  3226. await this.postStudyRecord(1);
  3227. this.nextSection();
  3228. }
  3229. },
  3230. //播放下一节
  3231. nextSection() {
  3232. console.log("播放下一节");
  3233. if (!this.menuAllList.length) {
  3234. return;
  3235. }
  3236. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  3237. let i_sectionId = item.sectionId || 0;
  3238. let i_chapterId = item.chapterId || 0;
  3239. let i_moduleId = item.moduleId || 0;
  3240. return (
  3241. i_sectionId == this.playSectionId &&
  3242. i_chapterId == this.chapterId &&
  3243. i_moduleId == this.moduleId
  3244. );
  3245. });
  3246. let data = this.menuAllList[this.curPlayIndex + 1];
  3247. if (!data) {
  3248. //第二个弹窗
  3249. uni.showModal({
  3250. title: "温馨提示",
  3251. content: "当前最后一节视频已学完 请检查所有章节是否学习完成?",
  3252. showCancel: false,
  3253. success: (res) => {
  3254. if (res.confirm) {
  3255. }
  3256. },
  3257. });
  3258. } else {
  3259. if (data.doType == 2) {
  3260. if (data.studyStatus == 1) {
  3261. uni.showToast({
  3262. title: "试卷已合格!",
  3263. duration: 2000,
  3264. icon: "none",
  3265. });
  3266. return;
  3267. }
  3268. uni.showModal({
  3269. title: "温馨提示",
  3270. content: "当前节视频已学完,是否进入考试?",
  3271. success: (res) => {
  3272. if (res.confirm) {
  3273. this.toQuestionBank(data);
  3274. }
  3275. },
  3276. });
  3277. return;
  3278. }
  3279. uni.showModal({
  3280. title: "温馨提示",
  3281. content: "当前节视频已学完,继续学习下一节?",
  3282. success: async (res) => {
  3283. if (res.confirm) {
  3284. this.moduleId = data.moduleId;
  3285. this.chapterId = data.chapterId;
  3286. this.sectionId = data.sectionId;
  3287. if (data.sectionType == 1) {
  3288. //录播
  3289. this.$store.commit("setPlaySectionId", {
  3290. playSectionId: data.sectionId,
  3291. });
  3292. this.$store.commit("setPlayVID", {
  3293. playVID: data.recordingUrl,
  3294. });
  3295. this.hasStart = false;
  3296. this.photoConfig = false;
  3297. this.photoIndex = 0;
  3298. this.sectionItem = data;
  3299. await this.getPhotoLastRecord(); // 获取拍照历史
  3300. this.playVideo(data);
  3301. } else if (data.sectionType == 2) {
  3302. //直播
  3303. this.studyRecordGetLastLive();
  3304. } else if (data.sectionType == 3) {
  3305. //回放
  3306. this.$store.commit("setPlaySectionId", {
  3307. playSectionId: data.sectionId,
  3308. });
  3309. this.$store.commit("setPlayVID", {
  3310. playVID: data.recordingUrl,
  3311. });
  3312. this.sectionItem = data;
  3313. this.playVideo(data);
  3314. }
  3315. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  3316. this.$store.commit("updatePlayNextId", playNextId);
  3317. this.updateChapterOpen(true);
  3318. this.reStart = false;
  3319. this.getMenuList();
  3320. }
  3321. },
  3322. });
  3323. }
  3324. },
  3325. //拍照
  3326. openPhoto() {
  3327. if (polyvPlayerContext) {
  3328. // #ifdef MP-WEIXIN
  3329. polyvPlayerContext.exitFullScreen();
  3330. // #endif
  3331. // #ifdef H5
  3332. if (this.isFullScreen()) {
  3333. this.exitFullscreen();
  3334. }
  3335. // #endif
  3336. }
  3337. // #ifdef MP-WEIXIN
  3338. this.enableAutoRotation = false;
  3339. this.photoPopup = true;
  3340. this.isTaking = true;
  3341. uni.setKeepScreenOn({
  3342. keepScreenOn: true,
  3343. });
  3344. uni.authorize({
  3345. scope: "scope.camera",
  3346. success() {},
  3347. });
  3348. // #endif
  3349. // #ifdef H5
  3350. if (
  3351. (window.navigator.mediaDevices &&
  3352. window.navigator.mediaDevices.getUserMedia) ||
  3353. window.navigator.getUserMedia ||
  3354. window.navigator.webkitGetUserMedia ||
  3355. window.navigator.mozGetUserMedia
  3356. ) {
  3357. console.log("getUserMedia----");
  3358. // 调用用户媒体设备, 访问摄像头
  3359. this.getUserMedia(
  3360. {
  3361. video: {
  3362. width: 400,
  3363. height: 300,
  3364. },
  3365. },
  3366. this.photographSuccess,
  3367. this.photographError
  3368. );
  3369. } else {
  3370. console.log("1111没有摄像");
  3371. this.photographError();
  3372. }
  3373. // #endif
  3374. },
  3375. /**
  3376. * 人脸匹配
  3377. */
  3378. faceRecognition() {
  3379. return new Promise((resolve) => {
  3380. // #ifdef MP-WEIXIN
  3381. let fileSystem = uni.getFileSystemManager();
  3382. fileSystem.readFile({
  3383. filePath: `${this.avatarUrl}`,
  3384. encoding: "base64",
  3385. position: 0,
  3386. success: (res) => {
  3387. let base64 = "data:image/jpg;base64," + res.data;
  3388. // console.log('base64Data人脸识别参数:', {
  3389. // imageA: base64,
  3390. // orderGoodsId: this.orderGoodsId,
  3391. // gradeId: this.gradeId,
  3392. // })
  3393. this.CompareFace(base64, resolve);
  3394. },
  3395. fail(err) {
  3396. // this.$u.toast('人脸识别错误!')
  3397. console.error(err, "err-----人脸识别错误");
  3398. },
  3399. });
  3400. // #endif
  3401. // #ifdef H5
  3402. this.CompareFace(this.faceUrl, resolve);
  3403. // #endif
  3404. });
  3405. },
  3406. CompareFace(url, resolve) {
  3407. let timer = setTimeout(() => {
  3408. uni.showToast({
  3409. icon: "none",
  3410. title: "拍照超时,请重新拍照",
  3411. duration: 2000,
  3412. success: () => {
  3413. setTimeout(() => {
  3414. uni.navigateBack();
  3415. }, 1000);
  3416. },
  3417. });
  3418. }, 10 * 1000);
  3419. this.$api
  3420. .faceCertificationCompareFace({
  3421. imageA: url,
  3422. orderGoodsId: this.orderGoodsId,
  3423. gradeId: this.gradeId,
  3424. })
  3425. .then((res) => {
  3426. clearTimeout(timer);
  3427. console.log(res, "人脸识别成功res");
  3428. resolve(res.data.data);
  3429. })
  3430. .catch((err) => {
  3431. clearTimeout(timer);
  3432. // 当前网络延迟,
  3433. console.log("人脸识别错误:", err);
  3434. uni.showModal({
  3435. content: "当前网络延迟",
  3436. showCancel: false,
  3437. success: (resultst) => {
  3438. if (resultst.confirm) {
  3439. uni.navigateBack();
  3440. }
  3441. },
  3442. });
  3443. });
  3444. },
  3445. // 确定拍照
  3446. async submit() {
  3447. if (this.uploadLock) {
  3448. return;
  3449. }
  3450. this.uploadLock = true;
  3451. let compareFaceData = await this.faceRecognition();
  3452. console.log(compareFaceData, "compareFaceData");
  3453. this.compareFaceData = compareFaceData;
  3454. if (compareFaceData >= 80) {
  3455. const waitYS = await this.imageInfos();
  3456. this.postCoursePhotoRecord()
  3457. .then(async (res) => {
  3458. this.photoHistoryList.push(this.photoIndex);
  3459. // console.log('拍照确定提交', this.photoHistoryList);
  3460. this.postStudyRecord(); //提交记录
  3461. if (this.erJianErZao && this.isReach) {
  3462. console.log("1校验");
  3463. await this.postStudyRecord(1);
  3464. this.photoPopup = false;
  3465. this.uploadLock = false;
  3466. this.enableAutoRotation = true;
  3467. this.nextSection();
  3468. return;
  3469. }
  3470. //恢复播放
  3471. // #ifdef MP-WEIXIN
  3472. uni.setKeepScreenOn({
  3473. keepScreenOn: false,
  3474. });
  3475. // #endif
  3476. this.photoPopup = false;
  3477. this.uploadLock = false;
  3478. this.enableAutoRotation = true;
  3479. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3480. if (polyvPlayerContext != null) {
  3481. // #ifdef MP-WEIXIN
  3482. polyvPlayerContext.play();
  3483. // #endif
  3484. // #ifdef H5
  3485. polyvPlayerContext.j2s_resumeVideo();
  3486. // #endif
  3487. }
  3488. })
  3489. .catch((err) => {
  3490. console.log("拍照记录接口的err", err);
  3491. uni.showToast({
  3492. title: "上传接口报错,请重新拍照上传" + err,
  3493. icon: "none",
  3494. });
  3495. this.uploadLock = false;
  3496. this.openPhoto();
  3497. });
  3498. } else {
  3499. uni.showToast({
  3500. title: "人脸匹配不通过,请重新拍照上传",
  3501. icon: "none",
  3502. duration: 2000,
  3503. });
  3504. setTimeout(() => {
  3505. this.uploadLock = false;
  3506. this.openPhoto();
  3507. }, 2000);
  3508. }
  3509. },
  3510. reTake() {
  3511. this.isTaking = true;
  3512. // #ifdef H5
  3513. this.faceUrl = "";
  3514. this.getUserMedia(
  3515. {
  3516. video: {
  3517. width: 400,
  3518. height: 300,
  3519. },
  3520. },
  3521. this.photographSuccess,
  3522. this.photographError
  3523. );
  3524. // #endif
  3525. },
  3526. toTakePhoto() {
  3527. this.popupPhotoShow = false;
  3528. this.openPhoto();
  3529. },
  3530. takePhTips() {
  3531. this.popupPhotoShow = true;
  3532. this.isTaking = false;
  3533. this.photoPopup = false;
  3534. this.enableAutoRotation = false;
  3535. },
  3536. //确认拍照
  3537. takePhoto() {
  3538. // #ifdef MP-WEIXIN
  3539. const ctx = uni.createCameraContext();
  3540. ctx.takePhoto({
  3541. quality: "high",
  3542. success: (res) => {
  3543. this.avatarUrl = res.tempImagePath;
  3544. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  3545. this.isTaking = false;
  3546. },
  3547. fail: (err) => {},
  3548. });
  3549. // #endif
  3550. // #ifdef H5
  3551. const canvas = document.createElement("canvas");
  3552. canvas.width = 400;
  3553. canvas.height = 400;
  3554. const context = canvas.getContext("2d");
  3555. const video = document.querySelector("video");
  3556. context.drawImage(video, 0, 0, 400, 400);
  3557. this.faceUrl = canvas.toDataURL("image/png");
  3558. this.isTaking = false;
  3559. // #endif
  3560. },
  3561. playError(e) {
  3562. console.log(e);
  3563. },
  3564. //拍照报错
  3565. error(e) {
  3566. console.log(e.detail);
  3567. },
  3568. //关闭相机
  3569. closePhoto() {
  3570. this.photoPopup = false;
  3571. self.enableAutoRotation = true;
  3572. },
  3573. /**
  3574. * 进入全屏
  3575. */
  3576. fullscreenchange(event) {
  3577. if (event.detail.direction == "vertical") {
  3578. this.navShow = true;
  3579. } else if (event.detail.direction == "horizontal") {
  3580. this.navShow = false;
  3581. }
  3582. },
  3583. checkFinishRequiredCourse() {
  3584. return this.$api
  3585. .checkFinishRequiredCourse({
  3586. businessId: this.goodsData.businessId,
  3587. goodsId: this.goodsId,
  3588. })
  3589. .then((res) => {
  3590. if (res.data.data > 0) {
  3591. uni.showModal({
  3592. showCancel: false,
  3593. confirmText: "确定",
  3594. content: "该业务层次下有未学完的商品,无法学习新商品!",
  3595. success: function (resultst) {
  3596. uni.navigateBack();
  3597. },
  3598. });
  3599. return Promise.reject();
  3600. }
  3601. return Promise.resolve();
  3602. });
  3603. },
  3604. getGoodsDetail() {
  3605. let self = this;
  3606. this.$api.goodsDetail(this.goodsId).then(async (res) => {
  3607. this.goodsData = res.data.data;
  3608. this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
  3609. if (self.goodsData.buyNote) {
  3610. this.baseHandoutTipList();
  3611. }
  3612. self.gradeId = self.goodsData.gradeId;
  3613. self.erJianErZao = self.goodsData.erJianErZao;
  3614. this.courseBusiness(this.goodsData.businessId);
  3615. self.getMenuList();
  3616. self.getReMenuList(); //获取重修目录
  3617. setTimeout(function () {
  3618. if (!self.needProfileModal) {
  3619. self.getGradeInfo();
  3620. }
  3621. }, 500);
  3622. //获取节笔记
  3623. this.getNoteList();
  3624. if (self.goodsData.goodsPlayConfig) {
  3625. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  3626. if (self.goodsPlayConfig.autoPlay > 0) {
  3627. // #ifdef H5
  3628. self.autoplay = true;
  3629. // #endif
  3630. }
  3631. if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
  3632. // #ifdef MP-WEIXIN
  3633. self.isAllowSeek = "yes";
  3634. // #endif
  3635. // #ifdef H5
  3636. self.H5isAllowSeek = "off";
  3637. // #endif
  3638. }
  3639. if (self.goodsPlayConfig.speed > 0) {
  3640. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  3641. }
  3642. }
  3643. if (self.goodsData.goodsPhotographConfig) {
  3644. self.goodsPhotographConfig = JSON.parse(
  3645. self.goodsData.goodsPhotographConfig
  3646. );
  3647. if (self.goodsPhotographConfig.photoNum > 0) {
  3648. self.photoNum = self.goodsPhotographConfig.photoNum;
  3649. }
  3650. }
  3651. });
  3652. },
  3653. startVideo() {
  3654. this.startStatus = true;
  3655. },
  3656. getAnswerList() {
  3657. let self = this;
  3658. this.$api
  3659. .answerList({
  3660. courseId: this.courseId,
  3661. goodsId: this.goodsId,
  3662. orderGoodsId: this.orderGoodsId,
  3663. })
  3664. .then((res) => {
  3665. if (res.data.code == 200) {
  3666. self.answerList = res.data.rows;
  3667. }
  3668. });
  3669. },
  3670. getReMenuList() {
  3671. // console.log('重修的目录');
  3672. let self = this;
  3673. this.$api
  3674. .reMenuList({
  3675. orderGoodsId: this.orderGoodsId,
  3676. courseId: this.courseId,
  3677. rebuild: 1,
  3678. gradeId: this.gradeId,
  3679. })
  3680. .then((res) => {
  3681. if (res.data.code == 200) {
  3682. for (let i = 0; i < res.data.rows.length; i++) {
  3683. let item = res.data.rows[i];
  3684. item.down = true;
  3685. item.id = item.menuId;
  3686. item.name = item.menuName;
  3687. }
  3688. self.reMenuList = res.data.rows;
  3689. if (self.reMenuList.length > 0) {
  3690. this.showNotes = false;
  3691. self.list = [
  3692. {
  3693. name: "目录",
  3694. },
  3695. {
  3696. name: "讲义",
  3697. },
  3698. {
  3699. name: "笔记",
  3700. },
  3701. {
  3702. name: "答疑",
  3703. },
  3704. { name: "重修目录" },
  3705. ];
  3706. this.current = 0;
  3707. if (Object.keys(this.sectionItem).length) {
  3708. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3709. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3710. }
  3711. } else {
  3712. if (Object.keys(this.sectionItem).length) {
  3713. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3714. this.$store.commit("updatePlayNextId", playNextId);
  3715. }
  3716. self.list = [
  3717. {
  3718. name: "目录",
  3719. },
  3720. {
  3721. name: "讲义",
  3722. },
  3723. {
  3724. name: "笔记",
  3725. },
  3726. {
  3727. name: "答疑",
  3728. },
  3729. ];
  3730. this.current = 0;
  3731. }
  3732. }
  3733. });
  3734. },
  3735. getMenuList() {
  3736. // console.log('menuList的目录');
  3737. let self = this;
  3738. // /course/menuList 查询课程目录结构列表
  3739. this.$api
  3740. .reMenuList({
  3741. courseId: this.courseId,
  3742. gradeId: this.gradeId,
  3743. orderGoodsId: this.orderGoodsId,
  3744. })
  3745. .then((res) => {
  3746. if (res.data.code == 200) {
  3747. for (let i = 0; i < res.data.rows.length; i++) {
  3748. let item = res.data.rows[i];
  3749. item.down = true;
  3750. item.id = item.menuId;
  3751. item.name = item.menuName;
  3752. item.menuType = item.type;
  3753. }
  3754. self.menuList = res.data.rows;
  3755. this.reStart = true;
  3756. for (let i = 0; i < res.data.rows.length; i++) {
  3757. if (res.data.rows[i].type == 1) {
  3758. // 模块
  3759. if (Object.keys(this.sectionItem).length) {
  3760. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3761. this.menuIndex = [i];
  3762. break;
  3763. }
  3764. } else {
  3765. this.menuIndex = [i];
  3766. break;
  3767. }
  3768. } else if (res.data.rows[i].type == 2) {
  3769. // 章
  3770. if (Object.keys(this.sectionItem).length) {
  3771. if (
  3772. res.data.rows[i].menuId == this.sectionItem.chapterId &&
  3773. (!this.sectionItem.moduleId ||
  3774. this.sectionItem.moduleId == 0)
  3775. ) {
  3776. this.menuIndex = [i];
  3777. break;
  3778. }
  3779. } else {
  3780. this.menuIndex = [i];
  3781. break;
  3782. }
  3783. }
  3784. }
  3785. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3786. }
  3787. });
  3788. },
  3789. courseDetail() {
  3790. let self = this;
  3791. // '/course/'+data,
  3792. this.$api.courseDetail(this.courseId).then((res) => {
  3793. if (res.data.code == 200) {
  3794. // if (res.data.data.educationName == "继续教育") {
  3795. this.$api
  3796. .lockLockAction({
  3797. action: "jxjy",
  3798. uuid: this.$method.getUuid(),
  3799. })
  3800. .then((res) => {});
  3801. this.lockTimer = setInterval(() => {
  3802. this.$api
  3803. .lockLockAction({
  3804. action: "jxjy",
  3805. uuid: this.$method.getUuid(),
  3806. })
  3807. .then((res) => {});
  3808. }, 10000);
  3809. // websocket.sendMsg("doCourse");
  3810. // }
  3811. self.detail = res.data.data;
  3812. }
  3813. });
  3814. },
  3815. open(item) {
  3816. item.showChildren = !item.showChildren;
  3817. },
  3818. change(index) {
  3819. this.current = index;
  3820. },
  3821. clickMulu() {
  3822. this.muluStyle = !this.muluStyle;
  3823. },
  3824. loadPlayerScript(callback) {
  3825. if (!window.polyvPlayer) {
  3826. const myScript = document.createElement("script");
  3827. myScript.setAttribute("src", this.vodPlayerJs);
  3828. myScript.onload = callback;
  3829. document.body.appendChild(myScript);
  3830. } else {
  3831. callback();
  3832. }
  3833. },
  3834. // 播放视频
  3835. loadPlayer() {
  3836. const polyvPlayer = window.polyvPlayer;
  3837. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  3838. this.player = await polyvPlayer({
  3839. wrap: "#player",
  3840. width: "100%",
  3841. showLine: "off",
  3842. height: 218,
  3843. ban_history_time: "on",
  3844. vid: this.vid,
  3845. forceH5: true,
  3846. autoplay: this.autoplay, // 自动播放
  3847. ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
  3848. speed: this.playbackRate, // 倍数
  3849. teaser_show: 1,
  3850. tail_show: 1,
  3851. hideSwitchPlayer: true,
  3852. watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
  3853. ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
  3854. sign: res.data.data.sign, // 移动端播放加密视频所需的签名
  3855. });
  3856. polyvPlayerContext = this.player;
  3857. this.player.on("s2j_onPlayStart", async (vid) => {
  3858. // 视频初次播放时触发
  3859. console.log("视频初次播放时触发:");
  3860. // #ifdef H5
  3861. // h5禁止拖动进度条
  3862. if (!this.$method.isWeixin()) {
  3863. this.clearBarTimer();
  3864. let originTime = this.recordObj.videoCurrentTime || 0;
  3865. if (this.H5isAllowSeek == "on") {
  3866. this.barTimer = setInterval(() => {
  3867. const currentTime = polyvPlayerContext.j2s_getCurrentTime();
  3868. // console.log(currentTime, originTime, 789);
  3869. if (
  3870. currentTime - originTime > 15 ||
  3871. currentTime - originTime < 0
  3872. ) {
  3873. polyvPlayerContext.j2s_seekVideo(originTime);
  3874. } else {
  3875. originTime = currentTime;
  3876. }
  3877. }, 2000);
  3878. }
  3879. }
  3880. // #endif
  3881. this.loadedmetadata();
  3882. this.postStudyRecord(0);
  3883. });
  3884. this.player.on("s2j_onVideoPause", () => {
  3885. // 视频暂停时触发
  3886. console.log("视频暂停时触发", this.vid);
  3887. this.erJianErZaoPauseTip();
  3888. this.clearBarTimer();
  3889. clearInterval(this.studyTimer);
  3890. clearInterval(this.timer);
  3891. });
  3892. this.player.on("s2j_onVideoPlay", () => {
  3893. // 视频初次播放或由暂停恢复播放时触发
  3894. console.log("视频初次播放或由暂停恢复播放时触发");
  3895. if (this.needSeek) {
  3896. if (this.recordObj.videoCurrentTime) {
  3897. this.seekTime = this.$method.secondToDate(
  3898. this.recordObj.videoCurrentTime
  3899. );
  3900. this.videoToastShow = true;
  3901. this.toastTimer = setTimeout(() => {
  3902. this.videoToastShow = false;
  3903. }, 3000);
  3904. }
  3905. this.needSeek = false;
  3906. // 新增用户视频学习日志
  3907. this.studyLog();
  3908. }
  3909. //开始播放
  3910. this.timer && clearInterval(this.timer);
  3911. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3912. this.clearPauseTimer();
  3913. this.isReach = false;
  3914. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3915. }
  3916. this.studyTimer && clearInterval(this.studyTimer);
  3917. this.studyTimer = setInterval(() => {
  3918. this.postStudyRecord(0, this.playSectionId);
  3919. }, 15000);
  3920. });
  3921. this.player.on("s2j_onPlayOver", async () => {
  3922. // 当前视频播放完毕时触发
  3923. this.hasStart = false;
  3924. this.clearBarTimer();
  3925. clearInterval(this.studyTimer);
  3926. clearInterval(this.timer);
  3927. uni.showToast({
  3928. icon: "none",
  3929. title: "播放完毕",
  3930. });
  3931. await this.postStudyRecord(1);
  3932. this.nextSection(); // 播放下一节
  3933. });
  3934. });
  3935. },
  3936. clears() {
  3937. return new Promise((resolve, reject) => {
  3938. this.vid = "";
  3939. this.player && this.player.destroy();
  3940. resolve();
  3941. });
  3942. },
  3943. /**
  3944. * 退出全屏
  3945. */
  3946. exitFullscreen() {
  3947. try {
  3948. var de = document;
  3949. if (de.exitFullscreen) {
  3950. de.exitFullscreen();
  3951. } else if (de.mozCancelFullScreen) {
  3952. de.mozCancelFullScreen();
  3953. } else if (de.webkitCancelFullScreen) {
  3954. de.webkitCancelFullScreen();
  3955. }
  3956. } catch (err) {}
  3957. },
  3958. fullele() {
  3959. return (
  3960. document.fullscreenElement ||
  3961. document.webkitFullscreenElement ||
  3962. document.msFullscreenElement ||
  3963. document.mozFullScreenElement ||
  3964. null
  3965. );
  3966. },
  3967. //判断是否全屏
  3968. isFullScreen() {
  3969. return !!(document.webkitIsFullScreen || this.fullele());
  3970. },
  3971. getUserMedia(constraints, success, error) {
  3972. console.log("getUserMedia===", constraints, "success:", success);
  3973. if (window.navigator.mediaDevices.getUserMedia) {
  3974. // 最新的标准API
  3975. window.navigator.mediaDevices
  3976. .getUserMedia(constraints)
  3977. .then(success)
  3978. .catch(error);
  3979. } else if (window.navigator.webkitGetUserMedia) {
  3980. // webkit核心浏览器
  3981. window.navigator.webkitGetUserMedia(constraints, success, error);
  3982. } else if (window.navigator.mozGetUserMedia) {
  3983. // firfox浏览器
  3984. window.navigator.mozGetUserMedia(constraints, success, error);
  3985. } else if (window.navigator.getUserMedia) {
  3986. // 旧版API
  3987. window.navigator.getUserMedia(constraints, success, error);
  3988. }
  3989. },
  3990. photographSuccess(stream) {
  3991. console.log("有摄像头---", stream);
  3992. this.photoPopup = true;
  3993. this.isTaking = true;
  3994. this.enableAutoRotation = false;
  3995. this.$nextTick(() => {
  3996. const video = document.querySelector("video");
  3997. console.log("video:", video);
  3998. video.srcObject = stream;
  3999. video.play();
  4000. });
  4001. },
  4002. photographError(err) {
  4003. console.log("没有摄像头:", err);
  4004. uni.showModal({
  4005. title: "提示",
  4006. content:
  4007. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  4008. cancelText: "取消",
  4009. confirmText: "确定",
  4010. success: (res) => {
  4011. if (res.confirm) {
  4012. uni.navigateBack();
  4013. } else if (res.cancel) {
  4014. }
  4015. },
  4016. });
  4017. },
  4018. },
  4019. };
  4020. </script>
  4021. <style lang="scss" scope>
  4022. @import "./css/detail.scss";
  4023. .top {
  4024. &__header {
  4025. position: relative;
  4026. width: 100%;
  4027. height: 150rpx;
  4028. padding: 24rpx 150rpx 24rpx 24rpx;
  4029. .img {
  4030. position: absolute;
  4031. left: 0;
  4032. top: 0;
  4033. width: 100%;
  4034. }
  4035. .note {
  4036. position: relative;
  4037. z-index: 10;
  4038. font-size: 24rpx;
  4039. font-family: PingFang SC;
  4040. font-weight: bold;
  4041. color: #efdbff;
  4042. }
  4043. .title {
  4044. position: relative;
  4045. z-index: 10;
  4046. font-size: 26rpx;
  4047. font-family: PingFang SC;
  4048. font-weight: bold;
  4049. color: #ffffff;
  4050. }
  4051. }
  4052. }
  4053. #top {
  4054. position: relative;
  4055. z-index: 99;
  4056. }
  4057. .polyv_detail {
  4058. display: flex;
  4059. flex-direction: column;
  4060. height: 100vh;
  4061. position: relative;
  4062. top: 0;
  4063. left: 0;
  4064. .pops {
  4065. position: absolute;
  4066. top: 0;
  4067. left: 0;
  4068. background: #ccc;
  4069. opacity: 0.5;
  4070. width: 100%;
  4071. height: 300rpx;
  4072. z-index: 9999;
  4073. }
  4074. .box {
  4075. flex: 1;
  4076. overflow: hidden;
  4077. margin: 16rpx 16rpx 100rpx 16rpx;
  4078. .box_in {
  4079. height: 100%;
  4080. }
  4081. }
  4082. .first_ml {
  4083. margin: 16rpx 16rpx 16rpx 16rpx;
  4084. }
  4085. }
  4086. .btnSet {
  4087. width: 440rpx;
  4088. height: 80rpx;
  4089. background: #007aff;
  4090. border-radius: 40rpx;
  4091. color: #ffffff;
  4092. font-size: 28rpx;
  4093. line-height: 80rpx;
  4094. }
  4095. .btnReply {
  4096. width: 80rpx;
  4097. height: 40rpx;
  4098. background: #e3f0ff;
  4099. border-radius: 16rpx;
  4100. text-align: center;
  4101. color: #007aff;
  4102. }
  4103. .btnDel {
  4104. width: 80rpx;
  4105. height: 40rpx;
  4106. background: #ffedf0;
  4107. border-radius: 16rpx;
  4108. text-align: center;
  4109. color: #ff2d55;
  4110. }
  4111. .btnReply {
  4112. width: 80rpx;
  4113. height: 40rpx;
  4114. background: #e3f0ff;
  4115. border-radius: 16rpx;
  4116. font-size: 24rpx;
  4117. }
  4118. .lecture-content {
  4119. background: #fff;
  4120. margin-top: 10rpx;
  4121. padding: 10rpx;
  4122. border-radius: 16rpx;
  4123. }
  4124. .photoBox {
  4125. width: 100%;
  4126. // background-color: #ffffff;
  4127. // border-radius: 24px 24px 0px 0px;
  4128. .photoTop {
  4129. width: 100%;
  4130. height: 74rpx;
  4131. border-radius: 20px 20px 0px 0px;
  4132. background-color: #ffffff;
  4133. display: flex;
  4134. align-items: center;
  4135. justify-content: center;
  4136. padding: 0rpx 38rpx;
  4137. .sqzz {
  4138. width: 28rpx;
  4139. height: 28rpx;
  4140. display: flex;
  4141. align-items: center;
  4142. justify-content: center;
  4143. }
  4144. .centersq {
  4145. color: #333;
  4146. font-size: 30rpx;
  4147. font-weight: 500;
  4148. }
  4149. }
  4150. .photoCenter {
  4151. width: 750rpx;
  4152. height: 75vh;
  4153. position: relative;
  4154. .center_camera {
  4155. width: 100%;
  4156. height: 75vh;
  4157. position: fixed;
  4158. .head_take {
  4159. width: 100%;
  4160. height: 75vh;
  4161. display: flex;
  4162. flex-direction: column;
  4163. }
  4164. .headTake_up {
  4165. width: 100%;
  4166. height: 100rpx;
  4167. }
  4168. .headTake_minddle {
  4169. display: flex;
  4170. .min_img {
  4171. width: 500rpx;
  4172. height: 550rpx;
  4173. }
  4174. .min_left,
  4175. .min_right {
  4176. flex: 1;
  4177. height: 550rpx;
  4178. }
  4179. }
  4180. .headTake_down {
  4181. width: 100%;
  4182. flex: 1;
  4183. }
  4184. .color {
  4185. background-color: #333;
  4186. opacity: 0.5;
  4187. }
  4188. .photo_v {
  4189. width: 100%;
  4190. height: 100%;
  4191. }
  4192. .mask {
  4193. width: 500rpx;
  4194. height: 550rpx;
  4195. position: absolute;
  4196. top: 100rpx;
  4197. left: 0;
  4198. right: 0;
  4199. bottom: 0;
  4200. margin: 0 auto;
  4201. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  4202. }
  4203. }
  4204. .custom {
  4205. width: 750rpx;
  4206. height: 75vh;
  4207. position: absolute;
  4208. z-index: 1000;
  4209. top: 0;
  4210. left: 0;
  4211. image {
  4212. width: 100%;
  4213. height: 100%;
  4214. }
  4215. }
  4216. }
  4217. .btns {
  4218. display: flex;
  4219. .takePhoto_btn {
  4220. width: 100%;
  4221. display: flex;
  4222. align-items: center;
  4223. justify-content: space-between;
  4224. background: #a9a7a9;
  4225. padding: 40rpx 26rpx;
  4226. .middle_btn {
  4227. width: 120rpx;
  4228. height: 120rpx;
  4229. border-radius: 40rpx;
  4230. border: 4rpx solid #ffffff;
  4231. display: flex;
  4232. align-items: center;
  4233. justify-content: center;
  4234. }
  4235. .square {
  4236. width: 96rpx;
  4237. height: 96rpx;
  4238. background: #ffffff;
  4239. border-radius: 28rpx;
  4240. }
  4241. .rights {
  4242. font-size: 32rpx;
  4243. font-weight: 500;
  4244. color: #ffffff;
  4245. }
  4246. }
  4247. .btnResult {
  4248. height: 100rpx;
  4249. flex: 1;
  4250. background-color: #07c160;
  4251. text-align: center;
  4252. line-height: 100rpx;
  4253. color: #fff;
  4254. font-size: 32rpx;
  4255. font-weight: bold;
  4256. }
  4257. }
  4258. }
  4259. .chat_box {
  4260. display: flex;
  4261. padding: 20rpx;
  4262. justify-content: space-between;
  4263. }
  4264. .chat3 {
  4265. font-size: 30rpx;
  4266. font-family: PingFang SC;
  4267. font-weight: 500;
  4268. color: #666666;
  4269. margin-top: 10rpx;
  4270. }
  4271. .chat2 {
  4272. font-size: 20rpx;
  4273. font-family: PingFang SC;
  4274. font-weight: 500;
  4275. color: #999999;
  4276. margin-top: 10rpx;
  4277. }
  4278. .chat1 {
  4279. font-size: 24rpx;
  4280. font-family: PingFang SC;
  4281. font-weight: 500;
  4282. color: #333333;
  4283. }
  4284. .leftPadding {
  4285. margin-left: 8rpx;
  4286. }
  4287. .t2Content {
  4288. font-size: 24rpx;
  4289. font-family: PingFang SC;
  4290. font-weight: bold;
  4291. color: #999999;
  4292. line-height: 48rpx;
  4293. }
  4294. .tBox2 {
  4295. display: flex;
  4296. padding-top: 10rpx;
  4297. color: #333333;
  4298. font-size: 30rpx;
  4299. font-weight: 400;
  4300. }
  4301. .tBox {
  4302. display: flex;
  4303. align-items: center;
  4304. padding-top: 10rpx;
  4305. }
  4306. .title {
  4307. font-size: 24rpx;
  4308. color: #999999;
  4309. }
  4310. .Answering {
  4311. .answer_item {
  4312. &:nth-child(2) {
  4313. border-radius: 16rpx 16rpx 0rpx 0rpx;
  4314. }
  4315. &:nth-last-child(1) {
  4316. border-radius: 0rpx 0rpx 16rpx 16rpx;
  4317. }
  4318. }
  4319. }
  4320. .inputBottom {
  4321. position: fixed;
  4322. left: 0;
  4323. bottom: 0;
  4324. background: #ffffff;
  4325. height: 98rpx;
  4326. display: flex;
  4327. align-items: center;
  4328. width: 100%;
  4329. .flex_auto {
  4330. flex: 1;
  4331. margin-left: 10%;
  4332. word-break: break-all;
  4333. // .input {
  4334. // height: 60rpx;
  4335. // }
  4336. }
  4337. .btn {
  4338. color: #007aff;
  4339. font-size: 30rpx;
  4340. font-weight: bold;
  4341. width: 15%;
  4342. text-align: center;
  4343. }
  4344. .input {
  4345. background: rgba(244, 244, 244, 0.98);
  4346. height: 60rpx;
  4347. border-radius: 24rpx;
  4348. margin-top: 12rpx;
  4349. }
  4350. }
  4351. .noteBox {
  4352. width: 100%;
  4353. background: #ffffff;
  4354. padding: 0rpx 10rpx 20rpx;
  4355. border-radius: 16rpx;
  4356. overflow: hidden;
  4357. .left_ti {
  4358. padding-top: 14rpx;
  4359. }
  4360. }
  4361. .dateBox {
  4362. width: 216rpx;
  4363. height: 48rpx;
  4364. background: #ffffff;
  4365. border-radius: 24rpx;
  4366. font-size: 24rpx;
  4367. color: #666666;
  4368. text-align: center;
  4369. line-height: 48rpx;
  4370. margin: 16rpx 0rpx 8rpx;
  4371. }
  4372. .t_content1 {
  4373. color: #007aff;
  4374. margin-left: 10rpx;
  4375. }
  4376. .tag1 {
  4377. border: 2rpx solid #007aff;
  4378. border-radius: 8rpx;
  4379. font-size: 20rpx;
  4380. color: #007aff;
  4381. padding: 5rpx;
  4382. }
  4383. .b_title {
  4384. color: #333333;
  4385. font-size: 30rpx;
  4386. font-weight: bold;
  4387. }
  4388. page {
  4389. background: #eaeef1;
  4390. }
  4391. .menuBox {
  4392. width: 100%;
  4393. background: #ffffff;
  4394. border-radius: 16rpx;
  4395. padding: 0rpx 20rpx;
  4396. margin-bottom: 20rpx;
  4397. }
  4398. .btnspric {
  4399. border-top: 1rpx solid #eee;
  4400. display: flex;
  4401. align-items: center;
  4402. justify-content: space-between;
  4403. height: 108rpx;
  4404. padding-left: 43rpx;
  4405. padding-right: 32rpx;
  4406. }
  4407. .btnspric > .lefprL {
  4408. font-size: 36rpx;
  4409. color: #0c141f;
  4410. font-weight: bold;
  4411. }
  4412. .btnspric > .lefprR {
  4413. padding: 0rpx 24rpx;
  4414. height: 60rpx;
  4415. line-height: 60rpx;
  4416. text-align: center;
  4417. color: #fff;
  4418. background: #32467b;
  4419. border-radius: 24rpx;
  4420. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4421. }
  4422. .yhj,
  4423. .hdyhj {
  4424. padding: 24rpx 29rpx 24rpx 34rpx;
  4425. }
  4426. .yhj {
  4427. border-bottom: 16rpx solid #f9f9f9;
  4428. }
  4429. .yhjtit {
  4430. font-size: 30rpx;
  4431. color: #0c141f;
  4432. font-weight: 500;
  4433. margin-bottom: 14rpx;
  4434. }
  4435. .yhjList {
  4436. display: flex;
  4437. align-items: center;
  4438. justify-content: space-between;
  4439. margin-bottom: 14rpx;
  4440. }
  4441. .yhjList > .yhjLefts {
  4442. display: flex;
  4443. align-items: center;
  4444. }
  4445. .yhjLefts > .yhl {
  4446. color: #32467b;
  4447. font-size: 30rpx;
  4448. margin-right: 31rpx;
  4449. }
  4450. .yhjLefts > .yhbq {
  4451. font-size: 24rpx;
  4452. color: #ff9500;
  4453. border-radius: 18rpx;
  4454. background-color: rgba(255, 149, 0, 0.2);
  4455. border: 2rpx solid #ff9500;
  4456. height: 38rpx;
  4457. line-height: 38rpx;
  4458. padding: 0rpx 16rpx;
  4459. }
  4460. .ts {
  4461. font-size: 24rpx;
  4462. color: #999;
  4463. margin: 14rpx 0rpx;
  4464. padding-right: 29rpx;
  4465. padding-left: 34rpx;
  4466. }
  4467. .yh {
  4468. padding-top: 20rpx;
  4469. }
  4470. .yh > .yhtitle {
  4471. display: flex;
  4472. align-items: center;
  4473. justify-content: space-between;
  4474. padding-right: 29rpx;
  4475. padding-left: 34rpx;
  4476. }
  4477. .priceBxs {
  4478. display: flex;
  4479. align-items: center;
  4480. }
  4481. .priceBxs > .pricleft {
  4482. border-radius: 24rpx;
  4483. border: 1rpx solid #e91313;
  4484. background-color: rgba(233, 19, 19, 0.1);
  4485. padding: 0rpx 18rpx;
  4486. height: 49rpx;
  4487. line-height: 49rpx;
  4488. text-align: center;
  4489. font-size: 30rpx;
  4490. font-weight: 500;
  4491. color: #e91313;
  4492. margin-right: 13rpx;
  4493. }
  4494. .topBox {
  4495. padding: 32rpx 32rpx 24rpx;
  4496. border-bottom: 1rpx solid #eeeeee;
  4497. }
  4498. .topBox > .boldFonstType {
  4499. font-weight: 500;
  4500. font-size: 30rpx;
  4501. margin: 16rpx 0rpx 23rpx;
  4502. }
  4503. .topBox > .firstTopL {
  4504. display: flex;
  4505. align-items: center;
  4506. }
  4507. .topBox > .firstTopL > .imageBs {
  4508. width: 331rpx;
  4509. height: 160rpx;
  4510. border-radius: 6rpx;
  4511. overflow: hidden;
  4512. margin-right: 8rpx;
  4513. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  4514. }
  4515. .topBox > .firstTopL > .imageBs > image {
  4516. width: 100%;
  4517. height: 100%;
  4518. }
  4519. .topBox > .firstTopL > .textBs {
  4520. font-size: 30rpx;
  4521. font-weight: bold;
  4522. color: #0c141f;
  4523. }
  4524. .content {
  4525. padding: 24rpx;
  4526. text-align: left;
  4527. }
  4528. .catalogBox {
  4529. display: flex;
  4530. align-items: center;
  4531. flex-wrap: nowrap;
  4532. overflow-x: auto;
  4533. padding-left: 38rpx;
  4534. max-height: 305rpx;
  4535. overflow-y: auto;
  4536. transition: all 0.4s;
  4537. }
  4538. .catalogBox > .catalogA {
  4539. min-width: 200rpx;
  4540. height: 48rpx;
  4541. line-height: 48rpx;
  4542. // text-align: center;
  4543. border: 2rpx solid transparent;
  4544. white-space: nowrap;
  4545. text-overflow: ellipsis;
  4546. overflow: hidden;
  4547. word-break: break-all;
  4548. border-radius: 10rpx;
  4549. background: rgba(22, 119, 255, 0.05);
  4550. padding-left: 19rpx;
  4551. box-sizing: border-box;
  4552. padding-right: 15rpx;
  4553. margin-right: 16rpx;
  4554. margin-bottom: 20rpx;
  4555. margin-top: 15rpx;
  4556. font-size: 24rpx;
  4557. color: #666;
  4558. }
  4559. .catalogBox > .activesq {
  4560. border-color: #1677ff;
  4561. }
  4562. .changeCatalogBox {
  4563. display: block;
  4564. }
  4565. .catalogBox::-webkit-scrollbar {
  4566. display: none; /* Chrome Safari */
  4567. }
  4568. .price_t2 {
  4569. font-size: 18rpx;
  4570. font-family: PingFang SC;
  4571. font-weight: 500;
  4572. text-decoration: line-through;
  4573. color: #999999;
  4574. }
  4575. .price_t1 {
  4576. font-size: 33rpx;
  4577. font-family: PingFang SC;
  4578. font-weight: bold;
  4579. color: #e91313;
  4580. }
  4581. .sc_t {
  4582. font-size: 22rpx;
  4583. color: #000000;
  4584. }
  4585. .sc {
  4586. width: 29rpx;
  4587. height: 29rpx;
  4588. }
  4589. .buy {
  4590. width: 138rpx;
  4591. height: 48rpx;
  4592. line-height: 48rpx;
  4593. background: #32467b;
  4594. border-radius: 10rpx;
  4595. color: #ffffff;
  4596. font-size: 28rpx;
  4597. text-align: center;
  4598. vertical-align: middle;
  4599. position: absolute;
  4600. right: 30rpx;
  4601. }
  4602. .video_body {
  4603. padding-bottom: 96rpx;
  4604. }
  4605. .footer_tab {
  4606. position: fixed;
  4607. bottom: 0;
  4608. height: 96rpx;
  4609. width: 100%;
  4610. background-color: #ffffff;
  4611. }
  4612. .tj_box {
  4613. width: 50%;
  4614. display: inline-block;
  4615. text-align: center;
  4616. margin: 10rpx 0;
  4617. }
  4618. .teacher_t {
  4619. font-size: 24rpx;
  4620. font-family: PingFang SC;
  4621. font-weight: 400;
  4622. color: #666666;
  4623. line-height: 36rpx;
  4624. margin-left: 15rpx;
  4625. }
  4626. .teacher_img {
  4627. width: 87rpx;
  4628. height: 129rpx;
  4629. }
  4630. .t2 {
  4631. font-size: 24rpx;
  4632. font-family: PingFang SC;
  4633. color: #666666;
  4634. line-height: 36rpx;
  4635. margin: 15rpx;
  4636. }
  4637. .r_t2 {
  4638. width: 201rpx;
  4639. height: 49rpx;
  4640. background: rgba(22, 119, 255, 0.05);
  4641. border: 1rpx solid #32467b;
  4642. border-radius: 16rpx;
  4643. color: #666666;
  4644. font-size: 23rpx;
  4645. text-align: center;
  4646. display: flex;
  4647. align-items: center;
  4648. padding: 5rpx;
  4649. }
  4650. .scroll_box {
  4651. width: 100%;
  4652. height: 60rpx;
  4653. background: #ffffff;
  4654. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4655. white-space: nowrap;
  4656. overflow: hidden;
  4657. margin: 15rpx 0;
  4658. }
  4659. .r_sliper {
  4660. padding: 0 20rpx;
  4661. }
  4662. .top_line {
  4663. width: 6rpx;
  4664. height: 22rpx;
  4665. background: #32467b;
  4666. margin-right: 10rpx;
  4667. }
  4668. .video_t2 {
  4669. font-size: 24rpx;
  4670. font-family: PingFang SC;
  4671. font-weight: 500;
  4672. color: #666666;
  4673. }
  4674. .video_play {
  4675. position: absolute;
  4676. width: 95rpx;
  4677. height: 95rpx;
  4678. top: 0;
  4679. left: 0;
  4680. right: 0;
  4681. bottom: 0;
  4682. margin: auto;
  4683. }
  4684. .video_box {
  4685. position: relative;
  4686. #playerVideo {
  4687. position: relative;
  4688. z-index: 99;
  4689. }
  4690. .video-toast {
  4691. position: absolute;
  4692. width: 686rpx;
  4693. height: 80rpx;
  4694. background: rgba(0, 0, 0, 0.6);
  4695. border-radius: 24rpx;
  4696. bottom: 100rpx;
  4697. left: 50%;
  4698. transform: translateX(-50%);
  4699. color: #fff;
  4700. display: flex;
  4701. font-size: 26rpx;
  4702. align-items: center;
  4703. overflow: visible;
  4704. z-index: 999;
  4705. &__text {
  4706. flex: 1;
  4707. margin-left: 40rpx;
  4708. }
  4709. &__btn {
  4710. width: 180rpx;
  4711. text-align: center;
  4712. border-left: 1rpx solid #fff;
  4713. }
  4714. }
  4715. .video-toast__close {
  4716. position: absolute;
  4717. right: 32rpx;
  4718. bottom: 184rpx;
  4719. width: 40rpx;
  4720. height: 40rpx;
  4721. line-height: 40rpx;
  4722. text-align: center;
  4723. background: rgba(0, 0, 0, 0.6);
  4724. border-radius: 50%;
  4725. color: rgba(255, 255, 255, 0.3);
  4726. }
  4727. }
  4728. .rotoct {
  4729. transform: rotate(90deg);
  4730. }
  4731. .slot-content {
  4732. padding: 0 20rpx;
  4733. }
  4734. .notice_modal {
  4735. .content {
  4736. width: 100%;
  4737. height: 100%;
  4738. padding: 56rpx 56rpx 56rpx 64rpx;
  4739. .title {
  4740. color: #222;
  4741. line-height: 40rpx;
  4742. font-size: 36rpx;
  4743. text-align: center;
  4744. font-weight: bold;
  4745. margin-bottom: 24rpx;
  4746. }
  4747. .text {
  4748. height: 340rpx;
  4749. line-height: 40rpx;
  4750. text-indent: 2em;
  4751. font-size: 32rpx;
  4752. color: #222;
  4753. }
  4754. .had_read {
  4755. width: 100%;
  4756. height: 88rpx;
  4757. line-height: 88rpx;
  4758. text-align: center;
  4759. background: #3577e8;
  4760. border-radius: 240rpx;
  4761. font-size: 32rpx;
  4762. font-weight: 500;
  4763. color: #fff;
  4764. margin-top: 20rpx;
  4765. &.gray {
  4766. background: #bbbec5;
  4767. }
  4768. }
  4769. }
  4770. }
  4771. .full_mulu {
  4772. position: absolute;
  4773. top: 100rpx;
  4774. right: 20rpx;
  4775. width: 700rpx;
  4776. height: 515rpx;
  4777. color: #333;
  4778. display: flex;
  4779. align-items: center;
  4780. justify-content: space-between;
  4781. z-index: 99999;
  4782. .mulus {
  4783. width: 623rpx;
  4784. // height: 515rpx;
  4785. height: 400rpx;
  4786. overflow-y: scroll;
  4787. // overflow: scroll;
  4788. }
  4789. .mulu_box_in {
  4790. background-color: #b7b7b7;
  4791. border-radius: 16rpx;
  4792. // transition: all 0.5s;
  4793. &::after {
  4794. content: "";
  4795. width: 0;
  4796. height: 0;
  4797. position: absolute;
  4798. top: 235rpx;
  4799. right: 27px;
  4800. border-top: 16rpx solid transparent;
  4801. border-right: 16rpx solid transparent;
  4802. border-left: 16rpx solid #b7b7b7;
  4803. border-bottom: 16rpx solid transparent;
  4804. }
  4805. }
  4806. .mulu_box_out {
  4807. // visibility: hidden;
  4808. display: none;
  4809. }
  4810. .menuBox_mulu {
  4811. // width: 100%;
  4812. background: #ffffff;
  4813. border-radius: 16rpx;
  4814. padding: 0rpx 20rpx;
  4815. margin-bottom: 20rpx;
  4816. }
  4817. .ml_img {
  4818. position: absolute;
  4819. right: 0;
  4820. top: 100rpx;
  4821. }
  4822. .items {
  4823. width: 620rpx;
  4824. height: 100rpx;
  4825. border: 1rpx solid red;
  4826. }
  4827. }
  4828. </style>