detail.vue 141 KB

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