video.vue 57 KB

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