detail.vue 141 KB

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