detail.vue 77 KB

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