video.vue 55 KB

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