detail.vue 100 KB

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