videovip.vue 64 KB

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