detail.vue 144 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845
  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. if (!this.photoConfig) {
  2304. this.photoConfig = true;
  2305. if (this.erJianErZao) {
  2306. this.photoList = this.randomConfig(totalVideoTime, duration);
  2307. return;
  2308. }
  2309. //没有历史拍照间隔数据
  2310. if (this.photoList.length == 0) {
  2311. this.commonConfig(totalVideoTime, true?46*60:undefined)
  2312. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2313. }
  2314. //兼容已有观看历史
  2315. for (let i = 0; i < this.photoList.length - 1; i++) {
  2316. if (
  2317. this.photoList[i] < duration &&
  2318. this.photoList[i + 1] > duration
  2319. ) {
  2320. this.photoIndex = i + 1;
  2321. break;
  2322. }
  2323. if (duration > this.photoList[this.photoList.length - 1]) {
  2324. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2325. break;
  2326. }
  2327. }
  2328. }
  2329. },
  2330. // 二建随机拍摄时间
  2331. randomConfig(totalVideoTime, duration) {
  2332. this.photoHistoryList = [];
  2333. let photoList = [duration];
  2334. let pre = duration;
  2335. if (totalVideoTime > 300) {
  2336. while (pre <= totalVideoTime) {
  2337. pre += this.randomNum(780, 900);
  2338. pre <= totalVideoTime && photoList.push(pre);
  2339. }
  2340. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  2341. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  2342. }
  2343. }
  2344. return photoList;
  2345. },
  2346. // 随机前后五分钟
  2347. commonConfig(totalVideoTime, fixS) {
  2348. let photoList = [0];
  2349. // 固定间隔时间取
  2350. if (fixS) {
  2351. let num = Math.ceil(totalVideoTime / fixS);
  2352. for (let i = 1; i < num; i++) {
  2353. photoList.push(i * fixS);
  2354. }
  2355. } else {
  2356. if (this.photoNum == 3) {
  2357. if (totalVideoTime >= 900) {
  2358. //大于15分钟
  2359. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2360. let centerMinTime = centerTime - 300; //前后5分钟
  2361. let centerMaxTime = centerTime + 300;
  2362. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2363. photoList.push(centerTakeTime); //中间拍一张
  2364. let endMaxTime = totalVideoTime - 60;
  2365. let endMinTime = totalVideoTime - 300;
  2366. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2367. photoList.push(endTakeTime); //最后拍一张
  2368. } else {
  2369. //小于15分钟
  2370. let centerTime = this.randomNum(
  2371. (1 / 3) * totalVideoTime,
  2372. (2 / 3) * totalVideoTime
  2373. );
  2374. photoList.push(centerTime);
  2375. let endTakeTime = this.randomNum(
  2376. (2 / 3) * totalVideoTime,
  2377. totalVideoTime
  2378. );
  2379. photoList.push(endTakeTime);
  2380. }
  2381. }
  2382. }
  2383. return photoList;
  2384. },
  2385. getLiveUid(channelId) {
  2386. let self = this;
  2387. return new Promise((resolve) => {
  2388. let data = {
  2389. channelId: channelId,
  2390. orderGoodsId: this.orderGoodsId,
  2391. };
  2392. self.$api.polyvSign(data).then((res) => {
  2393. resolve(res.data.data);
  2394. });
  2395. });
  2396. },
  2397. timeEventLiving() {
  2398. if (plv != null) {
  2399. if (this.livePlay) {
  2400. this.liveDuration = this.liveDuration + 1; //每隔1秒
  2401. if (this.liveDuration == 2) {
  2402. //直播第2秒拍照
  2403. if (
  2404. this.goodsPhotographConfig &&
  2405. this.goodsPhotographConfig.livephotograph == 1 &&
  2406. this.channelItem.learning != 1 &&
  2407. this.photoHistoryList.length == 0
  2408. ) {
  2409. //开启直播拍照
  2410. this.openPhoto();
  2411. } else {
  2412. this.postStudyRecord(0);
  2413. }
  2414. }
  2415. }
  2416. }
  2417. },
  2418. playerLiveStatusChange(e) {
  2419. const status = e.detail.status;
  2420. if (status === "live") {
  2421. //开始播放
  2422. if (this.timer) {
  2423. clearInterval(this.timer);
  2424. }
  2425. this.livePlay = true;
  2426. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2427. }
  2428. if (status === "end") {
  2429. this.hasStart = false;
  2430. if (this.livePlay) {
  2431. //只有播放过的结束才提交,避免未开播触发结束
  2432. this.postStudyRecord(1);
  2433. }
  2434. this.livePlay = false;
  2435. // 未开始
  2436. }
  2437. },
  2438. closePlv() {
  2439. if (plv) {
  2440. plv.destroy();
  2441. }
  2442. },
  2443. playChannel(item) {
  2444. if (this.timer) {
  2445. clearInterval(this.timer);
  2446. }
  2447. this.startStatus = true;
  2448. this.initLive();
  2449. },
  2450. setLiveOption(status) {
  2451. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2452. this.detail;
  2453. const playRecordFile =
  2454. playbackEnabled && recordFileSimpleModel && status === "end";
  2455. this.videoOption = {
  2456. mode: "live",
  2457. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2458. cid: this.playChannelId,
  2459. openId: this.userInfo.userAccount,
  2460. isAutoChange: false,
  2461. forceVideo: false,
  2462. };
  2463. },
  2464. async initLive() {
  2465. this.liveObj = await this.getLiveUid(this.playChannelId);
  2466. this.initLiveOk = true;
  2467. let optionsData = {};
  2468. optionsData.mode = "live";
  2469. optionsData.forceVideo = false;
  2470. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2471. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2472. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2473. let self = this;
  2474. this.closePlv();
  2475. plv.init(optionsData).then(({ detail, chat }) => {
  2476. self.liveDetail = detail;
  2477. // 设置mode为live的videoOption
  2478. this.setLiveOption();
  2479. if (detail.isPPT) {
  2480. chat.on(chat.events.SLICESTART, () => {
  2481. // 开始直播
  2482. });
  2483. } else {
  2484. plv.api.getOrdinaryLiveStatus(detail.stream);
  2485. }
  2486. });
  2487. },
  2488. openSetting(res) {
  2489. console.log(res, 98);
  2490. },
  2491. getCameraSetting() {
  2492. const self = this;
  2493. // 不支持h5
  2494. wx.getSetting({
  2495. success: (res) => {
  2496. if (res.authSetting["scope.camera"]) {
  2497. // 用户已经授权
  2498. self.showSet = false;
  2499. this.prendreAutoCarme = false;
  2500. } else {
  2501. this.prendreAutoCarme = true;
  2502. // 用户还没有授权,向用户发起授权请求
  2503. wx.authorize({
  2504. scope: "scope.camera",
  2505. success: () => {
  2506. // 用户同意授权
  2507. self.showSet = false;
  2508. this.prendreAutoCarme = false;
  2509. },
  2510. fail: () => {
  2511. // 用户不同意授权
  2512. self.showSet = true;
  2513. },
  2514. });
  2515. }
  2516. },
  2517. fail: (res) => {},
  2518. });
  2519. },
  2520. studyNotice() {
  2521. this.noticeShow = true;
  2522. },
  2523. //播放笔记视频
  2524. async playNoteVideo(item) {
  2525. if (this.timer) {
  2526. clearInterval(this.timer);
  2527. }
  2528. this.vid = item.recordingUrl;
  2529. // #ifdef MP-WEIXIN
  2530. if (this.vid) {
  2531. polyvPlayerContext.changeVid(this.vid);
  2532. }
  2533. // #endif
  2534. this.recordObj = { videoCurrentTime: item.noteSecond };
  2535. if (this.recordObj.videoCurrentTime) {
  2536. this.needSeek = true; //需要跳转到播放记录
  2537. }
  2538. this.startStatus = true;
  2539. //获取节笔记
  2540. this.getNoteList();
  2541. },
  2542. //正常播放视频
  2543. async playVideo(item) {
  2544. if (this.timer) {
  2545. clearInterval(this.timer);
  2546. }
  2547. // #ifdef H5
  2548. // await this.clears();
  2549. // #endif
  2550. this.vid = item.recordingUrl;
  2551. // #ifdef MP-WEIXIN
  2552. if (this.vid) {
  2553. polyvPlayerContext && polyvPlayerContext.changeVid(this.vid);
  2554. }
  2555. // #endif
  2556. this.recordObj = null;
  2557. this.recordObj = await this.getRecordLast();
  2558. this.needSeek = true; //跳转到播放记录
  2559. this.startStatus = true;
  2560. // #ifdef H5
  2561. await this.loadPlayerScript(this.loadPlayer);
  2562. // #endif
  2563. // 提交学习记录
  2564. // #ifdef MP-WEIXIN
  2565. this.postStudyRecord(0);
  2566. // #endif
  2567. //获取节笔记
  2568. this.getNoteList();
  2569. },
  2570. getRecordLast() {
  2571. return new Promise((resolve) => {
  2572. let data = {
  2573. gradeId:
  2574. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2575. goodsId:
  2576. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2577. sectionId: this.playSectionId || 0,
  2578. courseId:
  2579. this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2580. chapterId: this.chapterId || 0,
  2581. moduleId: this.moduleId || 0,
  2582. orderGoodsId: this.orderGoodsId,
  2583. };
  2584. this.$api.recordLast(data).then((res) => {
  2585. resolve(res.data.data);
  2586. });
  2587. });
  2588. },
  2589. jumpNote(item) {
  2590. this.noteId = item.noteId;
  2591. //没视频播放
  2592. if (this.playSectionId == 0) {
  2593. this.$u.toast("即将跳到笔记位置");
  2594. this.$store.commit("setPlaySectionId", {
  2595. playSectionId: item.sectionId || item.menuId,
  2596. });
  2597. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2598. this.playNoteVideo(item);
  2599. } else {
  2600. //正在看当前笔记视频
  2601. this.$u.toast("即将跳到笔记位置");
  2602. //跳到笔记时刻
  2603. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2604. // #ifdef MP-WEIXIN
  2605. polyvPlayerContext.seek(item.noteSecond);
  2606. polyvPlayerContext.play();
  2607. // #endif
  2608. // #ifdef H5
  2609. polyvPlayerContext.j2s_seekVideo(0);
  2610. polyvPlayerContext.j2s_resumeVideo();
  2611. // #endif
  2612. }
  2613. },
  2614. postNote() {
  2615. let self = this;
  2616. if (!(this.playSectionId > 0)) {
  2617. this.$u.toast("目前无播放视频");
  2618. return;
  2619. }
  2620. if (!this.noteValue) {
  2621. this.$u.toast("请输入内容");
  2622. return;
  2623. }
  2624. if (!this.gradeId) {
  2625. this.$u.toast("暂无班级数据");
  2626. return;
  2627. }
  2628. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2629. let noteDate = this.$method.getZeroTime();
  2630. let noteSecond = 0;
  2631. // #ifdef MP-WEIXIN
  2632. noteSecond = polyvPlayerContext.getCurrentTime();
  2633. // #endif
  2634. // #ifdef H5
  2635. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2636. // #endif
  2637. if (!noteSecond) {
  2638. if (noteSecond == 0) {
  2639. //播放结束
  2640. // #ifdef MP-WEIXIN
  2641. noteSecond = polyvPlayerContext.getDuration();
  2642. // #endif
  2643. // #ifdef H5
  2644. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2645. // #endif
  2646. }
  2647. if (!noteSecond) {
  2648. this.$u.toast("视频暂未开始");
  2649. return;
  2650. }
  2651. }
  2652. let data = {
  2653. gradeId: this.gradeId,
  2654. goodsId: this.goodsId,
  2655. sectionId: this.playSectionId,
  2656. courseId: this.courseId,
  2657. noteText: this.noteValue,
  2658. noteDate: noteDate,
  2659. noteSecond: noteSecond,
  2660. orderGoodsId: this.orderGoodsId,
  2661. };
  2662. this.$api.postNote(data).then((res) => {
  2663. if (res.data.code == 200) {
  2664. this.$u.toast("发布成功");
  2665. self.getNoteList();
  2666. this.noteValue = "";
  2667. }
  2668. });
  2669. },
  2670. getGradeInfo() {
  2671. let self = this;
  2672. this.$store.state.allowLoading = false;
  2673. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2674. if (res.data.code == 200) {
  2675. self.gradeDetail = res.data.data;
  2676. if (self.needProfileModal) {
  2677. return;
  2678. }
  2679. if (self.gradeDetail.learningStatus == 2) {
  2680. uni.showModal({
  2681. showCancel: false,
  2682. confirmText: "确定",
  2683. content:
  2684. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2685. success: function (resultst) {
  2686. uni.navigateBack();
  2687. },
  2688. });
  2689. }
  2690. if (
  2691. self.gradeDetail.learningStatus == 3 &&
  2692. Number(self.gradeDetail.learningTimeStart) >
  2693. Number(new Date() / 1000)
  2694. ) {
  2695. uni.showModal({
  2696. showCancel: false,
  2697. cancelText: "返回",
  2698. content:
  2699. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2700. success: function (resultst) {
  2701. uni.navigateBack();
  2702. },
  2703. });
  2704. }
  2705. }
  2706. });
  2707. this.$store.state.allowLoading = true;
  2708. },
  2709. getNoteList() {
  2710. let self = this;
  2711. self.noteList = [];
  2712. let data = {
  2713. courseId: this.courseId,
  2714. gradeId: this.gradeId,
  2715. goodsId: this.goodsId,
  2716. orderGoodsId: this.orderGoodsId,
  2717. };
  2718. if (this.playSectionId > 0) {
  2719. data.sectionId = this.playSectionId;
  2720. }
  2721. this.$api.noteList(data).then((res) => {
  2722. if (res.data.code == 200) {
  2723. self.noteList = res.data.rows;
  2724. }
  2725. });
  2726. },
  2727. delAnswer(answerId) {
  2728. let self = this;
  2729. let data = {
  2730. answerId: answerId,
  2731. status: -1,
  2732. orderGoodsId: this.orderGoodsId,
  2733. };
  2734. this.$api.delAnswer(data).then((res) => {
  2735. if (res.data.code == 200) {
  2736. self.getAnswerList();
  2737. }
  2738. });
  2739. },
  2740. clearCtx() {
  2741. this.placeholder = "您可以在这里输入答疑内容";
  2742. this.ctxValue = "";
  2743. this.assignUserId = 0;
  2744. },
  2745. focusNote(event) {
  2746. this.bottomHeight = event.detail.height;
  2747. },
  2748. blurNote() {
  2749. this.bottomHeight = 0;
  2750. },
  2751. blur() {
  2752. this.bottomHeight = 0;
  2753. this.clearTimer = setTimeout(() => {
  2754. this.ctxValue = "";
  2755. this.isFocus = false;
  2756. this.assignUserId = 0;
  2757. this.placeholder = "您可以在这里输入答疑内容";
  2758. }, 2000);
  2759. },
  2760. replyContent(item) {
  2761. this.isFocus = true;
  2762. this.assignUserId = item.userId;
  2763. this.placeholder = "@" + item.realname;
  2764. },
  2765. delContent(item) {
  2766. this.delAnswer(item.answerId);
  2767. },
  2768. postAnswer() {
  2769. let self = this;
  2770. let data = {
  2771. courseId: this.courseId,
  2772. answerText: this.ctxValue,
  2773. goodsId: this.goodsId,
  2774. orderGoodsId: this.orderGoodsId,
  2775. };
  2776. if (this.assignUserId > 0) {
  2777. data.assignUserId = this.assignUserId;
  2778. }
  2779. this.$api.postAnswer(data).then((res) => {
  2780. if (res.data.code == 200) {
  2781. this.$u.toast("发布成功");
  2782. self.getAnswerList();
  2783. this.isFocus = false;
  2784. this.placeholder = "您可以在这里输入答疑内容";
  2785. this.ctxValue = "";
  2786. this.assignUserId = 0;
  2787. }
  2788. });
  2789. },
  2790. postContent() {
  2791. if (!this.ctxValue || this.ctxValue == "") {
  2792. this.$u.toast("请输入内容");
  2793. return;
  2794. }
  2795. this.postAnswer();
  2796. },
  2797. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2798. let currentTime = 0;
  2799. let PlayDuration = 0;
  2800. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2801. if (polyvPlayerContext) {
  2802. // #ifdef MP-WEIXIN
  2803. currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
  2804. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2805. // #endif
  2806. // #ifdef H5
  2807. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2808. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2809. // #endif
  2810. }
  2811. if (currentTime < 10 && !this.ossAvatarUrl) {
  2812. return;
  2813. }
  2814. if (this.playChannelId > 0) {
  2815. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2816. }
  2817. let self = this;
  2818. let data = {
  2819. fromPlat: 1, //来源平台 1小程序 2网站
  2820. photo: self.ossAvatarUrl,
  2821. sectionId: sectionId || 0,
  2822. goodsId: parseInt(self.goodsId),
  2823. courseId: parseInt(self.courseId),
  2824. orderGoodsId: this.orderGoodsId,
  2825. studyDuration: parseInt(
  2826. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2827. ),
  2828. gradeId: parseInt(self.gradeId),
  2829. chapterId: this.chapterId || 0,
  2830. moduleId: this.moduleId || 0,
  2831. videoCurrentTime: parseInt(
  2832. currentTime > 0 ? currentTime : self.studyDuration
  2833. ),
  2834. erJianErZao: this.erJianErZao,
  2835. };
  2836. if (this.ossAvatarUrl) {
  2837. data.similarity = this.compareFaceData; // 相似度
  2838. }
  2839. if (status > 0) {
  2840. data.status = status;
  2841. }
  2842. console.log(data, "记录参数");
  2843. return new Promise((resolve, reject) => {
  2844. this.$api
  2845. .studyRecord(data)
  2846. .then((res) => {
  2847. console.log(res, "记录返回");
  2848. let { code, msg } = res.data;
  2849. if (code == 200) {
  2850. if (status > 0) {
  2851. this.studyRecordMenuAllList();
  2852. let moduleId = this.moduleId || 0;
  2853. let chapterId = this.chapterId || 0;
  2854. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2855. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2856. uni.$emit("playNext" + playNextIdisRebuild, {
  2857. fromRebuild: this.isRebuild,
  2858. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2859. uni.$emit("playNext" + playNextId); //通知播放结束
  2860. }
  2861. self.ossAvatarUrl = "";
  2862. } else if (code == 600) {
  2863. uni.showModal({
  2864. showCancel: false,
  2865. title: "提示",
  2866. content: msg,
  2867. success: (resultst) => {
  2868. uni.navigateBack();
  2869. },
  2870. });
  2871. } else if (code == 558) {
  2872. this.CountTo1 = msg.split(",")[1];
  2873. this.noticeShow1 = true;
  2874. var timer = setInterval(() => {
  2875. this.CountTo1--;
  2876. if (this.CountTo1 < 0) {
  2877. this.noticeShow1 = false;
  2878. clearInterval(timer);
  2879. this.postStudyRecord(1);
  2880. }
  2881. }, 1000);
  2882. reject("中断执行");
  2883. } else {
  2884. this.uploadLock = false;
  2885. uni.showToast({
  2886. icon: "none",
  2887. title: res.data.msg,
  2888. duration: 2000,
  2889. });
  2890. if (this.erJianErZao && code == 559) {
  2891. this.isReach = true;
  2892. this.openPhoto();
  2893. }
  2894. if (code == 559 || code == 588) {
  2895. reject("中断执行");
  2896. }
  2897. }
  2898. resolve();
  2899. })
  2900. .catch((err) => {
  2901. this.studyRecordMenuAllList();
  2902. });
  2903. });
  2904. },
  2905. uploadFile(options, int) {
  2906. var self = this;
  2907. return new Promise((resolve, reject) => {
  2908. var data = {
  2909. imageStatus: int,
  2910. gradeId: this.gradeId,
  2911. orderGoodsId: this.orderGoodsId,
  2912. };
  2913. self.$api.aliyunpolicy(data).then((res) => {
  2914. if (res.data.code != 200) {
  2915. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2916. return;
  2917. }
  2918. var ossToken = res.data.data.resultContent;
  2919. if (ossToken.host == null || ossToken.host == undefined) {
  2920. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2921. return;
  2922. }
  2923. let filePath = "";
  2924. // #ifdef H5
  2925. var localData = options; //dataUrl为base64位
  2926. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2927. let length = base.length;
  2928. let url = new Uint8Array(length);
  2929. while (length--) {
  2930. url[length] = base.charCodeAt(length);
  2931. }
  2932. filePath = new File([url], "a.jpg", {
  2933. type: "image/jpg",
  2934. });
  2935. uni.uploadFile({
  2936. url: ossToken.host,
  2937. name: "file",
  2938. file: filePath,
  2939. fileType: "image",
  2940. header: {
  2941. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2942. },
  2943. formData: {
  2944. key: ossToken.dir,
  2945. OSSAccessKeyId: ossToken.accessid,
  2946. policy: ossToken.policy,
  2947. Signature: ossToken.signature,
  2948. callback: ossToken.callback,
  2949. success_action_status: 200,
  2950. },
  2951. success: (result) => {
  2952. this.$u.toast("上传成功");
  2953. self.ossAvatarUrl = ossToken.dir;
  2954. resolve(ossToken.dir);
  2955. },
  2956. fail: (error) => {
  2957. uni.showToast({
  2958. title: "上传接口报错,请重新拍照上传" + error,
  2959. icon: "none",
  2960. });
  2961. this.openPhoto();
  2962. return;
  2963. },
  2964. });
  2965. // #endif
  2966. // #ifdef MP-WEIXIN
  2967. uni.uploadFile({
  2968. url: ossToken.host,
  2969. name: "file",
  2970. filePath: options,
  2971. fileType: "image",
  2972. header: {
  2973. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2974. },
  2975. formData: {
  2976. key: ossToken.dir,
  2977. OSSAccessKeyId: ossToken.accessid,
  2978. policy: ossToken.policy,
  2979. Signature: ossToken.signature,
  2980. callback: ossToken.callback,
  2981. success_action_status: 200,
  2982. },
  2983. success: (result) => {
  2984. // if (result.statusCode === 200) {
  2985. this.$u.toast("上传成功");
  2986. self.ossAvatarUrl = ossToken.dir;
  2987. resolve(ossToken.dir);
  2988. },
  2989. fail: (error) => {
  2990. uni.showToast({
  2991. title: "上传接口报错,请重新拍照上传" + error,
  2992. icon: "none",
  2993. });
  2994. this.openPhoto();
  2995. return;
  2996. },
  2997. });
  2998. // #endif
  2999. });
  3000. });
  3001. },
  3002. imageInfos() {
  3003. var self = this;
  3004. return new Promise(async (resolve, reject) => {
  3005. let resPath = await myCompressImage(this.avatarUrl || this.faceUrl, 50);
  3006. const waitUpload = await self.uploadFile(resPath, 0);
  3007. resolve(waitUpload);
  3008. });
  3009. },
  3010. timeEvent() {
  3011. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3012. if (polyvPlayerContext != null) {
  3013. // #ifdef MP-WEIXIN
  3014. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  3015. // #endif
  3016. // #ifdef H5
  3017. this.playTime = polyvPlayerContext.j2s_getCurrentTime();
  3018. // #endif
  3019. this.configPhoto();
  3020. console.info(this.photoList, "photoList");
  3021. let photoTime = 0; //获取拍照秒数
  3022. for (let i = 0; i < this.photoList.length; i++) {
  3023. photoTime = Number(this.photoList[i]); //获取拍照秒数
  3024. if (
  3025. (this.erJianErZao && !this.photoHistoryList.length) ||
  3026. (photoTime < this.playTime && photoTime > this.playTime - 8)
  3027. ) {
  3028. //3秒区间内才触发拍照,避免拉动滚动条
  3029. if (this.photoHistoryList.indexOf(i) < 0) {
  3030. //不存在拍照历史,没有重修过,没有学过,则拍照
  3031. //启动拍照
  3032. //暂停
  3033. console.log("去拍照");
  3034. // #ifdef MP-WEIXIN
  3035. polyvPlayerContext.exitFullScreen();
  3036. polyvPlayerContext.pause();
  3037. // #endif
  3038. // #ifdef H5
  3039. polyvPlayerContext.j2s_pauseVideo();
  3040. polyvPlayerContext.toggleFullscreen();
  3041. // #endif
  3042. this.photoIndex = i;
  3043. if (
  3044. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  3045. this.goodsId
  3046. ) {
  3047. return this.openPhoto();
  3048. } else {
  3049. this.popupPhotoShow = true;
  3050. uni.setStorageSync(
  3051. `tabkePhotoShow${this.goodsId}`,
  3052. this.goodsId
  3053. ); // 本地缓存用来判断是否已经弹出过弹窗
  3054. }
  3055. }
  3056. }
  3057. }
  3058. }
  3059. },
  3060. closeToast() {
  3061. clearTimeout(this.toastTimer);
  3062. this.videoToastShow = false;
  3063. },
  3064. restart() {
  3065. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3066. // #ifdef MP-WEIXIN
  3067. polyvPlayerContext.seek(0);
  3068. // #endif
  3069. // #ifdef H5
  3070. polyvPlayerContext.j2s_seekVideo(0);
  3071. // #endif
  3072. clearTimeout(this.toastTimer);
  3073. this.videoToastShow = false;
  3074. },
  3075. // 新增用户视频学习日志
  3076. studyLog() {
  3077. this.$http({
  3078. url: "/user/study/log",
  3079. method: "post",
  3080. data: {
  3081. goodsId: this.goodsId,
  3082. courseId: this.courseId,
  3083. moduleId: this.moduleId || 0,
  3084. chapterId: this.chapterId || 0,
  3085. sectionId: this.playSectionId || 0,
  3086. fromPlat: 1, //来源平台 1小程序 2PC网站
  3087. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  3088. orderGoodsId: this.orderGoodsId,
  3089. },
  3090. }).then((res) => {});
  3091. },
  3092. async onStateChange(newstate, oldstate) {
  3093. polyvPlayerContext = this.selectComponent("#playerVideo");
  3094. if (newstate.detail.newstate == "playing") {
  3095. console.log("播放");
  3096. if (this.noticeShow) {
  3097. polyvPlayerContext.pause();
  3098. return;
  3099. }
  3100. if (this.needSeek) {
  3101. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3102. if (this.recordObj.videoCurrentTime) {
  3103. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  3104. this.seekTime = this.$method.secondToDate(
  3105. this.recordObj.videoCurrentTime
  3106. );
  3107. this.videoToastShow = true;
  3108. this.toastTimer = setTimeout(() => {
  3109. this.videoToastShow = false;
  3110. }, 3000);
  3111. } else {
  3112. polyvPlayerContext.seek(1); //避免相同节继续播放
  3113. }
  3114. polyvPlayerContext.play();
  3115. this.needSeek = false;
  3116. // 新增用户视频学习日志
  3117. this.studyLog();
  3118. // 提交学习记录
  3119. }
  3120. //开始播放
  3121. this.timer && clearInterval(this.timer);
  3122. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3123. this.clearPauseTimer();
  3124. this.isReach = false;
  3125. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3126. }
  3127. }
  3128. if (newstate.detail.newstate == "pause") {
  3129. console.log("暂停");
  3130. this.erJianErZaoPauseTip();
  3131. clearInterval(this.timer);
  3132. //暂停提交记录
  3133. }
  3134. if (newstate.detail.newstate == "ended") {
  3135. clearInterval(this.timer);
  3136. uni.showToast({
  3137. icon: "none",
  3138. title: "播放完毕",
  3139. });
  3140. this.hasStart = false;
  3141. await this.postStudyRecord(1);
  3142. this.nextSection();
  3143. }
  3144. },
  3145. //播放下一节
  3146. nextSection() {
  3147. console.log("播放下一节");
  3148. if (!this.menuAllList.length) {
  3149. return;
  3150. }
  3151. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  3152. let i_sectionId = item.sectionId || 0;
  3153. let i_chapterId = item.chapterId || 0;
  3154. let i_moduleId = item.moduleId || 0;
  3155. return (
  3156. i_sectionId == this.playSectionId &&
  3157. i_chapterId == this.chapterId &&
  3158. i_moduleId == this.moduleId
  3159. );
  3160. });
  3161. let data = this.menuAllList[this.curPlayIndex + 1];
  3162. if (!data) {
  3163. //第二个弹窗
  3164. uni.showModal({
  3165. title: "温馨提示",
  3166. content:
  3167. "恭喜您课程学习全部完成,教务会在1-3个工作日内完成学习初审,请耐心等待。",
  3168. showCancel: !this.erJianErZao,
  3169. success: (res) => {
  3170. if (res.confirm) {
  3171. uni.switchTab({
  3172. url: "/pages/learn/index",
  3173. });
  3174. }
  3175. },
  3176. });
  3177. } else {
  3178. if (data.doType == 2) {
  3179. if (data.studyStatus == 1) {
  3180. uni.showToast({
  3181. title: "试卷已合格!",
  3182. duration: 2000,
  3183. icon: "none",
  3184. });
  3185. return;
  3186. }
  3187. uni.showModal({
  3188. title: "温馨提示",
  3189. content: "当前节视频已学完,是否进入考试?",
  3190. success: (res) => {
  3191. if (res.confirm) {
  3192. this.toQuestionBank(data);
  3193. }
  3194. },
  3195. });
  3196. return;
  3197. }
  3198. uni.showModal({
  3199. title: "温馨提示",
  3200. content: "当前节视频已学完,继续学习下一节?",
  3201. success: async (res) => {
  3202. if (res.confirm) {
  3203. this.moduleId = data.moduleId;
  3204. this.chapterId = data.chapterId;
  3205. this.sectionId = data.sectionId;
  3206. if (data.sectionType == 1) {
  3207. //录播
  3208. this.$store.commit("setPlaySectionId", {
  3209. playSectionId: data.sectionId,
  3210. });
  3211. this.$store.commit("setPlayVID", {
  3212. playVID: data.recordingUrl,
  3213. });
  3214. this.hasStart = false;
  3215. this.photoConfig = false;
  3216. this.photoIndex = 0;
  3217. this.sectionItem = data;
  3218. await this.getPhotoLastRecord(); // 获取拍照历史
  3219. this.playVideo(data);
  3220. } else if (data.sectionType == 2) {
  3221. //直播
  3222. this.studyRecordGetLastLive();
  3223. } else if (data.sectionType == 3) {
  3224. //回放
  3225. this.$store.commit("setPlaySectionId", {
  3226. playSectionId: data.sectionId,
  3227. });
  3228. this.$store.commit("setPlayVID", {
  3229. playVID: data.recordingUrl,
  3230. });
  3231. this.sectionItem = data;
  3232. this.playVideo(data);
  3233. }
  3234. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  3235. this.$store.commit("updatePlayNextId", playNextId);
  3236. this.updateChapterOpen(true);
  3237. this.reStart = false;
  3238. this.getMenuList();
  3239. }
  3240. },
  3241. });
  3242. }
  3243. },
  3244. //拍照
  3245. openPhoto() {
  3246. if (polyvPlayerContext) {
  3247. // #ifdef MP-WEIXIN
  3248. polyvPlayerContext.exitFullScreen();
  3249. // #endif
  3250. // #ifdef H5
  3251. if (this.isFullScreen()) {
  3252. this.exitFullscreen();
  3253. }
  3254. // #endif
  3255. }
  3256. // #ifdef MP-WEIXIN
  3257. this.enableAutoRotation = false;
  3258. this.photoPopup = true;
  3259. this.isTaking = true;
  3260. uni.setKeepScreenOn({
  3261. keepScreenOn: true,
  3262. });
  3263. uni.authorize({
  3264. scope: "scope.camera",
  3265. success() {},
  3266. });
  3267. // #endif
  3268. // #ifdef H5
  3269. if (
  3270. (window.navigator.mediaDevices &&
  3271. window.navigator.mediaDevices.getUserMedia) ||
  3272. window.navigator.getUserMedia ||
  3273. window.navigator.webkitGetUserMedia ||
  3274. window.navigator.mozGetUserMedia
  3275. ) {
  3276. console.log("getUserMedia----");
  3277. // 调用用户媒体设备, 访问摄像头
  3278. this.getUserMedia(
  3279. {
  3280. video: {
  3281. width: 400,
  3282. height: 300,
  3283. facingMode: "user",
  3284. },
  3285. },
  3286. this.photographSuccess,
  3287. this.photographError
  3288. );
  3289. } else {
  3290. console.log("1111没有摄像");
  3291. this.photographError();
  3292. }
  3293. // #endif
  3294. },
  3295. /**
  3296. * 人脸匹配
  3297. */
  3298. faceRecognition() {
  3299. return new Promise((resolve) => {
  3300. // #ifdef MP-WEIXIN
  3301. let fileSystem = uni.getFileSystemManager();
  3302. fileSystem.readFile({
  3303. filePath: `${this.avatarUrl}`,
  3304. encoding: "base64",
  3305. position: 0,
  3306. success: (res) => {
  3307. let base64 = "data:image/jpg;base64," + res.data;
  3308. // console.log('base64Data人脸识别参数:', {
  3309. // imageA: base64,
  3310. // orderGoodsId: this.orderGoodsId,
  3311. // gradeId: this.gradeId,
  3312. // })
  3313. this.CompareFace(base64, resolve);
  3314. },
  3315. fail(err) {
  3316. // this.$u.toast('人脸识别错误!')
  3317. console.error(err, "err-----人脸识别错误");
  3318. },
  3319. });
  3320. // #endif
  3321. // #ifdef H5
  3322. this.CompareFace(this.faceUrl, resolve);
  3323. // #endif
  3324. });
  3325. },
  3326. CompareFace(url, resolve) {
  3327. let timer = setTimeout(() => {
  3328. uni.showToast({
  3329. icon: "none",
  3330. title: "拍照超时,请重新拍照",
  3331. duration: 2000,
  3332. success: () => {
  3333. setTimeout(() => {
  3334. uni.navigateBack();
  3335. }, 1000);
  3336. },
  3337. });
  3338. }, 10 * 1000);
  3339. this.$api
  3340. .faceCertificationCompareFace({
  3341. imageA: url,
  3342. orderGoodsId: this.orderGoodsId,
  3343. gradeId: this.gradeId,
  3344. })
  3345. .then((res) => {
  3346. clearTimeout(timer);
  3347. console.log(res, "人脸识别成功res");
  3348. resolve(res.data.data);
  3349. })
  3350. .catch((err) => {
  3351. clearTimeout(timer);
  3352. // 当前网络延迟,
  3353. console.log("人脸识别错误:", err);
  3354. uni.showModal({
  3355. content: "当前网络延迟",
  3356. showCancel: false,
  3357. success: (resultst) => {
  3358. if (resultst.confirm) {
  3359. uni.navigateBack();
  3360. }
  3361. },
  3362. });
  3363. });
  3364. },
  3365. // 确定拍照
  3366. async submit() {
  3367. if (this.uploadLock) {
  3368. return;
  3369. }
  3370. this.uploadLock = true;
  3371. let compareFaceData = await this.faceRecognition();
  3372. this.compareFaceData = compareFaceData;
  3373. if (compareFaceData >= 80) {
  3374. await this.imageInfos();
  3375. this.postCoursePhotoRecord()
  3376. .then(async (res) => {
  3377. this.photoHistoryList.push(this.photoIndex);
  3378. // console.log('拍照确定提交', this.photoHistoryList);
  3379. this.postStudyRecord(); //提交记录
  3380. if (this.erJianErZao && this.isReach) {
  3381. console.log("1校验");
  3382. await this.postStudyRecord(1);
  3383. this.photoPopup = false;
  3384. this.uploadLock = false;
  3385. this.enableAutoRotation = true;
  3386. this.nextSection();
  3387. return;
  3388. }
  3389. //恢复播放
  3390. // #ifdef MP-WEIXIN
  3391. uni.setKeepScreenOn({
  3392. keepScreenOn: false,
  3393. });
  3394. // #endif
  3395. this.photoPopup = false;
  3396. this.uploadLock = false;
  3397. this.enableAutoRotation = true;
  3398. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3399. if (polyvPlayerContext != null) {
  3400. // #ifdef MP-WEIXIN
  3401. polyvPlayerContext.play();
  3402. // #endif
  3403. // #ifdef H5
  3404. polyvPlayerContext.j2s_resumeVideo();
  3405. // #endif
  3406. }
  3407. })
  3408. .catch((err) => {
  3409. console.log("拍照记录接口的err", err);
  3410. uni.showToast({
  3411. title: "上传接口报错,请重新拍照上传" + err,
  3412. icon: "none",
  3413. });
  3414. this.uploadLock = false;
  3415. this.openPhoto();
  3416. });
  3417. } else {
  3418. uni.showToast({
  3419. title: "人脸匹配不通过,请重新拍照上传",
  3420. icon: "none",
  3421. duration: 2000,
  3422. });
  3423. setTimeout(() => {
  3424. this.uploadLock = false;
  3425. this.openPhoto();
  3426. }, 2000);
  3427. }
  3428. },
  3429. reTake() {
  3430. this.isTaking = true;
  3431. // #ifdef H5
  3432. this.faceUrl = "";
  3433. this.getUserMedia(
  3434. {
  3435. video: {
  3436. width: 400,
  3437. height: 300,
  3438. facingMode: "user",
  3439. },
  3440. },
  3441. this.photographSuccess,
  3442. this.photographError
  3443. );
  3444. // #endif
  3445. },
  3446. toTakePhoto() {
  3447. this.popupPhotoShow = false;
  3448. this.openPhoto();
  3449. },
  3450. takePhTips() {
  3451. this.popupPhotoShow = true;
  3452. this.isTaking = false;
  3453. this.photoPopup = false;
  3454. this.enableAutoRotation = false;
  3455. },
  3456. //确认拍照
  3457. takePhoto() {
  3458. // #ifdef MP-WEIXIN
  3459. const ctx = uni.createCameraContext();
  3460. ctx.takePhoto({
  3461. quality: "high",
  3462. success: (res) => {
  3463. this.avatarUrl = res.tempImagePath;
  3464. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  3465. this.isTaking = false;
  3466. },
  3467. fail: (err) => {},
  3468. });
  3469. // #endif
  3470. // #ifdef H5
  3471. const canvas = document.createElement("canvas");
  3472. canvas.width = 400;
  3473. canvas.height = 400;
  3474. const context = canvas.getContext("2d");
  3475. const box = document.querySelector(".photo_v");
  3476. const video = box.querySelector("video");
  3477. context.drawImage(video, 0, 0, 400, 400);
  3478. this.faceUrl = canvas.toDataURL("image/png");
  3479. this.isTaking = false;
  3480. // #endif
  3481. },
  3482. playError(e) {
  3483. console.log(e);
  3484. },
  3485. //拍照报错
  3486. error(e) {
  3487. console.log(e.detail);
  3488. },
  3489. //关闭相机
  3490. closePhoto() {
  3491. this.photoPopup = false;
  3492. this.enableAutoRotation = true;
  3493. },
  3494. /**
  3495. * 进入全屏
  3496. */
  3497. fullscreenchange(event) {
  3498. if (event.detail.direction == "vertical") {
  3499. this.navShow = true;
  3500. } else if (event.detail.direction == "horizontal") {
  3501. this.navShow = false;
  3502. }
  3503. },
  3504. checkFinishRequiredCourse() {
  3505. return this.$api
  3506. .checkFinishRequiredCourse({
  3507. businessId: this.goodsData.businessId,
  3508. goodsId: this.goodsId,
  3509. })
  3510. .then((res) => {
  3511. if (res.data.data > 0) {
  3512. uni.showModal({
  3513. showCancel: false,
  3514. confirmText: "确定",
  3515. content: "该业务层次下有未学完的商品,无法学习新商品!",
  3516. success: function (resultst) {
  3517. uni.navigateBack();
  3518. },
  3519. });
  3520. return Promise.reject();
  3521. }
  3522. return Promise.resolve();
  3523. });
  3524. },
  3525. getGoodsDetail() {
  3526. let self = this;
  3527. this.$api.goodsDetail(this.goodsId).then(async (res) => {
  3528. this.goodsData = res.data.data;
  3529. this.option.periodWaitTime && (await this.checkFinishRequiredCourse());
  3530. if (self.goodsData.buyNote) {
  3531. this.baseHandoutTipList();
  3532. }
  3533. self.gradeId = self.goodsData.gradeId;
  3534. self.erJianErZao = self.goodsData.erJianErZao;
  3535. this.courseBusiness(this.goodsData.businessId);
  3536. self.getMenuList();
  3537. self.getReMenuList(); //获取重修目录
  3538. setTimeout(function () {
  3539. if (!self.needProfileModal) {
  3540. self.getGradeInfo();
  3541. }
  3542. }, 500);
  3543. //获取节笔记
  3544. this.getNoteList();
  3545. if (self.goodsData.goodsPlayConfig) {
  3546. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  3547. if (self.goodsPlayConfig.autoPlay > 0) {
  3548. self.autoplay = true;
  3549. }
  3550. if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
  3551. // #ifdef MP-WEIXIN
  3552. self.isAllowSeek = "yes";
  3553. // #endif
  3554. // #ifdef H5
  3555. self.H5isAllowSeek = "off";
  3556. // #endif
  3557. }
  3558. if (self.goodsPlayConfig.speed > 0) {
  3559. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  3560. }
  3561. }
  3562. if (self.goodsData.goodsPhotographConfig) {
  3563. self.goodsPhotographConfig = JSON.parse(
  3564. self.goodsData.goodsPhotographConfig
  3565. );
  3566. if (self.goodsPhotographConfig.photoNum > 0) {
  3567. self.photoNum = self.goodsPhotographConfig.photoNum;
  3568. }
  3569. }
  3570. });
  3571. },
  3572. startVideo() {
  3573. this.startStatus = true;
  3574. },
  3575. getAnswerList() {
  3576. let self = this;
  3577. this.$api
  3578. .answerList({
  3579. courseId: this.courseId,
  3580. goodsId: this.goodsId,
  3581. orderGoodsId: this.orderGoodsId,
  3582. })
  3583. .then((res) => {
  3584. if (res.data.code == 200) {
  3585. self.answerList = res.data.rows;
  3586. }
  3587. });
  3588. },
  3589. getReMenuList() {
  3590. // console.log('重修的目录');
  3591. let self = this;
  3592. this.$api
  3593. .reMenuList({
  3594. orderGoodsId: this.orderGoodsId,
  3595. courseId: this.courseId,
  3596. rebuild: 1,
  3597. gradeId: this.gradeId,
  3598. })
  3599. .then((res) => {
  3600. if (res.data.code == 200) {
  3601. for (let i = 0; i < res.data.rows.length; i++) {
  3602. let item = res.data.rows[i];
  3603. item.down = true;
  3604. item.id = item.menuId;
  3605. item.name = item.menuName;
  3606. }
  3607. self.reMenuList = res.data.rows;
  3608. if (self.reMenuList.length > 0) {
  3609. this.showNotes = false;
  3610. self.list = [
  3611. {
  3612. name: "目录",
  3613. },
  3614. {
  3615. name: "讲义",
  3616. },
  3617. {
  3618. name: "笔记",
  3619. },
  3620. {
  3621. name: "答疑",
  3622. },
  3623. { name: "重修目录" },
  3624. ];
  3625. this.current = 0;
  3626. if (Object.keys(this.sectionItem).length) {
  3627. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3628. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3629. }
  3630. } else {
  3631. if (Object.keys(this.sectionItem).length) {
  3632. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3633. this.$store.commit("updatePlayNextId", playNextId);
  3634. }
  3635. self.list = [
  3636. {
  3637. name: "目录",
  3638. },
  3639. {
  3640. name: "讲义",
  3641. },
  3642. {
  3643. name: "笔记",
  3644. },
  3645. {
  3646. name: "答疑",
  3647. },
  3648. ];
  3649. this.current = 0;
  3650. }
  3651. }
  3652. });
  3653. },
  3654. getMenuList() {
  3655. // console.log('menuList的目录');
  3656. let self = this;
  3657. // /course/menuList 查询课程目录结构列表
  3658. this.$api
  3659. .reMenuList({
  3660. courseId: this.courseId,
  3661. gradeId: this.gradeId,
  3662. orderGoodsId: this.orderGoodsId,
  3663. })
  3664. .then((res) => {
  3665. if (res.data.code == 200) {
  3666. for (let i = 0; i < res.data.rows.length; i++) {
  3667. let item = res.data.rows[i];
  3668. item.down = true;
  3669. item.id = item.menuId;
  3670. item.name = item.menuName;
  3671. item.menuType = item.type;
  3672. }
  3673. self.menuList = res.data.rows;
  3674. this.reStart = true;
  3675. for (let i = 0; i < res.data.rows.length; i++) {
  3676. if (res.data.rows[i].type == 1) {
  3677. // 模块
  3678. if (Object.keys(this.sectionItem).length) {
  3679. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3680. this.menuIndex = [i];
  3681. break;
  3682. }
  3683. } else {
  3684. this.menuIndex = [i];
  3685. break;
  3686. }
  3687. } else if (res.data.rows[i].type == 2) {
  3688. // 章
  3689. if (Object.keys(this.sectionItem).length) {
  3690. if (
  3691. res.data.rows[i].menuId == this.sectionItem.chapterId &&
  3692. (!this.sectionItem.moduleId ||
  3693. this.sectionItem.moduleId == 0)
  3694. ) {
  3695. this.menuIndex = [i];
  3696. break;
  3697. }
  3698. } else {
  3699. this.menuIndex = [i];
  3700. break;
  3701. }
  3702. }
  3703. }
  3704. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3705. }
  3706. });
  3707. },
  3708. courseDetail() {
  3709. let self = this;
  3710. // '/course/'+data,
  3711. this.$api.courseDetail(this.courseId).then((res) => {
  3712. if (res.data.code == 200) {
  3713. // if (res.data.data.educationName == "继续教育") {
  3714. this.$api
  3715. .lockLockAction({
  3716. action: "jxjy",
  3717. uuid: this.$method.getUuid(),
  3718. })
  3719. .then((res) => {});
  3720. this.lockTimer = setInterval(() => {
  3721. this.$api
  3722. .lockLockAction({
  3723. action: "jxjy",
  3724. uuid: this.$method.getUuid(),
  3725. })
  3726. .then((res) => {});
  3727. }, 10000);
  3728. // websocket.sendMsg("doCourse");
  3729. // }
  3730. self.detail = res.data.data;
  3731. }
  3732. });
  3733. },
  3734. open(item) {
  3735. item.showChildren = !item.showChildren;
  3736. },
  3737. change(index) {
  3738. this.current = index;
  3739. },
  3740. clickMulu() {
  3741. this.muluStyle = !this.muluStyle;
  3742. },
  3743. loadPlayerScript(callback) {
  3744. if (!window.polyvPlayer) {
  3745. const myScript = document.createElement("script");
  3746. myScript.setAttribute("src", this.vodPlayerJs);
  3747. myScript.onload = callback;
  3748. document.body.appendChild(myScript);
  3749. } else {
  3750. callback();
  3751. }
  3752. },
  3753. // 播放视频
  3754. loadPlayer() {
  3755. const polyvPlayer = window.polyvPlayer;
  3756. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  3757. let option = {
  3758. showLine: "off",
  3759. ban_history_time: "on",
  3760. vid: this.vid,
  3761. forceH5: true,
  3762. autoplay: this.autoplay, // 自动播放
  3763. ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
  3764. speed: this.playbackRate, // 倍数
  3765. banSeekDeviation: 7, // 做兼容
  3766. teaser_show: 1,
  3767. tail_show: 1,
  3768. hideSwitchPlayer: true,
  3769. watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
  3770. ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
  3771. sign: res.data.data.sign, // 移动端播放加密视频所需的签名
  3772. };
  3773. if (polyvPlayerContext) {
  3774. polyvPlayerContext.changeVid(option);
  3775. } else {
  3776. option = {
  3777. wrap: "#player",
  3778. width: "100%",
  3779. height: 218,
  3780. ...option,
  3781. };
  3782. polyvPlayerContext = await polyvPlayer(option);
  3783. }
  3784. // polyvPlayerContext = await polyvPlayer({
  3785. // wrap: "#player",
  3786. // width: "100%",
  3787. // showLine: "off",
  3788. // height: 218,
  3789. // ban_history_time: "on",
  3790. // vid: this.vid,
  3791. // forceH5: true,
  3792. // autoplay: this.autoplay, // 自动播放
  3793. // ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
  3794. // speed: this.playbackRate, // 倍数
  3795. // teaser_show: 1,
  3796. // tail_show: 1,
  3797. // hideSwitchPlayer: true,
  3798. // watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
  3799. // ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
  3800. // sign: res.data.data.sign, // 移动端播放加密视频所需的签名
  3801. // });
  3802. // polyvPlayerContext = this.player;
  3803. polyvPlayerContext.on("s2j_onPlayStart", async (vid) => {
  3804. console.log("视频初次播放时触发:");
  3805. // #ifdef H5
  3806. // h5禁止拖动进度条
  3807. if (!this.$method.isWeixin()) {
  3808. this.clearBarTimer();
  3809. let originTime = this.recordObj.videoCurrentTime || 0;
  3810. if (this.H5isAllowSeek == "on") {
  3811. this.barTimer = setInterval(() => {
  3812. const currentTime = polyvPlayerContext.j2s_getCurrentTime();
  3813. // console.log(currentTime, originTime, 789);
  3814. if (
  3815. currentTime - originTime > 15 ||
  3816. currentTime - originTime < 0
  3817. ) {
  3818. polyvPlayerContext.j2s_seekVideo(originTime);
  3819. } else {
  3820. originTime = currentTime;
  3821. }
  3822. }, 2000);
  3823. }
  3824. }
  3825. // #endif
  3826. this.loadedmetadata();
  3827. this.postStudyRecord(0);
  3828. });
  3829. polyvPlayerContext.on("s2j_onVideoPause", () => {
  3830. // 视频暂停时触发
  3831. console.log("视频暂停时触发", this.vid);
  3832. this.erJianErZaoPauseTip();
  3833. this.clearBarTimer();
  3834. clearInterval(this.studyTimer);
  3835. clearInterval(this.timer);
  3836. });
  3837. polyvPlayerContext.on("s2j_onVideoPlay", () => {
  3838. // 视频初次播放或由暂停恢复播放时触发
  3839. console.log("视频初次播放或由暂停恢复播放时触发");
  3840. if (this.noticeShow) {
  3841. polyvPlayerContext.j2s_pauseVideo();
  3842. return;
  3843. }
  3844. if (this.needSeek) {
  3845. if (this.recordObj.videoCurrentTime) {
  3846. this.seekTime = this.$method.secondToDate(
  3847. this.recordObj.videoCurrentTime
  3848. );
  3849. this.videoToastShow = true;
  3850. this.toastTimer = setTimeout(() => {
  3851. this.videoToastShow = false;
  3852. }, 3000);
  3853. }
  3854. this.needSeek = false;
  3855. // 新增用户视频学习日志
  3856. this.studyLog();
  3857. }
  3858. //开始播放
  3859. this.timer && clearInterval(this.timer);
  3860. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3861. this.clearPauseTimer();
  3862. this.isReach = false;
  3863. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3864. }
  3865. this.studyTimer && clearInterval(this.studyTimer);
  3866. this.studyTimer = setInterval(() => {
  3867. this.postStudyRecord(0, this.playSectionId);
  3868. }, 15000);
  3869. });
  3870. polyvPlayerContext.on("s2j_onPlayOver", async () => {
  3871. // 当前视频播放完毕时触发
  3872. this.hasStart = false;
  3873. this.clearBarTimer();
  3874. clearInterval(this.studyTimer);
  3875. clearInterval(this.timer);
  3876. uni.showToast({
  3877. icon: "none",
  3878. title: "播放完毕",
  3879. });
  3880. await this.postStudyRecord(1);
  3881. this.nextSection(); // 播放下一节
  3882. });
  3883. });
  3884. },
  3885. clears() {
  3886. return new Promise((resolve, reject) => {
  3887. this.vid = "";
  3888. polyvPlayerContext && polyvPlayerContext.destroy();
  3889. polyvPlayerContext = null;
  3890. resolve();
  3891. });
  3892. },
  3893. /**
  3894. * 退出全屏
  3895. */
  3896. exitFullscreen() {
  3897. try {
  3898. var de = document;
  3899. if (de.exitFullscreen) {
  3900. de.exitFullscreen();
  3901. } else if (de.mozCancelFullScreen) {
  3902. de.mozCancelFullScreen();
  3903. } else if (de.webkitCancelFullScreen) {
  3904. de.webkitCancelFullScreen();
  3905. }
  3906. } catch (err) {}
  3907. },
  3908. fullele() {
  3909. return (
  3910. document.fullscreenElement ||
  3911. document.webkitFullscreenElement ||
  3912. document.msFullscreenElement ||
  3913. document.mozFullScreenElement ||
  3914. null
  3915. );
  3916. },
  3917. //判断是否全屏
  3918. isFullScreen() {
  3919. return !!(document.webkitIsFullScreen || this.fullele());
  3920. },
  3921. getUserMedia(constraints, success, error) {
  3922. console.log("getUserMedia===", constraints, "success:", success);
  3923. if (window.navigator.mediaDevices.getUserMedia) {
  3924. // 最新的标准API
  3925. window.navigator.mediaDevices
  3926. .getUserMedia(constraints)
  3927. .then(success)
  3928. .catch(error);
  3929. } else if (window.navigator.webkitGetUserMedia) {
  3930. // webkit核心浏览器
  3931. window.navigator.webkitGetUserMedia(constraints, success, error);
  3932. } else if (window.navigator.mozGetUserMedia) {
  3933. // firfox浏览器
  3934. window.navigator.mozGetUserMedia(constraints, success, error);
  3935. } else if (window.navigator.getUserMedia) {
  3936. // 旧版API
  3937. window.navigator.getUserMedia(constraints, success, error);
  3938. }
  3939. },
  3940. photographSuccess(stream) {
  3941. console.log("有摄像头---", stream);
  3942. this.photoPopup = true;
  3943. this.isTaking = true;
  3944. this.enableAutoRotation = false;
  3945. this.$nextTick(() => {
  3946. const box = document.querySelector(".photo_v");
  3947. const video = box.querySelector("video");
  3948. console.log("video:", video);
  3949. video.srcObject = stream;
  3950. video.play();
  3951. });
  3952. },
  3953. photographError(err) {
  3954. console.log("没有摄像头:", err);
  3955. uni.showModal({
  3956. title: "提示",
  3957. content:
  3958. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  3959. cancelText: "取消",
  3960. confirmText: "确定",
  3961. success: (res) => {
  3962. if (res.confirm) {
  3963. uni.navigateBack();
  3964. } else if (res.cancel) {
  3965. }
  3966. },
  3967. });
  3968. },
  3969. },
  3970. };
  3971. </script>
  3972. <style lang="scss" scope>
  3973. @import "./css/detail.scss";
  3974. .top {
  3975. &__header {
  3976. position: relative;
  3977. width: 100%;
  3978. height: 150rpx;
  3979. padding: 24rpx 150rpx 24rpx 24rpx;
  3980. .img {
  3981. position: absolute;
  3982. left: 0;
  3983. top: 0;
  3984. width: 100%;
  3985. }
  3986. .note {
  3987. position: relative;
  3988. z-index: 10;
  3989. font-size: 24rpx;
  3990. font-family: PingFang SC;
  3991. font-weight: bold;
  3992. color: #efdbff;
  3993. }
  3994. .title {
  3995. position: relative;
  3996. z-index: 10;
  3997. font-size: 26rpx;
  3998. font-family: PingFang SC;
  3999. font-weight: bold;
  4000. color: #ffffff;
  4001. }
  4002. }
  4003. }
  4004. #top {
  4005. position: relative;
  4006. z-index: 99;
  4007. }
  4008. .polyv_detail {
  4009. display: flex;
  4010. flex-direction: column;
  4011. height: 100vh;
  4012. position: relative;
  4013. top: 0;
  4014. left: 0;
  4015. .pops {
  4016. position: absolute;
  4017. top: 0;
  4018. left: 0;
  4019. background: #ccc;
  4020. opacity: 0.5;
  4021. width: 100%;
  4022. height: 300rpx;
  4023. z-index: 9999;
  4024. }
  4025. .box {
  4026. flex: 1;
  4027. overflow: hidden;
  4028. margin: 16rpx 16rpx 100rpx 16rpx;
  4029. .box_in {
  4030. height: 100%;
  4031. }
  4032. }
  4033. .first_ml {
  4034. margin: 16rpx 16rpx 16rpx 16rpx;
  4035. }
  4036. }
  4037. .btnSet {
  4038. width: 440rpx;
  4039. height: 80rpx;
  4040. background: #007aff;
  4041. border-radius: 40rpx;
  4042. color: #ffffff;
  4043. font-size: 28rpx;
  4044. line-height: 80rpx;
  4045. }
  4046. .btnReply {
  4047. width: 80rpx;
  4048. height: 40rpx;
  4049. background: #e3f0ff;
  4050. border-radius: 16rpx;
  4051. text-align: center;
  4052. color: #007aff;
  4053. }
  4054. .btnDel {
  4055. width: 80rpx;
  4056. height: 40rpx;
  4057. background: #ffedf0;
  4058. border-radius: 16rpx;
  4059. text-align: center;
  4060. color: #ff2d55;
  4061. }
  4062. .btnReply {
  4063. width: 80rpx;
  4064. height: 40rpx;
  4065. background: #e3f0ff;
  4066. border-radius: 16rpx;
  4067. font-size: 24rpx;
  4068. }
  4069. .lecture-content {
  4070. background: #fff;
  4071. margin-top: 10rpx;
  4072. padding: 10rpx;
  4073. border-radius: 16rpx;
  4074. }
  4075. .photoBox {
  4076. width: 100%;
  4077. // background-color: #ffffff;
  4078. // border-radius: 24px 24px 0px 0px;
  4079. .photoTop {
  4080. width: 100%;
  4081. height: 74rpx;
  4082. border-radius: 20px 20px 0px 0px;
  4083. background-color: #ffffff;
  4084. display: flex;
  4085. align-items: center;
  4086. justify-content: center;
  4087. padding: 0rpx 38rpx;
  4088. .sqzz {
  4089. width: 28rpx;
  4090. height: 28rpx;
  4091. display: flex;
  4092. align-items: center;
  4093. justify-content: center;
  4094. }
  4095. .centersq {
  4096. color: #333;
  4097. font-size: 30rpx;
  4098. font-weight: 500;
  4099. }
  4100. }
  4101. .photoCenter {
  4102. width: 750rpx;
  4103. height: 75vh;
  4104. position: relative;
  4105. .center_camera {
  4106. width: 100%;
  4107. height: 75vh;
  4108. position: fixed;
  4109. .head_take {
  4110. width: 100%;
  4111. height: 75vh;
  4112. display: flex;
  4113. flex-direction: column;
  4114. }
  4115. .headTake_up {
  4116. width: 100%;
  4117. height: 100rpx;
  4118. }
  4119. .headTake_minddle {
  4120. display: flex;
  4121. .min_img {
  4122. width: 500rpx;
  4123. height: 550rpx;
  4124. }
  4125. .min_left,
  4126. .min_right {
  4127. flex: 1;
  4128. height: 550rpx;
  4129. }
  4130. }
  4131. .headTake_down {
  4132. width: 100%;
  4133. flex: 1;
  4134. }
  4135. .color {
  4136. background-color: #333;
  4137. opacity: 0.5;
  4138. }
  4139. .photo_v {
  4140. width: 100%;
  4141. height: 100%;
  4142. }
  4143. .mask {
  4144. width: 500rpx;
  4145. height: 550rpx;
  4146. position: absolute;
  4147. top: 100rpx;
  4148. left: 0;
  4149. right: 0;
  4150. bottom: 0;
  4151. margin: 0 auto;
  4152. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  4153. }
  4154. }
  4155. .custom {
  4156. width: 750rpx;
  4157. height: 75vh;
  4158. position: absolute;
  4159. z-index: 1000;
  4160. top: 0;
  4161. left: 0;
  4162. image {
  4163. width: 100%;
  4164. height: 100%;
  4165. }
  4166. }
  4167. }
  4168. .btns {
  4169. display: flex;
  4170. .takePhoto_btn {
  4171. width: 100%;
  4172. display: flex;
  4173. align-items: center;
  4174. justify-content: space-between;
  4175. background: #a9a7a9;
  4176. padding: 40rpx 26rpx;
  4177. .middle_btn {
  4178. width: 120rpx;
  4179. height: 120rpx;
  4180. border-radius: 40rpx;
  4181. border: 4rpx solid #ffffff;
  4182. display: flex;
  4183. align-items: center;
  4184. justify-content: center;
  4185. }
  4186. .square {
  4187. width: 96rpx;
  4188. height: 96rpx;
  4189. background: #ffffff;
  4190. border-radius: 28rpx;
  4191. }
  4192. .rights {
  4193. font-size: 32rpx;
  4194. font-weight: 500;
  4195. color: #ffffff;
  4196. }
  4197. }
  4198. .btnResult {
  4199. height: 100rpx;
  4200. flex: 1;
  4201. background-color: #07c160;
  4202. text-align: center;
  4203. line-height: 100rpx;
  4204. color: #fff;
  4205. font-size: 32rpx;
  4206. font-weight: bold;
  4207. }
  4208. }
  4209. }
  4210. .chat_box {
  4211. display: flex;
  4212. padding: 20rpx;
  4213. justify-content: space-between;
  4214. }
  4215. .chat3 {
  4216. font-size: 30rpx;
  4217. font-family: PingFang SC;
  4218. font-weight: 500;
  4219. color: #666666;
  4220. margin-top: 10rpx;
  4221. }
  4222. .chat2 {
  4223. font-size: 20rpx;
  4224. font-family: PingFang SC;
  4225. font-weight: 500;
  4226. color: #999999;
  4227. margin-top: 10rpx;
  4228. }
  4229. .chat1 {
  4230. font-size: 24rpx;
  4231. font-family: PingFang SC;
  4232. font-weight: 500;
  4233. color: #333333;
  4234. }
  4235. .leftPadding {
  4236. margin-left: 8rpx;
  4237. }
  4238. .t2Content {
  4239. font-size: 24rpx;
  4240. font-family: PingFang SC;
  4241. font-weight: bold;
  4242. color: #999999;
  4243. line-height: 48rpx;
  4244. }
  4245. .tBox2 {
  4246. display: flex;
  4247. padding-top: 10rpx;
  4248. color: #333333;
  4249. font-size: 30rpx;
  4250. font-weight: 400;
  4251. }
  4252. .tBox {
  4253. display: flex;
  4254. align-items: center;
  4255. padding-top: 10rpx;
  4256. }
  4257. .title {
  4258. font-size: 24rpx;
  4259. color: #999999;
  4260. }
  4261. .Answering {
  4262. .answer_item {
  4263. &:nth-child(2) {
  4264. border-radius: 16rpx 16rpx 0rpx 0rpx;
  4265. }
  4266. &:nth-last-child(1) {
  4267. border-radius: 0rpx 0rpx 16rpx 16rpx;
  4268. }
  4269. }
  4270. }
  4271. .inputBottom {
  4272. position: fixed;
  4273. left: 0;
  4274. bottom: 0;
  4275. background: #ffffff;
  4276. height: 98rpx;
  4277. display: flex;
  4278. align-items: center;
  4279. width: 100%;
  4280. .flex_auto {
  4281. flex: 1;
  4282. margin-left: 10%;
  4283. word-break: break-all;
  4284. // .input {
  4285. // height: 60rpx;
  4286. // }
  4287. }
  4288. .btn {
  4289. color: #007aff;
  4290. font-size: 30rpx;
  4291. font-weight: bold;
  4292. width: 15%;
  4293. text-align: center;
  4294. }
  4295. .input {
  4296. background: rgba(244, 244, 244, 0.98);
  4297. height: 60rpx;
  4298. border-radius: 24rpx;
  4299. margin-top: 12rpx;
  4300. }
  4301. }
  4302. .noteBox {
  4303. width: 100%;
  4304. background: #ffffff;
  4305. padding: 0rpx 10rpx 20rpx;
  4306. border-radius: 16rpx;
  4307. overflow: hidden;
  4308. .left_ti {
  4309. padding-top: 14rpx;
  4310. }
  4311. }
  4312. .dateBox {
  4313. width: 216rpx;
  4314. height: 48rpx;
  4315. background: #ffffff;
  4316. border-radius: 24rpx;
  4317. font-size: 24rpx;
  4318. color: #666666;
  4319. text-align: center;
  4320. line-height: 48rpx;
  4321. margin: 16rpx 0rpx 8rpx;
  4322. }
  4323. .t_content1 {
  4324. color: #007aff;
  4325. margin-left: 10rpx;
  4326. }
  4327. .tag1 {
  4328. border: 2rpx solid #007aff;
  4329. border-radius: 8rpx;
  4330. font-size: 20rpx;
  4331. color: #007aff;
  4332. padding: 5rpx;
  4333. }
  4334. .b_title {
  4335. color: #333333;
  4336. font-size: 30rpx;
  4337. font-weight: bold;
  4338. }
  4339. page {
  4340. background: #eaeef1;
  4341. }
  4342. .menuBox {
  4343. width: 100%;
  4344. background: #ffffff;
  4345. border-radius: 16rpx;
  4346. padding: 0rpx 20rpx;
  4347. margin-bottom: 20rpx;
  4348. }
  4349. .btnspric {
  4350. border-top: 1rpx solid #eee;
  4351. display: flex;
  4352. align-items: center;
  4353. justify-content: space-between;
  4354. height: 108rpx;
  4355. padding-left: 43rpx;
  4356. padding-right: 32rpx;
  4357. }
  4358. .btnspric > .lefprL {
  4359. font-size: 36rpx;
  4360. color: #0c141f;
  4361. font-weight: bold;
  4362. }
  4363. .btnspric > .lefprR {
  4364. padding: 0rpx 24rpx;
  4365. height: 60rpx;
  4366. line-height: 60rpx;
  4367. text-align: center;
  4368. color: #fff;
  4369. background: #32467b;
  4370. border-radius: 24rpx;
  4371. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4372. }
  4373. .yhj,
  4374. .hdyhj {
  4375. padding: 24rpx 29rpx 24rpx 34rpx;
  4376. }
  4377. .yhj {
  4378. border-bottom: 16rpx solid #f9f9f9;
  4379. }
  4380. .yhjtit {
  4381. font-size: 30rpx;
  4382. color: #0c141f;
  4383. font-weight: 500;
  4384. margin-bottom: 14rpx;
  4385. }
  4386. .yhjList {
  4387. display: flex;
  4388. align-items: center;
  4389. justify-content: space-between;
  4390. margin-bottom: 14rpx;
  4391. }
  4392. .yhjList > .yhjLefts {
  4393. display: flex;
  4394. align-items: center;
  4395. }
  4396. .yhjLefts > .yhl {
  4397. color: #32467b;
  4398. font-size: 30rpx;
  4399. margin-right: 31rpx;
  4400. }
  4401. .yhjLefts > .yhbq {
  4402. font-size: 24rpx;
  4403. color: #ff9500;
  4404. border-radius: 18rpx;
  4405. background-color: rgba(255, 149, 0, 0.2);
  4406. border: 2rpx solid #ff9500;
  4407. height: 38rpx;
  4408. line-height: 38rpx;
  4409. padding: 0rpx 16rpx;
  4410. }
  4411. .ts {
  4412. font-size: 24rpx;
  4413. color: #999;
  4414. margin: 14rpx 0rpx;
  4415. padding-right: 29rpx;
  4416. padding-left: 34rpx;
  4417. }
  4418. .yh {
  4419. padding-top: 20rpx;
  4420. }
  4421. .yh > .yhtitle {
  4422. display: flex;
  4423. align-items: center;
  4424. justify-content: space-between;
  4425. padding-right: 29rpx;
  4426. padding-left: 34rpx;
  4427. }
  4428. .priceBxs {
  4429. display: flex;
  4430. align-items: center;
  4431. }
  4432. .priceBxs > .pricleft {
  4433. border-radius: 24rpx;
  4434. border: 1rpx solid #e91313;
  4435. background-color: rgba(233, 19, 19, 0.1);
  4436. padding: 0rpx 18rpx;
  4437. height: 49rpx;
  4438. line-height: 49rpx;
  4439. text-align: center;
  4440. font-size: 30rpx;
  4441. font-weight: 500;
  4442. color: #e91313;
  4443. margin-right: 13rpx;
  4444. }
  4445. .topBox {
  4446. padding: 32rpx 32rpx 24rpx;
  4447. border-bottom: 1rpx solid #eeeeee;
  4448. }
  4449. .topBox > .boldFonstType {
  4450. font-weight: 500;
  4451. font-size: 30rpx;
  4452. margin: 16rpx 0rpx 23rpx;
  4453. }
  4454. .topBox > .firstTopL {
  4455. display: flex;
  4456. align-items: center;
  4457. }
  4458. .topBox > .firstTopL > .imageBs {
  4459. width: 331rpx;
  4460. height: 160rpx;
  4461. border-radius: 6rpx;
  4462. overflow: hidden;
  4463. margin-right: 8rpx;
  4464. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  4465. }
  4466. .topBox > .firstTopL > .imageBs > image {
  4467. width: 100%;
  4468. height: 100%;
  4469. }
  4470. .topBox > .firstTopL > .textBs {
  4471. font-size: 30rpx;
  4472. font-weight: bold;
  4473. color: #0c141f;
  4474. }
  4475. .content {
  4476. padding: 24rpx;
  4477. text-align: left;
  4478. }
  4479. .catalogBox {
  4480. display: flex;
  4481. align-items: center;
  4482. flex-wrap: nowrap;
  4483. overflow-x: auto;
  4484. padding-left: 38rpx;
  4485. max-height: 305rpx;
  4486. overflow-y: auto;
  4487. transition: all 0.4s;
  4488. }
  4489. .catalogBox > .catalogA {
  4490. min-width: 200rpx;
  4491. height: 48rpx;
  4492. line-height: 48rpx;
  4493. // text-align: center;
  4494. border: 2rpx solid transparent;
  4495. white-space: nowrap;
  4496. text-overflow: ellipsis;
  4497. overflow: hidden;
  4498. word-break: break-all;
  4499. border-radius: 10rpx;
  4500. background: rgba(22, 119, 255, 0.05);
  4501. padding-left: 19rpx;
  4502. box-sizing: border-box;
  4503. padding-right: 15rpx;
  4504. margin-right: 16rpx;
  4505. margin-bottom: 20rpx;
  4506. margin-top: 15rpx;
  4507. font-size: 24rpx;
  4508. color: #666;
  4509. }
  4510. .catalogBox > .activesq {
  4511. border-color: #1677ff;
  4512. }
  4513. .changeCatalogBox {
  4514. display: block;
  4515. }
  4516. .catalogBox::-webkit-scrollbar {
  4517. display: none; /* Chrome Safari */
  4518. }
  4519. .price_t2 {
  4520. font-size: 18rpx;
  4521. font-family: PingFang SC;
  4522. font-weight: 500;
  4523. text-decoration: line-through;
  4524. color: #999999;
  4525. }
  4526. .price_t1 {
  4527. font-size: 33rpx;
  4528. font-family: PingFang SC;
  4529. font-weight: bold;
  4530. color: #e91313;
  4531. }
  4532. .sc_t {
  4533. font-size: 22rpx;
  4534. color: #000000;
  4535. }
  4536. .sc {
  4537. width: 29rpx;
  4538. height: 29rpx;
  4539. }
  4540. .buy {
  4541. width: 138rpx;
  4542. height: 48rpx;
  4543. line-height: 48rpx;
  4544. background: #32467b;
  4545. border-radius: 10rpx;
  4546. color: #ffffff;
  4547. font-size: 28rpx;
  4548. text-align: center;
  4549. vertical-align: middle;
  4550. position: absolute;
  4551. right: 30rpx;
  4552. }
  4553. .video_body {
  4554. padding-bottom: 96rpx;
  4555. }
  4556. .footer_tab {
  4557. position: fixed;
  4558. bottom: 0;
  4559. height: 96rpx;
  4560. width: 100%;
  4561. background-color: #ffffff;
  4562. }
  4563. .tj_box {
  4564. width: 50%;
  4565. display: inline-block;
  4566. text-align: center;
  4567. margin: 10rpx 0;
  4568. }
  4569. .teacher_t {
  4570. font-size: 24rpx;
  4571. font-family: PingFang SC;
  4572. font-weight: 400;
  4573. color: #666666;
  4574. line-height: 36rpx;
  4575. margin-left: 15rpx;
  4576. }
  4577. .teacher_img {
  4578. width: 87rpx;
  4579. height: 129rpx;
  4580. }
  4581. .t2 {
  4582. font-size: 24rpx;
  4583. font-family: PingFang SC;
  4584. color: #666666;
  4585. line-height: 36rpx;
  4586. margin: 15rpx;
  4587. }
  4588. .r_t2 {
  4589. width: 201rpx;
  4590. height: 49rpx;
  4591. background: rgba(22, 119, 255, 0.05);
  4592. border: 1rpx solid #32467b;
  4593. border-radius: 16rpx;
  4594. color: #666666;
  4595. font-size: 23rpx;
  4596. text-align: center;
  4597. display: flex;
  4598. align-items: center;
  4599. padding: 5rpx;
  4600. }
  4601. .scroll_box {
  4602. width: 100%;
  4603. height: 60rpx;
  4604. background: #ffffff;
  4605. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4606. white-space: nowrap;
  4607. overflow: hidden;
  4608. margin: 15rpx 0;
  4609. }
  4610. .r_sliper {
  4611. padding: 0 20rpx;
  4612. }
  4613. .top_line {
  4614. width: 6rpx;
  4615. height: 22rpx;
  4616. background: #32467b;
  4617. margin-right: 10rpx;
  4618. }
  4619. .video_t2 {
  4620. font-size: 24rpx;
  4621. font-family: PingFang SC;
  4622. font-weight: 500;
  4623. color: #666666;
  4624. }
  4625. .video_play {
  4626. position: absolute;
  4627. width: 95rpx;
  4628. height: 95rpx;
  4629. top: 0;
  4630. left: 0;
  4631. right: 0;
  4632. bottom: 0;
  4633. margin: auto;
  4634. }
  4635. .video_box {
  4636. position: relative;
  4637. #playerVideo {
  4638. position: relative;
  4639. z-index: 99;
  4640. }
  4641. .video-toast {
  4642. position: absolute;
  4643. width: 686rpx;
  4644. height: 80rpx;
  4645. background: rgba(0, 0, 0, 0.6);
  4646. border-radius: 24rpx;
  4647. bottom: 100rpx;
  4648. left: 50%;
  4649. transform: translateX(-50%);
  4650. color: #fff;
  4651. display: flex;
  4652. font-size: 26rpx;
  4653. align-items: center;
  4654. overflow: visible;
  4655. z-index: 999;
  4656. &__text {
  4657. flex: 1;
  4658. margin-left: 40rpx;
  4659. }
  4660. &__btn {
  4661. width: 180rpx;
  4662. text-align: center;
  4663. border-left: 1rpx solid #fff;
  4664. }
  4665. }
  4666. .video-toast__close {
  4667. position: absolute;
  4668. right: 32rpx;
  4669. bottom: 184rpx;
  4670. width: 40rpx;
  4671. height: 40rpx;
  4672. line-height: 40rpx;
  4673. text-align: center;
  4674. background: rgba(0, 0, 0, 0.6);
  4675. border-radius: 50%;
  4676. color: rgba(255, 255, 255, 0.3);
  4677. }
  4678. }
  4679. .rotoct {
  4680. transform: rotate(90deg);
  4681. }
  4682. .slot-content {
  4683. padding: 0 20rpx;
  4684. }
  4685. .notice_modal {
  4686. .content {
  4687. width: 100%;
  4688. height: 100%;
  4689. padding: 56rpx 56rpx 56rpx 64rpx;
  4690. .title {
  4691. color: #222;
  4692. line-height: 40rpx;
  4693. font-size: 36rpx;
  4694. text-align: center;
  4695. font-weight: bold;
  4696. margin-bottom: 24rpx;
  4697. }
  4698. .text {
  4699. height: 340rpx;
  4700. line-height: 40rpx;
  4701. text-indent: 2em;
  4702. font-size: 32rpx;
  4703. color: #222;
  4704. }
  4705. .had_read {
  4706. width: 100%;
  4707. height: 88rpx;
  4708. line-height: 88rpx;
  4709. text-align: center;
  4710. background: #3577e8;
  4711. border-radius: 240rpx;
  4712. font-size: 32rpx;
  4713. font-weight: 500;
  4714. color: #fff;
  4715. margin-top: 20rpx;
  4716. &.gray {
  4717. background: #bbbec5;
  4718. }
  4719. }
  4720. }
  4721. }
  4722. .full_mulu {
  4723. position: absolute;
  4724. top: 100rpx;
  4725. right: 20rpx;
  4726. width: 700rpx;
  4727. height: 515rpx;
  4728. color: #333;
  4729. display: flex;
  4730. align-items: center;
  4731. justify-content: space-between;
  4732. z-index: 99999;
  4733. .mulus {
  4734. width: 623rpx;
  4735. // height: 515rpx;
  4736. height: 400rpx;
  4737. overflow-y: scroll;
  4738. // overflow: scroll;
  4739. }
  4740. .mulu_box_in {
  4741. background-color: #b7b7b7;
  4742. border-radius: 16rpx;
  4743. // transition: all 0.5s;
  4744. &::after {
  4745. content: "";
  4746. width: 0;
  4747. height: 0;
  4748. position: absolute;
  4749. top: 235rpx;
  4750. right: 27px;
  4751. border-top: 16rpx solid transparent;
  4752. border-right: 16rpx solid transparent;
  4753. border-left: 16rpx solid #b7b7b7;
  4754. border-bottom: 16rpx solid transparent;
  4755. }
  4756. }
  4757. .mulu_box_out {
  4758. // visibility: hidden;
  4759. display: none;
  4760. }
  4761. .menuBox_mulu {
  4762. // width: 100%;
  4763. background: #ffffff;
  4764. border-radius: 16rpx;
  4765. padding: 0rpx 20rpx;
  4766. margin-bottom: 20rpx;
  4767. }
  4768. .ml_img {
  4769. position: absolute;
  4770. right: 0;
  4771. top: 100rpx;
  4772. }
  4773. .items {
  4774. width: 620rpx;
  4775. height: 100rpx;
  4776. border: 1rpx solid red;
  4777. }
  4778. }
  4779. </style>