videovip.vue 62 KB

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