detail.vue 118 KB

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