videovip.vue 64 KB

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