detail.vue 82 KB

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