videovip.vue 63 KB

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