detail.vue 145 KB

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