videovip.vue 64 KB

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