videovip.vue 49 KB

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