detail.vue 114 KB

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