videovip.vue 62 KB

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