videovip.vue 62 KB

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