videovip.vue 63 KB

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