detail.vue 144 KB

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