detail.vue 144 KB

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