detail.vue 142 KB

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