videovip.vue 57 KB

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