detail.vue 116 KB

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