detail.vue 125 KB

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