videovip.vue 65 KB

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