detail.vue 104 KB

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