videovip.vue 62 KB

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