detail.vue 109 KB

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