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