videovip.vue 62 KB

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