videovip.vue 61 KB

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