learning.vue 47 KB

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