detail.vue 145 KB

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