detail.vue 76 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782
  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. ></courseChapter
  159. ></view>
  160. <!--节 -->
  161. <view v-if="item.type == 3"
  162. ><courseSection
  163. :isLive="true"
  164. :orderGoodsId="orderGoodsId"
  165. :sectionMaxNum="goodsData.sectionMaxNum"
  166. @playEnd="sectionPlayEnd($event, index)"
  167. :courseId="courseId"
  168. :preItem="menuList[index - 1]"
  169. :learningOrder="businessData.goodsLearningOrder"
  170. :goodsId="goodsId"
  171. :gradeId="gradeId"
  172. :isBuy="true"
  173. :menuItem="item"
  174. :levelId="'0-0-' + item.menuId"
  175. ></courseSection
  176. ></view>
  177. </view>
  178. </view>
  179. <!--笔记 -->
  180. <view v-show="current == 1">
  181. <view v-if="noteList.length == 0" style="text-align: center"
  182. >暂无笔记</view
  183. >
  184. <!-- <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0">
  185. <view style="width: 10%"
  186. ><image
  187. src="/static/icon/note3.png"
  188. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  189. ></image
  190. ></view>
  191. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  192. <u-input
  193. class="input"
  194. height="60"
  195. fixed="true"
  196. placeholder="您可以在这里输入笔记内容"
  197. type="input"
  198. :custom-style="inputStyle"
  199. v-model="noteValue"
  200. />
  201. </view>
  202. <view
  203. style="
  204. color: #007aff;
  205. font-size: 30rpx;
  206. font-weight: bold;
  207. width: 15%;
  208. text-align: center;
  209. "
  210. @click="postNote"
  211. >提交</view
  212. >
  213. </view> -->
  214. <view v-for="(item, index) in noteList" :key="index">
  215. <view class="dateBox">{{
  216. $method.timestampToTime(item.dateNote)
  217. }}</view>
  218. <view class="noteBox">
  219. <view
  220. v-for="(item1, index1) in item.userNotes"
  221. :key="index1"
  222. style="margin-top: 30rpx"
  223. @click="jumpNote(item1)"
  224. >
  225. <view style="display: flex">
  226. <view class="left_ti">
  227. <view>
  228. <image
  229. src="/static/icon/note2.png"
  230. v-if="noteId != item1.noteId"
  231. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  232. ></image>
  233. <image
  234. src="/static/icon/note1.png"
  235. v-if="noteId == item1.noteId"
  236. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  237. ></image>
  238. </view>
  239. <view
  240. class="title"
  241. style="width: 39rpx; height: 39rpx;"
  242. >{{ $method.secondToDate(item1.noteSecond) }}</view
  243. >
  244. </view>
  245. <view style="margin-left: 10rpx">
  246. <view class="t2Content leftPadding">{{
  247. item1.sectionName
  248. }}</view>
  249. <view class="tBox2">{{ item1.noteText }}</view>
  250. </view>
  251. </view>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. <!--答疑 -->
  257. <view v-show="current == 2" class="Answering">
  258. <!-- <view class="inputBottom">
  259. <view class="flex_auto">
  260. <u-input
  261. height="60"
  262. fixed="true"
  263. :focus="isFocus"
  264. :placeholder="placeholder"
  265. type="input"
  266. @blur="blur"
  267. :custom-style="inputStyle"
  268. v-model="ctxValue"
  269. />
  270. </view>
  271. <view class="btn" @click="postContent">提交</view>
  272. </view> -->
  273. <view
  274. v-for="(item, index) in answerList"
  275. :key="index"
  276. style="background-color: #ffffff;"
  277. class="answer_item"
  278. >
  279. <view class="chat_box" @click.stop="clearCtx">
  280. <view style="display: flex; flex: 1">
  281. <view
  282. ><image
  283. :src="
  284. item.assignUserId > 0 && !item.realname
  285. ? '/static/logo_xcx.png'
  286. : $method.splitImgHost(item.avatar)
  287. "
  288. style="width: 64rpx; height: 64rpx"
  289. ></image
  290. ></view>
  291. <view style="margin-left: 15rpx">
  292. <view class="chat1">{{
  293. item.assignUserId > 0 && !item.realname
  294. ? "祥粤老师"
  295. : item.realname
  296. }}</view>
  297. <view class="chat2">{{
  298. $method.timestampToTime(item.createTime, false)
  299. }}</view>
  300. <view class="chat3">
  301. <text v-if="item.assignUserId > 0">回复</text>
  302. <text v-if="item.assignUserId > 0" style="color: #007aff"
  303. >@{{ item.assignRealname }}</text
  304. >
  305. <view style="word-break: break-all">{{
  306. item.answerText
  307. }}</view>
  308. </view>
  309. </view>
  310. </view>
  311. <view
  312. class="btnReply"
  313. @click.stop="replyContent(item)"
  314. v-if="item.userId != userInfo.userId"
  315. >回复</view
  316. >
  317. <view v-else class="btnDel" @click.stop="delContent(item)"
  318. >删除</view
  319. >
  320. </view>
  321. <u-line color="#D6D6DB" />
  322. </view>
  323. <view v-if="answerList.length == 0" style="text-align: center"
  324. >暂无记录</view
  325. >
  326. </view>
  327. <!--答疑 -->
  328. <view v-show="current == 3">
  329. <view
  330. v-for="(item, index) in historyChatMsgList"
  331. :key="index"
  332. style="background-color: #ffffff; margin-bottom: 20rpx"
  333. >
  334. <view class="chat_box" @click.stop="clearCtx">
  335. <view style="display: flex; flex: 1">
  336. <view
  337. ><image
  338. :src="
  339. item.user.pic
  340. "
  341. style="width: 64rpx; height: 64rpx"
  342. ></image
  343. ></view>
  344. <view style="margin-left: 15rpx">
  345. <view class="chat1">{{
  346. item.user.nickname
  347. }}</view>
  348. <view class="chat2">{{
  349. item.time | formatDate
  350. }}</view>
  351. <view class="chat3">
  352. <!-- <text v-if="item.assignUserId > 0">回复</text>
  353. <text v-if="item.assignUserId > 0" style="color: #007aff"
  354. >@{{ item.assignRealname }}</text
  355. > -->
  356. <view style="word-break: break-all">{{
  357. item.content
  358. }}</view>
  359. </view>
  360. </view>
  361. </view>
  362. </view>
  363. <u-line color="#D6D6DB" />
  364. </view>
  365. <view v-if="historyChatMsgList.length == 0" style="text-align: center"
  366. >暂无记录</view
  367. >
  368. </view>
  369. </scroll-view>
  370. <!-- 底部固定按钮 -->
  371. <!-- 笔记的输入框 -->
  372. <template v-if="current == 1">
  373. <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0" :style="{ bottom: bottomHeight + 'px' }">
  374. <view style="width: 10%"
  375. ><image
  376. src="/static/icon/note3.png"
  377. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  378. ></image
  379. ></view>
  380. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  381. <input
  382. v-model="noteValue"
  383. class="input"
  384. height="60"
  385. fixed="true"
  386. placeholder="您可以在这里输入笔记内容"
  387. type="text"
  388. :custom-style="inputStyle"
  389. :adjust-position="false"
  390. @focus="focusNote"
  391. @blur="blurNote"
  392. />
  393. </view>
  394. <view
  395. style="
  396. color: #007aff;
  397. font-size: 30rpx;
  398. font-weight: bold;
  399. width: 15%;
  400. text-align: center;
  401. "
  402. @click="postNote"
  403. >提交</view
  404. >
  405. </view>
  406. </template>
  407. <!-- 答疑 -->
  408. <view v-if="current == 2" class="inputBottom" :style="{ bottom: bottomHeight + 'px' }">
  409. <view class="flex_auto">
  410. <input
  411. v-model="ctxValue"
  412. height="60"
  413. fixed="true"
  414. :focus="isFocus"
  415. :placeholder="placeholder"
  416. type="text"
  417. :custom-style="inputStyle"
  418. :adjust-position="false"
  419. class="input"
  420. @focus="focusNote"
  421. @blur="blur"
  422. />
  423. </view>
  424. <view class="btn" @click="postContent">提交</view>
  425. </view>
  426. </view>
  427. <!-- 播放前拍照end -->
  428. <u-popup
  429. v-model="showSet"
  430. :mask-close-able="false"
  431. mode="center"
  432. border-radius="24"
  433. >
  434. <view
  435. style="
  436. align-items: center;
  437. padding: 0 40rpx;
  438. display: flex;
  439. flex-direction: column;
  440. justify-content: center;
  441. "
  442. >
  443. <view
  444. style="
  445. font-weight: bold;
  446. color: #333333;
  447. font-size: 30rpx;
  448. margin-top: 30rpx;
  449. "
  450. >温馨提示</view
  451. >
  452. <view
  453. style="
  454. width: 457rpx;
  455. color: #666666;
  456. font-size: 30rpx;
  457. margin-top: 30rpx;
  458. "
  459. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  460. 是否授权使用?</view
  461. >
  462. <view style="margin: 40rpx 0">
  463. <button
  464. open-type="openSetting"
  465. @bindopensetting="openSetting"
  466. class="btnSet"
  467. >
  468. 去授权
  469. </button>
  470. </view>
  471. </view>
  472. </u-popup>
  473. <u-mask :show="photoPopup">
  474. <!-- 播放前拍照start -->
  475. <view
  476. v-if="photoPopup"
  477. :mask-close-able="false"
  478. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  479. >
  480. <view class="photoBox">
  481. <view class="photoTop">
  482. <view class="sqzz" v-if="false"
  483. ><u-icon
  484. name="close"
  485. color="#333333"
  486. size="30"
  487. @click="closePhoto"
  488. ></u-icon
  489. ></view>
  490. <view class="centersq">请正视手机屏幕</view>
  491. <view class="sqzz"></view>
  492. </view>
  493. <view class="photoCenter">
  494. <view
  495. style="width: 100%; height: 979rpx; position: fixed"
  496. v-if="photoPopup && isTaking"
  497. >
  498. <camera
  499. device-position="front"
  500. flash="off"
  501. @error="error"
  502. style="width: 100%; height: 100%"
  503. ></camera>
  504. </view>
  505. <view class="custom" v-if="!isTaking"
  506. ><image :src="avatarUrl" mode=""></image
  507. ></view>
  508. </view>
  509. <view class="btns">
  510. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  511. >拍照</view
  512. >
  513. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  514. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  515. </view>
  516. </view>
  517. </view>
  518. </u-mask>
  519. <u-popup
  520. v-model="noticeShow"
  521. class="notice_modal"
  522. mode="center"
  523. border-radius="14"
  524. width="700rpx"
  525. height="900rpx"
  526. >
  527. <div class="content">
  528. <scroll-view scroll-y="true" style="height: 100%">
  529. <view class="title">学员须知</view>
  530. <text class="text">
  531. {{ goodsData.buyNote }}
  532. </text>
  533. </scroll-view>
  534. </div>
  535. </u-popup>
  536. </view>
  537. </template>
  538. <script>
  539. import plv from "@/pages3/static/polyv-sdk/index";
  540. import courseModule from "@/components/course/courseModule.vue";
  541. import courseChapter from "@/components/course/courseChapter.vue";
  542. import courseSection from "@/components/course/courseSection.vue";
  543. import {WEBVIEW_URL} from '@/common/request.js'
  544. // import { websocket } from "@/common/socket.js";
  545. import { mapGetters, mapMutations } from "vuex";
  546. export default {
  547. components: {
  548. courseModule,
  549. courseChapter,
  550. courseSection,
  551. },
  552. filters: {
  553. formatDate(date) {
  554. const nDate = new Date(date)
  555. const nyear = nDate.getFullYear()
  556. const nmonth = (nDate.getMonth()+1).toString().padStart(2,0)
  557. const nday = nDate.getDate().toString().padStart(2,0)
  558. const hour = nDate.getHours()
  559. const mins = nDate.getMinutes()
  560. const seconds = nDate.getSeconds()
  561. return nyear+'-'+nmonth+'-'+nday+' '+hour+':'+(mins>=10 ? mins : '0'+mins)+':'+(seconds>=10 ? seconds : '0'+seconds)
  562. }
  563. },
  564. data() {
  565. return {
  566. hasStart:false,
  567. channelItem:null,
  568. lockTimer: null,
  569. orderGoodsId: 0,
  570. noticeShow: false,
  571. navShow: true,
  572. enableAutoRotation: true,
  573. seekTime: "",
  574. toastTimer: null,
  575. videoToastShow: false,
  576. initLiveOk: false,
  577. livePlay: false, //是否正在播放直播,不含暂停
  578. liveDuration: 0, //直播观看时长
  579. videoOption: {
  580. mode: "live",
  581. uid: "",
  582. cid: "",
  583. openId: "",
  584. isAutoChange: false,
  585. forceVideo: false,
  586. },
  587. courseHandoutsData: "",
  588. liveDetail: {},
  589. showSet: false,
  590. startStatus: false,
  591. detail: {},
  592. courseId: 0,
  593. placeholder:
  594. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  595. inputStyle: {
  596. background: "rgba(244, 244, 244, 0.98)",
  597. borderRadius: "24rpx",
  598. padding: "8rpx",
  599. marginBottom: "10rpx",
  600. },
  601. list: [{
  602. name: "目录",
  603. },
  604. {
  605. name: "笔记",
  606. },
  607. {
  608. name: "答疑",
  609. },
  610. {
  611. name: "聊天",
  612. }],
  613. menuList: [],
  614. current: 0,
  615. vid: "",
  616. goodsId: 0,
  617. goodsData: {},
  618. photoPopup: false,
  619. goodsPlayConfig: null,
  620. autoplay: false,
  621. isAllowSeek: "no",
  622. playbackRate: [1.0],
  623. timer: null,
  624. answerTimer: null,
  625. goodsPhotographConfig: null,
  626. intervalTimeList: [], // 间隔拍照时长
  627. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  628. playTime: 0, //页面播放时长,不含暂停
  629. currentTime: 0,
  630. avatarUrl: "",
  631. ossAvatarUrl: "",
  632. studyDuration: 0, // 当前视频时长
  633. gradeId: 0,
  634. chapterId: 0,
  635. moduleId: 0,
  636. reMenuList: [],
  637. answerList: [],
  638. assignUserId: 0,
  639. placeholder: "您可以在这里输入答疑内容",
  640. ctxValue: "",
  641. noteList: [],
  642. noteValue: "",
  643. noteId: 0,
  644. recordObj: 0,
  645. gradeDetail: {},
  646. isTaking: true, //是否正在拍照
  647. needSeek: false, //第一次播放是否需要跳转
  648. needProfileModal: false, //是否需要资料审核弹框
  649. liveObj: {},
  650. photoNum: 0,
  651. photoList: [], //拍照的时间点
  652. photoConfig: false, //是否配置好拍照次数
  653. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  654. photoHistoryList: [], //已拍照历史的下标点
  655. sectionItem: null,
  656. businessData: {},
  657. showNotes: true,
  658. menuIndex: [],
  659. uploadLock: false, //上传图片
  660. isPlayRebuild: false, //是否正在播放重修视频
  661. isRebuild: false, //视频是否从重修目录点击
  662. isFocus:false,
  663. clearTimer:null,
  664. historyChatMsgList:[],
  665. livingItem:'',
  666. bottomHeight: 0,
  667. };
  668. },
  669. computed: {
  670. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  671. },
  672. onLoad(option) {
  673. console.log('option====', 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. photo: self.ossAvatarUrl,
  1513. sectionId: parseInt(sectionId),
  1514. goodsId: parseInt(self.goodsId),
  1515. courseId: parseInt(self.courseId),
  1516. orderGoodsId: this.orderGoodsId,
  1517. studyDuration: parseInt(
  1518. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1519. ),
  1520. gradeId: parseInt(self.gradeId),
  1521. chapterId: parseInt(self.chapterId),
  1522. moduleId: parseInt(self.moduleId),
  1523. videoCurrentTime: parseInt(
  1524. currentTime > 0 ? currentTime : self.studyDuration
  1525. ),
  1526. };
  1527. if (status > 0) {
  1528. console.log(sectionId, "sectionId");
  1529. data.status = status;
  1530. }
  1531. console.log("提交接口", data);
  1532. this.$api.studyRecord(data).then((res) => {
  1533. if (res.data.code == 200) {
  1534. if (status > 0) {
  1535. let moduleId = this.moduleId || 0;
  1536. let chapterId = this.chapterId || 0;
  1537. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1538. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1539. console.log(playNextId, "playNextId");
  1540. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1541. uni.$emit("playNext" + playNextIdisRebuild, {
  1542. fromRebuild: this.isRebuild,
  1543. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1544. uni.$emit("playNext" + playNextId); //通知播放结束
  1545. }
  1546. self.ossAvatarUrl = "";
  1547. } else {
  1548. this.uploadLock = false;
  1549. uni.showToast({
  1550. icon: "none",
  1551. title: res.data.msg,
  1552. });
  1553. }
  1554. console.log(res, "res");
  1555. });
  1556. },
  1557. uploadFile(options, int) {
  1558. console.log(options)
  1559. var self = this;
  1560. return new Promise((resolve, reject) => {
  1561. var data = {
  1562. imageStatus: int,
  1563. gradeId: this.gradeId,
  1564. orderGoodsId: this.orderGoodsId,
  1565. };
  1566. self.$api.aliyunpolicy(data).then((res) => {
  1567. if (res.data.code != 200) {
  1568. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1569. return;
  1570. }
  1571. var ossToken = res.data.data.resultContent;
  1572. if (ossToken.host == null || ossToken.host == undefined) {
  1573. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1574. return;
  1575. }
  1576. uni.uploadFile({
  1577. url: ossToken.host,
  1578. name: "file",
  1579. filePath: options,
  1580. fileType: "image",
  1581. header: {
  1582. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1583. },
  1584. formData: {
  1585. key: ossToken.dir,
  1586. OSSAccessKeyId: ossToken.accessid,
  1587. policy: ossToken.policy,
  1588. Signature: ossToken.signature,
  1589. callback: ossToken.callback,
  1590. success_action_status: 200,
  1591. },
  1592. success: (result) => {
  1593. // if (result.statusCode === 200) {
  1594. this.$u.toast('上传成功')
  1595. self.ossAvatarUrl = ossToken.dir;
  1596. resolve();
  1597. // } else {
  1598. // uni.showToast({
  1599. // title: "上传失败",
  1600. // icon: "none",
  1601. // });
  1602. // this.openPhoto();
  1603. // return;
  1604. // }
  1605. },
  1606. fail: (error) => {
  1607. uni.showToast({
  1608. title: "上传接口报错,请重新拍照上传" + error,
  1609. icon: "none",
  1610. });
  1611. this.openPhoto();
  1612. return;
  1613. },
  1614. });
  1615. });
  1616. });
  1617. },
  1618. imageInfos() {
  1619. var self = this;
  1620. return new Promise((resolve, reject) => {
  1621. uni.getImageInfo({
  1622. src: self.avatarUrl,
  1623. success: async (res) => {
  1624. let canvasWidth = res.width; //图片原始长宽
  1625. let canvasHeight = res.height;
  1626. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1627. uni.compressImage({
  1628. src: self.avatarUrl,
  1629. quality: 75,
  1630. width: "35%",
  1631. height: "35%",
  1632. success: async (rest) => {
  1633. const waitUpload = await self.uploadFile(
  1634. rest.tempFilePath,
  1635. 0
  1636. );
  1637. resolve(waitUpload);
  1638. },
  1639. });
  1640. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1641. uni.compressImage({
  1642. src: self.avatarUrl,
  1643. quality: 75,
  1644. width: "50%",
  1645. height: "50%",
  1646. success: async (rest) => {
  1647. const waitUpload = await self.uploadFile(
  1648. rest.tempFilePath,
  1649. 0
  1650. );
  1651. resolve(waitUpload);
  1652. },
  1653. });
  1654. } else {
  1655. console.log("无需压缩");
  1656. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1657. resolve(waitUpload);
  1658. }
  1659. },
  1660. fail: (err) => {
  1661. this.$u.toast('图片上传失败')
  1662. }
  1663. });
  1664. });
  1665. },
  1666. timeEvent() {
  1667. let self = this;
  1668. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1669. if (polyvPlayerContext != null) {
  1670. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  1671. // console.log(this.playTime,789,this.photoHistoryList)
  1672. //判断是否需要拍照
  1673. if (this.photoNum > 0) {
  1674. this.configPhoto();
  1675. let photoTime = 0; //获取拍照秒数
  1676. for (let i = 0; i < this.photoList.length; i++) {
  1677. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1678. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  1679. //3秒区间内才触发拍照,避免拉动滚动条
  1680. if (
  1681. this.photoHistoryList.indexOf(i) < 0 &&
  1682. this.sectionItem.learning != 1
  1683. ) {
  1684. //不存在拍照历史,没有重修过,没有学过,则拍照
  1685. //启动拍照
  1686. //暂停
  1687. polyvPlayerContext.exitFullScreen();
  1688. polyvPlayerContext.pause();
  1689. this.photoIndex = i;
  1690. this.openPhoto();
  1691. }
  1692. }
  1693. }
  1694. }
  1695. }
  1696. },
  1697. closeToast() {
  1698. clearTimeout(this.toastTimer);
  1699. this.videoToastShow = false;
  1700. },
  1701. restart() {
  1702. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1703. polyvPlayerContext.seek(0);
  1704. console.log("seek1");
  1705. clearTimeout(this.toastTimer);
  1706. this.videoToastShow = false;
  1707. },
  1708. onStateChange(newstate, oldstate) {
  1709. if (newstate.detail.newstate == "playing") {
  1710. if (this.needSeek) {
  1711. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1712. if (this.recordObj.videoCurrentTime) {
  1713. console.log("seek2");
  1714. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1715. this.seekTime = this.$method.secondToDate(
  1716. this.recordObj.videoCurrentTime
  1717. );
  1718. this.videoToastShow = true;
  1719. this.toastTimer = setTimeout(() => {
  1720. this.videoToastShow = false;
  1721. }, 3000);
  1722. } else {
  1723. polyvPlayerContext.seek(1); //避免相同节继续播放
  1724. console.log("seek3");
  1725. }
  1726. polyvPlayerContext.play();
  1727. this.needSeek = false;
  1728. }
  1729. //开始播放
  1730. if (this.timer) {
  1731. clearInterval(this.timer);
  1732. }
  1733. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1734. }
  1735. if (newstate.detail.newstate == "pause") {
  1736. clearInterval(this.timer);
  1737. //暂停提交记录
  1738. /* this.ossAvatarUrl = ""
  1739. this.postStudyRecord() */
  1740. }
  1741. if (newstate.detail.newstate == "ended") {
  1742. clearInterval(this.timer);
  1743. uni.showToast({
  1744. icon: "none",
  1745. title: "播放完毕",
  1746. });
  1747. this.hasStart = false;
  1748. this.postStudyRecord(1);
  1749. // uni.$emit('playNext') //播放重修下一节
  1750. }
  1751. },
  1752. //拍照
  1753. openPhoto() {
  1754. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1755. if (polyvPlayerContext) {
  1756. polyvPlayerContext.exitFullScreen();
  1757. }
  1758. this.enableAutoRotation = false;
  1759. this.photoPopup = true;
  1760. this.isTaking = true;
  1761. uni.setKeepScreenOn({
  1762. keepScreenOn: true,
  1763. });
  1764. uni.authorize({
  1765. scope: "scope.camera",
  1766. success() {},
  1767. });
  1768. },
  1769. /**
  1770. * 人脸匹配
  1771. */
  1772. faceRecognition() {
  1773. return new Promise((resolve) => {
  1774. let fileSystem = uni.getFileSystemManager();
  1775. fileSystem.readFile({
  1776. filePath: `${this.avatarUrl}`,
  1777. encoding: "base64",
  1778. position: 0,
  1779. success: (res) => {
  1780. console.log(res);
  1781. let base64 = "data:image/jpg;base64," + res.data;
  1782. console.log({
  1783. imageA: base64,
  1784. orderGoodsId: this.orderGoodsId,
  1785. gradeId: this.gradeId,
  1786. },'base64Data')
  1787. this.$api
  1788. .faceCertificationCompareFace({
  1789. imageA: base64,
  1790. orderGoodsId: this.orderGoodsId,
  1791. gradeId: this.gradeId,
  1792. })
  1793. .then((res) => {
  1794. console.log(res, "res");
  1795. resolve(res.data.data);
  1796. });
  1797. },
  1798. fail(err) {
  1799. console.error(err, "err");
  1800. },
  1801. });
  1802. });
  1803. },
  1804. async submit() {
  1805. if (this.uploadLock) {
  1806. return;
  1807. }
  1808. this.uploadLock = true;
  1809. let compareFaceData = await this.faceRecognition();
  1810. console.log(compareFaceData,'compareFaceData')
  1811. if (compareFaceData >= 80) {
  1812. const waitYS = await this.imageInfos();
  1813. this.postCoursePhotoRecord()
  1814. .then((res) => {
  1815. this.photoHistoryList.push(this.photoIndex);
  1816. this.postStudyRecord(); //提交记录
  1817. //恢复播放
  1818. uni.setKeepScreenOn({
  1819. keepScreenOn: false,
  1820. });
  1821. this.photoPopup = false;
  1822. this.uploadLock = false;
  1823. this.enableAutoRotation = true;
  1824. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1825. if (polyvPlayerContext != null) {
  1826. polyvPlayerContext.play();
  1827. }
  1828. })
  1829. .catch((err) => {
  1830. uni.showToast({
  1831. title: "上传接口报错,请重新拍照上传" + err,
  1832. icon: "none",
  1833. });
  1834. this.uploadLock = false;
  1835. this.openPhoto();
  1836. });
  1837. } else {
  1838. uni.showToast({
  1839. title: "人脸匹配不通过,请重新拍照上传",
  1840. icon: "none",
  1841. duration: 2000,
  1842. });
  1843. setTimeout(() => {
  1844. this.uploadLock = false;
  1845. this.openPhoto();
  1846. }, 2000);
  1847. return;
  1848. }
  1849. },
  1850. reTake() {
  1851. this.isTaking = true;
  1852. },
  1853. //确认拍照
  1854. takePhoto() {
  1855. var self = this;
  1856. const ctx = uni.createCameraContext();
  1857. ctx.takePhoto({
  1858. quality: "high",
  1859. success: (res) => {
  1860. console.log(res.tempImagePath);
  1861. self.avatarUrl = res.tempImagePath;
  1862. this.isTaking = false;
  1863. // self.submit();
  1864. // self.photoPopup = false;
  1865. // self.enableAutoRotation = true;
  1866. },
  1867. fail: (err) => {
  1868. console.log(err);
  1869. },
  1870. });
  1871. },
  1872. playError(e) {
  1873. console.log(e);
  1874. },
  1875. //拍照报错
  1876. error(e) {
  1877. console.log(e.detail);
  1878. },
  1879. //关闭相机
  1880. closePhoto() {
  1881. this.photoPopup = false;
  1882. self.enableAutoRotation = true;
  1883. },
  1884. /**
  1885. * 进入全屏
  1886. */
  1887. fullscreenchange(event) {
  1888. console.log('进入全屏',event);
  1889. if (event.detail.direction == "vertical") {
  1890. this.navShow = true;
  1891. } else if (event.detail.direction == "horizontal") {
  1892. this.navShow = false;
  1893. }
  1894. },
  1895. getGoodsDetail() {
  1896. let self = this;
  1897. // app/common/goods/'+ data
  1898. this.$api.goodsDetail(this.goodsId).then((res) => {
  1899. self.goodsData = res.data.data;
  1900. console.log(self.gradeId, "班级ID");
  1901. // this.courseBusiness();
  1902. // this.courseHandouts();
  1903. self.getMenuList();
  1904. console.log(self.goodsData,'self.goodsData')
  1905. //获取节笔记
  1906. this.getNoteList();
  1907. if (self.goodsData.goodsPlayConfig) {
  1908. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  1909. if (self.goodsPlayConfig.autoPlay > 0) {
  1910. self.autoplay = true;
  1911. }
  1912. if (self.goodsPlayConfig.drag > 0) {
  1913. self.isAllowSeek = "yes";
  1914. }
  1915. if (self.goodsPlayConfig.speed > 0) {
  1916. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  1917. }
  1918. }
  1919. if (self.goodsData.goodsPhotographConfig) {
  1920. self.goodsPhotographConfig = JSON.parse(
  1921. self.goodsData.goodsPhotographConfig
  1922. );
  1923. if (self.goodsPhotographConfig.photoNum > 0) {
  1924. self.photoNum = self.goodsPhotographConfig.photoNum;
  1925. console.log(self.photoNum, 777777);
  1926. }
  1927. }
  1928. });
  1929. },
  1930. startVideo() {
  1931. this.startStatus = true;
  1932. },
  1933. getAnswerList() {
  1934. let self = this;
  1935. this.$api
  1936. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  1937. .then((res) => {
  1938. if (res.data.code == 200) {
  1939. self.answerList = res.data.rows;
  1940. }
  1941. });
  1942. },
  1943. getMenuList() {
  1944. let self = this;
  1945. this.$api
  1946. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1947. .then((res) => {
  1948. if (res.data.code == 200) {
  1949. for (let i = 0; i < res.data.rows.length; i++) {
  1950. let item = res.data.rows[i];
  1951. item.down = true;
  1952. item.id = item.menuId;
  1953. item.name = item.menuName;
  1954. item.menuType = item.type;
  1955. }
  1956. self.menuList = res.data.rows;
  1957. for (let i = 0; i < res.data.rows.length; i++) {
  1958. if (res.data.rows[i].type == 1) {
  1959. this.menuIndex = [i];
  1960. break;
  1961. } else if (res.data.rows[i].type == 2) {
  1962. this.menuIndex = [i];
  1963. break;
  1964. }
  1965. }
  1966. }
  1967. });
  1968. },
  1969. courseDetail() {
  1970. let self = this;
  1971. // /course/'+data 获取课程详细信息
  1972. this.$api.courseDetail(this.courseId).then((res) => {
  1973. if (res.data.code == 200) {
  1974. // if (res.data.data.educationName == "继续教育") {
  1975. this.$api
  1976. .lockLockAction({
  1977. action: "jxjy",
  1978. uuid:this.$method.getUuid()
  1979. })
  1980. .then((res) => {});
  1981. this.lockTimer = setInterval(() => {
  1982. this.$api
  1983. .lockLockAction({
  1984. action: "jxjy",
  1985. uuid:this.$method.getUuid()
  1986. })
  1987. .then((res) => {});
  1988. }, 10000);
  1989. // websocket.sendMsg("doCourse");
  1990. // }
  1991. self.detail = res.data.data;
  1992. }
  1993. });
  1994. },
  1995. open(item) {
  1996. item.showChildren = !item.showChildren;
  1997. },
  1998. change(index) {
  1999. this.current = index;
  2000. },
  2001. openDocument() {
  2002. let self = this;
  2003. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2004. console.log(url);
  2005. uni.downloadFile({
  2006. url: url,
  2007. success: function (res) {
  2008. console.log(999);
  2009. var filePath = res.tempFilePath;
  2010. uni.openDocument({
  2011. filePath: filePath,
  2012. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  2013. success: function (res) {
  2014. console.log(res, "打开文档成功");
  2015. },
  2016. fail: function (err) {
  2017. console.log(err);
  2018. uni.showToast({
  2019. icon: "none",
  2020. title: "文档地址错误",
  2021. });
  2022. },
  2023. });
  2024. },
  2025. fail: (err) => {
  2026. uni.showModal({
  2027. title: "提示",
  2028. content: "文档错误," + err.errMsg,
  2029. showCancel: false,
  2030. });
  2031. },
  2032. });
  2033. },
  2034. },
  2035. };
  2036. </script>
  2037. <style lang="scss" scope>
  2038. .top {
  2039. &__header {
  2040. position:relative;
  2041. width:100%;
  2042. height:150rpx;
  2043. padding:24rpx 150rpx 24rpx 24rpx;
  2044. .img {
  2045. position:absolute;
  2046. left:0;
  2047. top:0;
  2048. width:100%;
  2049. }
  2050. .note {
  2051. position:relative;
  2052. z-index: 10;
  2053. font-size: 24rpx;
  2054. font-family: PingFang SC;
  2055. font-weight: bold;
  2056. color: #EFDBFF;
  2057. }
  2058. .title {
  2059. position:relative;
  2060. z-index: 10;
  2061. font-size: 26rpx;
  2062. font-family: PingFang SC;
  2063. font-weight: bold;
  2064. color: #FFFFFF;
  2065. }
  2066. .desc {
  2067. }
  2068. }
  2069. }
  2070. .polyv_detail {
  2071. display: flex;
  2072. flex-direction: column;
  2073. height: 100vh;
  2074. .box {
  2075. flex: 1;
  2076. overflow: hidden;
  2077. margin: 16rpx 16rpx 100rpx 16rpx;
  2078. .box_in {
  2079. height: 100%;
  2080. }
  2081. }
  2082. .first_ml {
  2083. margin: 16rpx 16rpx 16rpx 16rpx;
  2084. }
  2085. }
  2086. .btnSet {
  2087. width: 440rpx;
  2088. height: 80rpx;
  2089. background: #007aff;
  2090. border-radius: 40rpx;
  2091. color: #ffffff;
  2092. font-size: 28rpx;
  2093. line-height: 80rpx;
  2094. }
  2095. .btnReply {
  2096. width: 80rpx;
  2097. height: 40rpx;
  2098. background: #e3f0ff;
  2099. border-radius: 16rpx;
  2100. text-align: center;
  2101. color: #007aff;
  2102. }
  2103. .btnDel {
  2104. width: 80rpx;
  2105. height: 40rpx;
  2106. background: #ffedf0;
  2107. border-radius: 16rpx;
  2108. text-align: center;
  2109. color: #ff2d55;
  2110. }
  2111. .btnReply {
  2112. width: 80rpx;
  2113. height: 40rpx;
  2114. background: #e3f0ff;
  2115. border-radius: 16rpx;
  2116. font-size: 24rpx;
  2117. }
  2118. .lecture-box {
  2119. display: flex;
  2120. align-items: center;
  2121. height: 80rpx;
  2122. background: #ffffff;
  2123. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2124. .title {
  2125. padding: 10rpx;
  2126. flex: 1;
  2127. overflow: hidden;
  2128. text-overflow: ellipsis;
  2129. white-space: nowrap;
  2130. color: #333;
  2131. font-weight: bold;
  2132. font-size: 32rpx;
  2133. }
  2134. .btn {
  2135. display: flex;
  2136. align-items: center;
  2137. justify-content: center;
  2138. width: 80rpx;
  2139. height: 80rpx;
  2140. background: #ffffff;
  2141. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2142. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2143. }
  2144. }
  2145. .lecture-content {
  2146. background: #fff;
  2147. margin-top: 10rpx;
  2148. padding: 10rpx;
  2149. border-radius: 16rpx;
  2150. }
  2151. .photoBox {
  2152. background-color: #ffffff;
  2153. border-radius: 32px 32px 0px 0px;
  2154. .photoTop {
  2155. height: 74rpx;
  2156. display: flex;
  2157. align-items: center;
  2158. justify-content: space-between;
  2159. padding: 0rpx 38rpx;
  2160. .sqzz {
  2161. width: 28rpx;
  2162. height: 28rpx;
  2163. display: flex;
  2164. align-items: center;
  2165. justify-content: center;
  2166. }
  2167. .centersq {
  2168. color: #333;
  2169. font-size: 30rpx;
  2170. font-weight: 500;
  2171. }
  2172. }
  2173. .photoCenter {
  2174. width: 750rpx;
  2175. height: 979rpx;
  2176. position: relative;
  2177. .custom {
  2178. width: 750rpx;
  2179. height: 979rpx;
  2180. position: absolute;
  2181. z-index: 1000;
  2182. top: 0;
  2183. left: 0;
  2184. image {
  2185. width: 100%;
  2186. height: 100%;
  2187. }
  2188. }
  2189. }
  2190. .btns {
  2191. display: flex;
  2192. .btnResult {
  2193. height: 100rpx;
  2194. flex: 1;
  2195. background-color: #07c160;
  2196. text-align: center;
  2197. line-height: 100rpx;
  2198. color: #fff;
  2199. font-size: 32rpx;
  2200. font-weight: bold;
  2201. }
  2202. }
  2203. }
  2204. .chat_box {
  2205. display: flex;
  2206. padding: 20rpx;
  2207. justify-content: space-between;
  2208. }
  2209. .chat3 {
  2210. font-size: 30rpx;
  2211. font-family: PingFang SC;
  2212. font-weight: 500;
  2213. color: #666666;
  2214. margin-top: 10rpx;
  2215. }
  2216. .chat2 {
  2217. font-size: 20rpx;
  2218. font-family: PingFang SC;
  2219. font-weight: 500;
  2220. color: #999999;
  2221. margin-top: 10rpx;
  2222. }
  2223. .chat1 {
  2224. font-size: 24rpx;
  2225. font-family: PingFang SC;
  2226. font-weight: 500;
  2227. color: #333333;
  2228. }
  2229. .leftPadding {
  2230. margin-left: 8rpx;
  2231. }
  2232. .t2Content {
  2233. font-size: 24rpx;
  2234. font-family: PingFang SC;
  2235. font-weight: bold;
  2236. color: #999999;
  2237. line-height: 48rpx;
  2238. }
  2239. .tBox2 {
  2240. display: flex;
  2241. padding-top: 10rpx;
  2242. color: #333333;
  2243. font-size: 30rpx;
  2244. font-weight: 400;
  2245. }
  2246. .tBox {
  2247. display: flex;
  2248. align-items: center;
  2249. padding-top: 10rpx;
  2250. }
  2251. .title {
  2252. font-size: 24rpx;
  2253. color: #999999;
  2254. }
  2255. page {
  2256. // padding-top: 10px;
  2257. // padding-top: constant(safe-area-inset-top);
  2258. // padding-top: env(safe-area-inset-top);
  2259. }
  2260. .Answering {
  2261. .answer_item {
  2262. &:nth-child(2) {
  2263. border-radius: 16rpx 16rpx 0rpx 0rpx;
  2264. }
  2265. &:nth-last-child(1) {
  2266. border-radius: 0rpx 0rpx 16rpx 16rpx;
  2267. }
  2268. }
  2269. }
  2270. .inputBottom {
  2271. position: fixed;
  2272. left: 0;
  2273. bottom: 0;
  2274. background: #ffffff;
  2275. height: 98rpx;
  2276. display: flex;
  2277. align-items: center;
  2278. width: 100%;
  2279. z-index: 99;
  2280. .flex_auto {
  2281. flex: 1;
  2282. margin-left: 10%;
  2283. }
  2284. .btn {
  2285. color: #007aff;
  2286. font-size: 30rpx;
  2287. font-weight: bold;
  2288. width: 15%;
  2289. text-align: center;
  2290. }
  2291. .input {
  2292. background: rgba(244, 244, 244, 0.98);
  2293. height: 60rpx;
  2294. border-radius: 24rpx;
  2295. margin-top: 12rpx;
  2296. }
  2297. }
  2298. .noteBox {
  2299. width: 100%;
  2300. background: #ffffff;
  2301. padding: 0rpx 10rpx 20rpx;
  2302. border-radius: 16rpx;
  2303. overflow: hidden;
  2304. .left_ti {
  2305. padding-top: 14rpx;
  2306. }
  2307. }
  2308. .dateBox {
  2309. width: 216rpx;
  2310. height: 48rpx;
  2311. background: #ffffff;
  2312. border-radius: 24rpx;
  2313. font-size: 24rpx;
  2314. color: #666666;
  2315. text-align: center;
  2316. line-height: 48rpx;
  2317. margin: 16rpx 0rpx 8rpx;
  2318. }
  2319. .t_content1 {
  2320. color: #007aff;
  2321. margin-left: 10rpx;
  2322. }
  2323. .tag1 {
  2324. border: 2rpx solid #007aff;
  2325. border-radius: 8rpx;
  2326. font-size: 20rpx;
  2327. color: #007aff;
  2328. padding: 5rpx;
  2329. }
  2330. .b_title {
  2331. color: #333333;
  2332. font-size: 30rpx;
  2333. font-weight: bold;
  2334. }
  2335. page {
  2336. background: #eaeef1;
  2337. }
  2338. .menuBox {
  2339. width: 100%;
  2340. background: #ffffff;
  2341. border-radius: 16rpx;
  2342. padding: 20rpx;
  2343. margin-bottom: 20rpx;
  2344. }
  2345. .btnspric {
  2346. border-top: 1rpx solid #eee;
  2347. display: flex;
  2348. align-items: center;
  2349. justify-content: space-between;
  2350. height: 108rpx;
  2351. padding-left: 43rpx;
  2352. padding-right: 32rpx;
  2353. }
  2354. .btnspric > .lefprL {
  2355. font-size: 36rpx;
  2356. color: #0c141f;
  2357. font-weight: bold;
  2358. }
  2359. .btnspric > .lefprR {
  2360. padding: 0rpx 24rpx;
  2361. height: 60rpx;
  2362. line-height: 60rpx;
  2363. text-align: center;
  2364. color: #fff;
  2365. background: #32467b;
  2366. border-radius: 24rpx;
  2367. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2368. }
  2369. .yhj,
  2370. .hdyhj {
  2371. padding: 24rpx 29rpx 24rpx 34rpx;
  2372. }
  2373. .yhj {
  2374. border-bottom: 16rpx solid #f9f9f9;
  2375. }
  2376. .yhjtit {
  2377. font-size: 30rpx;
  2378. color: #0c141f;
  2379. font-weight: 500;
  2380. margin-bottom: 14rpx;
  2381. }
  2382. .yhjList {
  2383. display: flex;
  2384. align-items: center;
  2385. justify-content: space-between;
  2386. margin-bottom: 14rpx;
  2387. }
  2388. .yhjList > .yhjLefts {
  2389. display: flex;
  2390. align-items: center;
  2391. }
  2392. .yhjLefts > .yhl {
  2393. color: #32467b;
  2394. font-size: 30rpx;
  2395. margin-right: 31rpx;
  2396. }
  2397. .yhjLefts > .yhbq {
  2398. font-size: 24rpx;
  2399. color: #ff9500;
  2400. border-radius: 18rpx;
  2401. background-color: rgba(255, 149, 0, 0.2);
  2402. border: 2rpx solid #ff9500;
  2403. height: 38rpx;
  2404. line-height: 38rpx;
  2405. padding: 0rpx 16rpx;
  2406. }
  2407. .ts {
  2408. font-size: 24rpx;
  2409. color: #999;
  2410. margin: 14rpx 0rpx;
  2411. padding-right: 29rpx;
  2412. padding-left: 34rpx;
  2413. }
  2414. .yh {
  2415. padding-top: 20rpx;
  2416. }
  2417. .yh > .yhtitle {
  2418. display: flex;
  2419. align-items: center;
  2420. justify-content: space-between;
  2421. padding-right: 29rpx;
  2422. padding-left: 34rpx;
  2423. }
  2424. .priceBxs {
  2425. display: flex;
  2426. align-items: center;
  2427. }
  2428. .priceBxs > .pricleft {
  2429. border-radius: 24rpx;
  2430. border: 1rpx solid #e91313;
  2431. background-color: rgba(233, 19, 19, 0.1);
  2432. padding: 0rpx 18rpx;
  2433. height: 49rpx;
  2434. line-height: 49rpx;
  2435. text-align: center;
  2436. font-size: 30rpx;
  2437. font-weight: 500;
  2438. color: #e91313;
  2439. margin-right: 13rpx;
  2440. }
  2441. .topBox {
  2442. padding: 32rpx 32rpx 24rpx;
  2443. border-bottom: 1rpx solid #eeeeee;
  2444. }
  2445. .topBox > .boldFonstType {
  2446. font-weight: 500;
  2447. font-size: 30rpx;
  2448. margin: 16rpx 0rpx 23rpx;
  2449. }
  2450. .topBox > .firstTopL {
  2451. display: flex;
  2452. align-items: center;
  2453. }
  2454. .topBox > .firstTopL > .imageBs {
  2455. width: 331rpx;
  2456. height: 160rpx;
  2457. border-radius: 6rpx;
  2458. overflow: hidden;
  2459. margin-right: 8rpx;
  2460. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2461. }
  2462. .topBox > .firstTopL > .imageBs > image {
  2463. width: 100%;
  2464. height: 100%;
  2465. }
  2466. .topBox > .firstTopL > .textBs {
  2467. font-size: 30rpx;
  2468. font-weight: bold;
  2469. color: #0c141f;
  2470. }
  2471. .content {
  2472. padding: 24rpx;
  2473. text-align: left;
  2474. }
  2475. .catalogBox {
  2476. display: flex;
  2477. align-items: center;
  2478. flex-wrap: nowrap;
  2479. overflow-x: auto;
  2480. padding-left: 38rpx;
  2481. max-height: 305rpx;
  2482. overflow-y: auto;
  2483. transition: all 0.4s;
  2484. }
  2485. .catalogBox > .catalogA {
  2486. min-width: 200rpx;
  2487. height: 48rpx;
  2488. line-height: 48rpx;
  2489. // text-align: center;
  2490. border: 2rpx solid transparent;
  2491. white-space: nowrap;
  2492. text-overflow: ellipsis;
  2493. overflow: hidden;
  2494. word-break: break-all;
  2495. border-radius: 10rpx;
  2496. background: rgba(22, 119, 255, 0.05);
  2497. padding-left: 19rpx;
  2498. box-sizing: border-box;
  2499. padding-right: 15rpx;
  2500. margin-right: 16rpx;
  2501. margin-bottom: 20rpx;
  2502. margin-top: 15rpx;
  2503. font-size: 24rpx;
  2504. color: #666;
  2505. }
  2506. .catalogBox > .activesq {
  2507. border-color: #1677ff;
  2508. }
  2509. .changeCatalogBox {
  2510. display: block;
  2511. }
  2512. .catalogBox::-webkit-scrollbar {
  2513. display: none; /* Chrome Safari */
  2514. }
  2515. .price_t2 {
  2516. font-size: 18rpx;
  2517. font-family: PingFang SC;
  2518. font-weight: 500;
  2519. text-decoration: line-through;
  2520. color: #999999;
  2521. }
  2522. .price_t1 {
  2523. font-size: 33rpx;
  2524. font-family: PingFang SC;
  2525. font-weight: bold;
  2526. color: #e91313;
  2527. }
  2528. .sc_t {
  2529. font-size: 22rpx;
  2530. color: #000000;
  2531. }
  2532. .sc {
  2533. width: 29rpx;
  2534. height: 29rpx;
  2535. }
  2536. .buy {
  2537. width: 138rpx;
  2538. height: 48rpx;
  2539. line-height: 48rpx;
  2540. background: #32467b;
  2541. border-radius: 10rpx;
  2542. color: #ffffff;
  2543. font-size: 28rpx;
  2544. text-align: center;
  2545. vertical-align: middle;
  2546. position: absolute;
  2547. right: 30rpx;
  2548. }
  2549. .video_body {
  2550. padding-bottom: 96rpx;
  2551. }
  2552. .footer_tab {
  2553. position: fixed;
  2554. bottom: 0;
  2555. height: 96rpx;
  2556. width: 100%;
  2557. background-color: #ffffff;
  2558. }
  2559. .tj_box {
  2560. width: 50%;
  2561. display: inline-block;
  2562. text-align: center;
  2563. margin: 10rpx 0;
  2564. }
  2565. .teacher_t {
  2566. font-size: 24rpx;
  2567. font-family: PingFang SC;
  2568. font-weight: 400;
  2569. color: #666666;
  2570. line-height: 36rpx;
  2571. margin-left: 15rpx;
  2572. }
  2573. .teacher_img {
  2574. width: 87rpx;
  2575. height: 129rpx;
  2576. }
  2577. .t2 {
  2578. font-size: 24rpx;
  2579. font-family: PingFang SC;
  2580. color: #666666;
  2581. line-height: 36rpx;
  2582. margin: 15rpx;
  2583. }
  2584. .r_t2 {
  2585. width: 201rpx;
  2586. height: 49rpx;
  2587. background: rgba(22, 119, 255, 0.05);
  2588. border: 1rpx solid #32467b;
  2589. border-radius: 16rpx;
  2590. color: #666666;
  2591. font-size: 23rpx;
  2592. text-align: center;
  2593. display: flex;
  2594. align-items: center;
  2595. padding: 5rpx;
  2596. }
  2597. .scroll_box {
  2598. width: 100%;
  2599. height: 60rpx;
  2600. background: #ffffff;
  2601. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2602. white-space: nowrap;
  2603. overflow: hidden;
  2604. margin: 15rpx 0;
  2605. }
  2606. .r_sliper {
  2607. padding: 0 20rpx;
  2608. }
  2609. .top_line {
  2610. width: 6rpx;
  2611. height: 22rpx;
  2612. background: #32467b;
  2613. margin-right: 10rpx;
  2614. }
  2615. .video_t2 {
  2616. font-size: 24rpx;
  2617. font-family: PingFang SC;
  2618. font-weight: 500;
  2619. color: #666666;
  2620. }
  2621. .course_name {
  2622. height: 80rpx;
  2623. background-color: #fff;
  2624. }
  2625. .video_t1 {
  2626. height: 80rpx;
  2627. color: #333333;
  2628. line-height: 80rpx;
  2629. font-size: 30rpx;
  2630. font-family: PingFang SC;
  2631. font-weight: bold;
  2632. color: #333333;
  2633. margin-left: 15rpx;
  2634. overflow: hidden;
  2635. text-overflow: ellipsis;
  2636. white-space: nowrap;
  2637. }
  2638. .notice_wrap {
  2639. height: 80rpx;
  2640. display: flex;
  2641. align-items: center;
  2642. justify-content: flex-end;
  2643. .video_t1_t {
  2644. width: 100%;
  2645. height: 40rpx;
  2646. line-height: 40rpx;
  2647. text-align: center;
  2648. background: rgba(245, 154, 35, 1);
  2649. color: #333;
  2650. border-radius: 10rpx;
  2651. font-size: 24rpx;
  2652. }
  2653. }
  2654. .video_play {
  2655. position: absolute;
  2656. width: 95rpx;
  2657. height: 95rpx;
  2658. top: 0;
  2659. left: 0;
  2660. right: 0;
  2661. bottom: 0;
  2662. margin: auto;
  2663. }
  2664. .video_box {
  2665. position: relative;
  2666. .video-toast {
  2667. position: absolute;
  2668. width: 686rpx;
  2669. height: 80rpx;
  2670. background: rgba(0, 0, 0, 0.6);
  2671. border-radius: 24rpx;
  2672. bottom: 100rpx;
  2673. left: 50%;
  2674. transform: translateX(-50%);
  2675. color: #fff;
  2676. display: flex;
  2677. font-size: 26rpx;
  2678. align-items: center;
  2679. overflow: visible;
  2680. &__text {
  2681. flex: 1;
  2682. margin-left: 40rpx;
  2683. }
  2684. &__btn {
  2685. width: 180rpx;
  2686. text-align: center;
  2687. border-left: 1rpx solid #fff;
  2688. }
  2689. }
  2690. .video-toast__close {
  2691. position: absolute;
  2692. right: 32rpx;
  2693. bottom: 184rpx;
  2694. width: 40rpx;
  2695. height: 40rpx;
  2696. line-height: 40rpx;
  2697. text-align: center;
  2698. background: rgba(0, 0, 0, 0.6);
  2699. border-radius: 50%;
  2700. color: rgba(255, 255, 255, 0.3);
  2701. }
  2702. }
  2703. .rotoct {
  2704. transform: rotate(90deg);
  2705. }
  2706. .notice_modal {
  2707. .content {
  2708. width: 100%;
  2709. height: 100%;
  2710. padding: 20rpx;
  2711. .title {
  2712. color: #333;
  2713. line-height: 40rpx;
  2714. font-size: 30rpx;
  2715. text-align: center;
  2716. font-weight: bold;
  2717. }
  2718. .text {
  2719. line-height: 40rpx;
  2720. }
  2721. }
  2722. }
  2723. </style>