videovip.vue 64 KB

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