detail.vue 113 KB

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