videovip.vue 57 KB

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