video.vue 52 KB

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