videoNew.vue 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021
  1. <template>
  2. <view class="content">
  3. <view class="header-nav" :style="{height: `calc(88rpx + ${statusBarHeight}px)`,paddingTop: statusBarHeight + 'px'}">
  4. <view class="header-title" :style="{width:menuButtonLeft + 'px',height:menuButtonH+'px',lineHeight:menuButtonH+'px'}">{{courseInfo.title}}</view>
  5. </view>
  6. <view class="video-box">
  7. <image v-if="!isLogin || isAddKf!=1" class="video-poster" :src="courseInfo.imgUrl" mode="aspectFill">
  8. </image>
  9. <video
  10. @timeupdate="onTimeUpdate"
  11. @progress="progressChange"
  12. @error="videoErrorCallback"
  13. @play="getPlay"
  14. @pause="getPause"
  15. @ended="getEnded"
  16. @fullscreenchange="fullscreenchange"
  17. @controlstoggle="controlstoggle"
  18. @waiting="getWaiting"
  19. :title="courseInfo.title"
  20. style="width: 100%;height: 420rpx;"
  21. :poster="poster"
  22. id="video-content-box"
  23. controls
  24. :show-fullscreen-btn="true"
  25. :auto-pause-if-open-native="true"
  26. :auto-pause-if-navigate="true"
  27. :enable-progress-gesture="false"
  28. :show-progress="true"
  29. :picture-in-picture-mode="[]"
  30. :show-background-playback-button="false"
  31. :src="videoUrl"
  32. >
  33. <!-- :danmu-list="danmuList"
  34. enable-danmu
  35. danmu-btn -->
  36. <!-- 弹幕展示 -->
  37. <template v-if="showDanmu==1&&openCommentStatus==2">
  38. <text v-for="(item, index) in activeDanmus" :key="item.commentId" class="danmu-item danmuMove"
  39. :style="{
  40. top: item.top + 'px',
  41. ...item.style,
  42. 'animation-duration': '8s'
  43. }" @animationend="animationend(item,index)">
  44. {{ item.content }}
  45. </text>
  46. </template>
  47. <cover-view class="video-danmu-btnbox" :style="{display: openCommentStatus==2&&isfull&&crtShow&&isLogin&&isAddKf==1 ? 'block':'none'}">
  48. <cover-image class="video-danmu-image" src="/static/images/danmu_set.png" @click="openDanmu(1)"></cover-image>
  49. </cover-view>
  50. </video>
  51. </view>
  52. <!-- 弹幕方法 -->
  53. <commentBox
  54. v-if="openCommentStatus==2"
  55. ref="danmuBox"
  56. :height="height"
  57. :urlOption="urlOption"
  58. :time="playTime"
  59. :showDanmu="showDanmu"
  60. :viewCommentNum="viewCommentNum"
  61. :openCommentStatus="openCommentStatus"
  62. @setInputText="setInputText"
  63. @getScrollTop="getScrollTop"
  64. @getMore="getMore"
  65. @getActiveDanmus="getActiveDanmus"></commentBox>
  66. <view id="title-contentnav">
  67. <view class="title-content" v-if="openCommentStatus!=1">
  68. <!-- 答题时展示小节课程名,其他展示课程名 -->
  69. <!-- 小节课程名 -->
  70. <view class="subtitlebox" v-if="isLogin&&isAddKf==1">
  71. {{courseInfo.title}}
  72. </view>
  73. <!-- 课程名字 -->
  74. <view class="miantitlebox" v-else>
  75. {{courseInfo.courseName}}
  76. </view>
  77. <!-- 投诉 -->
  78. <view class="warning" @click="feedback">
  79. <image src="/static/images/warning.png"></image>
  80. <text>投诉</text>
  81. </view>
  82. </view>
  83. <view class="tabbox-bar" v-if="openCommentStatus==1">
  84. <view class="tabbox">
  85. <view :class="currentTab == nav.id ? 'tabbox-active':''" v-for="nav in navList" :key="nav.id" @click="handleTab(nav.id)">{{nav.name}}</view>
  86. </view>
  87. <!-- 投诉 -->
  88. <view class="warning" @click="feedback">
  89. <image src="/static/images/warning.png"></image>
  90. <text>投诉</text>
  91. </view>
  92. </view>
  93. </view>
  94. <scroll-view
  95. class="scroll-view"
  96. :style="{height: height}"
  97. :scroll-top="scrollTop"
  98. :scroll-y="true"
  99. :refresher-enabled="currentTab == 2"
  100. :refresher-triggered="triggered"
  101. @refresherrefresh="handleRefresher">
  102. <template v-if="openCommentStatus==1">
  103. <view v-show="currentTab==0">
  104. <descInfoNav ref="descInfoNav" :isLogin="isLogin" :isAddKf="isAddKf" :courseInfo="courseInfo"></descInfoNav>
  105. </view>
  106. <view v-show="currentTab==2">
  107. <commentBox
  108. ref="commentBox"
  109. :height="height"
  110. :urlOption="urlOption"
  111. :time="playTime"
  112. :flagTime="flagTime"
  113. :showDanmu="showDanmu"
  114. :viewCommentNum="viewCommentNum"
  115. :openCommentStatus="openCommentStatus"
  116. @setInputText="setInputText"
  117. @getScrollTop="getScrollTop"
  118. @getMore="getMore"></commentBox>
  119. </view>
  120. </template>
  121. <view v-show="currentTab==1">
  122. <template v-if="openCommentStatus!=1">
  123. <!-- 介绍 -->
  124. <descInfo ref="descInfo" :isLogin="isLogin" :isAddKf="isAddKf" :courseInfo="courseInfo"></descInfo>
  125. </template>
  126. <!-- 问题 -->
  127. <template v-if="isLogin&&isAddKf==1">
  128. <ques ref="ques" :quesList="quesList" :openCommentStatus="openCommentStatus" @handleAnswer="handleAnswer"></ques>
  129. </template>
  130. </view>
  131. </scroll-view>
  132. <!-- 线路 -->
  133. <view class="video-line" v-if="isLogin&&isAddKf==1" @click="openPop">
  134. <image :src="baseUrl+'/images/changePlayer-icon.png'"></image>
  135. <text>线路{{numberToChinese(lineIndex + 1)}}</text>
  136. </view>
  137. <!-- 线路弹窗 -->
  138. <uni-popup ref="popup" type="bottom" class="full-width-popup">
  139. <view class="popupbox">
  140. <view class="popupbox-head">
  141. <text>线路选择</text>
  142. <image class="close-icon" :src="baseUrl+'/images/tc_close_icon.png'" mode="aspectFill" @click="close">
  143. </image>
  144. </view>
  145. <view class="popupbox-content">
  146. <view :class="lineIndex == index ? 'line-item line-active': 'line-item'"
  147. v-for="(it,index) in lineList" :key="index" @click="handleLine(index)">
  148. 线路{{numberToChinese(lineIndex + 1)}}</view>
  149. </view>
  150. </view>
  151. </uni-popup>
  152. <!-- 发送弹幕 -->
  153. <view class="video-line danmu-line" v-if="isLogin&&isAddKf==1&&openCommentStatus==2" @click="openDanmu(0)" >
  154. <image class="set_image" src="/static/images/danmu_set_black.png" mode="aspectFill"></image>
  155. <text>发弹幕</text>
  156. </view>
  157. <!-- 发送弹幕弹窗 -->
  158. <uni-popup ref="danmuPopup" type="bottom" style="z-index: 999;" @change="changeShowPopup">
  159. <view class="danmuPopup" :style="{marginLeft:isfull ? statusBarHeight+'px': 0,marginBottom: danmuboxHeight+'px'}">
  160. <view class="danmuPopup-head border-line">
  161. <image class="danmu-icon" :src="showDanmu==0?'/static/images/danmu-off.png':'/static/images/danmu-on.png'" mode="heightFix" @click="switchDanmu()"></image>
  162. <view class="u-border">
  163. <input
  164. class="danmuPopup-input"
  165. placeholder="发个弹幕吧~"
  166. border="border"
  167. :focus="focus"
  168. :adjustPosition="false"
  169. :autoBlur="true"
  170. maxlength="50"
  171. v-model.trim="inputText">
  172. </input>
  173. <text style="font-size: 24rpx;color: #bbb;margin-left: 10rpx;">{{inputText?inputText.trim().length:0}}/50</text>
  174. </view>
  175. <button class="danmuPopup-send" @click="handleChatInput">发送</button>
  176. </view>
  177. </view>
  178. </uni-popup>
  179. <!-- 答题弹窗 -->
  180. <uni-popup ref="answerPopup" type="center" :show="answerPopup">
  181. <view :class="errTitle == '恭喜你,回答正确' ? 'answerPopup-box bg':'answerPopup-box'">
  182. <!-- 正确 -->
  183. <image class="tipimg" v-if="errTitle == '恭喜你,回答正确'" :src="baseUrl+'/images/course_answer_img.png'"
  184. mode="aspectFill"></image>
  185. <!-- 错误 -->
  186. <image class="tipimg" v-else :src="baseUrl+'/images/course_answer_incorrectly_img.png'" mode="aspectFill">
  187. </image>
  188. <view class="answerPopup-title">{{errTitle}}</view>
  189. <view class="answerPopup-desc" v-html="errDesc"></view>
  190. <!-- 选择奖励 -->
  191. <view class="reward-list" v-if="errTitle == '恭喜你,回答正确'">
  192. <radio-group class="reward-list-group" @change="rewardChange">
  193. <label class="reward-list-option" v-for="(item, index) in rewardType" :key="item.value">
  194. <radio :value="item.value+ ''" :checked="item.value == currentReward"
  195. activeBorderColor="#FF5C03" activeBackgroundColor="#FF5C03"
  196. style="transform:scale(0.7)" />
  197. <view :style="{color: item.value == currentReward ? '#FF5C03':''}">{{item.name}}</view>
  198. </label>
  199. </radio-group>
  200. </view>
  201. <!-- 错误题目 -->
  202. <view class="errQuesbox" v-if="errQues&&errQues.length>0">
  203. <view class="errQuesbox-item textOne" v-for="(it,index) in errQues" :key="index">{{it.title}}</view>
  204. </view>
  205. <view class="answerPopup-btn" v-if="errTitle == '恭喜你,回答正确'" @click="closeAnswerPopup">确认</view>
  206. <view class="tipsPopup-btn-box" v-else
  207. :style="{marginTop: errQues&&errQues.length>0 ? '40rpx':'54rpx'}">
  208. <view class="tipsPopup-btn" @click="closeAnswerPopup">{{remain > 0 ? '重新答题': '确认'}}</view>
  209. </view>
  210. </view>
  211. </uni-popup>
  212. <!-- 客服二维码弹窗 -->
  213. <uni-popup ref="kfPopup" type="center" :mask-click="false">
  214. <view class="kfqrcode-box">
  215. <image class="kfqrcode" :src="qrcode" show-menu-by-longpress="true"></image>
  216. <view v-show="qrcodeMsg" style="margin-top: 30rpx;" v-html="qrcodeMsg"></view>
  217. <image class="kfqrcode-close" :src="baseUrl+'/images/course_close_white_icon.png'" mode="aspectFill"
  218. @click="closeKFPop"></image>
  219. </view>
  220. </uni-popup>
  221. <!-- 可以答题提示 -->
  222. <view class="answerTip" v-if="currentTab!=1&&openCommentStatus==1&&showAnswerTip" @click="handleTab(1)">
  223. 可以答题啦
  224. </view>
  225. <!-- footer -->
  226. <view class="footer" v-show="currentTab!=2&&videoId">
  227. <view class="footer-btn" v-if="!isLogin || isAddKf !=1" @click="submit">
  228. <text>立即学习</text>
  229. </view>
  230. <view v-if="isLogin&&isAddKf==1&&currentTab==1&&quesList&&quesList.length>0" class="footer-btn footer-btn-border" @click="submit">
  231. <image class="footer-btn-img" :src="baseUrl+'/images/red_envelope_btnimg.png'" mode="aspectFill"></image>
  232. <text>提交答案领取奖励</text>
  233. </view>
  234. <!-- <view @click="checked=!checked" class="agreement" v-if="!isLogin">
  235. <radio value="r1" :checked="checked" color="#ff5c03" activeBorderColor="#ff5c03"
  236. style="transform:scale(0.6);" />
  237. <view>阅读并同意<text style="color: #ff5c03;" @click.stop="goWeb(0)">《用户协议》</text>和<text
  238. style="color: #ff5c03;" @click.stop="goWeb(1)">《隐私协议》</text></view>
  239. </view> -->
  240. <view class="footer-tips">重庆云联融智提供技术支持</view>
  241. </view>
  242. <view v-show="currentTab==2">
  243. <view class="chatinput" :style="{bottom:danmuboxHeight>0?danmuboxHeight+'px':'calc(var(--window-bottom) + 24rpx)'}">
  244. <input class="uni-input" v-model.trim="inputText" :adjustPosition="false" :autoBlur="false" maxlength="140" placeholder="发消息···" confirm-type="send" @confirm="handleChatInput" />
  245. <button class="send" @click="handleChatInput">发送</button>
  246. </view>
  247. </view>
  248. </view>
  249. </template>
  250. <script>
  251. import {TOKEN_KEY} from '@/utils/common.js'
  252. import ques from "./components/ques.vue"
  253. import descInfo from "./components/descInfo.vue"
  254. import descInfoNav from "./components/descInfoNav.vue"
  255. import commentBox from "./components/commentBox.vue"
  256. import { generateRandomString } from "@/utils/common.js"
  257. import dayjs from 'dayjs';
  258. import {
  259. getErrMsg,
  260. getH5CourseByVideoId,
  261. getH5CourseVideoDetails,
  262. courseAnswer,
  263. getFinishCourseVideo,
  264. getIsAddKf,
  265. getInternetTraffic,
  266. getIntegralByH5Video,
  267. sendReward,
  268. loginByMp,
  269. getRealLink,
  270. errorLogUpload,
  271. } from "@/api/course.js"
  272. export default {
  273. components: {
  274. descInfoNav,
  275. descInfo,
  276. commentBox,
  277. ques,
  278. },
  279. data() {
  280. return {
  281. baseUrl:uni.getStorageSync('requestPath'),
  282. // 1 红包 2 积分
  283. rewardType: [{
  284. name: '红包奖励',
  285. value: 1
  286. }, {
  287. name: '积分奖励',
  288. value: 2
  289. }],
  290. currentReward: 1,
  291. player: null,
  292. loading: true,
  293. progress: 0,
  294. code: null,
  295. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  296. scrollTop: 0,
  297. height: '0px',
  298. isLogin: true,
  299. videoUrl: "",
  300. videoId: "",
  301. //现在的时长
  302. playTime: 0,
  303. //总时长
  304. duration: 0,
  305. playDuration: 0,
  306. // 用于续播
  307. playDurationSeek: 0,
  308. // 温馨提醒时间节点,
  309. tipsTime: 0,
  310. tipsOpen: false,
  311. config: {},
  312. courseInfo: {},
  313. quesList: [],
  314. lineList: [],
  315. // 错题
  316. errQues: [],
  317. // 答题机会
  318. remain: 0,
  319. errTitle: "",
  320. errDesc: "",
  321. showPlay: true,
  322. showControls: false,
  323. playStatus: "",
  324. isfull: false,
  325. isAddKf: 0,
  326. lineIndex: 0,
  327. textHeight: 0, //文本高度
  328. qwUserId: "",
  329. qrcode: "",
  330. corpId: "",
  331. qrcodeMsg: "",
  332. urlOption: {},
  333. bufferRate: 0, // 缓冲时间
  334. uuId: "",
  335. isEnded: false,
  336. // 是否允许拖动进度条
  337. linkType: 0,
  338. ip: null,
  339. checked: true,
  340. isFinish: 0, // 是否完课
  341. interval: null,
  342. intervalIntegral: null, // 积分定时
  343. options: {
  344. sources: [{
  345. src: ""
  346. }],
  347. poster: "",
  348. live: false /* 是否直播 */ ,
  349. controls: true,
  350. autoplay: false,
  351. licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
  352. LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
  353. controlBar: {
  354. volumePanel: false,
  355. playbackRateMenuButton: false,
  356. QualitySwitcherMenuButton: false,
  357. // progressControl: false
  358. },
  359. plugins: {
  360. // ProgressMarker: false,
  361. ContextMenu: {
  362. statistic: false
  363. }
  364. },
  365. },
  366. poster: "",
  367. // 错误请求次数
  368. errorCount: 0,
  369. answerPopup: false,
  370. sortLink:"",
  371. // 课程是否过期
  372. isExpire: false,
  373. menuButtonLeft: 281,
  374. menuButtonH: 45,
  375. timer: null,
  376. flag: false,
  377. focus: false,
  378. openDanmuType: 0,
  379. danmuboxHeight: 0,
  380. user: {},
  381. crtShow: true,
  382. courseLogo: '',
  383. isfull: false,
  384. navList:[{
  385. id: 0,
  386. name: '介绍'
  387. },{
  388. id: 1,
  389. name: '答题'
  390. },{
  391. id: 2,
  392. name: '评论'
  393. }],
  394. currentTab: 1,
  395. triggered: false,
  396. // 没有更多
  397. isMore: false,
  398. inputText:"",
  399. // 获取最多历史评论条数
  400. viewCommentNum: 200,
  401. // 1-开启评论;2-开启弹幕;3-关闭
  402. openCommentStatus: 3,
  403. showAnswerTip: false,
  404. showDanmu: 1,
  405. activeDanmus:[],
  406. flagTime: 0
  407. }
  408. },
  409. onLoad(option) {
  410. this.code = option.code
  411. this.urlOption = option.course ? JSON.parse(option.course) : {}
  412. this.videoId = this.urlOption.videoId || ''
  413. this.qwUserId = this.urlOption.qwUserId || ''
  414. this.corpId = this.urlOption.corpId || ''
  415. this.linkType = this.urlOption.linkType || 0
  416. // if (this.code) {
  417. // this.loginByMp()
  418. // }
  419. var that=this;
  420. if (this.videoId) {
  421. this.getH5CourseByVideo()
  422. }
  423. this.sortLink = this.urlOption.link || ''
  424. this.getMenuButton()
  425. // #ifndef H5
  426. uni.onKeyboardHeightChange(this.keyboardHeightChange);
  427. // #endif
  428. },
  429. onShow() {
  430. this.tipsOpen = false
  431. // this.isLogin = this.$isLoginCourse()
  432. this.uuId = generateRandomString(16)
  433. if(uni.getStorageSync('userInfo') && JSON.stringify(uni.getStorageSync('userInfo'))!='{}') {
  434. this.user = JSON.parse(uni.getStorageSync('userInfo'))
  435. } else {
  436. this.user = {}
  437. }
  438. if(this.sortLink){
  439. this.getLink()
  440. } else {
  441. uni.showToast({
  442. title: 'sortLink is not found',
  443. icon: 'none'
  444. });
  445. }
  446. },
  447. mounted() {
  448. this.getIP()
  449. this.getHeight()
  450. },
  451. onHide() {
  452. // this.player = uni.createVideoContext('video-content-box');
  453. if (this.player) {
  454. this.player.pause()
  455. }
  456. this.getFinishCourseVideo()
  457. this.getInternetTraffic()
  458. // if (this.interval != null) {
  459. // clearInterval(this.interval)
  460. // this.interval = null
  461. // }
  462. },
  463. onUnload() {
  464. if (this.interval != null) {
  465. clearInterval(this.interval)
  466. this.interval = null
  467. }
  468. this.getFinishCourseVideo()
  469. this.getInternetTraffic()
  470. this.clearIntegral()
  471. // #ifndef H5
  472. uni.offKeyboardHeightChange(this.keyboardHeightChange);
  473. // #endif
  474. },
  475. beforeDestroy() {
  476. this.player = uni.createVideoContext('video-content-box');
  477. if (this.player) {
  478. this.player.stop()
  479. this.player = null
  480. }
  481. if (this.interval != null) {
  482. clearInterval(this.interval)
  483. this.interval = null
  484. }
  485. this.clearIntegral()
  486. // #ifndef H5
  487. uni.offKeyboardHeightChange(this.keyboardHeightChange);
  488. // #endif
  489. },
  490. methods: {
  491. numberToChinese(number) {
  492. if (number) {
  493. const chineseNumber = ['一', '二', '三', '四', '五', '六', '七', '八', '九'];
  494. return chineseNumber[number - 1];
  495. } else {
  496. return ''
  497. }
  498. },
  499. keyboardHeightChange(res) {
  500. // #ifndef H5
  501. console.log("this.danmuboxHeight",this.danmuboxHeight)
  502. this.danmuboxHeight = res.height
  503. // #endif
  504. },
  505. getMenuButton(){
  506. const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  507. this.menuButtonLeft = menuButtonInfo.left
  508. this.menuButtonH = menuButtonInfo.height
  509. },
  510. //播放时间更新事件方法
  511. onTimeUpdate(e){
  512. let currentTime = Math.round(e.detail.currentTime)
  513. if (this.playDurationSeek > 0) {
  514. this.playTime = this.playDurationSeek
  515. this.throttle(() => this.changeTime(this), 1000, false)
  516. } else {
  517. if (this.linkType != 1 && (currentTime - this.playTime > 3 || currentTime - this.playTime < -3)&&this.isFinish!=1) {
  518. uni.showToast({
  519. title: '不能快进哦',
  520. icon: 'none',
  521. });
  522. currentTime = this.playTime
  523. this.player.seek(this.playTime);
  524. }
  525. this.playTime = currentTime
  526. }
  527. if(this.isEnded||this.playTime >= this.duration - 60) {
  528. this.showAnswerTip = true
  529. } else {
  530. this.showAnswerTip = false
  531. }
  532. if (Math.floor(e.detail.currentTime) != this.flagTime &&this.openCommentStatus == 2) {
  533. this.flagTime = Math.floor(e.detail.currentTime)
  534. this.$refs.danmuBox&&this.$refs.danmuBox.checkDanmu(this.flagTime)
  535. }
  536. },
  537. changeTime(that,e) {
  538. that.playDurationSeek = 0
  539. },
  540. videoErrorCallback(e) {
  541. this.errorCount++
  542. if (this.errorCount > 3) return
  543. if (this.interval != null) {
  544. clearInterval(this.interval)
  545. }
  546. this.clearIntegral()
  547. console.log(e)
  548. this.getErrMsg(e.target.errMsg)
  549. this.getH5CourseVideoDetails('error')
  550. },
  551. // 当开始/继续播放时触发play事件
  552. getPlay() {
  553. this.errorCount = 0
  554. this.judgeDuration()
  555. },
  556. getPause() {
  557. this.clearIntegral()
  558. },
  559. getEnded() {
  560. this.clearIntegral()
  561. this.isEnded = true
  562. this.showAnswerTip = true
  563. this.getFinishCourseVideo()
  564. },
  565. getWaiting() {
  566. this.getErrMsg('','waiting')
  567. },
  568. fullscreenchange(event) {
  569. this.isfull = event.detail.fullScreen
  570. if(this.isfull) {
  571. this.$refs.danmuBox&&this.$refs.danmuBox.initTracks()
  572. }
  573. },
  574. controlstoggle(event) {
  575. this.crtShow = event.detail.show
  576. },
  577. getIP() {
  578. uni.request({
  579. url: 'https://ipinfo.io/json', //仅为示例,并非真实接口地址。
  580. method: 'GET',
  581. success: (res) => {
  582. this.ip = res.data.ip
  583. }
  584. });
  585. },
  586. getHeight() {
  587. setTimeout(()=>{
  588. const query = uni.createSelectorQuery().in(this);
  589. query
  590. .select("#title-contentnav")
  591. .boundingClientRect((data) => {
  592. if(data) {
  593. this.height =
  594. `calc(100vh - ${data.height}px - 420rpx - ${this.statusBarHeight}px - 100px - 88rpx)`
  595. }
  596. })
  597. .exec();
  598. },200)
  599. },
  600. numberToLetter(num) {
  601. // 将数字转换为字母的 ASCII 码
  602. let letterCode = num + 65;
  603. // 将 ASCII 码转换为大写字母
  604. let letter = String.fromCharCode(letterCode);
  605. return letter;
  606. },
  607. updateTime() {
  608. var that = this;
  609. if (this.interval != null) {
  610. clearInterval(this.interval)
  611. }
  612. this.interval = setInterval(function() {
  613. that.getFinishCourseVideo()
  614. that.getInternetTraffic()
  615. }, 60000);
  616. },
  617. judgeDuration() {
  618. var that = this;
  619. if (this.intervalIntegral != null) {
  620. clearInterval(this.intervalIntegral)
  621. this.intervalIntegral = null
  622. }
  623. // 观看10分钟获得积分
  624. this.intervalIntegral = setInterval(function() {
  625. that.getIntegralByH5Video()
  626. }, 600000);
  627. },
  628. clearIntegral() {
  629. if (this.intervalIntegral != null) {
  630. clearInterval(this.intervalIntegral)
  631. this.intervalIntegral = null
  632. }
  633. },
  634. getH5CourseByVideo() {
  635. this.loading = true
  636. getH5CourseByVideoId({
  637. videoId: this.videoId
  638. }).then(res => {
  639. this.loading = false
  640. if (res.code == 200) {
  641. this.courseInfo = res.data
  642. uni.setNavigationBarTitle({
  643. title: this.courseInfo && this.courseInfo.title ? this.courseInfo.title : ''
  644. });
  645. }
  646. this.getHeight()
  647. this.$nextTick(()=>{
  648. this.$refs.descInfo&&this.$refs.descInfo.getDescHeight()
  649. this.$refs.descInfoNav&&this.$refs.descInfoNav.getDescHeight()
  650. })
  651. },
  652. rej => {
  653. this.loading = false
  654. }
  655. ).catch(() => {
  656. this.loading = false
  657. })
  658. },
  659. getH5CourseVideoDetails(type) {
  660. getH5CourseVideoDetails(this.urlOption).then(res => {
  661. if (res.code == 200) {
  662. this.config = res.config || {}
  663. this.isFinish = res.isFinish || 0
  664. this.duration = res.course && res.course.duration ? res.course.duration : 0
  665. this.playDuration = res.playDuration || 0
  666. this.playDurationSeek = res.playDuration || 0
  667. this.tipsTime = res.tipsTime || 0
  668. let lineList = []
  669. if (res.course && res.course.lineOne) {
  670. lineList.push(res.course.lineOne)
  671. }
  672. if (res.course && res.course.lineTwo) {
  673. lineList.push(res.course.lineTwo)
  674. }
  675. if (res.course && res.course.lineThree) {
  676. lineList.push(res.course.lineThree)
  677. }
  678. this.lineList = lineList
  679. this.courseLogo = res.config&&res.config.courseLogo
  680. this.viewCommentNum = res.config&&res.config.viewCommentNum || 200
  681. if(this.openCommentStatus == 3) {
  682. this.$refs.commentBox&&this.$refs.commentBox.closeWSocket()
  683. this.$refs.danmuBox&&this.$refs.danmuBox.closeWSocket()
  684. }
  685. const status = res.config&&res.config.openCommentStatus || 3
  686. if(status != this.openCommentStatus) {
  687. this.openCommentStatus = status
  688. }
  689. if(this.openCommentStatus==1) {
  690. this.currentTab = 0
  691. } else {
  692. this.currentTab = 1
  693. }
  694. if(this.openCommentStatus!=2 || this.showDanmu!=1) {
  695. this.activeDanmus = []
  696. }
  697. if (!this.player || type == 'error') {
  698. this.lineIndex = this.config.defaultLine
  699. this.videoUrl = lineList[this.lineIndex]
  700. this.poster= res.course && res.course.imgUrl ? res.course.imgUrl : ''
  701. // this.options.sources = [{
  702. // src: this.videoUrl
  703. // }]
  704. // this.options.poster = res.course && res.course.imgUrl ? res.course.imgUrl : ''
  705. // this.initVideo()
  706. this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
  707. setTimeout(()=>{
  708. this.player = uni.createVideoContext('video-content-box');
  709. this.player.seek(this.playTime)
  710. this.player.play();
  711. },500);
  712. } else {
  713. // let div = document.querySelector(".vjs-progress-control");
  714. // if(div) {
  715. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  716. // div.style.pointerEvents = "auto";
  717. // } else {
  718. // div.style.pointerEvents = "none"; //禁止所有事件
  719. // }
  720. // }
  721. this.playTime = this.playTime > this.playDuration ? this.playTime : this.playDuration >= this.duration ? 0 : this.playDuration
  722. this.player.seek(this.playTime)
  723. this.player.play();
  724. }
  725. this.updateTime();
  726. this.quesList = res.questions && res.questions.length > 0 ? res.questions : [],
  727. this.quesList = this.quesList.map(item => ({
  728. ...item,
  729. questionOption: JSON.parse(item.question),
  730. answer: ''
  731. }))
  732. }
  733. this.getHeight()
  734. this.$nextTick(()=>{
  735. this.$refs.descInfo&&this.$refs.descInfo.getDescHeight()
  736. this.$refs.descInfoNav&&this.$refs.descInfoNav.getDescHeight()
  737. })
  738. },
  739. rej => {}
  740. )
  741. },
  742. handleAnswer(val) {
  743. let {item, option} = val
  744. let time = this.playTime
  745. if(this.isEnded) {
  746. time = this.duration
  747. } else {
  748. if(time < this.playDuration&&this.isFinish!=1) {
  749. // 没完课且小于续播的时间
  750. time = this.playDuration
  751. }
  752. }
  753. if(Number(this.duration || 0) == 0 || time < this.duration - 60) {
  754. uni.showToast({
  755. title: "请先观看完整课程再答题哦~",
  756. icon: "none"
  757. })
  758. return
  759. }
  760. if (item.type == 1) {
  761. // 单选option
  762. item.answer = option.name
  763. } else if (item.type == 2) {
  764. // 多选
  765. let answer = item.answer ? item.answer.split(',') : []
  766. if (answer.indexOf(option.name) === -1) {
  767. answer.push(option.name)
  768. item.answer = answer.join(',')
  769. } else {
  770. answer.splice(answer.indexOf(option.name), 1)
  771. item.answer = answer.join(',')
  772. }
  773. }
  774. },
  775. submit() {
  776. if(this.isExpire){
  777. uni.showToast({
  778. title: '课程已过期或链接无效',
  779. icon: 'none'
  780. });
  781. return
  782. }
  783. // 登录
  784. this.$isLoginCourse().then(
  785. res => {
  786. if(res){
  787. if (this.isAddKf == 1) {
  788. // 答题
  789. // 您已提交过答案,请领取红包
  790. this.courseAnswer()
  791. } else {
  792. // 添加客服
  793. if (this.videoId && this.qwUserId) {
  794. this.getIsAddKf()
  795. } else {
  796. uni.showToast({
  797. title: '请添加客服',
  798. icon: 'none'
  799. })
  800. }
  801. }
  802. } else{
  803. this.goLogin()
  804. }
  805. },
  806. rej => {}
  807. );
  808. },
  809. // 答题
  810. courseAnswer() {
  811. let time = this.playTime
  812. if (this.isEnded) {
  813. time = this.duration
  814. } else {
  815. if (time < this.playDuration && this.isFinish != 1) {
  816. // 没完课且小于续播的时间
  817. time = this.playDuration
  818. }
  819. }
  820. if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
  821. uni.showToast({
  822. title: "请先观看完整课程再答题哦~",
  823. icon: "none"
  824. })
  825. return
  826. }
  827. if (this.quesList.some(item => !item.answer)) {
  828. uni.showToast({
  829. title: "请确认是否答完所有题目",
  830. icon: "none"
  831. })
  832. return
  833. }
  834. const questions = this.quesList.map(obj => {
  835. const {
  836. questionOption,
  837. ...rest
  838. } = obj;
  839. return rest;
  840. });
  841. const param = {
  842. ...this.urlOption,
  843. questions: questions,
  844. videoId: this.videoId,
  845. duration: this.playTime,
  846. }
  847. this.errTitle = ""
  848. this.errDesc = ""
  849. this.errQues = []
  850. courseAnswer(param).then(res => {
  851. if (res.code == 200) {
  852. if (res.incorrectQuestions) {
  853. // 答题失败
  854. if (res.incorrectQuestions.length > 0) {
  855. this.errQues = res.incorrectQuestions
  856. }
  857. this.remain = res.remain || 0
  858. if (res.remain > 0) {
  859. this.errTitle = "很遗憾答错了"
  860. this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
  861. this.$refs.answerPopup.open("center")
  862. }
  863. } else {
  864. // 答题成功
  865. this.errTitle = "恭喜你,回答正确"
  866. this.errDesc = `请选择奖励`
  867. this.$refs.answerPopup.open("center")
  868. }
  869. } else {
  870. if (res.msg == "该课题到达答错次数限制") {
  871. this.errTitle = "答题次数超过限制"
  872. this.errDesc = "以后的课程要认真学习哦"
  873. this.$refs.answerPopup.open("center")
  874. } else {
  875. uni.showToast({
  876. title: res.msg,
  877. icon: "none"
  878. })
  879. }
  880. }
  881. },
  882. rej => {}
  883. )
  884. },
  885. // 选择
  886. rewardChange(e) {
  887. this.currentReward = e.detail.value
  888. },
  889. closeAnswerPopup() {
  890. this.$refs.answerPopup.close()
  891. if (this.errTitle == '恭喜你,回答正确') {
  892. const param = {
  893. ...this.urlOption,
  894. rewardType: Number(this.currentReward),
  895. source: 2
  896. }
  897. sendReward(param).then(res => {
  898. uni.showToast({
  899. title: res.msg,
  900. icon: 'none'
  901. })
  902. // if(res.code == 200) {
  903. // //重构 发红包,后台通过OPENID发零钱到 账
  904. // //this.initWXConfig(res.package)
  905. // }else {
  906. // uni.showToast({
  907. // title: res.msg,
  908. // icon: 'none'
  909. // })
  910. // }
  911. })
  912. }
  913. },
  914. // 线路
  915. openPop() {
  916. this.$refs.popup.open('bottom')
  917. },
  918. close() {
  919. this.$refs.popup.close()
  920. },
  921. handleLine(index) {
  922. var that=this;
  923. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  924. this.close()
  925. return
  926. } else {
  927. // let div = document.querySelector(".vjs-progress-control");
  928. // if(div) {
  929. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  930. // div.style.pointerEvents = "auto";
  931. // } else {
  932. // div.style.pointerEvents = "none"; //禁止所有事件
  933. // }
  934. // }
  935. this.lineIndex = index
  936. this.videoUrl = this.lineList[index]
  937. this.tipsOpen = false
  938. this.playDurationSeek = this.playTime || 0
  939. this.player = uni.createVideoContext('video-content-box');
  940. setTimeout(function(){
  941. that.player.seek(that.playDurationSeek)
  942. that.player.play();
  943. },500);
  944. // this.player.src(this.lineList[index])
  945. // this.player.one('loadedmetadata', () => {
  946. // this.player.currentTime(this.playDurationSeek);
  947. // this.player.play();
  948. // });
  949. this.close()
  950. }
  951. },
  952. // 客服
  953. getIsAddKf() {
  954. this.qrcode = ''
  955. this.qrcodeMsg = ''
  956. this.isAddKf = 0
  957. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  958. getIsAddKf(this.urlOption).then(res => {
  959. if (res.code == 200) {
  960. this.isAddKf = 1
  961. this.getH5CourseVideoDetails()
  962. } else if (res.code == 400) {
  963. this.isAddKf = 0
  964. this.qrcode = res.qrcode
  965. this.qrcodeMsg = res.msg
  966. this.$refs.kfPopup.open()
  967. } else if (res.code == 504) {
  968. // 登录
  969. this.goLogin()
  970. } else if (res.code == 566) {
  971. // 官方群发通用链接
  972. const url = res.courseLink.realLink.split('?course=')[1]
  973. this.urlOption = JSON.parse(url)
  974. this.isAddKf = 1
  975. this.getH5CourseVideoDetails()
  976. } else {
  977. this.isAddKf = 0
  978. uni.showToast({
  979. title: res.msg,
  980. icon: 'none'
  981. });
  982. }
  983. },
  984. err => {}
  985. );
  986. },
  987. closeKFPop() {
  988. this.$refs.kfPopup.close()
  989. },
  990. getFinishCourseVideo() {
  991. if (!this.isLogin||!this.playTime || this.isAddKf!=1) return
  992. // {videoId: this.videoId,duration:this.playTime}
  993. const param = {
  994. duration: this.playTime,
  995. ...this.urlOption
  996. }
  997. getFinishCourseVideo(param)
  998. },
  999. // 每十分钟获得积分
  1000. getIntegralByH5Video() {
  1001. if(!this.isLogin||this.isAddKf!=1) return
  1002. const param = {
  1003. duration: this.playTime,
  1004. ...this.urlOption
  1005. }
  1006. getIntegralByH5Video(param).then(res => {
  1007. if (res.code == 200) {
  1008. uni.showToast({
  1009. title: "积分+10",
  1010. icon: "none"
  1011. })
  1012. }
  1013. })
  1014. },
  1015. progressChange(e) {
  1016. this.bufferRate = Math.ceil(e.detail.buffered)
  1017. },
  1018. // 缓冲
  1019. getInternetTraffic() {
  1020. if(!this.isLogin||this.isAddKf!=1) return
  1021. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  1022. if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  1023. this.bufferRate = playVideoTime
  1024. }
  1025. if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  1026. const param = {
  1027. ...this.urlOption,
  1028. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  1029. duration: this.playTime,
  1030. bufferRate: Number(this.bufferRate.toFixed(2)),
  1031. }
  1032. if(!param.bufferRate) return
  1033. getInternetTraffic(param)
  1034. },
  1035. getErrMsg(err,type) {
  1036. let msgerr = {
  1037. errType: type || 'error',
  1038. videoUrl: this.videoUrl,
  1039. lineIndex: this.lineIndex,
  1040. errTime: new Date(),
  1041. ip: this.ip,
  1042. errMsg: err || ''
  1043. }
  1044. getErrMsg({
  1045. msg: JSON.stringify(msgerr)
  1046. })
  1047. },
  1048. goLogin() {
  1049. this.$getProvider().then(provider=>{
  1050. console.log('当前的环境商',provider)
  1051. if (!provider) {
  1052. reject()
  1053. }
  1054. uni.login({
  1055. provider: provider,
  1056. success: async loginRes => {
  1057. console.log(loginRes)
  1058. uni.getUserInfo({
  1059. provider: provider,
  1060. success: (infoRes)=> {
  1061. uni.showToast({
  1062. title: '处理中...',
  1063. icon: 'loading'
  1064. });
  1065. loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv}).then(res=>{
  1066. uni.hideLoading();
  1067. if (res.code == 200) {
  1068. uni.setStorageSync(TOKEN_KEY, res.token);
  1069. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  1070. this.user = res.user
  1071. this.isLogin = true
  1072. this.getIsAddKf()
  1073. } else {
  1074. uni.showToast({
  1075. title: res.msg,
  1076. icon: 'none'
  1077. });
  1078. }
  1079. }).catch(err=>{
  1080. uni.hideLoading();
  1081. uni.showToast({
  1082. icon:'none',
  1083. title: "登录失败,请重新登录",
  1084. });
  1085. });
  1086. }
  1087. });
  1088. }
  1089. })
  1090. }).catch(err => {})
  1091. },
  1092. getLink() {
  1093. let that = this;
  1094. getRealLink({sortLink:this.sortLink}).then(res=>{
  1095. if(res.code == 200) {
  1096. this.isExpire = false
  1097. // 如果响应中包含真实链接,则跳转到真实链接
  1098. // window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
  1099. if (this.isLogin && this.isAddKf == 1) {
  1100. this.getH5CourseVideoDetails()
  1101. }
  1102. if (this.videoId &&this.isAddKf != 1) {
  1103. this.$isLoginCourse().then(
  1104. isLogin => {
  1105. this.isLogin = isLogin
  1106. if(isLogin){
  1107. this.getIsAddKf()
  1108. } else {
  1109. this.goLogin()
  1110. }
  1111. },
  1112. rej => {}
  1113. );
  1114. }
  1115. } else {
  1116. this.isExpire = true
  1117. uni.showToast({
  1118. title: '课程已过期或链接无效',
  1119. icon: 'none'
  1120. });
  1121. }
  1122. }).catch(err=>{
  1123. this.isExpire = true
  1124. uni.showToast({
  1125. title: '发生错误,请稍后再试',
  1126. icon: 'none'
  1127. });
  1128. })
  1129. },
  1130. /**
  1131. * 节流原理:在一定时间内,只能触发一次
  1132. *
  1133. * @param {Function} func 要执行的回调函数
  1134. * @param {Number} wait 延时的时间
  1135. * @param {Boolean} immediate 是否立即执行
  1136. * @return null
  1137. */
  1138. throttle(func, wait = 500, immediate = true) {
  1139. if (immediate) {
  1140. if (!this.flag) {
  1141. this.flag = true
  1142. // 如果是立即执行,则在wait毫秒内开始时执行
  1143. typeof func === 'function' && func()
  1144. this.timer = setTimeout(() => {
  1145. this.flag = false
  1146. }, wait)
  1147. }
  1148. } else if (!this.flag) {
  1149. this.flag = true
  1150. // 如果是非立即执行,则在wait毫秒内的结束处执行
  1151. this.timer = setTimeout(() => {
  1152. this.flag = false
  1153. typeof func === 'function' && func()
  1154. }, wait)
  1155. }
  1156. },
  1157. // 弹幕
  1158. openDanmu(type) {
  1159. this.openDanmuType = type
  1160. this.inputText = ''
  1161. if(type == 1) {
  1162. this.player.exitFullScreen()
  1163. }
  1164. this.$refs.danmuPopup.open()
  1165. },
  1166. changeShowPopup(val) {
  1167. this.focus = val.show
  1168. },
  1169. switchDanmu() {
  1170. this.showDanmu = this.showDanmu == 1 ? 0:1
  1171. if(this.showDanmu == 0&&this.$refs.danmuBox) {
  1172. this.$refs.danmuPopup.close()
  1173. this.activeDanmus = []
  1174. this.$refs.danmuBox.activeDanmus = []
  1175. this.$refs.danmuBox.initTracks()
  1176. }
  1177. },
  1178. getScrollTop(res) {
  1179. console.log(res)
  1180. if(this.currentTab == 2) {
  1181. this.scrollTop = res
  1182. } else {
  1183. this.scrollTop = 0
  1184. }
  1185. },
  1186. handleTab(index) {
  1187. this.currentTab = index
  1188. if(this.currentTab==2) {
  1189. if(this.$refs.commentBox) {
  1190. this.$refs.commentBox.msgs = []
  1191. this.$refs.commentBox.pageNum = 1
  1192. this.$refs.commentBox.getComments()
  1193. }
  1194. } else {
  1195. setTimeout(()=>{
  1196. this.scrollTop = 0
  1197. },100)
  1198. }
  1199. },
  1200. handleRefresher() {
  1201. this.triggered = true;
  1202. if (!this.isMore&&this.currentTab==2&&this.openCommentStatus==1) {
  1203. this.$nextTick(()=>{
  1204. this.$refs.commentBox&&this.$refs.commentBox.getComments()
  1205. })
  1206. }
  1207. setTimeout(() => {
  1208. this.triggered = false;
  1209. }, 500);
  1210. },
  1211. getMore(val) {
  1212. this.triggered = false;
  1213. this.isMore = val == 1
  1214. },
  1215. handleChatInput() {
  1216. this.inputText = this.inputText.trim()
  1217. if (this.inputText == "" || this.inputText.trim() == "") {
  1218. uni.showToast({
  1219. title: '请输入评论',
  1220. icon: "none"
  1221. })
  1222. return;
  1223. }
  1224. if(this.openCommentStatus==1) {
  1225. this.$refs.commentBox&&this.$refs.commentBox.handleInput(this.inputText)
  1226. } else if(this.openCommentStatus==2) {
  1227. this.$refs.danmuBox&&this.$refs.danmuBox.handleInput(this.inputText)
  1228. }
  1229. },
  1230. setInputText() {
  1231. this.inputText = ""
  1232. if(this.openCommentStatus==2) {
  1233. this.$refs.danmuPopup.close()
  1234. }
  1235. },
  1236. getActiveDanmus(val) {
  1237. this.activeDanmus = val
  1238. },
  1239. animationend(moveItem, i) {
  1240. // 移除动画结束的弹幕(性能优化)
  1241. if(this.openCommentStatus==2) {
  1242. this.$refs.danmuBox&&this.$refs.danmuBox.animationend(moveItem, i)
  1243. }
  1244. },
  1245. feedback() {
  1246. const userId = this.user.userId || ''
  1247. const courseId = this.urlOption.courseId || ''
  1248. const videoId = this.urlOption.videoId || ''
  1249. uni.navigateTo({
  1250. url: './feedback?userId='+userId+'&courseId='+courseId+'&videoId='+videoId
  1251. })
  1252. }
  1253. }
  1254. }
  1255. </script>
  1256. <style scoped>
  1257. .full-width-popup {
  1258. width: 100%;
  1259. }
  1260. </style>
  1261. <style lang="scss" scoped>
  1262. @mixin u-flex($flexD, $alignI, $justifyC) {
  1263. display: flex;
  1264. flex-direction: $flexD;
  1265. align-items: $alignI;
  1266. justify-content: $justifyC;
  1267. }
  1268. .footer-tips {
  1269. margin-top: 14rpx;
  1270. text-align: center;
  1271. font-family: PingFang SC,PingFang SC;
  1272. font-weight: 500;
  1273. font-size: 12px;
  1274. color: #bbb;
  1275. }
  1276. .textOne {
  1277. overflow: hidden;
  1278. white-space: nowrap;
  1279. text-overflow: ellipsis;
  1280. }
  1281. .textTwo {
  1282. overflow: hidden;
  1283. text-overflow: ellipsis;
  1284. display: -webkit-box;
  1285. -webkit-line-clamp: 2;
  1286. -webkit-box-orient: vertical;
  1287. }
  1288. .header-nav {
  1289. height: 88rpx;
  1290. @include u-flex(row, center, flex-start);
  1291. overflow: hidden;
  1292. background-color: #fff;
  1293. box-sizing: border-box;
  1294. .header-title {
  1295. text-align: center;
  1296. overflow: hidden;
  1297. white-space: nowrap;
  1298. text-overflow: ellipsis;
  1299. padding: 0 10rpx 0 100rpx;
  1300. font-family: PingFang SC,PingFang SC;
  1301. font-weight: 500;
  1302. font-size: 15px;
  1303. color: #000;
  1304. box-sizing: border-box;
  1305. }
  1306. }
  1307. .reward-list {
  1308. width: 100%;
  1309. margin-top: 20rpx;
  1310. margin-bottom: -40rpx;
  1311. &-group {
  1312. font-family: PingFang SC, PingFang SC;
  1313. font-weight: 400;
  1314. font-size: 14px;
  1315. color: #222222;
  1316. @include u-flex(row, center, center);
  1317. }
  1318. &-option {
  1319. @include u-flex(row, center, flex-start);
  1320. &:first-child {
  1321. margin-right: 40rpx;
  1322. }
  1323. }
  1324. }
  1325. .err {
  1326. color: #f56c6c !important;
  1327. }
  1328. .kfqrcode-box {
  1329. background-color: #fff;
  1330. border-radius: 16rpx;
  1331. max-width: 560rpx;
  1332. padding: 60rpx 40rpx;
  1333. margin-top: -100rpx;
  1334. box-sizing: border-box;
  1335. @include u-flex(column, center, flex-start);
  1336. font-family: PingFang SC, PingFang SC;
  1337. font-weight: 400;
  1338. font-size: 34rpx;
  1339. color: #222;
  1340. position: relative;
  1341. text-align: center;
  1342. .kfqrcode {
  1343. height: 460rpx;
  1344. width: 460rpx;
  1345. }
  1346. }
  1347. .kfqrcode-close {
  1348. width: 64rpx;
  1349. height: 64rpx;
  1350. position: absolute;
  1351. bottom: -100rpx;
  1352. left: 50%;
  1353. transform: translateX(-50%);
  1354. }
  1355. .tipsPopup-mask {
  1356. position: relative;
  1357. width: 560rpx;
  1358. background-color: transparent;
  1359. .red_envelope_top {
  1360. width: 480rpx;
  1361. height: 360rpx;
  1362. margin: 0 auto;
  1363. display: inherit;
  1364. }
  1365. }
  1366. .tipsPopup-btn-box {
  1367. width: 456rpx;
  1368. height: 104rpx;
  1369. padding: 4rpx;
  1370. box-sizing: border-box;
  1371. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  1372. border-radius: 52rpx;
  1373. }
  1374. .tipsPopup-btn {
  1375. width: 100%;
  1376. height: 100%;
  1377. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  1378. border-radius: 52rpx 52rpx 52rpx 52rpx;
  1379. font-family: PingFang SC, PingFang SC;
  1380. font-weight: 500;
  1381. font-size: 36rpx;
  1382. color: #FFFFFF;
  1383. line-height: 96rpx;
  1384. text-align: center;
  1385. }
  1386. .tipsPopup {
  1387. width: 560rpx;
  1388. padding: 12rpx;
  1389. margin-top: -72rpx;
  1390. box-sizing: border-box;
  1391. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1392. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1393. position: relative;
  1394. &-close {
  1395. width: 64rpx;
  1396. height: 64rpx;
  1397. position: absolute;
  1398. right: 0;
  1399. top: -188rpx;
  1400. }
  1401. &-line {
  1402. padding: 3rpx;
  1403. box-sizing: border-box;
  1404. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  1405. border-radius: 24rpx;
  1406. }
  1407. &-box {
  1408. padding: 0 40rpx 40rpx 40rpx;
  1409. box-sizing: border-box;
  1410. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1411. border-radius: 24rpx;
  1412. @include u-flex(column, center, flex-start);
  1413. }
  1414. &-head {
  1415. @include u-flex(row, center, center);
  1416. &-title {
  1417. width: 364rpx;
  1418. height: auto;
  1419. margin-top: -22rpx;
  1420. }
  1421. }
  1422. &-content {
  1423. margin: 48rpx 0;
  1424. font-family: PingFang SC, PingFang SC;
  1425. font-weight: 500;
  1426. font-size: 32rpx;
  1427. color: #222222;
  1428. text-align: center;
  1429. &-title {
  1430. margin-bottom: 26rpx;
  1431. font-weight: 600;
  1432. font-size: 40rpx;
  1433. color: #FF5C03;
  1434. }
  1435. }
  1436. }
  1437. .video-controls-box {
  1438. width: 100%;
  1439. height: 420rpx;
  1440. overflow: hidden;
  1441. position: absolute;
  1442. bottom: 0;
  1443. left: 0;
  1444. z-index: 2;
  1445. background: rgba(0, 0, 0, 0.2);
  1446. .video-play {
  1447. height: 72rpx;
  1448. width: 72rpx;
  1449. position: absolute;
  1450. top: 50%;
  1451. left: 50%;
  1452. transform: translate(-50%, -50%);
  1453. }
  1454. }
  1455. .video-controls {
  1456. width: 100%;
  1457. height: 80rpx;
  1458. padding: 0 28rpx;
  1459. box-sizing: border-box;
  1460. position: absolute;
  1461. bottom: 0;
  1462. left: 0;
  1463. display: flex;
  1464. align-items: center;
  1465. justify-content: space-between;
  1466. background: linear-gradient(to top, #222 0%, transparent 80%);
  1467. .video-icon {
  1468. height: 44rpx;
  1469. width: 44rpx;
  1470. }
  1471. }
  1472. .errQuesbox {
  1473. width: 100%;
  1474. max-height: 260rpx;
  1475. overflow-y: auto;
  1476. margin-top: 24rpx;
  1477. font-family: PingFang SC, PingFang SC;
  1478. font-weight: 500;
  1479. font-size: 30rpx;
  1480. color: #222222;
  1481. &-item {
  1482. width: 100%;
  1483. height: 128rpx;
  1484. line-height: 128rpx;
  1485. margin-bottom: 24rpx;
  1486. padding: 0 30rpx;
  1487. box-sizing: border-box;
  1488. overflow: hidden;
  1489. background: #fff;
  1490. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1491. position: relative;
  1492. &::after {
  1493. content: "题目";
  1494. min-width: 64rpx;
  1495. height: 36rpx;
  1496. padding: 0 12rpx;
  1497. line-height: 36rpx;
  1498. background: #FF5C03;
  1499. box-sizing: border-box;
  1500. border-radius: 0rpx 0rpx 16rpx 0rpx;
  1501. text-align: center;
  1502. font-family: PingFang SC, PingFang SC;
  1503. font-weight: 500;
  1504. font-size: 20rpx;
  1505. color: #fff;
  1506. position: absolute;
  1507. left: 0;
  1508. top: 0;
  1509. }
  1510. }
  1511. }
  1512. .bg {
  1513. background: #fff !important;
  1514. }
  1515. .answerPopup {
  1516. &-box {
  1517. width: 560rpx;
  1518. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  1519. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1520. background-color: #fff;
  1521. font-weight: 400;
  1522. padding: 32rpx;
  1523. box-sizing: border-box;
  1524. position: relative;
  1525. @include u-flex(column, center, flex-start);
  1526. font-family: PingFang SC, PingFang SC;
  1527. font-weight: 400;
  1528. .tipimg {
  1529. width: 206rpx;
  1530. height: 206rpx;
  1531. margin-bottom: 16rpx;
  1532. }
  1533. }
  1534. &-title {
  1535. font-weight: 600;
  1536. font-size: 36rpx;
  1537. color: #222222;
  1538. }
  1539. &-desc {
  1540. margin-top: 10rpx;
  1541. font-size: 28rpx;
  1542. color: #757575;
  1543. }
  1544. &-btn {
  1545. width: 464rpx;
  1546. height: 84rpx;
  1547. margin-top: 54rpx;
  1548. margin-bottom: 16rpx;
  1549. background: #FF5C03;
  1550. border-radius: 42rpx;
  1551. font-weight: 500;
  1552. font-size: 32rpx;
  1553. color: #FFFFFF;
  1554. text-align: center;
  1555. line-height: 84rpx;
  1556. }
  1557. }
  1558. .popupbox {
  1559. width: 100%;
  1560. background-color: #fff;
  1561. border-radius: 16rpx 16rpx 0 0;
  1562. padding: 24rpx 32rpx;
  1563. position: relative;
  1564. &-head {
  1565. height: 60rpx;
  1566. margin-bottom: 30rpx;
  1567. text-align: center;
  1568. overflow-y: auto;
  1569. color: #414858;
  1570. font-size: 32rpx;
  1571. font-weight: bold;
  1572. position: relative;
  1573. .close-icon {
  1574. position: absolute;
  1575. right: 0;
  1576. top: 0;
  1577. height: 40rpx;
  1578. width: 40rpx;
  1579. }
  1580. }
  1581. &-content {
  1582. height: 20vh;
  1583. overflow-y: auto;
  1584. display: flex;
  1585. align-items: flex-start;
  1586. flex-wrap: wrap;
  1587. gap: 32rpx;
  1588. .line-item {
  1589. display: inline-block;
  1590. min-width: 200rpx;
  1591. min-height: 60rpx;
  1592. padding: 0 20rpx;
  1593. box-sizing: border-box;
  1594. border-radius: 50rpx;
  1595. overflow: hidden;
  1596. background-color: #f7f7f7;
  1597. text-align: center;
  1598. color: #414858;
  1599. font-size: 28rpx;
  1600. line-height: 60rpx;
  1601. }
  1602. .line-active {
  1603. color: #f56c6c !important;
  1604. background-color: #fef0f0 !important;
  1605. }
  1606. }
  1607. }
  1608. .content {
  1609. padding-bottom: calc(var(--window-bottom));
  1610. .video-box {
  1611. width: 100%;
  1612. height: 420rpx;
  1613. overflow: hidden;
  1614. position: relative;
  1615. #myVideo {
  1616. width: 100%;
  1617. height: 100%;
  1618. }
  1619. }
  1620. .video-poster {
  1621. width: 100%;
  1622. height: 420rpx;
  1623. }
  1624. .miantitlebox {
  1625. padding: 30rpx 0;
  1626. border-bottom: 2rpx solid #F5F7FA;
  1627. font-family: PingFang SC, PingFang SC;
  1628. font-weight: 500;
  1629. font-size: 36rpx;
  1630. color: #222222;
  1631. }
  1632. .subtitlebox {
  1633. padding: 30rpx 0;
  1634. border-bottom: 2rpx solid #F5F7FA;
  1635. font-family: PingFang SC, PingFang SC;
  1636. font-weight: 500;
  1637. font-size: 36rpx;
  1638. color: #222222;
  1639. }
  1640. .title-content {
  1641. padding: 0 32rpx;
  1642. background-color: #fff;
  1643. font-size: 28rpx;
  1644. line-height: 1.6;
  1645. box-sizing: border-box;
  1646. @include u-flex(row, center, space-between);
  1647. .title {
  1648. font-size: 36rpx;
  1649. font-weight: 500;
  1650. color: #414858;
  1651. }
  1652. .time-or-subtitle {
  1653. margin-top: 12rpx;
  1654. color: #666666;
  1655. }
  1656. }
  1657. .warning {
  1658. color: #888;
  1659. font-size: 24rpx;
  1660. @include u-flex(column, center, center);
  1661. image {
  1662. flex-shrink: 0;
  1663. height: 36rpx;
  1664. width: 36rpx;
  1665. }
  1666. }
  1667. .video-line {
  1668. min-width: 140rpx;
  1669. max-width: 200rpx;
  1670. height: 60rpx;
  1671. padding: 0 20rpx;
  1672. box-sizing: border-box;
  1673. border-radius: 50rpx 0 0 50rpx;
  1674. overflow: hidden;
  1675. background-color: #fff;
  1676. text-align: center;
  1677. color: #888;
  1678. font-size: 28rpx;
  1679. line-height: 60rpx;
  1680. display: inline-flex;
  1681. align-items: center;
  1682. justify-content: center;
  1683. position: fixed;
  1684. right: 0;
  1685. z-index: 9;
  1686. bottom: calc(var(--window-bottom) + 280rpx);
  1687. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  1688. image {
  1689. flex-shrink: 0;
  1690. height: 34rpx;
  1691. width: 34rpx;
  1692. margin-right: 6rpx;
  1693. }
  1694. }
  1695. .danmu-line {
  1696. bottom: calc(var(--window-bottom) + 370rpx);
  1697. word-break: keep-all;
  1698. .set_image {
  1699. height: 40rpx;
  1700. width: 40rpx;
  1701. }
  1702. }
  1703. .footer {
  1704. border-top: 1rpx solid #ededef;
  1705. background: #fff;
  1706. width: 100%;
  1707. position: fixed;
  1708. bottom: 0;
  1709. padding: 32rpx;
  1710. padding-bottom: calc(var(--window-bottom) + 14rpx);
  1711. box-sizing: border-box;
  1712. z-index: 9;
  1713. &-btn {
  1714. width: 100%;
  1715. height: 98rpx;
  1716. background: #FF5C03;
  1717. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1718. line-height: 98rpx;
  1719. text-align: center;
  1720. font-family: PingFang SC, PingFang SC;
  1721. font-weight: 600;
  1722. font-size: 32rpx;
  1723. color: #FFFFFF;
  1724. @include u-flex(row, center, center);
  1725. &-img {
  1726. flex-shrink: 0;
  1727. width: 144rpx;
  1728. height: 144rpx;
  1729. margin-right: 8rpx;
  1730. margin-top: -24rpx;
  1731. }
  1732. }
  1733. &-btn-border {
  1734. position: relative;
  1735. &::after {
  1736. content: "";
  1737. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  1738. position: absolute;
  1739. top: -2rpx;
  1740. left: 0;
  1741. height: 103rpx;
  1742. width: 100%;
  1743. z-index: -1;
  1744. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1745. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  1746. overflow: hidden;
  1747. }
  1748. }
  1749. }
  1750. }
  1751. .agreement {
  1752. display: inline-flex;
  1753. margin-top: 16rpx;
  1754. font-size: 24rpx;
  1755. color: #525252;
  1756. align-items: center;
  1757. justify-content: center;
  1758. }
  1759. .video-danmu-btnbox {
  1760. width: 50px;
  1761. height: 50px;
  1762. border-radius: 50%;
  1763. overflow: hidden;
  1764. position: absolute;
  1765. right: 10px;
  1766. bottom: calc(50% - 50px);
  1767. transform: translateY(-50%);
  1768. padding: 8px;
  1769. box-sizing: border-box;
  1770. }
  1771. .video-danmu-image {
  1772. width: 100%;
  1773. height: 100%;
  1774. }
  1775. .danmuPopup {
  1776. background-color: #fff;
  1777. padding-bottom: calc(var(--window-bottom) + 10px);
  1778. .u-border {
  1779. flex: 1;
  1780. @include u-flex(row,center,flex-start);
  1781. padding: 0 10rpx;
  1782. border-radius: 6px;
  1783. border: 1rpx solid #eee;
  1784. }
  1785. &-head {
  1786. width: 100%;
  1787. padding: 10px;
  1788. box-sizing: border-box;
  1789. overflow: hidden;
  1790. @include u-flex(row,center,flex-start);
  1791. .danmu-icon {
  1792. height: 24px;
  1793. width: 24px;
  1794. margin-right: 10px;
  1795. }
  1796. }
  1797. &-input {
  1798. flex: 1;
  1799. height: 35px;
  1800. }
  1801. &-send {
  1802. flex-shrink: 0;
  1803. height: 35px;
  1804. display: flex;
  1805. align-items: center;
  1806. justify-content: center;
  1807. padding: 5px 15px;
  1808. box-sizing: border-box;
  1809. background: #FF5C03 !important;
  1810. border-radius: 6px;
  1811. font-family: PingFang SC, PingFang SC;
  1812. font-weight: 500;
  1813. font-size: 15px;
  1814. color: #fff !important;
  1815. margin-left: 12px;
  1816. &::after {
  1817. border: none;
  1818. }
  1819. }
  1820. &-con {
  1821. background-color: #F5F7FA;
  1822. padding: 24px 12px 48px 12px;
  1823. font-family: PingFang SC, PingFang SC;
  1824. font-weight: 400;
  1825. font-size: 14px;
  1826. color: #757575;
  1827. }
  1828. }
  1829. .danmu-icon{
  1830. height: 24px;
  1831. width: 24px;
  1832. margin-right: 12px;
  1833. }
  1834. .logo {
  1835. display: inline-block;
  1836. width: 30px;
  1837. height: auto;
  1838. margin: 20px 0 0 10px;
  1839. pointer-events: none;
  1840. object-fit: cover;
  1841. }
  1842. .logo-full {
  1843. display: inline-block;
  1844. width: 40px;
  1845. height: auto;
  1846. margin: 50px 0 0 30px;
  1847. pointer-events: none;
  1848. object-fit: cover;
  1849. }
  1850. .tabbox-bar {
  1851. @include u-flex(row, center, flex-start);
  1852. background-color: #fff;
  1853. .warning {
  1854. padding-right: 20rpx;
  1855. }
  1856. }
  1857. .tabbox {
  1858. flex: 1;
  1859. @include u-flex(row, center, center);
  1860. border-bottom: 2rpx solid #F5F7FA;
  1861. height: 44px;
  1862. background-color: #fff;
  1863. view {
  1864. flex: 1;
  1865. padding: 20rpx 0;
  1866. margin-right: 40rpx;
  1867. text-align: center;
  1868. }
  1869. &-active {
  1870. position: relative;
  1871. &::after {
  1872. position: absolute;
  1873. bottom: 0;
  1874. left: 50%;
  1875. transform: translateX(-50%);
  1876. content: "";
  1877. width: 3rem;
  1878. border-bottom: 4px solid #FF5C03;
  1879. }
  1880. }
  1881. }
  1882. .chatinput {
  1883. position: fixed;
  1884. left: 32rpx;
  1885. right: 32rpx;
  1886. z-index: 999;
  1887. height: 96rpx;
  1888. background-color: green;
  1889. background: #FFFFFF;
  1890. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  1891. border-radius: 24rpx 24rpx 24rpx 24rpx;
  1892. @include u-flex(row, center, center);
  1893. padding: 0 24rpx;
  1894. box-sizing: border-box;
  1895. .uni-input {
  1896. flex: 1;
  1897. margin-right: 32rpx;
  1898. font-size: 30rpx;
  1899. }
  1900. .send {
  1901. font-family: PingFang SC, PingFang SC;
  1902. font-weight: 400;
  1903. font-size: 28rpx;
  1904. color: #FFFFFF !important;
  1905. flex-shrink: 0;
  1906. padding: 0 20rpx;
  1907. height: 72rpx;
  1908. background: #FF5C03 !important;
  1909. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1910. &::after {
  1911. border: none;
  1912. }
  1913. }
  1914. }
  1915. .answerTip {
  1916. position: fixed;
  1917. right: 0;
  1918. z-index: 9;
  1919. bottom: calc(var(--window-bottom) + 380rpx);
  1920. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  1921. border-radius: 24rpx 24rpx 24rpx 24rpx;
  1922. background-color: #ff5c03;
  1923. color: #fff;
  1924. border-radius: 50%;
  1925. height: 100rpx;
  1926. width: 100rpx;
  1927. font-size: 25rpx;
  1928. text-align: center;
  1929. padding: 10rpx;
  1930. @include u-flex(row, center, center);
  1931. }
  1932. .danmu-item {
  1933. position: absolute;
  1934. top: 0;
  1935. white-space: nowrap;
  1936. font-size: 16px;
  1937. height: 20px;
  1938. display: inline-flex;
  1939. box-sizing: border-box;
  1940. align-items: center;
  1941. }
  1942. .danmuMove {
  1943. // animation: mymove 8s linear forwards;
  1944. // animation-duration: 8s;
  1945. animation-timing-function: linear;
  1946. animation-delay: 0s;
  1947. animation-iteration-count: 1;
  1948. animation-direction: normal;
  1949. animation-fill-mode: forwards;
  1950. animation-play-state: running;
  1951. animation-name: mymove;
  1952. will-change: transform;
  1953. }
  1954. @keyframes mymove {
  1955. from {
  1956. transform: translateX(100vw);
  1957. }
  1958. to {
  1959. transform: translateX(-100%);
  1960. }
  1961. }
  1962. </style>