videovip.vue 63 KB

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