videovip.vue 63 KB

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