detail.vue 148 KB

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