detail.vue 145 KB

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