video.vue 52 KB

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