detail.vue 114 KB

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