learningBase.vue 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764
  1. <template>
  2. <view>
  3. <view class="expirebox" v-if="isExpire">
  4. <image src="/static/images/expire.png" mode="aspectFill"></image>
  5. {{msg}}
  6. </view>
  7. <view class="content" v-show="!isExpire">
  8. <view class="video-box">
  9. <image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
  10. </image>
  11. <video
  12. @timeupdate="onTimeUpdate"
  13. @progress="progressChange"
  14. @error="videoErrorCallback"
  15. @play="getPlay"
  16. @pause="getPause"
  17. @ended="getEnded"
  18. @waiting="getWaiting"
  19. @fullscreenchange="fullscreenchange"
  20. :title="courseInfo.title"
  21. style="width: 100%;height: 420rpx;"
  22. :poster="poster"
  23. id="video-content-box"
  24. controls
  25. :auto-pause-if-open-native="true"
  26. :auto-pause-if-navigate="true"
  27. :enable-progress-gesture="false"
  28. :show-progress="true"
  29. :picture-in-picture-mode="[]"
  30. :show-background-playback-button="false"
  31. :src="videoUrl">
  32. <!-- logo -->
  33. <cover-image v-if="courseLogo" :class="isfull?'logo-full':'logo'" :src="courseLogo" mode="widthFix"></cover-image>
  34. <cover-view class="video-controls-box" v-if="isLogin&&isAddKf==1&&isPause">
  35. <cover-image class="video-play" src="@/static/images/video_icon.png" @click="clickVideo()"></cover-image>
  36. </cover-view>
  37. </video>
  38. </view>
  39. <view class="title-content" id="title-content">
  40. <!-- 答题时展示小节课程名,其他展示课程名 -->
  41. <!-- 小节课程名 -->
  42. <view class="subtitlebox" v-if="isLogin&&isAddKf==1">
  43. {{courseInfo.title}}
  44. </view>
  45. <!-- 课程名字 -->
  46. <view class="miantitlebox" v-else>
  47. {{courseInfo.courseName}}
  48. </view>
  49. </view>
  50. <scroll-view class="scroll-view" :style="{height: height}" :scroll-top="scrollTop" scroll-y="true">
  51. <!-- 介绍 -->
  52. <!-- <view class="descbox">
  53. <template v-if="!isLogin||isAddKf!=1">
  54. <view class="descbox-title">{{courseInfo.title}}</view>
  55. <view class="descbox-info">
  56. <view class="descbox-info-r expand" v-if="textHeight > 21">
  57. <text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
  58. <image src="/static/images/course_arrow_up_icon.png" v-show="isExpand"></image>
  59. <image src="/static/images/course_arrow_down_icon.png" v-show="!isExpand"></image>
  60. </view>
  61. </view>
  62. </template>
  63. <view class="descbox-desc" id="descbox-desc" :style="{height: isExpand ? 'auto': '42rpx'}">
  64. <text>{{courseInfo.description}}</text>
  65. <view :class="isExpand ? 'expand': 'expand expand-ab'" v-if="isLogin&&isAddKf==1&&textHeight > 21">
  66. <text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
  67. <image src="/static/images/course_arrow_up_icon.png" v-show="isExpand"></image>
  68. <image src="/static/images/course_arrow_down_icon.png" v-show="!isExpand"></image>
  69. </view>
  70. </view>
  71. </view> -->
  72. <!-- 问题 -->
  73. <view class="ques-content" v-if="isLogin&&isAddKf==1&&quesList&&quesList.length>0">
  74. <view class="ques-content-tit">问答题</view>
  75. <view v-for="(item,index) in quesList" :key="index">
  76. <view class="ques-title">
  77. <text>{{index + 1}}.</text>
  78. <view class="ques-type" v-show="item.type == 1 || item.type == 2">
  79. {{item.type == 1 ? '单选' : item.type == 2 ? '多选' : ''}}
  80. </view>
  81. <text>{{item.title}}</text>
  82. </view>
  83. <view
  84. :class="isAnswer(item,option.name) ?'ques-option ques-option-active':'ques-option'"
  85. v-for="(option,idx) in item.questionOption"
  86. :key="idx"
  87. @click="handleAnswer(item,option)">
  88. <view>
  89. {{numberToLetter(idx)}}.
  90. </view>
  91. <view>{{option.name}}</view>
  92. </view>
  93. </view>
  94. </view>
  95. </scroll-view>
  96. <!-- 线路 -->
  97. <view class="video-line" @click="openPop" v-if="isLogin&&isAddKf==1">
  98. <image src="/static/images/changePlayer-icon.png"></image>
  99. <text>线路{{lineIndex + 1 | numberToChinese}}</text>
  100. </view>
  101. <!-- 线路弹窗 -->
  102. <uni-popup ref="popup" type="bottom" class="full-width-popup">
  103. <view class="popupbox">
  104. <view class="popupbox-head">
  105. <text>线路选择</text>
  106. <image class="close-icon" src="/static/images/tc_close_icon.png" mode="aspectFill" @click="close">
  107. </image>
  108. </view>
  109. <view class="popupbox-content">
  110. <view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
  111. v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
  112. 线路{{index + 1 | numberToChinese}}</view>
  113. </view>
  114. </view>
  115. </uni-popup>
  116. <!-- 温馨提示弹窗 -->
  117. <uni-popup ref="tipsPopup" type="center" :is-mask-click="false">
  118. <view class="tipsPopup-mask">
  119. <image class="red_envelope_top" src="/static/images/red_envelope_img.png" mode="aspectFill"></image>
  120. <view class="tipsPopup">
  121. <image class="tipsPopup-close" src="/static/images/course_close_white_icon.png" mode="aspectFill"
  122. @click="closeTipsPop"></image>
  123. <view class="tipsPopup-line">
  124. <view class="tipsPopup-box">
  125. <view class="tipsPopup-head">
  126. <image class="tipsPopup-head-title" src="/static/images/tips_title_img.png"
  127. mode="widthFix"></image>
  128. </view>
  129. <view class="tipsPopup-content">
  130. <view class="tipsPopup-content-title">亲爱的用户,</view>
  131. <view>您已经观看课程一半的时间了,请注意休息并保持专注。</view>
  132. </view>
  133. <view class="tipsPopup-btn-box">
  134. <view class="tipsPopup-btn" @click="closeTipsPop">继续观看领奖励</view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </uni-popup>
  141. <!-- 答题弹窗 -->
  142. <uni-popup ref="answerPopup" type="center" :show="answerPopup">
  143. <view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
  144. <!-- 正确 -->
  145. <image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" src="/static/images/course_answer_img.png"
  146. mode="aspectFill"></image>
  147. <!-- 错误 -->
  148. <image class="tipimg" v-else src="/static/images/course_answer_incorrectly_img.png" mode="aspectFill">
  149. </image>
  150. <view class="answerPopup-title">{{errTitle}}</view>
  151. <view class="answerPopup-desc" v-html="errDesc"></view>
  152. <!-- 选择奖励 -->
  153. <view class="reward-list" v-if="errTitle == '恭喜你,回答正确'">
  154. <radio-group class="reward-list-group" @change="rewardChange">
  155. <label class="reward-list-option" v-for="(item, index) in rewardType" :key="item.value">
  156. <radio :value="item.value+ ''" :checked="item.value == currentReward"
  157. activeBorderColor="#FF5C03" activeBackgroundColor="#FF5C03"
  158. style="transform:scale(0.7)" />
  159. <view :style="{color: item.value == currentReward ? '#FF5C03':''}">{{item.name}}</view>
  160. </label>
  161. </radio-group>
  162. </view>
  163. <!-- 错误题目 -->
  164. <view class="errQuesbox" v-if="errQues&&errQues.length>0">
  165. <view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
  166. </view>
  167. <view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">领取</view>
  168. <view class="tipsPopup-btn-box" v-else
  169. :style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
  170. <view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
  171. </view>
  172. </view>
  173. </uni-popup>
  174. <!-- 客服二维码弹窗 -->
  175. <uni-popup ref="kfPopup" type="center" :mask-click="false">
  176. <view class="kfqrcode-box">
  177. <image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true"></image>
  178. <view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view>
  179. <image class="kfqrcode-close" src="/static/images/course_close_white_icon.png" mode="aspectFill"
  180. @click="closeKFPop"></image>
  181. </view>
  182. </uni-popup>
  183. <!-- footer -->
  184. <view class="footer" v-if="videoId||sortLink">
  185. <view class="footer-btn" v-if="!isLogin || isAddKf !=1" @click="submit">
  186. <text>立即学习</text>
  187. </view>
  188. <view v-if="isLogin&&isAddKf==1&&quesList&&quesList.length>0" class="footer-btn footer-btn-border" @click="submit">
  189. <!-- <image class="footer-btn-img" v-show="isLogin&&isAddKf==1" src="@/static/images/red_envelope_btnimg.png"
  190. mode="aspectFill"></image> -->
  191. <text>提交答案领取奖励</text>
  192. </view>
  193. <view @click="checked=!checked" class="agreement" v-if="!isLogin">
  194. <radio value="r1" :checked="checked" color="#ff5c03" activeBorderColor="#ff5c03"
  195. style="transform:scale(0.6);" />
  196. <view>阅读并同意<text style="color: #ff5c03;" @click.stop="goWeb(0)">《用户协议》</text>和<text
  197. style="color: #ff5c03;" @click.stop="goWeb(1)">《隐私协议》</text></view>
  198. </view>
  199. <view class="footer-tips" v-if="isLogin">重庆云联融智提供技术支持</view>
  200. </view>
  201. </view>
  202. </view>
  203. </template>
  204. <script>
  205. import { generateRandomString,initJssdk } from "@/utils/common.js"
  206. import dayjs from 'dayjs';
  207. import {
  208. getErrMsg,
  209. getH5CourseByVideoId,
  210. getH5CourseVideoDetails,
  211. courseAnswer,
  212. getFinishCourseVideo,
  213. getIsAddKf,
  214. internetTraffic,
  215. getIntegralByH5Video,
  216. sendReward,
  217. loginByMp,
  218. getRealLink
  219. } from "@/api/course.js"
  220. const isWechat = () => {
  221. return String(navigator.userAgent.toLowerCase().match(/MicroMessenger/i)) === "micromessenger";
  222. }
  223. export default {
  224. data() {
  225. return {
  226. // 1 红包 2 积分
  227. rewardType: [{
  228. name: '红包奖励',
  229. value: 1
  230. }, {
  231. name: '积分奖励',
  232. value: 2
  233. }],
  234. currentReward: 1,
  235. player: null,
  236. loading: true,
  237. progress: 0,
  238. code: null,
  239. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  240. scrollTop: 0,
  241. height: '0px',
  242. isLogin: false,
  243. videoUrl: "",
  244. videoId: "",
  245. //现在的时长
  246. playTime: 0,
  247. //总时长
  248. duration: 0,
  249. playDuration: 0,
  250. // 用于续播
  251. playDurationSeek: 0,
  252. // 温馨提醒时间节点,
  253. tipsTime: 0,
  254. tipsOpen: false,
  255. config: {},
  256. courseInfo: {},
  257. quesList: [],
  258. lineList: [],
  259. // 错题
  260. errQues: [],
  261. // 答题机会
  262. remain: 0,
  263. errTitle: "",
  264. errDesc: "",
  265. showPlay: true,
  266. showControls: false,
  267. playStatus: "",
  268. isAddKf: 0,
  269. lineIndex: 0,
  270. // 是否展开
  271. isExpand: true,
  272. textHeight: 0, //文本高度
  273. qwUserId: "",
  274. qrcode: "",
  275. corpId: "",
  276. qrcodeMsg: "",
  277. urlOption: {},
  278. bufferRate: 0, // 缓冲时间
  279. uuId: "",
  280. isEnded: false,
  281. // 是否允许拖动进度条
  282. linkType: 0,
  283. ip: null,
  284. checked: true,
  285. isFinish: 0, // 是否完课
  286. interval: null,
  287. intervalIntegral: null, // 积分定时
  288. // 错误请求次数
  289. errorCount: 0,
  290. answerPopup: false,
  291. sortLink:"",
  292. // 课程是否过期
  293. isExpire: false,
  294. timer: null,
  295. flag: false,
  296. poster:"",
  297. msg:"",
  298. authDomainName: "",
  299. // 是否暂停
  300. isPause: true,
  301. courseLogo: '',
  302. isfull: false,
  303. }
  304. },
  305. filters: {
  306. numberToChinese(number) {
  307. if (number) {
  308. const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
  309. return chineseNumber[number - 1];
  310. } else {
  311. return ''
  312. }
  313. },
  314. },
  315. computed: {
  316. isAnswer() {
  317. return (item, name) => {
  318. if (item.type == 1) {
  319. return item.answer == name
  320. } else if (item.type == 2) {
  321. const array = item.answer.split(',')
  322. return array.some(i => i == name)
  323. } else {
  324. return false
  325. }
  326. }
  327. }
  328. },
  329. onLoad(option) {
  330. this.sortLink = option.s || ''
  331. this.code = option.code
  332. this.urlOption = option.course ? JSON.parse(option.course) : {}
  333. this.videoId = this.urlOption.videoId || ''
  334. console.log("this.videoId====",this.videoId)
  335. this.qwUserId = this.urlOption.qwUserId || ''
  336. this.corpId = this.urlOption.corpId || ''
  337. this.linkType = this.urlOption.linkType || 0
  338. if (this.videoId) {
  339. this.getH5CourseByVideo()
  340. }
  341. },
  342. onShow() {
  343. this.isLogin = this.$isLogin()
  344. this.tipsOpen = false
  345. this.isExpand = true
  346. this.uuId = generateRandomString(16)
  347. if(this.videoId) {
  348. if (this.$isLogin()) {
  349. if(this.isAddKf == 1) {
  350. this.getH5CourseVideoDetails()
  351. } else {
  352. this.getIsAddKf()
  353. }
  354. } else {
  355. this.loginByMp()
  356. }
  357. } else {
  358. if(this.sortLink){
  359. this.getLink()
  360. return
  361. }
  362. uni.showToast({
  363. title: 'sortLink is not found',
  364. icon: 'none'
  365. });
  366. }
  367. },
  368. mounted() {
  369. this.getIP()
  370. this.getHeight()
  371. },
  372. onHide() {
  373. if (this.player) {
  374. this.player.pause()
  375. }
  376. this.getFinishCourseVideo()
  377. this.getInternetTraffic()
  378. if (this.interval != null) {
  379. clearInterval(this.interval)
  380. this.interval = null
  381. }
  382. },
  383. onUnload() {
  384. this.getFinishCourseVideo()
  385. this.getInternetTraffic()
  386. if (this.interval != null) {
  387. clearInterval(this.interval)
  388. this.interval = null
  389. }
  390. this.clearIntegral()
  391. },
  392. beforeDestroy() {
  393. this.player = uni.createVideoContext('video-content-box');
  394. if (this.player) {
  395. this.player.stop()
  396. this.player = null
  397. }
  398. if (this.interval != null) {
  399. clearInterval(this.interval)
  400. this.interval = null
  401. }
  402. this.clearIntegral()
  403. },
  404. methods: {
  405. fullscreenchange(e) {
  406. this.isfull = e.detail.fullScreen
  407. },
  408. clickVideo() {
  409. if (this.player) {
  410. this.player.play()
  411. }
  412. },
  413. //播放时间更新事件方法
  414. onTimeUpdate(e){
  415. let currentTime = Math.round(e.detail.currentTime)
  416. if (this.playDurationSeek > 0) {
  417. this.playTime = this.playDurationSeek
  418. this.throttle(() => this.changeTime(this), 1000, false)
  419. } else {
  420. if (this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this.playTime < -3)&&this.isFinish!=1) {
  421. uni.showToast({
  422. title: '不能快进哦',
  423. icon: 'none',
  424. });
  425. currentTime = this.playTime
  426. this.player.seek(this.playTime);
  427. }
  428. this.playTime = currentTime
  429. }
  430. },
  431. changeTime(that,e) {
  432. that.playDurationSeek = 0
  433. },
  434. videoErrorCallback(e) {
  435. if(this.$isLogin()&&this.isAddKf==1) {
  436. this.clearIntegral()
  437. this.errorCount++
  438. if (this.errorCount > 3) return
  439. console.log(e)
  440. this.getErrMsg(e.target.errMsg)
  441. this.getH5CourseVideoDetails('error')
  442. }
  443. },
  444. // 当开始/继续播放时触发play事件
  445. getPlay() {
  446. this.isPause = false
  447. this.errorCount = 0
  448. // this.judgeDuration()
  449. },
  450. getPause() {
  451. this.isPause = true
  452. this.clearIntegral()
  453. },
  454. getEnded() {
  455. this.clearIntegral()
  456. this.isEnded = true
  457. this.getFinishCourseVideo()
  458. },
  459. getWaiting() {
  460. this.getErrMsg('','waiting')
  461. },
  462. getIP() {
  463. uni.request({
  464. url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
  465. method: 'GET',
  466. success: (res) => {
  467. this.ip = res.data.ip
  468. }
  469. });
  470. },
  471. goWeb(tyep) {
  472. const path = uni.getStorageSync('requestPath',path);
  473. const url = tyep == 0 ? path + "/web/userAgreement" : path + "/web/privacyPolicy"
  474. window.open(url)
  475. },
  476. getHeight() {
  477. this.$nextTick(() => {
  478. const query = uni.createSelectorQuery().in(this);
  479. query
  480. .select("#title-content")
  481. .boundingClientRect((data) => {
  482. this.height =
  483. `calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 164rpx)`
  484. })
  485. .exec();
  486. })
  487. },
  488. getDescHeight() {
  489. this.$nextTick(() => {
  490. const query = uni.createSelectorQuery().in(this);
  491. query
  492. .select("#descbox-desc")
  493. .boundingClientRect((data) => {
  494. this.textHeight = data.height
  495. })
  496. .exec();
  497. })
  498. },
  499. numberToLetter(num) {
  500. // 将数字转换为字母的 ASCII 码
  501. let letterCode = num + 65;
  502. // 将 ASCII 码转换为大写字母
  503. let letter = String.fromCharCode(letterCode);
  504. return letter;
  505. },
  506. updateTime() {
  507. var that = this;
  508. if (this.interval != null) {
  509. clearInterval(this.interval)
  510. }
  511. this.interval = setInterval(function() {
  512. that.getFinishCourseVideo()
  513. that.getInternetTraffic()
  514. }, 60000);
  515. },
  516. judgeDuration() {
  517. var that = this;
  518. if (this.intervalIntegral != null) {
  519. clearInterval(this.intervalIntegral)
  520. this.intervalIntegral = null
  521. }
  522. // 观看10分钟获得积分
  523. this.intervalIntegral = setInterval(function() {
  524. that.getIntegralByH5Video()
  525. }, 600000);
  526. },
  527. clearIntegral() {
  528. if (this.intervalIntegral != null) {
  529. clearInterval(this.intervalIntegral)
  530. this.intervalIntegral = null
  531. }
  532. },
  533. // 展开简介
  534. handleExpand() {
  535. this.isExpand = !this.isExpand
  536. },
  537. getH5CourseByVideo(videoId) {
  538. this.loading = true
  539. getH5CourseByVideoId({
  540. videoId: this.videoId || videoId
  541. }).then(res => {
  542. this.loading = false
  543. if (res.code == 200) {
  544. this.courseInfo = res.data
  545. uni.setNavigationBarTitle({
  546. title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
  547. });
  548. }
  549. this.getHeight()
  550. // this.getDescHeight()
  551. },
  552. rej => {
  553. this.loading = false
  554. }
  555. ).catch(() => {
  556. this.loading = false
  557. })
  558. },
  559. getH5CourseVideoDetails(type) {
  560. const param = {
  561. ...this.urlOption
  562. }
  563. getH5CourseVideoDetails(param).then(res => {
  564. if (res.code == 200) {
  565. this.config = res.config || {}
  566. this.courseLogo = res.config&&res.config.courseLogo
  567. this.isFinish = res.isFinish || 0
  568. this.duration = res.course && res.course.duration ? res.course.duration : 0
  569. this.playDuration = res.playDuration || 0
  570. this.playDurationSeek = res.playDuration || 0
  571. this.tipsTime = res.tipsTime || 0
  572. let lineList = []
  573. if (res.course && res.course.lineOne) {
  574. lineList.push(res.course.lineOne)
  575. }
  576. if (res.course && res.course.lineTwo) {
  577. lineList.push(res.course.lineTwo)
  578. }
  579. if (res.course && res.course.lineThree) {
  580. lineList.push(res.course.lineThree)
  581. }
  582. this.lineList = lineList
  583. if (!this.player || type == 'error') {
  584. this.lineIndex = this.config.defaultLine
  585. this.videoUrl = lineList[this.lineIndex]
  586. this.poster= res.course && res.course.imgUrl ? res.course.imgUrl : ''
  587. this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
  588. setTimeout(()=>{
  589. this.player = uni.createVideoContext('video-content-box');
  590. this.player.seek(this.playTime)
  591. this.player.play();
  592. },500);
  593. } else {
  594. this.playTime = this.playTime > this.playDuration ? this.playTime : this.playDuration >= this.duration ? 0 : this.playDuration
  595. this.player.seek(this.playTime)
  596. this.player.play();
  597. }
  598. this.updateTime();
  599. this.quesList = res.questions && res.questions.length > 0 ? res.questions : [],
  600. this.quesList = this.quesList.map(item => ({
  601. ...item,
  602. questionOption: JSON.parse(item.question),
  603. answer: ''
  604. }))
  605. }
  606. this.getHeight()
  607. // this.getDescHeight()
  608. },
  609. rej => {}
  610. )
  611. },
  612. handleAnswer(item, option, idx) {
  613. let time = this.playTime
  614. if(this.isEnded) {
  615. time = this.duration
  616. } else {
  617. if(time < this.playDuration&&this.isFinish!=1) {
  618. // 没完课且小于续播的时间
  619. time = this.playDuration
  620. }
  621. }
  622. if(Number(this.duration || 0) == 0 || time < this.duration - 60) {
  623. uni.showToast({
  624. title: "请先观看完整课程再答题哦~",
  625. icon: "none"
  626. })
  627. return
  628. }
  629. if (item.type == 1) {
  630. // 单选option
  631. item.answer = option.name
  632. } else if (item.type == 2) {
  633. // 多选
  634. let answer = item.answer ? item.answer.split(',') : []
  635. if (answer.indexOf(option.name) === -1) {
  636. answer.push(option.name)
  637. item.answer = answer.join(',')
  638. } else {
  639. answer.splice(answer.indexOf(option.name), 1)
  640. item.answer = answer.join(',')
  641. }
  642. }
  643. },
  644. submit() {
  645. // 登录
  646. if (this.$isLogin()) {
  647. if (this.isAddKf == 1) {
  648. // 答题
  649. // 您已提交过答案,请领取红包
  650. this.courseAnswer()
  651. } else {
  652. // 添加客服
  653. if (this.videoId && this.qwUserId) {
  654. this.getIsAddKf()
  655. } else {
  656. uni.showToast({
  657. title: '请添加客服',
  658. icon: 'none'
  659. })
  660. }
  661. }
  662. } else {
  663. // 登录
  664. if (!this.checked) {
  665. uni.showToast({
  666. title: "请先勾选阅读并同意《用户协议》和《隐私协议》",
  667. icon: "none"
  668. })
  669. return
  670. }
  671. // #ifdef H5
  672. if (isWechat) { //是否在微信浏览器中打开
  673. this.loginByMp()
  674. } else {
  675. uni.showToast({
  676. title: '请在微信浏览器中打开',
  677. icon: 'error'
  678. })
  679. }
  680. // #endif
  681. }
  682. },
  683. // 答题
  684. courseAnswer() {
  685. let time = this.playTime
  686. if (this.isEnded) {
  687. time = this.duration
  688. } else {
  689. if (time < this.playDuration && this.isFinish != 1) {
  690. // 没完课且小于续播的时间
  691. time = this.playDuration
  692. }
  693. }
  694. if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
  695. uni.showToast({
  696. title: "请先观看完整课程再答题哦~",
  697. icon: "none"
  698. })
  699. return
  700. }
  701. if (this.quesList.some(item => !item.answer)) {
  702. uni.showToast({
  703. title: "请确认是否答完所有题目",
  704. icon: "none"
  705. })
  706. return
  707. }
  708. const questions = this.quesList.map(obj => {
  709. const {
  710. questionOption,
  711. ...rest
  712. } = obj;
  713. return rest;
  714. });
  715. const param = {
  716. ...this.urlOption,
  717. questions: questions,
  718. videoId: this.videoId,
  719. duration: this.playTime
  720. }
  721. this.errTitle = ""
  722. this.errDesc = ""
  723. this.errQues = []
  724. courseAnswer(param).then(res => {
  725. if (res.code == 200) {
  726. if (res.incorrectQuestions) {
  727. // 答题失败
  728. if (res.incorrectQuestions.length > 0) {
  729. this.errQues = res.incorrectQuestions
  730. }
  731. this.remain = res.remain || 0
  732. if (res.remain > 0) {
  733. this.errTitle = "很遗憾答错了"
  734. this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
  735. this.$refs.answerPopup.open("center")
  736. }
  737. } else {
  738. // 答题成功
  739. this.errTitle = "恭喜你,回答正确"
  740. this.errDesc = `您有一份奖励待领取哦~`
  741. // this.$refs.answerPopup.open("center")
  742. this.closeAnswerPopup(1)
  743. }
  744. } else {
  745. if (res.msg == "该课题到达答错次数限制") {
  746. this.errTitle = "答题次数超过限制"
  747. this.errDesc = "以后的课程要认真学习哦"
  748. this.$refs.answerPopup.open("center")
  749. } else {
  750. uni.showToast({
  751. title: res.msg,
  752. icon: "none"
  753. })
  754. }
  755. }
  756. },
  757. rej => {}
  758. )
  759. },
  760. // 选择
  761. rewardChange(e) {
  762. this.currentReward = e.detail.value
  763. },
  764. closeAnswerPopup(type) {
  765. this.$refs.answerPopup.close()
  766. if (this.errTitle == '恭喜你,回答正确') {
  767. let param = {
  768. ...this.urlOption,
  769. rewardType: Number(this.currentReward),
  770. }
  771. if(type == 1) {
  772. param = {
  773. ...this.urlOption
  774. }
  775. }
  776. sendReward(param).then(res => {
  777. if(res.code == 200) {
  778. if(res.isNew&&res.isNew==1) {
  779. const packageInfo = res.data.packageInfo || ''
  780. if(packageInfo) {
  781. uni.setStorageSync('receive_package',packageInfo);
  782. if(res.mchId) uni.setStorageSync('mchId',res.mchId);
  783. uni.navigateTo({
  784. url: '/pages/course/reward'
  785. })
  786. }
  787. } else {
  788. uni.showToast({
  789. title: res.msg,
  790. icon: 'none'
  791. })
  792. }
  793. }else {
  794. uni.showToast({
  795. title: res.msg,
  796. icon: 'none'
  797. })
  798. }
  799. })
  800. }
  801. },
  802. // 线路
  803. openPop() {
  804. this.$refs.popup.open('bottom')
  805. },
  806. close() {
  807. this.$refs.popup.close()
  808. },
  809. handleLine(index) {
  810. var that=this;
  811. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  812. this.close()
  813. return
  814. } else {
  815. // let div = document.querySelector(".vjs-progress-control");
  816. // if(div) {
  817. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  818. // div.style.pointerEvents = "auto";
  819. // } else {
  820. // div.style.pointerEvents = "none"; //禁止所有事件
  821. // }
  822. // }
  823. this.lineIndex = index
  824. this.videoUrl = this.lineList[index]
  825. this.tipsOpen = false
  826. this.playDurationSeek = this.playTime || 0
  827. this.player = uni.createVideoContext('video-content-box');
  828. setTimeout(function(){
  829. that.player.seek(that.playDurationSeek)
  830. that.player.play();
  831. },500);
  832. // this.player.src(this.lineList[index])
  833. // this.player.one('loadedmetadata', () => {
  834. // this.player.currentTime(this.playDurationSeek);
  835. // this.player.play();
  836. // });
  837. this.close()
  838. }
  839. },
  840. // 温馨提示
  841. openTipsPop() {
  842. this.$refs.tipsPopup.open()
  843. this.tipsOpen = true
  844. this.pause()
  845. },
  846. closeTipsPop() {
  847. this.$refs.tipsPopup.close()
  848. },
  849. // 客服
  850. getIsAddKf() {
  851. this.qrcode = ''
  852. this.qrcodeMsg = ''
  853. this.isAddKf = 0
  854. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  855. const param = {
  856. ...this.urlOption
  857. }
  858. getIsAddKf(param).then(res => {
  859. if (res.code == 200) {
  860. if (this.urlOption.isRoom == 1 && res.qwExternalId) {
  861. this.urlOption = {
  862. ...this.urlOption,
  863. qwExternalId: res.qwExternalId
  864. }
  865. }
  866. this.isAddKf = 1
  867. this.getH5CourseVideoDetails()
  868. } else if (res.code == 400) {
  869. this.isAddKf = 0
  870. this.qrcode = res.qrcode
  871. this.qrcodeMsg = res.msg
  872. this.$refs.kfPopup.open()
  873. } else if (res.code == 567) {
  874. // 群聊通用链接
  875. this.urlOption = {
  876. ...this.urlOption,
  877. qwExternalId: res.qwExternalId
  878. }
  879. this.isAddKf = 1
  880. this.getH5CourseVideoDetails()
  881. } else if (res.code == 504) {
  882. // 登录
  883. // #ifdef H5
  884. if (isWechat) { //是否在微信浏览器中打开
  885. this.loginByMp()
  886. } else {
  887. uni.navigateTo({
  888. url: "/pages/auth/login"
  889. });
  890. }
  891. // #endif
  892. } else {
  893. this.isAddKf = 0
  894. uni.showToast({
  895. title: res.msg,
  896. icon: 'none'
  897. });
  898. }
  899. },
  900. err => {}
  901. );
  902. },
  903. closeKFPop() {
  904. this.$refs.kfPopup.close()
  905. },
  906. loginByMp() {
  907. if (this.code == null||!this.code) {
  908. if(this.sortLink) {
  909. window.location.href = uni.getStorageSync('authDomainName') + '?sortLink='+this.sortLink
  910. } else {
  911. if(this.urlOption.link) {
  912. window.location.href = uni.getStorageSync('authDomainName') + '?sortLink='+this.urlOption.link
  913. } else {
  914. this.isExpire = true
  915. this.msg = '课程链接地址有误'
  916. uni.showToast({
  917. title: '课程链接地址有误',
  918. icon: 'none'
  919. });
  920. }
  921. }
  922. return;
  923. }
  924. uni.showLoading({
  925. title: "处理中..."
  926. });
  927. let that = this;
  928. var data = {
  929. code: this.code
  930. }
  931. loginByMp(data).then(res => {
  932. uni.hideLoading();
  933. if (res.code == 200) {
  934. uni.setStorageSync(this.$TOKEN_KEY, res.token);
  935. this.isLogin = this.$isLogin()
  936. if(this.isAddKf == 1) {
  937. this.getH5CourseVideoDetails()
  938. } else {
  939. this.getIsAddKf()
  940. }
  941. } else {
  942. uni.showToast({
  943. title: res.msg,
  944. icon: 'none'
  945. });
  946. }
  947. },
  948. err => {}
  949. ).catch(err=>{
  950. uni.hideLoading();
  951. });
  952. },
  953. getFinishCourseVideo() {
  954. if (!this.playTime || !this.isLogin || this.isAddKf!=1) return
  955. // {videoId: this.videoId,duration:this.playTime}
  956. const param = {
  957. duration: this.playTime,
  958. ...this.urlOption
  959. }
  960. getFinishCourseVideo(param)
  961. },
  962. // 每十分钟获得积分
  963. getIntegralByH5Video() {
  964. if(!this.isLogin || this.isAddKf!=1) return;
  965. const param = {
  966. duration: this.playTime,
  967. ...this.urlOption,
  968. }
  969. getIntegralByH5Video(param).then(res => {
  970. if (res.code == 200) {
  971. uni.showToast({
  972. title: "积分+10",
  973. icon: "none"
  974. })
  975. }
  976. })
  977. },
  978. progressChange(e) {
  979. this.bufferRate = Math.ceil(e.detail.buffered)
  980. },
  981. // 缓冲
  982. getInternetTraffic() {
  983. if(!this.isLogin || this.isAddKf!=1) return
  984. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  985. if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  986. this.bufferRate = playVideoTime
  987. }
  988. if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  989. const param = {
  990. ...this.urlOption,
  991. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  992. duration: this.playTime,
  993. bufferRate: Number(this.bufferRate.toFixed(2)),
  994. }
  995. if(!param.bufferRate) return
  996. internetTraffic(param)
  997. },
  998. getErrMsg(err,type) {
  999. let msgerr = {
  1000. errType: type || 'error',
  1001. videoUrl: this.videoUrl,
  1002. lineIndex: this.lineIndex,
  1003. errTime: new Date(),
  1004. ip: this.ip,
  1005. errMsg: err || ''
  1006. }
  1007. getErrMsg({
  1008. msg: JSON.stringify(msgerr)
  1009. })
  1010. },
  1011. getLink() {
  1012. let that = this;
  1013. getRealLink({sortLink:this.sortLink}).then(res=>{
  1014. if(res.code == 200) {
  1015. this.isExpire = false
  1016. this.authDomainName = res.config.authDomainName || ''
  1017. if(this.authDomainName) {
  1018. uni.setStorageSync('authDomainName',this.authDomainName)
  1019. }
  1020. if(this.isLogin) {
  1021. window.location.replace(res.realLink)
  1022. } else{
  1023. const option = res.realLink.split('?course=')[1]
  1024. const urlOption = option ? JSON.parse(option) : {}
  1025. const videoId = urlOption.videoId || ''
  1026. this.getH5CourseByVideo(videoId)
  1027. }
  1028. } else {
  1029. this.isExpire = true
  1030. this.msg = '课程已过期或链接无效'
  1031. uni.showToast({
  1032. title: '课程已过期或链接无效',
  1033. icon: 'none'
  1034. });
  1035. }
  1036. }).catch(err=>{
  1037. this.isExpire = true
  1038. this.msg = '发生错误,请稍后再试'
  1039. uni.showToast({
  1040. title: '发生错误,请稍后再试',
  1041. icon: 'none'
  1042. });
  1043. })
  1044. },
  1045. /**
  1046. * 节流原理:在一定时间内,只能触发一次
  1047. *
  1048. * @param {Function} func 要执行的回调函数
  1049. * @param {Number} wait 延时的时间
  1050. * @param {Boolean} immediate 是否立即执行
  1051. * @return null
  1052. */
  1053. throttle(func, wait = 500, immediate = true) {
  1054. if (immediate) {
  1055. if (!this.flag) {
  1056. this.flag = true
  1057. // 如果是立即执行,则在wait毫秒内开始时执行
  1058. typeof func === 'function' && func()
  1059. this.timer = setTimeout(() => {
  1060. this.flag = false
  1061. }, wait)
  1062. }
  1063. } else if (!this.flag) {
  1064. this.flag = true
  1065. // 如果是非立即执行,则在wait毫秒内的结束处执行
  1066. this.timer = setTimeout(() => {
  1067. this.flag = false
  1068. typeof func === 'function' && func()
  1069. }, wait)
  1070. }
  1071. }
  1072. }
  1073. }
  1074. </script>
  1075. <style scoped>
  1076. .full-width-popup {
  1077. width: 100%;
  1078. }
  1079. </style>
  1080. <style lang="scss" scoped>
  1081. @mixin u-flex($flexD, $alignI, $justifyC) {
  1082. display: flex;
  1083. flex-direction: $flexD;
  1084. align-items: $alignI;
  1085. justify-content: $justifyC;
  1086. }
  1087. .footer-tips {
  1088. margin-top: 14rpx;
  1089. text-align: center;
  1090. font-family: PingFang SC,PingFang SC;
  1091. font-weight: 500;
  1092. font-size: 12px;
  1093. color: #bbb;
  1094. }
  1095. .textOne {
  1096. overflow: hidden;
  1097. white-space: nowrap;
  1098. text-overflow: ellipsis;
  1099. }
  1100. .textTwo {
  1101. overflow: hidden;
  1102. text-overflow: ellipsis;
  1103. display: -webkit-box;
  1104. -webkit-line-clamp: 2;
  1105. -webkit-box-orient: vertical;
  1106. }
  1107. .expirebox {
  1108. height: 100vh;
  1109. @include u-flex(column, center, center);
  1110. font-family: PingFang SC, PingFang SC;
  1111. font-weight: 400;
  1112. font-size: 32rpx;
  1113. color: #757575;
  1114. image {
  1115. width: 428rpx;
  1116. height: 360rpx;
  1117. margin-bottom: 30rpx;
  1118. }
  1119. }
  1120. .reward-list {
  1121. width: 100%;
  1122. margin-top: 20rpx;
  1123. margin-bottom: -40rpx;
  1124. &-group {
  1125. font-family: PingFang SC, PingFang SC;
  1126. font-weight: 400;
  1127. font-size: 14px;
  1128. color: #222222;
  1129. @include u-flex(row, center, center);
  1130. }
  1131. &-option {
  1132. @include u-flex(row, center, flex-start);
  1133. &:first-child {
  1134. margin-right: 40rpx;
  1135. }
  1136. }
  1137. }
  1138. .err {
  1139. color: #f56c6c !important;
  1140. }
  1141. .kfqrcode-box {
  1142. background-color: #fff;
  1143. border-radius: 16rpx;
  1144. max-width: 560rpx;
  1145. padding: 60rpx 40rpx;
  1146. margin-top: -100rpx;
  1147. box-sizing: border-box;
  1148. @include u-flex(column, center, flex-start);
  1149. font-family: PingFang SC, PingFang SC;
  1150. font-weight: 400;
  1151. font-size: 34rpx;
  1152. color: #222;
  1153. position: relative;
  1154. text-align: center;
  1155. .kfqrcode {
  1156. height: 460rpx;
  1157. width: 460rpx;
  1158. }
  1159. }
  1160. .kfqrcode-close {
  1161. width: 64rpx;
  1162. height: 64rpx;
  1163. position: absolute;
  1164. bottom: -100rpx;
  1165. left: 50%;
  1166. transform: translateX(-50%);
  1167. }
  1168. .tipsPopup-mask {
  1169. position: relative;
  1170. width: 560rpx;
  1171. background-color: transparent;
  1172. .red_envelope_top {
  1173. width: 480rpx;
  1174. height: 360rpx;
  1175. margin: 0 auto;
  1176. display: inherit;
  1177. }
  1178. }
  1179. .tipsPopup-btn-box {
  1180. width: 456rpx;
  1181. height: 104rpx;
  1182. padding: 4rpx;
  1183. box-sizing: border-box;
  1184. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  1185. border-radius: 52rpx;
  1186. }
  1187. .tipsPopup-btn {
  1188. width: 100%;
  1189. height: 100%;
  1190. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  1191. border-radius: 52rpx 52rpx 52rpx 52rpx;
  1192. font-family: PingFang SC, PingFang SC;
  1193. font-weight: 500;
  1194. font-size: 36rpx;
  1195. color: #FFFFFF;
  1196. line-height: 96rpx;
  1197. text-align: center;
  1198. }
  1199. .tipsPopup {
  1200. width: 560rpx;
  1201. padding: 12rpx;
  1202. margin-top: -72rpx;
  1203. box-sizing: border-box;
  1204. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1205. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1206. position: relative;
  1207. &-close {
  1208. width: 64rpx;
  1209. height: 64rpx;
  1210. position: absolute;
  1211. right: 0;
  1212. top: -188rpx;
  1213. }
  1214. &-line {
  1215. padding: 3rpx;
  1216. box-sizing: border-box;
  1217. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  1218. border-radius: 24rpx;
  1219. }
  1220. &-box {
  1221. padding: 0 40rpx 40rpx 40rpx;
  1222. box-sizing: border-box;
  1223. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1224. border-radius: 24rpx;
  1225. @include u-flex(column, center, flex-start);
  1226. }
  1227. &-head {
  1228. @include u-flex(row, center, center);
  1229. &-title {
  1230. width: 364rpx;
  1231. height: auto;
  1232. margin-top: -22rpx;
  1233. }
  1234. }
  1235. &-content {
  1236. margin: 48rpx 0;
  1237. font-family: PingFang SC, PingFang SC;
  1238. font-weight: 500;
  1239. font-size: 32rpx;
  1240. color: #222222;
  1241. text-align: center;
  1242. &-title {
  1243. margin-bottom: 26rpx;
  1244. font-weight: 600;
  1245. font-size: 40rpx;
  1246. color: #FF5C03;
  1247. }
  1248. }
  1249. }
  1250. .video-controls-box {
  1251. width: 100%;
  1252. height: calc(100% - 44px);
  1253. overflow: hidden;
  1254. position: absolute;
  1255. top: 0;
  1256. left: 0;
  1257. z-index: 2;
  1258. background: rgba(0, 0, 0, 0.2);
  1259. .video-play {
  1260. height: 72rpx;
  1261. width: 72rpx;
  1262. position: absolute;
  1263. top: 50%;
  1264. left: 50%;
  1265. transform: translate(-50%, -50%);
  1266. }
  1267. }
  1268. .video-controls {
  1269. width: 100%;
  1270. height: 80rpx;
  1271. padding: 0 28rpx;
  1272. box-sizing: border-box;
  1273. position: absolute;
  1274. bottom: 0;
  1275. left: 0;
  1276. display: flex;
  1277. align-items: center;
  1278. justify-content: space-between;
  1279. background: linear-gradient(to top, #222 0%, transparent 80%);
  1280. .video-icon {
  1281. height: 44rpx;
  1282. width: 44rpx;
  1283. }
  1284. }
  1285. .errQuesbox {
  1286. width: 100%;
  1287. max-height: 260rpx;
  1288. overflow-y: auto;
  1289. margin-top: 24rpx;
  1290. font-family: PingFang SC, PingFang SC;
  1291. font-weight: 500;
  1292. font-size: 30rpx;
  1293. color: #222222;
  1294. &-item {
  1295. width: 100%;
  1296. height: 128rpx;
  1297. line-height: 128rpx;
  1298. margin-bottom: 24rpx;
  1299. padding: 0 30rpx;
  1300. box-sizing: border-box;
  1301. overflow: hidden;
  1302. background: #fff;
  1303. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1304. position: relative;
  1305. &::after {
  1306. content: "题目";
  1307. min-width: 64rpx;
  1308. height: 36rpx;
  1309. padding: 0 12rpx;
  1310. line-height: 36rpx;
  1311. background: #FF5C03;
  1312. box-sizing: border-box;
  1313. border-radius: 0rpx 0rpx 16rpx 0rpx;
  1314. text-align: center;
  1315. font-family: PingFang SC, PingFang SC;
  1316. font-weight: 500;
  1317. font-size: 20rpx;
  1318. color: #fff;
  1319. position: absolute;
  1320. left: 0;
  1321. top: 0;
  1322. }
  1323. }
  1324. }
  1325. .bg {
  1326. background: #fff !important;
  1327. }
  1328. .answerPopup {
  1329. &-box {
  1330. width: 560rpx;
  1331. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  1332. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1333. background-color: #fff;
  1334. font-weight: 400;
  1335. padding: 32rpx;
  1336. box-sizing: border-box;
  1337. position: relative;
  1338. @include u-flex(column, center, flex-start);
  1339. font-family: PingFang SC, PingFang SC;
  1340. font-weight: 400;
  1341. .tipimg {
  1342. width: 206rpx;
  1343. height: 206rpx;
  1344. margin-bottom: 16rpx;
  1345. }
  1346. }
  1347. &-title {
  1348. font-weight: 600;
  1349. font-size: 36rpx;
  1350. color: #222222;
  1351. }
  1352. &-desc {
  1353. margin-top: 10rpx;
  1354. font-size: 28rpx;
  1355. color: #757575;
  1356. }
  1357. &-btn {
  1358. width: 464rpx;
  1359. height: 84rpx;
  1360. margin-top: 54rpx;
  1361. margin-bottom: 16rpx;
  1362. background: #FF5C03;
  1363. border-radius: 42rpx;
  1364. font-weight: 500;
  1365. font-size: 32rpx;
  1366. color: #FFFFFF;
  1367. text-align: center;
  1368. line-height: 84rpx;
  1369. }
  1370. }
  1371. .popupbox {
  1372. width: 100%;
  1373. background-color: #fff;
  1374. border-radius: 16rpx 16rpx 0 0;
  1375. padding: 24rpx 32rpx;
  1376. position: relative;
  1377. &-head {
  1378. height: 60rpx;
  1379. margin-bottom: 30rpx;
  1380. text-align: center;
  1381. overflow-y: auto;
  1382. color: #414858;
  1383. font-size: 32rpx;
  1384. font-weight: bold;
  1385. position: relative;
  1386. .close-icon {
  1387. position: absolute;
  1388. right: 0;
  1389. top: 0;
  1390. height: 40rpx;
  1391. width: 40rpx;
  1392. }
  1393. }
  1394. &-content {
  1395. height: 20vh;
  1396. overflow-y: auto;
  1397. display: flex;
  1398. align-items: flex-start;
  1399. flex-wrap: wrap;
  1400. gap: 32rpx;
  1401. .line-item {
  1402. display: inline-block;
  1403. min-width: 200rpx;
  1404. min-height: 60rpx;
  1405. padding: 0 20rpx;
  1406. box-sizing: border-box;
  1407. border-radius: 50rpx;
  1408. overflow: hidden;
  1409. background-color: #f7f7f7;
  1410. text-align: center;
  1411. color: #414858;
  1412. font-size: 28rpx;
  1413. line-height: 60rpx;
  1414. }
  1415. .line-active {
  1416. color: #f56c6c !important;
  1417. background-color: #fef0f0 !important;
  1418. }
  1419. }
  1420. }
  1421. .content {
  1422. // padding-bottom: calc(var(--window-bottom));
  1423. padding-bottom: calc(var(--window-bottom) + 164rpx);
  1424. .video-box {
  1425. width: 100%;
  1426. height: 420rpx;
  1427. overflow: hidden;
  1428. position: relative;
  1429. #myVideo {
  1430. width: 100%;
  1431. height: 100%;
  1432. }
  1433. }
  1434. .video-poster {
  1435. width: 100%;
  1436. height: 420rpx;
  1437. }
  1438. .miantitlebox {
  1439. padding: 30rpx 0;
  1440. border-bottom: 2rpx solid #F5F7FA;
  1441. font-family: PingFang SC, PingFang SC;
  1442. font-weight: 500;
  1443. font-size: 36rpx;
  1444. color: #222222;
  1445. }
  1446. .subtitlebox {
  1447. padding: 30rpx 0;
  1448. border-bottom: 2rpx solid #F5F7FA;
  1449. font-family: PingFang SC, PingFang SC;
  1450. font-weight: 500;
  1451. font-size: 36rpx;
  1452. color: #222222;
  1453. }
  1454. .title-content {
  1455. padding: 0 32rpx;
  1456. background-color: #fff;
  1457. font-size: 28rpx;
  1458. line-height: 1.6;
  1459. .title {
  1460. font-size: 36rpx;
  1461. font-weight: 500;
  1462. color: #414858;
  1463. }
  1464. .time-or-subtitle {
  1465. margin-top: 12rpx;
  1466. color: #666666;
  1467. }
  1468. }
  1469. .descbox {
  1470. padding: 36rpx 32rpx;
  1471. margin-bottom: 20rpx;
  1472. background-color: #fff;
  1473. font-family: PingFang SC, PingFang SC;
  1474. font-weight: 400;
  1475. font-size: 28rpx;
  1476. color: #222222;
  1477. line-height: 42rpx;
  1478. word-break: break-word;
  1479. &-title {
  1480. margin-bottom: 24rpx;
  1481. font-weight: 500;
  1482. font-size: 32rpx;
  1483. }
  1484. &-info {
  1485. margin-bottom: 24rpx;
  1486. @include u-flex(row, center, space-between);
  1487. font-size: 26rpx;
  1488. color: #757575;
  1489. &-l {
  1490. flex: 1;
  1491. @include u-flex(row, center, flex-start);
  1492. }
  1493. &-time {
  1494. margin-left: 18rpx;
  1495. padding-left: 18rpx;
  1496. position: relative;
  1497. &::after {
  1498. content: "";
  1499. width: 4rpx;
  1500. height: 4rpx;
  1501. background: #999999;
  1502. border-radius: 50%;
  1503. position: absolute;
  1504. left: 0;
  1505. top: 50%;
  1506. transform: translateY(-50%);
  1507. }
  1508. }
  1509. &-r {
  1510. background: transparent;
  1511. }
  1512. }
  1513. &-desc {
  1514. overflow: hidden;
  1515. position: relative;
  1516. }
  1517. }
  1518. .expand {
  1519. flex-shrink: 0;
  1520. @include u-flex(row, center, flex-end);
  1521. color: #FF5C03;
  1522. font-weight: 400;
  1523. font-size: 24rpx;
  1524. image {
  1525. width: 32rpx;
  1526. height: 32rpx;
  1527. }
  1528. }
  1529. .expand-ab {
  1530. position: absolute;
  1531. top: 0;
  1532. right: 0;
  1533. box-shadow: -50rpx 0 20rpx 8rpx #FFFFFF;
  1534. background-color: #fff;
  1535. }
  1536. .ques-content {
  1537. background-color: #fff;
  1538. padding: 40rpx 32rpx;
  1539. box-sizing: border-box;
  1540. font-family: PingFang SC, PingFang SC;
  1541. font-weight: 400;
  1542. font-size: 28rpx;
  1543. color: #222222;
  1544. }
  1545. .ques-content-tit {
  1546. font-family: PingFang SC, PingFang SC;
  1547. font-weight: 600;
  1548. font-size: 36rpx;
  1549. color: #222222;
  1550. }
  1551. .ques-title {
  1552. margin: 48rpx 0 34rpx 0;
  1553. font-weight: 500;
  1554. font-size: 32rpx;
  1555. white-space: normal;
  1556. }
  1557. .ques-type {
  1558. flex-shrink: 0;
  1559. min-width: 72rpx;
  1560. min-height: 40rpx;
  1561. padding: 0 12rpx;
  1562. margin: 0 12rpx;
  1563. box-sizing: border-box;
  1564. background: #FF5C03;
  1565. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1566. line-height: 40rpx;
  1567. text-align: center;
  1568. font-family: PingFang SC, PingFang SC;
  1569. font-weight: 400;
  1570. font-size: 24rpx;
  1571. color: #FFFFFF;
  1572. display: inline-block;
  1573. }
  1574. .ques-option {
  1575. min-height: 88rpx;
  1576. padding: 24rpx 32rpx;
  1577. box-sizing: border-box;
  1578. margin-bottom: 24rpx;
  1579. background: #F5F7FA;
  1580. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1581. display: flex;
  1582. align-items: center;
  1583. &-active {
  1584. color: #FF5C03 !important;
  1585. background: #FCF0E7 !important;
  1586. }
  1587. }
  1588. .video-line {
  1589. min-width: 140rpx;
  1590. max-width: 200rpx;
  1591. height: 60rpx;
  1592. padding: 0 20rpx;
  1593. box-sizing: border-box;
  1594. border-radius: 50rpx 0 0 50rpx;
  1595. overflow: hidden;
  1596. background-color: #fff;
  1597. text-align: center;
  1598. color: #888;
  1599. font-size: 28rpx;
  1600. line-height: 60rpx;
  1601. display: inline-flex;
  1602. align-items: center;
  1603. justify-content: center;
  1604. position: fixed;
  1605. right: 0;
  1606. z-index: 9;
  1607. bottom: calc(var(--window-bottom) + 280rpx);
  1608. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  1609. image {
  1610. flex-shrink: 0;
  1611. height: 30rpx;
  1612. width: 30rpx;
  1613. margin-right: 6rpx;
  1614. }
  1615. }
  1616. .footer {
  1617. border-top: 1rpx solid #ededef;
  1618. background: #fff;
  1619. width: 100%;
  1620. position: fixed;
  1621. bottom: 0;
  1622. padding: 18rpx 32rpx;
  1623. padding-bottom: calc(var(--window-bottom) + 18rpx);
  1624. box-sizing: border-box;
  1625. z-index: 9;
  1626. &-btn {
  1627. width: 100%;
  1628. height: 98rpx;
  1629. background: #FF5C03;
  1630. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1631. line-height: 98rpx;
  1632. text-align: center;
  1633. font-family: PingFang SC, PingFang SC;
  1634. font-weight: 600;
  1635. font-size: 32rpx;
  1636. color: #FFFFFF;
  1637. @include u-flex(row, center, center);
  1638. &-img {
  1639. flex-shrink: 0;
  1640. width: 144rpx;
  1641. height: 144rpx;
  1642. margin-right: 8rpx;
  1643. margin-top: -24rpx;
  1644. }
  1645. }
  1646. &-btn-border {
  1647. position: relative;
  1648. &::after {
  1649. content: "";
  1650. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  1651. position: absolute;
  1652. top: -2rpx;
  1653. left: 0;
  1654. height: 103rpx;
  1655. width: 100%;
  1656. z-index: -1;
  1657. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1658. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  1659. overflow: hidden;
  1660. }
  1661. }
  1662. }
  1663. }
  1664. .agreement {
  1665. display: inline-flex;
  1666. margin-top: 16rpx;
  1667. font-size: 24rpx;
  1668. color: #525252;
  1669. align-items: center;
  1670. justify-content: center;
  1671. }
  1672. .logo {
  1673. display: inline-block;
  1674. width: 30px;
  1675. height: auto;
  1676. margin: 20px 0 0 10px;
  1677. pointer-events: none;
  1678. object-fit: cover;
  1679. }
  1680. .logo-full {
  1681. display: inline-block;
  1682. width: 40px;
  1683. height: auto;
  1684. margin: 50px 0 0 30px;
  1685. pointer-events: none;
  1686. object-fit: cover;
  1687. }
  1688. </style>