detail.vue 141 KB

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