video.vue 52 KB

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