detail.vue 114 KB

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