detail.vue 141 KB

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