videovipolds.vue 65 KB

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