learning.vue 45 KB

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