detail.vue 115 KB

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