detail.vue 115 KB

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