detail.vue 111 KB

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