videovip.vue 62 KB

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