videovip.vue 63 KB

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