videovip.vue 64 KB

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