detail.vue 113 KB

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