videovips.vue 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545
  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. @fullscreenchange="fullscreenchange"
  18. :title="courseInfo.title"
  19. style="width: 100%;height: 420rpx;"
  20. :poster="poster"
  21. id="video-content-box"
  22. controls
  23. :auto-pause-if-open-native="true"
  24. :auto-pause-if-navigate="true"
  25. :enable-progress-gesture="false"
  26. :show-progress="true"
  27. :picture-in-picture-mode="[]"
  28. :show-background-playback-button="false"
  29. :src="videoUrl">
  30. <!-- <cover-image v-if="courseLogo" :class="isFull?'logo-full':'logo'" :src="courseLogo" mode="widthFix"></cover-image> -->
  31. </video>
  32. </view>
  33. <view class="justify-start align-center fs24 base-color-9" v-if="userInfo.userId">
  34. <view>{{nameuser?nameuser:'暂未授权昵称'}}#</view>
  35. <view>{{userInfo.userId}}</view>
  36. </view>
  37. <view class="title-content" id="title-content">
  38. <!-- 答题时展示小节课程名,其他展示课程名 -->
  39. <!-- 小节课程名 -->
  40. <view class="subtitlebox " v-if="isLogin&&isAddKf==1">
  41. {{courseInfo.title|| ''}}
  42. </view>
  43. <!-- 课程名字 -->
  44. <view class="miantitlebox" v-else>
  45. {{courseInfo.courseName|| ''}}
  46. </view>
  47. </view>
  48. <scroll-view class="scroll-view" :style="{height: height}" :scroll-top="scrollTop" scroll-y="true">
  49. <!-- 介绍 -->
  50. <view class="descbox">
  51. <template v-if="!isLogin||isAddKf!=1">
  52. <view class="descbox-title">{{courseInfo.title?courseInfo.title:''}}</view>
  53. <view class="descbox-info">
  54. <!-- <view class="descbox-info-l">
  55. <view>{{courseInfo.views}}次播放</view>
  56. <view class="descbox-info-time">总时长:{{courseInfo.totalDuration}}</view>
  57. </view> -->
  58. <view class="descbox-info-r expand" v-if="textHeight > 21">
  59. <text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
  60. <image :src="imgPath+'/app/image/course_arrow_up_icon.png'" v-show="isExpand"></image>
  61. <image :src="imgPath+'/app/image/course_arrow_down_icon.png'" v-show="!isExpand"></image>
  62. </view>
  63. </view>
  64. </template>
  65. <view class="descbox-desc" id="descbox-desc" :style="{height: isExpand ? 'auto': '42rpx'}">
  66. <text>{{courseInfo.description==null?'暂无简介':courseInfo.description}}</text>
  67. <view :class="isExpand ? 'expand': 'expand expand-ab'" v-if="isLogin&&isAddKf==1&&textHeight > 21">
  68. <text @click="handleExpand">{{isExpand ? '收起简介' : '展开简介'}}</text>
  69. <image :src="imgPath+'/app/image/course_arrow_up_icon.png'" v-show="isExpand"></image>
  70. <image :src="imgPath+'/app/image/course_arrow_down_icon.png'" v-show="!isExpand"></image>
  71. </view>
  72. </view>
  73. </view>
  74. <!-- 无效或者已过期 -->
  75. <view class="nocourse" v-if="msg">
  76. <image :src="imgPath+'/app/image/course_expiration_img.png'" mode="widthFix"></image>
  77. <view>{{msg}}</view>
  78. </view>
  79. <!-- 问题 -->
  80. <view class="ques-content" v-if="isLogin&&isAddKf==1">
  81. <view class="ques-content-tit" v-if="isLogin &&!isquestion" >问答题</view>
  82. <view v-for="(item,index) in quesList" :key="index">
  83. <view class="ques-title">
  84. <text >{{index + 1}}.</text>
  85. <view class="ques-type" v-show="item.type == 1 || item.type == 2">
  86. {{item.type == 1 ? '单选' : item.type == 2 ? '多选' : ''}}
  87. </view>
  88. <text class="fs40">{{item.title}}</text>
  89. </view>
  90. <view
  91. :class="isAnswer(item,option.name) ?'ques-option ques-option-active':'ques-option'"
  92. v-for="(option,idx) in item.questionOption"
  93. :key="idx"
  94. @click="handleAnswer(item,option)">
  95. <view class="fs40">
  96. {{numberToLetter(idx)}}.
  97. </view>
  98. <view class="fs40">{{option.name}}</view>
  99. </view>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. <!-- 线路 -->
  104. <!-- <view class="video-line" @click="openPop" v-if="isLogin&&isAddKf==1">
  105. <image :src="imgPath+'/app/image/changePlayer-icon.png'"></image>
  106. <text>线路{{lineIndex + 1 | numberToChinese}}</text>
  107. </view> -->
  108. <!-- 线路弹窗 -->
  109. <!-- <uni-popup ref="popup" type="bottom" class="full-width-popup">
  110. <view class="popupbox">
  111. <view class="popupbox-head">
  112. <text>线路选择</text>
  113. <image class="close-icon" :src="imgPath+'/app/image/tc_close_icon.png'" mode="aspectFill" @click="close">
  114. </image>
  115. </view>
  116. <view class="popupbox-content">
  117. <view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
  118. v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
  119. 线路{{index + 1 | numberToChinese}}</view>
  120. </view>
  121. </view>
  122. </uni-popup> -->
  123. <!-- 温馨提示弹窗 -->
  124. <u-popup :show="tipsPopup" mode="center" :closeOnClickOverlay='true' @close='tipsPopup=!tipsPopup'
  125. :safeAreaInsetBottom='false' round='12'>
  126. <view class="tipsPopup-mask">
  127. <image class="red_envelope_top" :src="imgPath+'/app/image/red_envelope_img.png'" mode="aspectFill"></image>
  128. <view class="tipsPopup">
  129. <image class="tipsPopup-close" :src="imgPath+'/app/image/course_close_white_icon.png'" mode="aspectFill"
  130. @click="closeTipsPop"></image>
  131. <view class="tipsPopup-line">
  132. <view class="tipsPopup-box">
  133. <view class="tipsPopup-head">
  134. <image class="tipsPopup-head-title" :src="imgPath+'/app/image/tips_title_img.png'"
  135. mode="widthFix"></image>
  136. </view>
  137. <view class="tipsPopup-content">
  138. <view class="tipsPopup-content-title">亲爱的用户,</view>
  139. <view>您已经观看课程{{timepath}}的时间了,请注意休息并保持专注。</view>
  140. </view>
  141. <view class="tipsPopup-btn-box">
  142. <view class="tipsPopup-btn" @click="closeTipsPop">继续观看领奖励</view>
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </u-popup>
  149. <!-- 答题弹窗 -->
  150. <u-popup :show="answerPopup" mode="center" @close="closepop()" @open="open" closeOnClickOverlay
  151. :safeAreaInsetBottom='false' round='12'>
  152. <view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
  153. <!-- 正确 -->
  154. <image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" :src="imgPath+'/app/image/course_answer_img.png'"
  155. mode="aspectFill"></image>
  156. <!-- 错误 -->
  157. <image class="tipimg" v-else :src="imgPath+'/app/image/course_answer_incorrectly_img.png'" mode="aspectFill">
  158. </image>
  159. <view class="answerPopup-title">{{errTitle}}</view>
  160. <view class="answerPopup-desc" v-html="errDesc"></view>
  161. <!-- 选择奖励 -->
  162. <!-- 错误题目 -->
  163. <view class="errQuesbox" v-if="errQues&&errQues.length>0">
  164. <view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
  165. </view>
  166. <view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">点击领取红包</view>
  167. <view class="tipsPopup-btn-box" v-else
  168. :style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
  169. <view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
  170. </view>
  171. </view>
  172. </u-popup>
  173. <!-- 客服二维码弹窗 -->
  174. <u-popup :show="kfPopup" mode="center" :mask-click="false" round='12' @close="kefpop">
  175. <view class="kfqrcode-box">
  176. <view class="justify-start align-center fs24 base-color-9">
  177. <view>{{nameuser}}#</view>
  178. <view>{{userInfo.userId}}</view>
  179. </view>
  180. <view>请添加客服</view>
  181. <image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true" mode="aspectFit"></image>
  182. <!-- <view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view> -->
  183. <!-- <image class="kfqrcode-close" :src="imgPath+'/app/image/course_close_white_icon.png'" mode="aspectFill"
  184. @click="closeKFPop"></image> -->
  185. </view>
  186. </u-popup>
  187. <u-popup :show="timepop" mode="center" round='12'>
  188. <view class="timepopbox center column">
  189. <view class="fs40 bold ">不在看课时间范围内</view>
  190. <view class="mtb20">看课时间</view>
  191. <view >{{videocont.startDateTime}}</view>
  192. <view>至</view>
  193. <view >{{videocont.endDateTime}}</view>
  194. <view class="base-bg-orange colorf p20 radius50 mt20"
  195. @click="getH5CourseVideoDetails">刷新时间</view>
  196. </view>
  197. </u-popup>
  198. <u-popup :show="userlogo" mode="bottom" round='12'>
  199. <view class="userlogo column">
  200. <view class="mtb30 justify-start align-center ml20">
  201. <u-avatar :src="imgPath+'/app/image/logo.png'" size="50"></u-avatar>
  202. <view class="bold mlr20">{{imgname}}</view>
  203. <view>申请</view>
  204. </view>
  205. <view class="bold fs36 ml20">授权你的昵称头像信息</view>
  206. <view class="mtb20 justify-between align-center plr20">
  207. <view class="justify-start align-center">
  208. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  209. <view v-if="userinfos.nickname">√</view>
  210. </view>
  211. <view class="ml20">
  212. <view class="base-color-3 bold">第一步</view>
  213. <view class="fs32 base-color-9">请点击授权微信昵称</view>
  214. </view>
  215. </view>
  216. <view class="button-container">
  217. <input
  218. type="nickname"
  219. class="hidden-input"
  220. @blur="onNickNameInput"
  221. @input="onNickNameInput"
  222. />
  223. <button class="custom-button" :class="nameuser==''?'subname':'subavt'">{{nameuser?"已授权":'允许授权'}}</button>
  224. </view>
  225. </view>
  226. <view class="mtb20 justify-between align-center plr20 mt40">
  227. <view class="justify-start align-center">
  228. <view class="boxweixin" :class="userinfos.nickname==''?'boxnosel':'boxsel'">
  229. <view v-if="userinfos.avatar">√</view>
  230. </view>
  231. <view class="ml20">
  232. <view class="base-color-3 bold">第二步</view>
  233. <view class="fs32 base-color-9">请点击授权微信头像</view>
  234. </view>
  235. </view>
  236. <view class="button-container">
  237. <button open-type="chooseAvatar" @chooseavatar="onChooseAvatar" class="hidden-input"
  238. v-if="nameuser">
  239. 允许授权
  240. </button>
  241. <button class="custom-button sub" @click="shouquan" v-if="nameuser==''">允许授权</button>
  242. <button class="custom-button " :class="avataruser==''?'subname':'subavt'"
  243. v-else>{{avataruser?"已授权":'允许授权'}}</button>
  244. </view>
  245. </view>
  246. <view class="submitname" @click="confimrname" :class="nameuser&&avataruser?'subact':'sub'">确定</view>
  247. </view>
  248. </u-popup>
  249. <!-- <view class="footer-tips">重庆云联融智提供技术支持</view> -->
  250. <!-- footer -->
  251. <view class="footer" v-if="videoId">
  252. <view class="btns" >
  253. <!-- <button
  254. class="author-btn"
  255. open-type="getPhoneNumber"
  256. @getphonenumber="phoneLogin" v-if="!isquestion&&authType==1">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即学习'}}</button>
  257. <button
  258. class="author-btn"
  259. open-type="getUserInfo" :disabled="userdisabled"
  260. @getuserinfo="userInfologin" v-if="authType==0&&!isquestion">{{isLogin&&isAddKf==1 ? '提交答案领取奖励' : '立即学习'}}</button> -->
  261. <button class="author-btn"
  262. @click="submit">{{isLogin&&isAddKf==1 ?'提交答案领取奖励' : '立即学习'}}</button>
  263. </view>
  264. </view>
  265. <view>
  266. <u-modal :show="showfalse" title="提示" :content='contentmsg' @confirm='showfalse=false'></u-modal>
  267. </view>
  268. <u-loading-page :loading="viewload" iconSize="32" loadingColor="#3c9cff" fontSize="24"
  269. :loading-text="loadingtext"></u-loading-page>
  270. </view>
  271. </template>
  272. <script>
  273. import { generateRandomString} from "@/utils/common.js"
  274. import { mapGetters } from 'vuex';
  275. import dayjs from 'dayjs';
  276. import {
  277. getErrMsg,
  278. getH5CourseByVideoId,
  279. getH5CourseVideoDetails,
  280. courseAnswer,
  281. getFinishCourseVideo,
  282. getIsAddKf,
  283. getInternetTraffic,
  284. getIntegralByH5Video,
  285. sendReward,
  286. getRealLink,
  287. loginByMiniApp,
  288. handleFsUserWx
  289. } from "@/api/courseLook.js"
  290. import {
  291. getConfigByKey
  292. } from "@/api/user.js"
  293. export default {
  294. data() {
  295. return {
  296. videoItem:{},
  297. viewload:true,
  298. loadingtext:"数据加载中...",
  299. baseUrl:uni.getStorageSync('requestPath'),
  300. // 1 红包 2 积分
  301. rewardType: [{
  302. name: '红包奖励',
  303. value: 1
  304. }, {
  305. name: '积分奖励',
  306. value: 2
  307. }],
  308. currentReward: 1,
  309. player: null,
  310. loading: true,
  311. progress: 0,
  312. code: null,
  313. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  314. scrollTop: 0,
  315. height: '0px',
  316. isLogin: false,
  317. videoUrl: "",
  318. videoId: "",
  319. //现在的时长
  320. playTime: 0,
  321. //总时长
  322. duration: 0,
  323. playDuration: 0,
  324. // 用于续播
  325. playDurationSeek: 0,
  326. // 温馨提醒时间节点,
  327. tipsTime: 0,
  328. tipsOpen: false,
  329. config: {},
  330. courseInfo: {},
  331. quesList: [],
  332. lineList: [],
  333. // 错题
  334. errQues: [],
  335. // 答题机会
  336. remain: 0,
  337. errTitle: "",
  338. errDesc: "",
  339. showPlay: true,
  340. showControls: false,
  341. playStatus: "",
  342. isFull: false,
  343. isAddKf: 0,
  344. lineIndex: 0,
  345. // 是否展开
  346. isExpand: true,
  347. textHeight: 0, //文本高度
  348. qwUserId: "",
  349. qrcode: "",
  350. corpId: "",
  351. periodId:"",//营期id
  352. companyUserId:"",//销售id
  353. companyId:"",//公司id
  354. courseId:"",//课程id
  355. qrcodeMsg: "",
  356. urlOption: {},
  357. bufferRate: 0, // 缓冲时间
  358. uuId: "",
  359. isEnded: false,
  360. // 是否允许拖动进度条
  361. linkType: 0,
  362. ip: null,
  363. checked: true,
  364. isFinish: 0, // 是否完课
  365. interval: null,
  366. intervalIntegral: null, // 积分定时
  367. options: {
  368. sources: [{
  369. src: ""
  370. }],
  371. poster: "",
  372. live: false /* 是否直播 */ ,
  373. controls: true,
  374. autoplay: false,
  375. licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
  376. LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
  377. controlBar: {
  378. volumePanel: false,
  379. playbackRateMenuButton: false,
  380. QualitySwitcherMenuButton: false,
  381. // progressControl: false
  382. },
  383. plugins: {
  384. // ProgressMarker: false,
  385. ContextMenu: {
  386. statistic: false
  387. }
  388. },
  389. },
  390. // 错误请求次数
  391. errorCount: 0,
  392. answerPopup: false,
  393. sortLink:"",
  394. // 课程是否过期
  395. isExpire: false,
  396. menuButtonLeft: 281,
  397. menuButtonH: 45,
  398. timer: null,
  399. flag: false,
  400. msg:'',
  401. poster:'',
  402. userInfo:{},
  403. timeid:'',
  404. videocont:{},
  405. timepop:false,
  406. appToken:'',
  407. kfPopup:false,
  408. iskftype:0,
  409. iskftypemsg:'',
  410. courseLogo: '',
  411. isquestion:false,
  412. tipsPopup:false,
  413. timepath:'3分之1',
  414. tipsTime2:0,
  415. userlogo:false,
  416. userinfos:{
  417. nickname:"",
  418. avatar:""
  419. },
  420. headImg:'',
  421. authType:0,//0微信登录 1手机号登录
  422. userdisabled:false,
  423. projectId:'',
  424. showfalse:false,
  425. contentmsg:null,
  426. }
  427. },
  428. filters: {
  429. numberToChinese(number) {
  430. if (number) {
  431. const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
  432. return chineseNumber[number - 1];
  433. } else {
  434. return ''
  435. }
  436. },
  437. },
  438. computed: {
  439. isAnswer() {
  440. return (item, name) => {
  441. if (item.type == 1) {
  442. return item.answer == name
  443. } else if (item.type == 2) {
  444. const array = item.answer.split(',')
  445. return array.some(i => i == name)
  446. } else {
  447. return false
  448. }
  449. }
  450. },
  451. imgPath() {
  452. return this.$store.state.imgpath
  453. },
  454. imgname() {
  455. return this.$store.state.logoname
  456. },
  457. appid() {
  458. return this.$store.state.appid
  459. },
  460. nameuser() {
  461. return this.userinfos.nickname
  462. },
  463. avataruser() {
  464. return this.userinfos.avatar
  465. },
  466. ...mapGetters(['coureLogin']),
  467. },
  468. watch: {
  469. coureLogin: {
  470. immediate: true, // 页面一进入就检查一次
  471. handler(val) {
  472. console.log('huoqu ',val)
  473. if (val == 2&&this.isLogin) {
  474. console.log("看课AppToken失效,请重新登录")
  475. this.isLogin = false
  476. this.isAddKf = 0
  477. this.goLogins()
  478. }
  479. }
  480. }
  481. },
  482. onLoad(option) {
  483. this.getWebviewUrl()
  484. console.log('huoquoption ')
  485. uni.$on('usercode',(data)=>{
  486. console.log('huoqu ',data)
  487. if(data) {
  488. this.code=data.code
  489. this.goLogins(data)
  490. }
  491. })
  492. uni.$on('vipMsg',(data)=>{
  493. console.log(4444,data)
  494. this.contentmsg=data
  495. this.showfalse=true
  496. uni.showToast({
  497. icon:'none',
  498. title: data,
  499. duration:5000
  500. });
  501. })
  502. this.videoContext = uni.createVideoContext('video-content-box', this)
  503. this.code = option.code
  504. if(uni.getStorageSync('userInfo')&&JSON.stringify(uni.getStorageSync('userInfo'))!='{}') {
  505. this.userInfo =JSON.parse(uni.getStorageSync('userInfo'))
  506. } else {
  507. this.userInfo = {}
  508. }
  509. this.appToken=uni.getStorageSync('companyUserInfo')
  510. if(!option.course){
  511. const keys = decodeURIComponent(Object.keys(option)[0]);
  512. this.urlOption=JSON.parse(keys.split('course=')[1])
  513. }else{
  514. this.urlOption = option.course ? JSON.parse(option.course) : {}
  515. }
  516. uni.setStorageSync('H5course',this.urlOption)
  517. this.videoId = this.urlOption.videoId
  518. this.courseId = this.urlOption.courseId
  519. this.periodId = this.urlOption.periodId
  520. this.companyId = this.urlOption.companyId
  521. this.companyUserId = this.urlOption.companyUserId
  522. this.projectId= this.urlOption.projectId
  523. this.timeid=this.urlOption.id
  524. console.log(this.urlOption)
  525. console.log(decodeURIComponent(option.course))
  526. // this.sortLink = this.urlOption.link || ''
  527. this.getMenuButton()
  528. // #ifdef MP-WEIXIN
  529. // if(this.$store.state.logoname!=='乐氏本源'&&!uni.getStorageSync('userInfos')){
  530. // this.userlogo=true
  531. // }
  532. console.log(uni.getStorageSync('userInfos'))
  533. if(!uni.getStorageSync('userInfos')&&this.$store.state.logoname=='乐氏本源'){
  534. uni.navigateTo({
  535. url:'/pages_course/webview'
  536. })
  537. return
  538. }
  539. // #endif
  540. },
  541. onShow() {
  542. this.userinfos=uni.getStorageSync('userinfos')
  543. this.userinfo=uni.getStorageSync('userinfo')
  544. this.tipsOpen = false
  545. this.isExpand = true
  546. this.uuId = generateRandomString(16)
  547. if(this.videoId) {
  548. this.getH5CourseByVideo()
  549. }
  550. const AppToken=uni.getStorageSync('TOKEN_WEXIN')
  551. console.log(AppToken)
  552. if (AppToken&&!this.code) {
  553. // this.isLogin=true
  554. if(this.isAddKf == 1&&this.userinfo.userId){
  555. console.log(1233)
  556. this.getH5CourseVideoDetails()
  557. } else{
  558. // this.checkUserInfoA()
  559. this.getIsAddKf()
  560. }
  561. }
  562. // if(this.sortLink){
  563. // this.getLink()
  564. // } else {
  565. // uni.showToast({
  566. // title: 'sortLink is not found',
  567. // icon: 'none'
  568. // });
  569. // }
  570. },
  571. mounted() {
  572. // this.getIP()
  573. this.getHeight()
  574. },
  575. onHide() {
  576. // this.player = uni.createVideoContext('video-content-box');
  577. if (this.player) {
  578. this.player.pause()
  579. }
  580. // if (this.interval != null) {
  581. // clearInterval(this.interval)
  582. // this.interval = null
  583. // }
  584. },
  585. onUnload() {
  586. if (this.interval != null) {
  587. clearInterval(this.interval)
  588. this.interval = null
  589. }
  590. this.clearIntegral()
  591. uni.$off('usercode')
  592. },
  593. beforeDestroy() {
  594. this.player = uni.createVideoContext('video-content-box');
  595. if (this.player) {
  596. this.player.stop()
  597. this.player = null
  598. }
  599. if (this.interval != null) {
  600. clearInterval(this.interval)
  601. this.interval = null
  602. }
  603. this.clearIntegral()
  604. },
  605. methods: {
  606. getWebviewUrl() {
  607. var data = {
  608. key: 'course.config'
  609. }
  610. getConfigByKey(data).then(res => {
  611. if (res.code == 200) {
  612. console.log("getConfigByKey====", JSON.parse(res.data))
  613. let data = JSON.parse(res.data,)
  614. uni.setStorageSync('setWebviewUrl',data.userCourseAuthDomain)
  615. }else{
  616. uni.showToast({
  617. icon:'none',
  618. title: res.msg,
  619. });
  620. }
  621. })
  622. },
  623. goLogin(){
  624. uni.showLoading({
  625. title: '加载中'
  626. })
  627. uni.login({
  628. provider: "weixin",
  629. success: async loginRes => {
  630. let code = loginRes.code // 获取开发code
  631. loginByMiniApp({
  632. // encryptedData: loginRes.mp.detail.encryptedData,
  633. // iv: loginRes.mp.detail.iv,
  634. code: code,
  635. companyId : this.companyId || '',
  636. companyUserId:this.companyUserId || 0,
  637. nickname:this.userinfos.nickname ||'',
  638. avatar:this.userinfos.avatar||'',
  639. authType:this.authType,
  640. appId:this.appid,
  641. projectId:this.projectId
  642. })
  643. .then( res => {
  644. if(res.code==200){
  645. console.log(res)
  646. uni.hideLoading();
  647. uni.showToast({
  648. icon:'none',
  649. title: "登录成功",
  650. });
  651. uni.setStorageSync('TOKEN_WEXIN', res.token);
  652. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  653. this.userInfo=res.user;
  654. // this.userinfos=uni.getStorageSync('userinfos')
  655. // uni.getStorageSync('TOKEN_WEXIN');
  656. // this.userInfo=uni.getStorageSync('userInfo');
  657. this.isLogin = true
  658. // this.getH5CourseVideoDetails()
  659. setTimeout(()=>{
  660. this.getIsAddKf()
  661. },200)
  662. }else if(res.code==406){
  663. uni.hideLoading();
  664. uni.showToast({
  665. icon:'none',
  666. title: '该用户已成为其他销售会员',
  667. });
  668. }else{
  669. uni.hideLoading();
  670. uni.showToast({
  671. icon:'none',
  672. title: res.msg,
  673. });
  674. }
  675. })
  676. },
  677. })
  678. },
  679. goLogins(data) {
  680. if(data){
  681. console.log('huoqu1222',data)
  682. uni.showLoading({
  683. title: '加载中'
  684. })
  685. uni.login({
  686. provider: "weixin",
  687. success: async loginRes => {
  688. let code = loginRes.code // 获取开发code
  689. handleFsUserWx({
  690. code: code,
  691. appId:this.appid,
  692. userId:data.userId
  693. })
  694. .then( res => {
  695. if(res.code==200){
  696. console.log(res)
  697. uni.hideLoading();
  698. uni.showToast({
  699. icon:'none',
  700. title: "登录成功",
  701. });
  702. this.userinfos=uni.getStorageSync('userinfos')
  703. uni.getStorageSync('TOKEN_WEXIN');
  704. this.userInfo=uni.getStorageSync('userInfo');
  705. this.isLogin = true
  706. this.getH5CourseVideoDetails()
  707. // setTimeout(()=>{
  708. // this.getIsAddKf()
  709. // },200)
  710. }else if(res.code==406){
  711. uni.hideLoading();
  712. uni.showToast({
  713. icon:'none',
  714. title: '该用户已成为其他销售会员',
  715. });
  716. }else{
  717. uni.hideLoading();
  718. uni.showToast({
  719. icon:'none',
  720. title: res.msg,
  721. });
  722. }
  723. })
  724. },
  725. })
  726. }else{
  727. uni.navigateTo({
  728. url:'/pages_course/webview?H5course='+uni.getStorageSync('H5course')
  729. })
  730. }
  731. },
  732. shouquan(){
  733. if(this.userinfos.nickname==''){
  734. uni.showToast({
  735. icon:'none',
  736. title: "请先授权微信昵称",
  737. });
  738. }
  739. },
  740. confimrname(){
  741. if(this.userinfos.nickname==''){
  742. uni.showToast({
  743. icon:'none',
  744. title: "请授权微信昵称",
  745. });
  746. return
  747. }
  748. if(this.userinfos.avatar==''){
  749. uni.showToast({
  750. icon:'none',
  751. title: "请授权微信头像",
  752. });
  753. return
  754. }
  755. uni.setStorageSync('userInfos',this.userinfos)
  756. this.editUserA()
  757. this.userlogo=false
  758. },
  759. onChooseAvatar(e){
  760. this.userinfos.avatar=e.detail.avatarUrl
  761. uni.uploadFile({
  762. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  763. filePath: e.detail.avatarUrl,
  764. name: 'file',
  765. formData: {
  766. 'user': 'test' // 上传附带参数
  767. },
  768. success: (uploadFileRes) => {
  769. console.log(uploadFileRes)
  770. // 根据接口具体返回格式 赋值具体对应url
  771. var data=JSON.parse(uploadFileRes.data)
  772. this.headImg=uni.getStorageSync('requestPath')+data.fileName
  773. this.userinfos.avatar=data.url
  774. }
  775. });
  776. },
  777. onNickNameInput(e){
  778. console.log(e)
  779. this.userinfos.nickname=e.detail.value
  780. },
  781. kefpop(){
  782. if(this.appToken){
  783. this.kfPopup==false
  784. }
  785. },
  786. tosales(){
  787. uni.switchTab({
  788. url:"/pages/index/index"
  789. })
  790. },
  791. closepop(){
  792. this.answerPopup=false
  793. },
  794. open(){
  795. },
  796. userInfologin(e){
  797. console.log(e)
  798. this.userdisabled=true
  799. uni.showLoading({
  800. title: "处理中..."
  801. });
  802. if (e.mp.detail.errMsg == 'getUserInfo:ok') {
  803. this.utils.getProvider()
  804. .then(provider => {
  805. if (!provider) {
  806. this.userdisabled=false
  807. reject()
  808. }
  809. // uni登录
  810. uni.login({
  811. provider: provider,
  812. success: async loginRes => {
  813. console.log(loginRes)
  814. console.log(e)
  815. let code = loginRes.code // 获取开发code
  816. this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
  817. loginByMiniApp({
  818. encryptedData: e.mp.detail.encryptedData,
  819. iv: e.mp.detail.iv,
  820. code: code,
  821. companyId : this.companyId || '',
  822. companyUserId:this.companyUserId || 0,
  823. nickname:this.userinfos.nickname ||'',
  824. avatar:this.userinfos.avatar||'',
  825. authType:this.authType,
  826. appId:this.appid,
  827. projectId:this.projectId
  828. })
  829. .then( res => {
  830. this.userdisabled=false
  831. if(res.code==200){
  832. console.log(res)
  833. uni.hideLoading();
  834. uni.showToast({
  835. icon:'none',
  836. title: "登录成功",
  837. });
  838. uni.setStorageSync('TOKEN_WEXIN', res.token);
  839. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  840. this.userInfo=res.user;
  841. uni.hideLoading()
  842. // this.checkUserInfoA()
  843. // this.isLogin = true
  844. }else if(res.code==406){
  845. uni.hideLoading();
  846. uni.showToast({
  847. icon:'none',
  848. title: '该用户已成为其他销售会员',
  849. });
  850. }else{
  851. uni.hideLoading();
  852. uni.showToast({
  853. icon:'none',
  854. title: res.msg,
  855. });
  856. }
  857. })
  858. .catch(res=>{
  859. this.userdisabled=false
  860. })
  861. },
  862. fail() {
  863. this.userdisabled=false
  864. }
  865. })
  866. })
  867. .catch(err => {
  868. this.userdisabled=false
  869. uni.showToast({
  870. icon:'none',
  871. title: err,
  872. });
  873. })
  874. } else {
  875. this.userdisabled=false
  876. uni.showToast({
  877. title: '已拒绝授权',
  878. icon: 'none',
  879. duration: 2000,
  880. })
  881. }
  882. },
  883. phoneLogin(e) {
  884. console.log(e)
  885. this.userdisabled=false
  886. uni.showLoading({
  887. title: "处理中..."
  888. });
  889. if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
  890. this.utils.getProvider()
  891. .then(provider => {
  892. if (!provider) {
  893. this.userdisabled=false
  894. reject()
  895. }
  896. // uni登录
  897. uni.login({
  898. provider: provider,
  899. success: async loginRes => {
  900. this.userdisabled=false
  901. console.log(loginRes)
  902. console.log(e)
  903. let code = loginRes.code // 获取开发code
  904. this.userinfos=uni.getStorageSync('userInfos')?uni.getStorageSync('userInfos'):this.userinfos
  905. loginByMiniApp({
  906. encryptedData: e.mp.detail.encryptedData,
  907. iv: e.mp.detail.iv,
  908. code: code,
  909. companyId : this.companyId || '',
  910. companyUserId:this.companyUserId || 0,
  911. nickname:this.userinfos.nickname||'',
  912. avatar:this.userinfos.avatar||"",
  913. authType:this.authType,
  914. appId:this.appid,
  915. projectId:this.projectId
  916. })
  917. .then( res => {
  918. this.userdisabled=false
  919. if(res.code==200){
  920. console.log(res)
  921. uni.hideLoading();
  922. uni.showToast({
  923. icon:'none',
  924. title: "登录成功",
  925. });
  926. uni.setStorageSync('TOKEN_WEXIN', res.token);
  927. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  928. this.userInfo=res.user;
  929. uni.hideLoading()
  930. this.checkUserInfoA()
  931. // this.isLogin = true
  932. // setTimeout(()=>{
  933. // this.getIsAddKf()
  934. // },200)
  935. }else if(res.code==406){
  936. uni.hideLoading();
  937. uni.showToast({
  938. icon:'none',
  939. title: '该用户已成为其他销售会员',
  940. });
  941. }else{
  942. uni.hideLoading();
  943. uni.showToast({
  944. icon:'none',
  945. title: res.msg,
  946. });
  947. }
  948. })
  949. .catch(res=>{
  950. this.userdisabled=false
  951. })
  952. },
  953. fail() {
  954. this.userdisabled=false
  955. }
  956. })
  957. })
  958. .catch(err => {
  959. this.userdisabled=false
  960. uni.showToast({
  961. icon:'none',
  962. title: err,
  963. });
  964. })
  965. } else {
  966. this.userdisabled=false
  967. uni.showToast({
  968. title: '已拒绝授权',
  969. icon: 'none',
  970. duration: 2000,
  971. })
  972. }
  973. },
  974. getMenuButton(){
  975. const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  976. this.menuButtonLeft = menuButtonInfo.left
  977. this.menuButtonH = menuButtonInfo.height
  978. },
  979. //播放时间更新事件方法
  980. onTimeUpdate(e){
  981. let currentTime = Math.round(e.detail.currentTime)
  982. if (this.playDurationSeek > 0) {
  983. this.playTime = this.playDurationSeek
  984. this.throttle(() => this.changeTime(this), 1000, false)
  985. } else {
  986. // console.log(this.isFinish)
  987. if (this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this.playTime < -3)&&this.isFinish!=1) {
  988. uni.showToast({
  989. title: '不能快进哦',
  990. icon: 'none',
  991. });
  992. currentTime = this.playTime
  993. this.player.seek(this.playTime);
  994. }
  995. if (Math.floor(e.detail.currentTime) != this.flagTime) {
  996. this.flagTime = Math.floor(e.detail.currentTime)
  997. // 中途弹窗逻辑
  998. if(!this.tipsOpen&&this.tipsTime && this.playTime == this.tipsTime) {
  999. this.timepath='33%'
  1000. this.openTipsPop()
  1001. }
  1002. if(!this.tipsOpen&&this.tipsTime2 && this.playTime == this.tipsTime2) {
  1003. this.timepath='66%'
  1004. this.openTipsPop()
  1005. }
  1006. }
  1007. this.playTime = currentTime
  1008. }
  1009. },
  1010. changeTime(that,e) {
  1011. that.playDurationSeek = 0
  1012. },
  1013. videoErrorCallback(e) {
  1014. this.clearIntegral()
  1015. this.errorCount++
  1016. if (this.errorCount > 3) return
  1017. console.log(e)
  1018. this.getErrMsg(e.target.errMsg)
  1019. this.getH5CourseVideoDetails('error')
  1020. },
  1021. // 当开始/继续播放时触发play事件
  1022. getPlay() {
  1023. this.errorCount = 0
  1024. // this.judgeDuration()
  1025. },
  1026. getPause() {
  1027. this.clearIntegral()
  1028. },
  1029. getEnded() {
  1030. this.clearIntegral()
  1031. this.isEnded = true
  1032. this.isFinish=1
  1033. this.getFinishCourseVideo()
  1034. },
  1035. getIP() {
  1036. uni.request({
  1037. url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
  1038. method: 'GET',
  1039. success: (res) => {
  1040. this.ip = res.data.ip
  1041. }
  1042. });
  1043. },
  1044. getHeight() {
  1045. this.$nextTick(() => {
  1046. const query = uni.createSelectorQuery().in(this);
  1047. query
  1048. .select("#title-content")
  1049. .boundingClientRect((data) => {
  1050. this.height =
  1051. `calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 120rpx )`
  1052. })
  1053. .exec();
  1054. })
  1055. },
  1056. getDescHeight() {
  1057. this.$nextTick(() => {
  1058. const query = uni.createSelectorQuery().in(this);
  1059. query
  1060. .select("#descbox-desc")
  1061. .boundingClientRect((data) => {
  1062. this.textHeight = data.height
  1063. })
  1064. .exec();
  1065. })
  1066. },
  1067. numberToLetter(num) {
  1068. // 将数字转换为字母的 ASCII 码
  1069. let letterCode = num + 65;
  1070. // 将 ASCII 码转换为大写字母
  1071. let letter = String.fromCharCode(letterCode);
  1072. return letter;
  1073. },
  1074. updateTime() {
  1075. var that = this;
  1076. if (this.interval != null) {
  1077. clearInterval(this.interval)
  1078. }
  1079. this.interval = setInterval(function() {
  1080. that.getFinishCourseVideo()
  1081. that.getInternetTraffic()
  1082. }, 60000);
  1083. },
  1084. judgeDuration() {
  1085. var that = this;
  1086. if (this.intervalIntegral != null) {
  1087. clearInterval(this.intervalIntegral)
  1088. this.intervalIntegral = null
  1089. }
  1090. // 观看10分钟获得积分
  1091. this.intervalIntegral = setInterval(function() {
  1092. that.getIntegralByH5Video()
  1093. }, 600000);
  1094. },
  1095. clearIntegral() {
  1096. if (this.intervalIntegral != null) {
  1097. clearInterval(this.intervalIntegral)
  1098. this.intervalIntegral = null
  1099. }
  1100. },
  1101. // 展开简介
  1102. handleExpand() {
  1103. this.isExpand = !this.isExpand
  1104. },
  1105. getH5CourseByVideo() {
  1106. this.loading = true
  1107. getH5CourseByVideoId({
  1108. videoId: this.videoId
  1109. }).then(res => {
  1110. this.loading = false
  1111. if (res.code == 200) {
  1112. this.viewload=false
  1113. this.courseInfo = res.data
  1114. uni.setNavigationBarTitle({
  1115. title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
  1116. });
  1117. }
  1118. this.getHeight()
  1119. this.getDescHeight()
  1120. },
  1121. rej => {
  1122. this.loading = false
  1123. }
  1124. ).catch(() => {
  1125. this.loading = false
  1126. })
  1127. },
  1128. getH5CourseVideoDetails(type) {
  1129. uni.showLoading({
  1130. title: '加载中'
  1131. })
  1132. console.log(this.userInfo)
  1133. const data={
  1134. videoId:this.videoId,
  1135. fsUserId:this.userInfo.userId,
  1136. courseId:this.courseId,
  1137. companyUserId:this.companyUserId,
  1138. periodId:this.periodId,
  1139. id:this.timeid
  1140. }
  1141. getH5CourseVideoDetails(data).then(res => {
  1142. if (res.code == 200) {
  1143. this.config = res.data.courseConfig || {}
  1144. this.isFinish = res.data.isFinish || 0
  1145. this.duration = res.data.courseVideoDetails &&
  1146. res.data.courseVideoDetails.duration ? res.data.courseVideoDetails.duration : 0
  1147. this.courseLogo = this.config&&JSON.stringify(this.config)!='{}'? this.config.courseLogo : ''
  1148. this.playDuration = res.data.playDuration || 0
  1149. this.playDurationSeek = res.data.playDuration || 0
  1150. // this.tipsTime = 38
  1151. this.tipsTime = res.data.tipsTime || 0
  1152. this.tipsTime2 = res.data.tipsTime2 || 0
  1153. let lineList = []
  1154. // if (res.course && res.course.lineOne) {
  1155. // lineList.push(res.course.lineOne)
  1156. // }
  1157. // if (res.course && res.course.lineTwo) {
  1158. // lineList.push(res.course.lineTwo)
  1159. // }
  1160. // if (res.course && res.course.lineThree) {
  1161. // lineList.push(res.course.lineThree)
  1162. // }
  1163. this.lineList = lineList
  1164. if (!this.player || type == 'error') {
  1165. uni.hideLoading();
  1166. this.lineIndex = this.config.defaultLine
  1167. this.videoUrl = res.data.courseVideoDetails.videoUrl
  1168. this.poster= res.data.courseVideoDetails &&
  1169. res.data.courseVideoDetails.thumbnail ? res.data.courseVideoDetails.thumbnail : ''
  1170. this.videocont=res.data
  1171. // this.options.sources = [{
  1172. // src: this.videoUrl
  1173. // }]
  1174. // this.options.poster = res.course && res.course.imgUrl ? res.course.imgUrl : ''
  1175. // this.initVideo()
  1176. this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
  1177. if(this.videocont.rang){
  1178. setTimeout(()=>{
  1179. this.player = uni.createVideoContext('video-content-box');
  1180. this.player.seek(this.playTime)
  1181. this.player.play();
  1182. },500);
  1183. this.timepop=false
  1184. }else{
  1185. this.timepop=true
  1186. }
  1187. } else {
  1188. // let div = document.querySelector(".vjs-progress-control");
  1189. // if(div) {
  1190. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  1191. // div.style.pointerEvents = "auto";
  1192. // } else {
  1193. // div.style.pointerEvents = "none"; //禁止所有事件
  1194. // }
  1195. // }
  1196. this.playTime = this.playTime > this.playDuration ? this.playTime : this.playDuration >= this.duration ? 0 : this.playDuration
  1197. this.player.seek(this.playTime)
  1198. this.player.play();
  1199. }
  1200. this.updateTime();
  1201. if(res.data.courseVideoDetails.questionBankList.length==0){
  1202. this.isquestion=true
  1203. }else{
  1204. this.isquestion=false
  1205. }
  1206. console.log('题目',res.data.courseVideoDetails.questionBankList)
  1207. this.quesList = res.data.courseVideoDetails.questionBankList
  1208. && res.data.courseVideoDetails.questionBankList.length > 0 ? res.data.courseVideoDetails.questionBankList : [],
  1209. this.quesList = this.quesList.map(item => ({
  1210. ...item,
  1211. questionOption: JSON.parse(item.question),
  1212. answer: ''
  1213. }))
  1214. }
  1215. this.getHeight()
  1216. this.getDescHeight()
  1217. },
  1218. rej => {}
  1219. )
  1220. },
  1221. handleAnswer(item, option, idx) {
  1222. let time = this.playTime
  1223. if(this.isEnded || this.isFinish==1) {
  1224. time = this.duration
  1225. } else {
  1226. if(time < this.playDuration&&this.isFinish!=1) {
  1227. // 没完课且小于续播的时间
  1228. time = this.playDuration
  1229. }
  1230. }
  1231. if(Number(this.duration || 0) == 0 || time < this.duration - 60) {
  1232. uni.showToast({
  1233. title: "请先观看完整课程再答题哦~",
  1234. icon: "none"
  1235. })
  1236. return
  1237. }
  1238. if (item.type == 1) {
  1239. // 单选option
  1240. item.answer = option.name
  1241. } else if (item.type == 2) {
  1242. // 多选
  1243. let answer = item.answer ? item.answer.split(',') : []
  1244. if (answer.indexOf(option.name) === -1) {
  1245. answer.push(option.name)
  1246. item.answer = answer.join(',')
  1247. } else {
  1248. answer.splice(answer.indexOf(option.name), 1)
  1249. item.answer = answer.join(',')
  1250. }
  1251. }
  1252. },
  1253. submit() {
  1254. if(this.isExpire){
  1255. uni.showToast({
  1256. title: '课程已过期或链接无效',
  1257. icon: 'none'
  1258. });
  1259. return
  1260. }
  1261. // 登录
  1262. this.$isLoginCourse().then(
  1263. res => {
  1264. console.log(res)
  1265. if(res){
  1266. console.log(res)
  1267. if (this.isAddKf == 1) {
  1268. // 答题
  1269. // 您已提交过答案,请领取红包
  1270. console.log(1223)
  1271. this.courseAnswer()
  1272. } else {
  1273. // 添加客服
  1274. if (this.videoId&&this.isLogin) {
  1275. console.log(12223131)
  1276. this.getIsAddKf()
  1277. } else if(this.iskftype==1){
  1278. uni.showToast({
  1279. title: this.iskftypemsg,
  1280. icon: 'none'
  1281. })
  1282. }
  1283. else {
  1284. // this.kfPopup=true
  1285. uni.removeStorageSync('TOKEN_WEXIN')
  1286. uni.showToast({
  1287. title: '已清除缓存,请重新进入页面!',
  1288. icon: 'none'
  1289. })
  1290. }
  1291. }
  1292. } else{
  1293. this.goLogin()
  1294. }
  1295. },
  1296. rej => {}
  1297. );
  1298. },
  1299. // 答题
  1300. courseAnswer() {
  1301. let time = this.playTime
  1302. if (this.isEnded||this.isFinish==1) {
  1303. time = this.duration
  1304. } else {
  1305. if (time < this.playDuration && this.isFinish != 1) {
  1306. // 没完课且小于续播的时间
  1307. time = this.playDuration
  1308. }
  1309. }
  1310. if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
  1311. uni.showToast({
  1312. title: "请先观看完整课程再答题哦~",
  1313. icon: "none"
  1314. })
  1315. return
  1316. }
  1317. if (this.quesList.some(item => !item.answer)) {
  1318. uni.showToast({
  1319. title: "请确认是否答完所有题目",
  1320. icon: "none"
  1321. })
  1322. return
  1323. }
  1324. const questions = this.quesList.map(obj => {
  1325. const {
  1326. questionOption,
  1327. ...rest
  1328. } = obj;
  1329. return rest;
  1330. });
  1331. const param = {
  1332. ...this.urlOption,
  1333. userId:this.userInfo.userId,
  1334. questions: questions,
  1335. videoId: this.videoId,
  1336. duration: this.playTime,
  1337. }
  1338. this.errTitle = ""
  1339. this.errDesc = ""
  1340. this.errQues = []
  1341. courseAnswer(param).then(res => {
  1342. if (res.code == 200) {
  1343. if (res.incorrectQuestions) {
  1344. // 答题失败
  1345. if (res.incorrectQuestions.length > 0) {
  1346. this.errQues = res.incorrectQuestions
  1347. }
  1348. this.remain = res.remain || 0
  1349. if (res.remain > 0) {
  1350. this.answerPopup=true
  1351. this.errTitle = "很遗憾答错了"
  1352. this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
  1353. // this.$refs.answerPopup.open("center")
  1354. this.answerPopup=true
  1355. }
  1356. } else {
  1357. // 答题成功
  1358. this.errTitle = "恭喜你,回答正确"
  1359. // this.errDesc = `请选择奖励`
  1360. // this.$refs.answerPopup.open("center")
  1361. // this.answerPopup=true
  1362. if(res.msg=='答题成功'){
  1363. uni.login({
  1364. provider: 'weixin',
  1365. success: async loginRes => {
  1366. console.log(loginRes)
  1367. var code=loginRes
  1368. this.closeAnswerPopup(loginRes.code)
  1369. }
  1370. })
  1371. }
  1372. }
  1373. } else {
  1374. if (res.msg == "该课题到达答错次数限制") {
  1375. this.errTitle = "答题次数超过限制"
  1376. this.errDesc = "以后的课程要认真学习哦"
  1377. // this.$refs.answerPopup.open("center")
  1378. this.answerPopup=true
  1379. } else {
  1380. uni.showToast({
  1381. title: res.msg,
  1382. icon: "none"
  1383. })
  1384. }
  1385. }
  1386. },
  1387. rej => {}
  1388. )
  1389. },
  1390. // 选择
  1391. rewardChange(e) {
  1392. this.currentReward = e.detail.value
  1393. },
  1394. closeAnswerPopup() {
  1395. // this.$refs.answerPopup.close()
  1396. uni.showLoading({
  1397. title: "加载中..."
  1398. })
  1399. if (this.errTitle == '恭喜你,回答正确') {
  1400. const param = {
  1401. ...this.urlOption,
  1402. userId:this.userInfo.userId,
  1403. // rewardType: Number(this.currentReward),
  1404. source: 2, // 小程序
  1405. appId: this.appid
  1406. }
  1407. sendReward(param).then(res => {
  1408. if(res.code == 200) {
  1409. uni.hideLoading()
  1410. this.answerPopup=false
  1411. console.log('红包',res)
  1412. if(res.isNew&&res.isNew==1) {
  1413. console.log('红包配置',res)
  1414. const packageInfo = res.data.packageInfo || ''
  1415. if(packageInfo) {
  1416. uni.setStorageSync('receive_package',packageInfo)
  1417. uni.setStorageSync('mchId',res.mchId)
  1418. uni.navigateTo({
  1419. url: '/pages_course/reward'
  1420. })
  1421. }
  1422. } else {
  1423. uni.showToast({
  1424. title: res.msg,
  1425. icon: 'none'
  1426. })
  1427. }
  1428. }else {
  1429. uni.hideLoading()
  1430. uni.showToast({
  1431. title: res.msg,
  1432. icon: 'none'
  1433. })
  1434. }
  1435. // if(res.code == 200) {
  1436. // //重构 发红包,后台通过OPENID发零钱到 账
  1437. // //this.initWXConfig(res.package)
  1438. // }else {
  1439. // uni.showToast({
  1440. // title: res.msg,
  1441. // icon: 'none'
  1442. // })
  1443. // }
  1444. })
  1445. }else{
  1446. uni.hideLoading()
  1447. this.answerPopup=!this.answerPopup
  1448. }
  1449. },
  1450. // 线路
  1451. openPop() {
  1452. this.$refs.popup.open('bottom')
  1453. },
  1454. close() {
  1455. this.$refs.popup.close()
  1456. },
  1457. handleLine(index) {
  1458. var that=this;
  1459. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  1460. this.close()
  1461. return
  1462. } else {
  1463. // let div = document.querySelector(".vjs-progress-control");
  1464. // if(div) {
  1465. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  1466. // div.style.pointerEvents = "auto";
  1467. // } else {
  1468. // div.style.pointerEvents = "none"; //禁止所有事件
  1469. // }
  1470. // }
  1471. this.lineIndex = index
  1472. this.videoUrl = this.lineList[index]
  1473. this.tipsOpen = false
  1474. this.playDurationSeek = this.playTime || 0
  1475. this.player = uni.createVideoContext('video-content-box');
  1476. setTimeout(function(){
  1477. that.player.seek(that.playDurationSeek)
  1478. that.player.play();
  1479. },500);
  1480. // this.player.src(this.lineList[index])
  1481. // this.player.one('loadedmetadata', () => {
  1482. // this.player.currentTime(this.playDurationSeek);
  1483. // this.player.play();
  1484. // });
  1485. this.close()
  1486. }
  1487. },
  1488. // 温馨提示
  1489. openTipsPop() {
  1490. // this.$refs.tipsPopup.open()
  1491. this.tipsPopup=true
  1492. // 暂停视频
  1493. this.videoContext.pause()
  1494. // this.tipsOpen = true
  1495. // this.pause()
  1496. },
  1497. closeTipsPop() {
  1498. // this.$refs.tipsPopup.close()
  1499. this.videoContext.play()
  1500. this.tipsPopup=!this.tipsPopup
  1501. },
  1502. // 客服
  1503. getIsAddKf() {
  1504. this.qrcode = ''
  1505. this.qrcodeMsg = ''
  1506. this.isAddKf = 0
  1507. const data = {
  1508. videoId:this.videoId,
  1509. userId:this.userInfo.userId,
  1510. companyUserId:this.companyUserId,
  1511. companyId:this.companyId,
  1512. courseId:this.courseId,
  1513. periodId:this.periodId,
  1514. projectId:this.projectId
  1515. }
  1516. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  1517. getIsAddKf(data).then(res => {
  1518. if (res.code == 200) {
  1519. this.isLogin = true
  1520. if(res.data){
  1521. this.isAddKf = 1
  1522. if(this.userInfo.userId){
  1523. this.getH5CourseVideoDetails()
  1524. console.log(123223)
  1525. }
  1526. }
  1527. // else{
  1528. // uni.showToast({
  1529. // title: '请联系管理员,注册为会员!',
  1530. // icon: 'none'
  1531. // });
  1532. // }
  1533. }else if(res.code==1002){
  1534. this.isAddKf = 0
  1535. this.qrcode=res.ext
  1536. this.kfPopup=true
  1537. uni.showToast({
  1538. title: "请添加管理员微信,成为会员!",
  1539. icon: 'none'
  1540. });
  1541. }else if(res.code==505){
  1542. this.isAddKf = 0
  1543. this.qrcode=res.ext
  1544. this.kfPopup=true
  1545. uni.showToast({
  1546. title: "管理员开启了会员审核,请等待审核!",
  1547. icon: 'none'
  1548. });
  1549. }else if(res.code==406){
  1550. uni.hideLoading();
  1551. this.iskftypemsg=res.msg
  1552. uni.showToast({
  1553. icon:'none',
  1554. title: '该用户已成为其他销售会员',
  1555. });
  1556. }else if(res.code==504){
  1557. this.isAddKf = 0
  1558. this.iskftype=1
  1559. this.iskftypemsg=res.msg
  1560. uni.showToast({
  1561. title: res.msg,
  1562. icon: 'none'
  1563. });
  1564. }else {
  1565. this.isAddKf = 0
  1566. this.iskftypemsg=res.msg
  1567. uni.showToast({
  1568. title: res.msg,
  1569. icon: 'none'
  1570. });
  1571. }
  1572. },
  1573. err => {}
  1574. );
  1575. },
  1576. closeKFPop() {
  1577. // this.$refs.kfPopup.close()
  1578. // this.kfPopup=!this.kfPopup
  1579. },
  1580. getFinishCourseVideo() {
  1581. if (!this.playTime) return
  1582. // {videoId: this.videoId,duration:this.playTime}
  1583. const param = {
  1584. duration: this.playTime,
  1585. videoId:this.videoId,
  1586. userId:this.userInfo.userId,
  1587. companyUserId:this.companyUserId
  1588. }
  1589. getFinishCourseVideo(param)
  1590. },
  1591. // 每十分钟获得积分
  1592. getIntegralByH5Video() {
  1593. const param = {
  1594. duration: this.playTime,
  1595. ...this.urlOption
  1596. }
  1597. getIntegralByH5Video(param).then(res => {
  1598. if (res.code == 200) {
  1599. uni.showToast({
  1600. title: "积分+10",
  1601. icon: "none"
  1602. })
  1603. }
  1604. })
  1605. },
  1606. progressChange(e) {
  1607. this.bufferRate = Math.ceil(e.detail.buffered)
  1608. // console.log('缓冲结果',this.bufferRate)
  1609. // console.log('缓冲',this.playTime,this.duration)
  1610. },
  1611. // 缓冲
  1612. getInternetTraffic() {
  1613. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  1614. // console.log('播放百分比',playVideoTime)
  1615. if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  1616. this.bufferRate = playVideoTime
  1617. console.log(this.bufferRate)
  1618. }
  1619. if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  1620. const param = {
  1621. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  1622. duration: this.playTime,
  1623. bufferRate: Number(this.bufferRate.toFixed(2)),
  1624. userId:this.userId,
  1625. periodId:this.periodId,
  1626. ...this.urlOption
  1627. }
  1628. getInternetTraffic(param)
  1629. },
  1630. getErrMsg(err) {
  1631. let msgerr = {
  1632. videoUrl: this.videoUrl,
  1633. lineIndex: this.lineIndex,
  1634. errTime: new Date(),
  1635. // ip: this.ip,
  1636. errMsg: err
  1637. }
  1638. getErrMsg({
  1639. msg: JSON.stringify(msgerr)
  1640. })
  1641. },
  1642. getLink() {
  1643. this.goLogin()
  1644. return
  1645. let that = this;
  1646. this.msg = ''
  1647. getRealLink({sortLink:this.sortLink}).then(res=>{
  1648. if(res.code == 200) {
  1649. this.isExpire = false
  1650. // 如果响应中包含真实链接,则跳转到真实链接
  1651. // window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
  1652. if (this.isLogin && this.isAddKf == 1) {
  1653. this.getH5CourseVideoDetails()
  1654. }
  1655. if (this.videoId && this.isAddKf != 1) {
  1656. this.$isLoginCourse().then(
  1657. isLogin => {
  1658. this.isLogin = isLogin
  1659. if(isLogin){
  1660. this.getIsAddKf()
  1661. } else {
  1662. this.goLogin()
  1663. }
  1664. },
  1665. rej => {}
  1666. );
  1667. }
  1668. } else {
  1669. this.isExpire = true
  1670. this.msg = '课程已过期或链接无效'
  1671. uni.showToast({
  1672. title: '课程已过期或链接无效',
  1673. icon: 'none'
  1674. });
  1675. }
  1676. }).catch(err=>{
  1677. this.isExpire = true
  1678. this.msg = '发生错误,请稍后再试'
  1679. uni.showToast({
  1680. title: '发生错误,请稍后再试',
  1681. icon: 'none'
  1682. });
  1683. })
  1684. },
  1685. /**
  1686. * 节流原理:在一定时间内,只能触发一次
  1687. *
  1688. * @param {Function} func 要执行的回调函数
  1689. * @param {Number} wait 延时的时间
  1690. * @param {Boolean} immediate 是否立即执行
  1691. * @return null
  1692. */
  1693. throttle(func, wait = 500, immediate = true) {
  1694. if (immediate) {
  1695. if (!this.flag) {
  1696. this.flag = true
  1697. // 如果是立即执行,则在wait毫秒内开始时执行
  1698. typeof func === 'function' && func()
  1699. this.timer = setTimeout(() => {
  1700. this.flag = false
  1701. }, wait)
  1702. }
  1703. } else if (!this.flag) {
  1704. this.flag = true
  1705. // 如果是非立即执行,则在wait毫秒内的结束处执行
  1706. this.timer = setTimeout(() => {
  1707. this.flag = false
  1708. typeof func === 'function' && func()
  1709. }, wait)
  1710. }
  1711. }
  1712. }
  1713. }
  1714. </script>
  1715. <style scoped>
  1716. .full-width-popup {
  1717. width: 100%;
  1718. }
  1719. </style>
  1720. <style lang="scss" scoped>
  1721. .subname{
  1722. background-color: #00aa00;
  1723. color: #fff;
  1724. }
  1725. .subavt{
  1726. background-color: #fff;
  1727. border: 2rpx #0a0 solid;
  1728. color: #00aa00;
  1729. }
  1730. .boxweixin{
  1731. width: 44rpx;
  1732. height: 44rpx;
  1733. border-radius: 50%;
  1734. text-align: center;
  1735. line-height: 34rpx;
  1736. color: #0a0;
  1737. }
  1738. .boxnosel{
  1739. border: #757575 4rpx solid;
  1740. }
  1741. .boxsel{
  1742. border: #0a0 4rpx solid;
  1743. }
  1744. .button-container {
  1745. position: relative;
  1746. width: 240rpx;
  1747. }
  1748. .hidden-input {
  1749. position: absolute;
  1750. top: 0;
  1751. left: 0;
  1752. width: 100%;
  1753. height: 100%;
  1754. opacity: 0;
  1755. z-index: 2;
  1756. }
  1757. .custom-button {
  1758. position: relative;
  1759. z-index: 1;
  1760. /* 其他样式 */
  1761. width:100%;
  1762. margin: 0 auto;
  1763. height: 80rpx;
  1764. line-height: 60rpx;
  1765. font-size: 28rpx;
  1766. padding: 10rpx 20rpx;
  1767. }
  1768. .submitname{
  1769. width: 90%;
  1770. margin: 0 auto;
  1771. text-align: center;
  1772. padding: 30rpx;
  1773. margin-top: 40rpx;
  1774. }
  1775. .sub{
  1776. background-color: #f0f0f0;
  1777. color: #0a0;
  1778. }
  1779. .subact{
  1780. background-color: #0a0;
  1781. color: #fff;
  1782. }
  1783. .userlogo{
  1784. height: 760rpx;
  1785. }
  1786. .getlogo{
  1787. width:240rpx;
  1788. background-color: #fff;
  1789. // padding: 10rpx 20rpx;
  1790. }
  1791. @mixin u-flex($flexD, $alignI, $justifyC) {
  1792. display: flex;
  1793. flex-direction: $flexD;
  1794. align-items: $alignI;
  1795. justify-content: $justifyC;
  1796. }
  1797. .footer-tips {
  1798. position: fixed;
  1799. width: 100%;
  1800. bottom: 144rpx;
  1801. text-align: center;
  1802. font-family: PingFang SC,PingFang SC;
  1803. font-weight: 500;
  1804. font-size: 12px;
  1805. color: #bbb;
  1806. transform: scale(0.8);
  1807. }
  1808. .btns{
  1809. position: relative;
  1810. width: 100%;
  1811. height: 80rpx;
  1812. .author-btn{
  1813. z-index:100;
  1814. position: absolute;
  1815. width: 100%;
  1816. height: 80rpx;
  1817. background: #ff5c03;
  1818. border-radius: 40rpx;
  1819. font-size: 36rpx;
  1820. font-family: PingFang SC;
  1821. font-weight: 500;
  1822. text-align: center;
  1823. line-height: 80rpx;
  1824. color: rgba(255, 255, 255, 1);
  1825. }
  1826. }
  1827. .textOne {
  1828. overflow: hidden;
  1829. white-space: nowrap;
  1830. text-overflow: ellipsis;
  1831. }
  1832. .textTwo {
  1833. overflow: hidden;
  1834. text-overflow: ellipsis;
  1835. display: -webkit-box;
  1836. -webkit-line-clamp: 2;
  1837. -webkit-box-orient: vertical;
  1838. }
  1839. .header-nav {
  1840. height: 88rpx;
  1841. @include u-flex(row, center, flex-start);
  1842. overflow: hidden;
  1843. background-color: #fff;
  1844. box-sizing: border-box;
  1845. .header-title {
  1846. text-align: center;
  1847. overflow: hidden;
  1848. white-space: nowrap;
  1849. text-overflow: ellipsis;
  1850. padding: 0 10rpx 0 100rpx;
  1851. font-family: PingFang SC,PingFang SC;
  1852. font-weight: 500;
  1853. font-size: 15px;
  1854. color: #000;
  1855. box-sizing: border-box;
  1856. }
  1857. }
  1858. .reward-list {
  1859. width: 100%;
  1860. margin-top: 20rpx;
  1861. margin-bottom: -40rpx;
  1862. &-group {
  1863. font-family: PingFang SC, PingFang SC;
  1864. font-weight: 400;
  1865. font-size: 14px;
  1866. color: #222222;
  1867. @include u-flex(row, center, center);
  1868. }
  1869. &-option {
  1870. @include u-flex(row, center, flex-start);
  1871. &:first-child {
  1872. margin-right: 40rpx;
  1873. }
  1874. }
  1875. }
  1876. .err {
  1877. color: #f56c6c !important;
  1878. }
  1879. .kfqrcode-box {
  1880. background-color: #fff;
  1881. border-radius: 16rpx;
  1882. max-width: 560rpx;
  1883. padding: 60rpx 40rpx;
  1884. margin-top: -100rpx;
  1885. box-sizing: border-box;
  1886. @include u-flex(column, center, flex-start);
  1887. font-family: PingFang SC, PingFang SC;
  1888. font-weight: 400;
  1889. font-size: 34rpx;
  1890. color: #222;
  1891. position: relative;
  1892. text-align: center;
  1893. .kfqrcode {
  1894. // height: 460rpx;
  1895. width: 460rpx;
  1896. }
  1897. }
  1898. .kfqrcode-close {
  1899. width: 64rpx;
  1900. height: 64rpx;
  1901. position: absolute;
  1902. bottom: -100rpx;
  1903. left: 50%;
  1904. transform: translateX(-50%);
  1905. }
  1906. .tipsPopup-mask {
  1907. position: relative;
  1908. width: 560rpx;
  1909. background-color: transparent;
  1910. .red_envelope_top {
  1911. width: 480rpx;
  1912. height: 360rpx;
  1913. margin: 0 auto;
  1914. display: inherit;
  1915. }
  1916. }
  1917. .tipsPopup-btn-box {
  1918. width: 456rpx;
  1919. height: 104rpx;
  1920. padding: 4rpx;
  1921. box-sizing: border-box;
  1922. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  1923. border-radius: 52rpx;
  1924. }
  1925. .tipsPopup-btn {
  1926. width: 100%;
  1927. height: 100%;
  1928. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  1929. border-radius: 52rpx 52rpx 52rpx 52rpx;
  1930. font-family: PingFang SC, PingFang SC;
  1931. font-weight: 500;
  1932. font-size: 36rpx;
  1933. color: #FFFFFF;
  1934. line-height: 96rpx;
  1935. text-align: center;
  1936. }
  1937. .tipsPopup {
  1938. width: 560rpx;
  1939. padding: 12rpx;
  1940. margin-top: -72rpx;
  1941. box-sizing: border-box;
  1942. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1943. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1944. position: relative;
  1945. &-close {
  1946. width: 64rpx;
  1947. height: 64rpx;
  1948. position: absolute;
  1949. right: 0;
  1950. top: -188rpx;
  1951. }
  1952. &-line {
  1953. padding: 3rpx;
  1954. box-sizing: border-box;
  1955. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  1956. border-radius: 24rpx;
  1957. }
  1958. &-box {
  1959. padding: 0 40rpx 40rpx 40rpx;
  1960. box-sizing: border-box;
  1961. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1962. border-radius: 24rpx;
  1963. @include u-flex(column, center, flex-start);
  1964. }
  1965. &-head {
  1966. @include u-flex(row, center, center);
  1967. &-title {
  1968. width: 364rpx;
  1969. height: auto;
  1970. margin-top: -22rpx;
  1971. }
  1972. }
  1973. &-content {
  1974. margin: 48rpx 0;
  1975. font-family: PingFang SC, PingFang SC;
  1976. font-weight: 500;
  1977. font-size: 32rpx;
  1978. color: #222222;
  1979. text-align: center;
  1980. &-title {
  1981. margin-bottom: 26rpx;
  1982. font-weight: 600;
  1983. font-size: 40rpx;
  1984. color: #FF5C03;
  1985. }
  1986. }
  1987. }
  1988. .video-controls-box {
  1989. width: 100%;
  1990. height: 420rpx;
  1991. overflow: hidden;
  1992. position: absolute;
  1993. bottom: 0;
  1994. left: 0;
  1995. z-index: 2;
  1996. background: rgba(0, 0, 0, 0.2);
  1997. .video-play {
  1998. height: 72rpx;
  1999. width: 72rpx;
  2000. position: absolute;
  2001. top: 50%;
  2002. left: 50%;
  2003. transform: translate(-50%, -50%);
  2004. }
  2005. }
  2006. .video-controls {
  2007. width: 100%;
  2008. height: 80rpx;
  2009. padding: 0 28rpx;
  2010. box-sizing: border-box;
  2011. position: absolute;
  2012. bottom: 0;
  2013. left: 0;
  2014. display: flex;
  2015. align-items: center;
  2016. justify-content: space-between;
  2017. background: linear-gradient(to top, #222 0%, transparent 80%);
  2018. .video-icon {
  2019. height: 44rpx;
  2020. width: 44rpx;
  2021. }
  2022. }
  2023. .errQuesbox {
  2024. width: 100%;
  2025. max-height: 260rpx;
  2026. overflow-y: auto;
  2027. margin-top: 24rpx;
  2028. font-family: PingFang SC, PingFang SC;
  2029. font-weight: 500;
  2030. font-size: 30rpx;
  2031. color: #222222;
  2032. &-item {
  2033. width: 100%;
  2034. height: 128rpx;
  2035. line-height: 128rpx;
  2036. margin-bottom: 24rpx;
  2037. padding: 0 30rpx;
  2038. box-sizing: border-box;
  2039. overflow: hidden;
  2040. background: #fff;
  2041. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2042. position: relative;
  2043. &::after {
  2044. content: "题目";
  2045. min-width: 64rpx;
  2046. height: 36rpx;
  2047. padding: 0 12rpx;
  2048. line-height: 36rpx;
  2049. background: #FF5C03;
  2050. box-sizing: border-box;
  2051. border-radius: 0rpx 0rpx 16rpx 0rpx;
  2052. text-align: center;
  2053. font-family: PingFang SC, PingFang SC;
  2054. font-weight: 500;
  2055. font-size: 20rpx;
  2056. color: #fff;
  2057. position: absolute;
  2058. left: 0;
  2059. top: 0;
  2060. }
  2061. }
  2062. }
  2063. .bg {
  2064. background: #fff !important;
  2065. }
  2066. .timepopbox{
  2067. width: 560rpx;
  2068. padding: 32rpx;
  2069. box-sizing: border-box;
  2070. }
  2071. .answerPopup {
  2072. &-box {
  2073. width: 560rpx;
  2074. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  2075. border-radius: 32rpx 32rpx 32rpx 32rpx;
  2076. background-color: #fff;
  2077. font-weight: 400;
  2078. padding: 32rpx;
  2079. box-sizing: border-box;
  2080. position: relative;
  2081. @include u-flex(column, center, flex-start);
  2082. font-family: PingFang SC, PingFang SC;
  2083. font-weight: 400;
  2084. .tipimg {
  2085. width: 206rpx;
  2086. height: 206rpx;
  2087. margin-bottom: 16rpx;
  2088. }
  2089. }
  2090. &-title {
  2091. font-weight: 600;
  2092. font-size: 36rpx;
  2093. color: #222222;
  2094. }
  2095. &-desc {
  2096. margin-top: 10rpx;
  2097. font-size: 28rpx;
  2098. color: #757575;
  2099. }
  2100. &-btn {
  2101. width: 464rpx;
  2102. height: 84rpx;
  2103. margin-top: 54rpx;
  2104. margin-bottom: 16rpx;
  2105. background: #FF5C03;
  2106. border-radius: 42rpx;
  2107. font-weight: 500;
  2108. font-size: 32rpx;
  2109. color: #FFFFFF;
  2110. text-align: center;
  2111. line-height: 84rpx;
  2112. }
  2113. }
  2114. .popupbox {
  2115. width: 100%;
  2116. background-color: #fff;
  2117. border-radius: 16rpx 16rpx 0 0;
  2118. padding: 24rpx 32rpx;
  2119. position: relative;
  2120. &-head {
  2121. height: 60rpx;
  2122. margin-bottom: 30rpx;
  2123. text-align: center;
  2124. overflow-y: auto;
  2125. color: #414858;
  2126. font-size: 32rpx;
  2127. font-weight: bold;
  2128. position: relative;
  2129. .close-icon {
  2130. position: absolute;
  2131. right: 0;
  2132. top: 0;
  2133. height: 40rpx;
  2134. width: 40rpx;
  2135. }
  2136. }
  2137. &-content {
  2138. height: 20vh;
  2139. overflow-y: auto;
  2140. display: flex;
  2141. align-items: flex-start;
  2142. flex-wrap: wrap;
  2143. gap: 32rpx;
  2144. .line-item {
  2145. display: inline-block;
  2146. min-width: 200rpx;
  2147. min-height: 60rpx;
  2148. padding: 0 20rpx;
  2149. box-sizing: border-box;
  2150. border-radius: 50rpx;
  2151. overflow: hidden;
  2152. background-color: #f7f7f7;
  2153. text-align: center;
  2154. color: #414858;
  2155. font-size: 28rpx;
  2156. line-height: 60rpx;
  2157. }
  2158. .line-active {
  2159. color: #f56c6c !important;
  2160. background-color: #fef0f0 !important;
  2161. }
  2162. }
  2163. }
  2164. .content {
  2165. padding-bottom: calc(var(--window-bottom) + 100rpx);
  2166. .video-box {
  2167. width: 100%;
  2168. height: 420rpx;
  2169. overflow: hidden;
  2170. position: relative;
  2171. #myVideo {
  2172. width: 100%;
  2173. height: 100%;
  2174. }
  2175. }
  2176. .video-poster {
  2177. width: 100%;
  2178. height: 420rpx;
  2179. }
  2180. .miantitlebox {
  2181. padding: 30rpx 0;
  2182. border-bottom: 2rpx solid #F5F7FA;
  2183. font-family: PingFang SC, PingFang SC;
  2184. font-weight: 500;
  2185. font-size: 40rpx;
  2186. color: #222222;
  2187. }
  2188. .subtitlebox {
  2189. padding: 30rpx 0;
  2190. border-bottom: 2rpx solid #F5F7FA;
  2191. font-family: PingFang SC, PingFang SC;
  2192. font-weight: 500;
  2193. font-size: 40rpx;
  2194. color: #222222;
  2195. }
  2196. .title-content {
  2197. padding: 0 32rpx;
  2198. background-color: #fff;
  2199. font-size: 28rpx;
  2200. line-height: 1.6;
  2201. .title {
  2202. font-size: 36rpx;
  2203. font-weight: 500;
  2204. color: #414858;
  2205. }
  2206. .time-or-subtitle {
  2207. margin-top: 12rpx;
  2208. color: #666666;
  2209. }
  2210. }
  2211. .descbox {
  2212. padding: 36rpx 32rpx;
  2213. margin-bottom: 20rpx;
  2214. background-color: #fff;
  2215. font-family: PingFang SC, PingFang SC;
  2216. font-weight: 400;
  2217. font-size: 28rpx;
  2218. color: #222222;
  2219. line-height: 42rpx;
  2220. word-break: break-word;
  2221. &-title {
  2222. margin-bottom: 24rpx;
  2223. font-weight: 500;
  2224. font-size: 32rpx;
  2225. }
  2226. &-info {
  2227. margin-bottom: 24rpx;
  2228. @include u-flex(row, center, space-between);
  2229. font-size: 26rpx;
  2230. color: #757575;
  2231. &-l {
  2232. flex: 1;
  2233. @include u-flex(row, center, flex-start);
  2234. }
  2235. &-time {
  2236. margin-left: 18rpx;
  2237. padding-left: 18rpx;
  2238. position: relative;
  2239. &::after {
  2240. content: "";
  2241. width: 4rpx;
  2242. height: 4rpx;
  2243. background: #999999;
  2244. border-radius: 50%;
  2245. position: absolute;
  2246. left: 0;
  2247. top: 50%;
  2248. transform: translateY(-50%);
  2249. }
  2250. }
  2251. &-r {
  2252. background: transparent;
  2253. }
  2254. }
  2255. &-desc {
  2256. overflow: hidden;
  2257. position: relative;
  2258. }
  2259. }
  2260. .expand {
  2261. flex-shrink: 0;
  2262. @include u-flex(row, center, flex-end);
  2263. color: #FF5C03;
  2264. font-weight: 400;
  2265. font-size: 24rpx;
  2266. image {
  2267. width: 32rpx;
  2268. height: 32rpx;
  2269. }
  2270. }
  2271. .expand-ab {
  2272. position: absolute;
  2273. top: 0;
  2274. right: 0;
  2275. box-shadow: -50rpx 0 20rpx 8rpx #FFFFFF;
  2276. background-color: #fff;
  2277. }
  2278. .ques-content {
  2279. background-color: #fff;
  2280. padding: 40rpx 32rpx;
  2281. box-sizing: border-box;
  2282. font-family: PingFang SC, PingFang SC;
  2283. font-weight: 400;
  2284. font-size: 28rpx;
  2285. color: #222222;
  2286. }
  2287. .ques-content-tit {
  2288. font-family: PingFang SC, PingFang SC;
  2289. font-weight: 600;
  2290. font-size: 36rpx;
  2291. color: #222222;
  2292. }
  2293. .ques-title {
  2294. margin: 48rpx 0 34rpx 0;
  2295. font-weight: 500;
  2296. font-size: 32rpx;
  2297. white-space: normal;
  2298. }
  2299. .ques-type {
  2300. flex-shrink: 0;
  2301. min-width: 72rpx;
  2302. min-height: 40rpx;
  2303. padding: 0 12rpx;
  2304. margin: 0 12rpx;
  2305. box-sizing: border-box;
  2306. background: #FF5C03;
  2307. border-radius: 8rpx 8rpx 8rpx 8rpx;
  2308. line-height: 40rpx;
  2309. text-align: center;
  2310. font-family: PingFang SC, PingFang SC;
  2311. font-weight: 400;
  2312. font-size: 24rpx;
  2313. color: #FFFFFF;
  2314. display: inline-block;
  2315. }
  2316. .ques-option {
  2317. min-height: 88rpx;
  2318. padding: 24rpx 32rpx;
  2319. box-sizing: border-box;
  2320. margin-bottom: 24rpx;
  2321. background: #F5F7FA;
  2322. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2323. display: flex;
  2324. align-items: center;
  2325. &-active {
  2326. color: #FF5C03 !important;
  2327. background: #FCF0E7 !important;
  2328. }
  2329. }
  2330. .video-line {
  2331. min-width: 140rpx;
  2332. max-width: 200rpx;
  2333. height: 60rpx;
  2334. padding: 0 20rpx;
  2335. box-sizing: border-box;
  2336. border-radius: 50rpx 0 0 50rpx;
  2337. overflow: hidden;
  2338. background-color: #fff;
  2339. text-align: center;
  2340. color: #888;
  2341. font-size: 28rpx;
  2342. line-height: 60rpx;
  2343. display: inline-flex;
  2344. align-items: center;
  2345. justify-content: center;
  2346. position: fixed;
  2347. right: 0;
  2348. z-index: 9;
  2349. bottom: calc(var(--window-bottom) + 280rpx);
  2350. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  2351. image {
  2352. flex-shrink: 0;
  2353. height: 30rpx;
  2354. width: 30rpx;
  2355. margin-right: 6rpx;
  2356. }
  2357. }
  2358. .footer {
  2359. border-top: 1rpx solid #ededef;
  2360. background: #fff;
  2361. width: 100%;
  2362. position: fixed;
  2363. bottom: 0;
  2364. padding: 32rpx;
  2365. // padding-bottom: calc(var(--window-bottom) + 14rpx);
  2366. box-sizing: border-box;
  2367. z-index: 0;
  2368. &-btn {
  2369. width: 100%;
  2370. height: 98rpx;
  2371. background: #FF5C03;
  2372. border-radius: 49rpx 49rpx 49rpx 49rpx;
  2373. line-height: 98rpx;
  2374. text-align: center;
  2375. font-family: PingFang SC, PingFang SC;
  2376. font-weight: 600;
  2377. font-size: 32rpx;
  2378. color: #FFFFFF;
  2379. @include u-flex(row, center, center);
  2380. &-img {
  2381. flex-shrink: 0;
  2382. width: 144rpx;
  2383. height: 144rpx;
  2384. margin-right: 8rpx;
  2385. margin-top: -24rpx;
  2386. }
  2387. }
  2388. &-btn-border {
  2389. position: relative;
  2390. &::after {
  2391. content: "";
  2392. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  2393. position: absolute;
  2394. top: -2rpx;
  2395. left: 0;
  2396. height: 103rpx;
  2397. width: 100%;
  2398. z-index: -1;
  2399. border-radius: 49rpx 49rpx 49rpx 49rpx;
  2400. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  2401. overflow: hidden;
  2402. }
  2403. }
  2404. }
  2405. }
  2406. .agreement {
  2407. display: inline-flex;
  2408. margin-top: 16rpx;
  2409. font-size: 24rpx;
  2410. color: #525252;
  2411. align-items: center;
  2412. justify-content: center;
  2413. }
  2414. .nocourse {
  2415. display: flex;
  2416. flex-direction: column;
  2417. align-items: center;
  2418. padding-bottom: 88rpx;
  2419. justify-content: center;
  2420. font-family: PingFang SC, PingFang SC;
  2421. font-weight: 400;
  2422. font-size: 32rpx;
  2423. color: #757575;
  2424. line-height: 48rpx;
  2425. text-align: center;
  2426. image {
  2427. width: 328rpx;
  2428. height: auto;
  2429. margin-bottom: 30rpx;
  2430. }
  2431. }
  2432. .logo {
  2433. display: inline-block;
  2434. width: 30px;
  2435. height: auto;
  2436. margin: 20px 0 0 10px;
  2437. pointer-events: none;
  2438. object-fit: cover;
  2439. }
  2440. .logo-full {
  2441. display: inline-block;
  2442. width: 40px;
  2443. height: auto;
  2444. margin: 50px 0 0 30px;
  2445. pointer-events: none;
  2446. object-fit: cover;
  2447. }
  2448. </style>