videovip.vue 62 KB

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