detail.vue 104 KB

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