detail.vue 113 KB

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