video.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180
  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)" color="#FF5C03" />
  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. <turntableOne ref="turntableOne" @sendRewardFun="sendRewardFun" @openAppPop="openAppPop"></turntableOne>
  262. <turntableTwo ref="turntableTwo" @sendRewardFun="sendRewardFun" @openAppPop="openAppPop"></turntableTwo>
  263. </view>
  264. </template>
  265. <script>
  266. import turntableOne from "./components/turntableOne.vue"
  267. import turntableTwo from "./components/turntableTwo.vue"
  268. import appPopup from "./components/appPopup.vue"
  269. import treasureChest from "./components/treasureChest.vue"
  270. import networkError from "./components/networkError.vue"
  271. import ques from "./components/ques.vue"
  272. import descInfo from "./components/descInfo.vue"
  273. import descInfoNav from "./components/descInfoNav.vue"
  274. import commentBox from "./components/commentBox.vue"
  275. import { generateRandomString } from "@/utils/common.js"
  276. import dayjs from 'dayjs';
  277. import {
  278. getErrMsg,
  279. getH5CourseByVideoId,
  280. getH5CourseVideoDetails,
  281. courseAnswer,
  282. getFinishCourseVideo,
  283. getIsAddKf,
  284. internetTraffic,
  285. getIntegralByH5Video,
  286. sendReward,
  287. loginByMp,
  288. getRealLink,
  289. errorLogUpload,
  290. getConfigByKey,
  291. claim,
  292. getVideoRewardTypes,
  293. } from "@/api/course.js"
  294. export default {
  295. components: {
  296. descInfoNav,
  297. descInfo,
  298. commentBox,
  299. ques,
  300. networkError,
  301. treasureChest,
  302. appPopup,
  303. turntableOne,
  304. turntableTwo
  305. },
  306. data() {
  307. return {
  308. baseUrl:uni.getStorageSync('requestPath'),
  309. // 1 红包 2 芳华币
  310. rewardType:[],
  311. currentReward: -1,
  312. player: null,
  313. loading: true,
  314. progress: 0,
  315. code: null,
  316. statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
  317. scrollTop: 0,
  318. height: '0px',
  319. isLogin: false,
  320. videoUrl: "",
  321. videoId: "",
  322. //现在的时长
  323. playTime: 0,
  324. //总时长
  325. duration: 0,
  326. playDuration: 0,
  327. // 用于续播
  328. playDurationSeek: 0,
  329. // 温馨提醒时间节点,
  330. tipsTime: 0,
  331. tipsOpen: false,
  332. config: {},
  333. courseInfo: {},
  334. quesList: [],
  335. lineList: [],
  336. // 错题
  337. errQues: [],
  338. // 答题机会
  339. remain: 0,
  340. errTitle: "",
  341. errDesc: "",
  342. showPlay: true,
  343. showControls: false,
  344. playStatus: "",
  345. isfull: false,
  346. isAddKf: 0,
  347. lineIndex: 0,
  348. textHeight: 0, //文本高度
  349. qwUserId: "",
  350. qrcode: "",
  351. corpId: "",
  352. qrcodeMsg: "",
  353. urlOption: {},
  354. bufferRate: 0, // 缓冲时间
  355. uuId: "",
  356. isEnded: false,
  357. // 是否允许拖动进度条
  358. linkType: 0,
  359. ip: null,
  360. checked: true,
  361. isFinish: 0, // 是否完课
  362. interval: null,
  363. intervalIntegral: null, // 芳华币定时
  364. options: {
  365. sources: [{
  366. src: ""
  367. }],
  368. poster: "",
  369. live: false /* 是否直播 */ ,
  370. controls: true,
  371. autoplay: false,
  372. licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1323137866_1/v_cube.license', // license 地址,参考准备工作部分,在视立方控制台申请 license 后可获得 licenseUrl,
  373. LicenseKey: 'bcc5bd9a14b798b48c52ff005a21d926',
  374. controlBar: {
  375. volumePanel: false,
  376. playbackRateMenuButton: false,
  377. QualitySwitcherMenuButton: false,
  378. // progressControl: false
  379. },
  380. plugins: {
  381. // ProgressMarker: false,
  382. ContextMenu: {
  383. statistic: false
  384. }
  385. },
  386. },
  387. poster: "",
  388. // 错误请求次数
  389. errorCount: 0,
  390. answerPopup: false,
  391. sortLink:"",
  392. // 课程是否过期
  393. isExpire: false,
  394. menuButtonLeft: 281,
  395. menuButtonH: 45,
  396. timer: null,
  397. flag: false,
  398. focus: false,
  399. openDanmuType: 0,
  400. danmuboxHeight: 0,
  401. user: {},
  402. crtShow: true,
  403. // 是否获取到对应观看者的真实链接
  404. isCheckRealUrl: false,
  405. courseLogo: '',
  406. navList:[{
  407. id: 0,
  408. name: '介绍'
  409. },{
  410. id: 1,
  411. name: '答题'
  412. },{
  413. id: 2,
  414. name: '评论'
  415. }],
  416. currentTab: 1,
  417. triggered: false,
  418. // 没有更多
  419. isMore: false,
  420. inputText:"",
  421. // 获取最多历史评论条数
  422. viewCommentNum: 200,
  423. // 1-开启评论;2-开启弹幕;3-关闭
  424. openCommentStatus: 3,
  425. showAnswerTip: false,
  426. showDanmu: 1,
  427. activeDanmus:[],
  428. flagTime: 0,
  429. notice: '',
  430. fsUserCourseRewardRoundStatusVO: [],
  431. onHide: false
  432. }
  433. },
  434. onLoad(option) {
  435. console.log("onLoad===",'')
  436. this.code = option.code
  437. this.urlOption = option.course ? JSON.parse(option.course) : {}
  438. this.videoId = this.urlOption.videoId || ''
  439. this.qwUserId = this.urlOption.qwUserId || ''
  440. this.corpId = this.urlOption.corpId || ''
  441. this.linkType = this.urlOption.linkType || 0
  442. // if (this.code) {
  443. // this.loginByMp()
  444. // }
  445. var that=this;
  446. if (this.videoId) {
  447. this.getH5CourseByVideo()
  448. }
  449. this.sortLink = this.urlOption.link || ''
  450. this.getMenuButton()
  451. // #ifndef H5
  452. uni.onKeyboardHeightChange(this.keyboardHeightChange);
  453. // #endif
  454. },
  455. onShow() {
  456. this.onHide = false
  457. this.tipsOpen = false
  458. // this.isLogin = this.$isLoginCourse()
  459. this.uuId = generateRandomString(16)
  460. if(uni.getStorageSync('userInfo') && JSON.stringify(uni.getStorageSync('userInfo'))!='{}') {
  461. this.user = JSON.parse(uni.getStorageSync('userInfo'))
  462. } else {
  463. this.user = {}
  464. }
  465. if(this.sortLink){
  466. this.getLink()
  467. } else {
  468. uni.showToast({
  469. title: '链接地址有误',
  470. icon: 'none'
  471. });
  472. }
  473. this.getConfigByKey()
  474. this.getVideoRewardTypes()
  475. },
  476. mounted() {
  477. this.getIP()
  478. this.getHeight()
  479. },
  480. onHide() {
  481. this.onHide = true
  482. // this.player = uni.createVideoContext('video-content-box');
  483. if (this.player) {
  484. this.player.pause()
  485. }
  486. // if (this.interval != null) {
  487. // clearInterval(this.interval)
  488. // this.interval = null
  489. // }
  490. },
  491. onUnload() {
  492. if (this.interval != null) {
  493. clearInterval(this.interval)
  494. this.interval = null
  495. }
  496. this.clearIntegral()
  497. // #ifndef H5
  498. uni.offKeyboardHeightChange(this.keyboardHeightChange);
  499. // #endif
  500. },
  501. beforeDestroy() {
  502. this.player = uni.createVideoContext('video-content-box');
  503. if (this.player) {
  504. this.player.stop()
  505. this.player = null
  506. }
  507. if (this.interval != null) {
  508. clearInterval(this.interval)
  509. this.interval = null
  510. }
  511. this.clearIntegral()
  512. // #ifndef H5
  513. uni.offKeyboardHeightChange(this.keyboardHeightChange);
  514. // #endif
  515. },
  516. methods: {
  517. getVideoRewardTypes() {
  518. getVideoRewardTypes({...this.urlOption}).then(res=>{
  519. if(res.code == 200) {
  520. this.rewardType = res.data
  521. this.currentReward = this.rewardType&&this.rewardType.length>0 ? this.rewardType[0].value : -1
  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.currentReward = this.rewardType&&this.rewardType.length>0 ? this.rewardType[0].value : -1
  944. this.$refs.answerPopup.open("center")
  945. }
  946. } else {
  947. if (res.msg == "该课题到达答错次数限制") {
  948. this.errTitle = "答题次数超过限制"
  949. this.errDesc = "以后的课程要认真学习哦"
  950. this.$refs.answerPopup.open("center")
  951. } else {
  952. uni.showToast({
  953. title: res.msg,
  954. icon: "none"
  955. })
  956. }
  957. }
  958. },
  959. rej => {}
  960. )
  961. },
  962. // 选择
  963. rewardChange(e) {
  964. this.currentReward = e.detail.value
  965. },
  966. closeAnswerPopup() {
  967. this.$refs.answerPopup.close()
  968. if(!this.isCheckRealUrl) return;
  969. if (this.errTitle == '恭喜你,回答正确') {
  970. if(this.currentReward==4) {
  971. this.$refs.turntableTwo.open(this.urlOption)
  972. } else if(this.currentReward==3) {
  973. this.$refs.turntableOne.open(this.urlOption)
  974. } else {
  975. this.sendRewardFun(this.currentReward)
  976. }
  977. }
  978. },
  979. sendRewardFun(currentReward) {
  980. this.currentReward = currentReward
  981. const param = {
  982. ...this.urlOption,
  983. rewardType: Number(this.currentReward),
  984. source: 2,
  985. appId: getApp().globalData.appId
  986. }
  987. sendReward(param).then(res => {
  988. if(res.code == 200) {
  989. if(currentReward == 4) {
  990. this.$refs.turntableTwo.endSuccess(res.data)
  991. }else if(currentReward == 3) {
  992. this.$refs.turntableOne.endSuccess(res.data)
  993. }else {
  994. uni.showToast({
  995. title: res.msg,
  996. icon: 'none'
  997. })
  998. this.openAppPop()
  999. }
  1000. } else {
  1001. this.currentReward == 4 ? this.$refs.turntableTwo.close('close') : this.currentReward == 3? this.$refs.turntableOne.close('close'):''
  1002. uni.showToast({
  1003. title: res.msg,
  1004. icon: 'none'
  1005. })
  1006. }
  1007. })
  1008. },
  1009. openAppPop() {
  1010. this.$refs.appPopup.openPop()
  1011. },
  1012. // 线路
  1013. openPop() {
  1014. this.$refs.popup.open('bottom')
  1015. },
  1016. close() {
  1017. this.$refs.popup.close()
  1018. },
  1019. handleLine(index) {
  1020. var that=this;
  1021. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  1022. this.close()
  1023. return
  1024. } else {
  1025. // let div = document.querySelector(".vjs-progress-control");
  1026. // if(div) {
  1027. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  1028. // div.style.pointerEvents = "auto";
  1029. // } else {
  1030. // div.style.pointerEvents = "none"; //禁止所有事件
  1031. // }
  1032. // }
  1033. this.lineIndex = index
  1034. this.videoUrl = this.lineList[index]
  1035. this.tipsOpen = false
  1036. this.playDurationSeek = this.playTime || 0
  1037. this.player = uni.createVideoContext('video-content-box');
  1038. setTimeout(function(){
  1039. that.player.seek(that.playDurationSeek)
  1040. that.player.play();
  1041. },500);
  1042. // this.player.src(this.lineList[index])
  1043. // this.player.one('loadedmetadata', () => {
  1044. // this.player.currentTime(this.playDurationSeek);
  1045. // this.player.play();
  1046. // });
  1047. this.close()
  1048. }
  1049. },
  1050. // 客服
  1051. getIsAddKf() {
  1052. this.qrcode = ''
  1053. this.qrcodeMsg = ''
  1054. this.isAddKf = 0
  1055. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  1056. getIsAddKf(this.urlOption).then(res => {
  1057. if (res.code == 200) {
  1058. this.isAddKf = 1
  1059. this.isCheckRealUrl = true
  1060. this.getH5CourseVideoDetails()
  1061. } else if (res.code == 400) {
  1062. this.isAddKf = 0
  1063. this.isCheckRealUrl = false
  1064. this.qrcode = res.qrcode
  1065. this.qrcodeMsg = res.msg
  1066. this.$refs.kfPopup.open()
  1067. } else if (res.code == 504) {
  1068. // 登录
  1069. this.isCheckRealUrl = false
  1070. this.goLogin()
  1071. } else if (res.code == 566) {
  1072. // 官方群发通用链接
  1073. const url = res.courseLink.realLink.split('?course=')[1]
  1074. this.urlOption = JSON.parse(url)
  1075. this.isAddKf = 1
  1076. this.isCheckRealUrl = true
  1077. this.getH5CourseVideoDetails()
  1078. } else if (res.code == 567) {
  1079. // 群聊通用链接
  1080. this.urlOption = {
  1081. ...this.urlOption,
  1082. qwExternalId: res.qwExternalId
  1083. }
  1084. this.isAddKf = 1
  1085. this.isCheckRealUrl = true
  1086. this.getH5CourseVideoDetails()
  1087. } else {
  1088. this.isCheckRealUrl = false
  1089. this.isAddKf = 0
  1090. uni.showToast({
  1091. title: res.msg,
  1092. icon: 'none'
  1093. });
  1094. }
  1095. },
  1096. err => {}
  1097. );
  1098. },
  1099. closeKFPop() {
  1100. this.$refs.kfPopup.close()
  1101. },
  1102. getFinishCourseVideo() {
  1103. if (!this.isLogin||!this.playTime || !this.isCheckRealUrl) return
  1104. // {videoId: this.videoId,duration:this.playTime}
  1105. const param = {
  1106. duration: this.playTime,
  1107. ...this.urlOption
  1108. }
  1109. getFinishCourseVideo(param)
  1110. },
  1111. // 每十分钟获得芳华币
  1112. getIntegralByH5Video() {
  1113. if(!this.isLogin||!this.isCheckRealUrl) return
  1114. const param = {
  1115. duration: this.playTime,
  1116. ...this.urlOption
  1117. }
  1118. getIntegralByH5Video(param).then(res => {
  1119. if (res.code == 200) {
  1120. uni.showToast({
  1121. title: "芳华币+10",
  1122. icon: "none"
  1123. })
  1124. }
  1125. })
  1126. },
  1127. progressChange(e) {
  1128. this.bufferRate = Math.ceil(e.detail.buffered)
  1129. },
  1130. // 缓冲
  1131. getInternetTraffic() {
  1132. if(!this.isLogin||!this.isCheckRealUrl) return
  1133. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  1134. if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  1135. this.bufferRate = playVideoTime
  1136. }
  1137. if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  1138. const param = {
  1139. ...this.urlOption,
  1140. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  1141. duration: this.playTime,
  1142. bufferRate: Number(this.bufferRate.toFixed(2)),
  1143. }
  1144. if(!param.bufferRate) return
  1145. internetTraffic(param)
  1146. },
  1147. getErrMsg(err,type) {
  1148. let msgerr = {
  1149. errType: type || 'error',
  1150. videoUrl: this.videoUrl,
  1151. lineIndex: this.lineIndex,
  1152. errTime: new Date(),
  1153. ip: this.ip,
  1154. errMsg: err || ''
  1155. }
  1156. getErrMsg({
  1157. msg: JSON.stringify(msgerr)
  1158. })
  1159. },
  1160. goLogin() {
  1161. this.$getProvider().then(provider=>{
  1162. console.log('当前的环境商',provider)
  1163. if (!provider) {
  1164. reject()
  1165. }
  1166. uni.login({
  1167. provider: provider,
  1168. success: async loginRes => {
  1169. console.log(loginRes)
  1170. uni.getUserInfo({
  1171. provider: provider,
  1172. success: (infoRes)=> {
  1173. uni.showToast({
  1174. title: '处理中...',
  1175. icon: 'loading'
  1176. });
  1177. loginByMp({code: loginRes.code,encryptedData:infoRes.encryptedData,iv:infoRes.iv,appId: getApp().globalData.appId}).then(res=>{
  1178. uni.hideLoading();
  1179. if (res.code == 200) {
  1180. uni.setStorageSync('AppTokenmini_RTCourse', res.token);
  1181. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  1182. this.user = res.user
  1183. this.isLogin = true
  1184. this.getIsAddKf()
  1185. } else {
  1186. uni.showToast({
  1187. title: res.msg,
  1188. icon: 'none'
  1189. });
  1190. }
  1191. }).catch(err=>{
  1192. uni.hideLoading();
  1193. uni.showToast({
  1194. icon:'none',
  1195. title: "登录失败,请重新登录",
  1196. });
  1197. });
  1198. }
  1199. });
  1200. }
  1201. })
  1202. }).catch(err => {})
  1203. },
  1204. getLink() {
  1205. let that = this;
  1206. getRealLink({sortLink:this.sortLink}).then(res=>{
  1207. if(res.code == 200) {
  1208. this.isExpire = false
  1209. // 如果响应中包含真实链接,则跳转到真实链接
  1210. // window.location.href = res.realLink +"&sortLink="+this.sortLink+"&code="+this.code+"&time="+new Date().getTime()
  1211. if (this.isLogin && this.isAddKf == 1&&this.isCheckRealUrl) {
  1212. this.getH5CourseVideoDetails()
  1213. }
  1214. if (this.videoId &&(this.isAddKf != 1 || !this.isCheckRealUrl)) {
  1215. this.$isLoginCourse().then(
  1216. isLogin => {
  1217. this.isLogin = isLogin
  1218. if(isLogin){
  1219. this.getIsAddKf()
  1220. } else {
  1221. this.goLogin()
  1222. }
  1223. },
  1224. rej => {}
  1225. );
  1226. }
  1227. } else {
  1228. this.isExpire = true
  1229. uni.showToast({
  1230. title: '课程已过期或链接无效',
  1231. icon: 'none'
  1232. });
  1233. }
  1234. }).catch(err=>{
  1235. this.isExpire = true
  1236. uni.showToast({
  1237. title: '发生错误,请稍后再试',
  1238. icon: 'none'
  1239. });
  1240. })
  1241. },
  1242. /**
  1243. * 节流原理:在一定时间内,只能触发一次
  1244. *
  1245. * @param {Function} func 要执行的回调函数
  1246. * @param {Number} wait 延时的时间
  1247. * @param {Boolean} immediate 是否立即执行
  1248. * @return null
  1249. */
  1250. throttle(func, wait = 500, immediate = true) {
  1251. if (immediate) {
  1252. if (!this.flag) {
  1253. this.flag = true
  1254. // 如果是立即执行,则在wait毫秒内开始时执行
  1255. typeof func === 'function' && func()
  1256. this.timer = setTimeout(() => {
  1257. this.flag = false
  1258. }, wait)
  1259. }
  1260. } else if (!this.flag) {
  1261. this.flag = true
  1262. // 如果是非立即执行,则在wait毫秒内的结束处执行
  1263. this.timer = setTimeout(() => {
  1264. this.flag = false
  1265. typeof func === 'function' && func()
  1266. }, wait)
  1267. }
  1268. },
  1269. // 弹幕
  1270. openDanmu(type) {
  1271. this.openDanmuType = type
  1272. this.inputText = ''
  1273. if(type == 1) {
  1274. this.player.exitFullScreen()
  1275. }
  1276. this.$refs.danmuPopup.open()
  1277. },
  1278. changeShowPopup(val) {
  1279. this.focus = val.show
  1280. },
  1281. switchDanmu() {
  1282. this.showDanmu = this.showDanmu == 1 ? 0:1
  1283. if(this.showDanmu == 0&&this.$refs.danmuBox) {
  1284. this.$refs.danmuPopup.close()
  1285. this.activeDanmus = []
  1286. this.$refs.danmuBox.activeDanmus = []
  1287. this.$refs.danmuBox.initTracks()
  1288. }
  1289. },
  1290. getScrollTop(res) {
  1291. console.log(res)
  1292. if(this.currentTab == 2) {
  1293. this.scrollTop = res
  1294. } else {
  1295. this.scrollTop = 0
  1296. }
  1297. },
  1298. handleTab(index) {
  1299. this.currentTab = index
  1300. if(this.currentTab==2) {
  1301. if(this.$refs.commentBox) {
  1302. this.$refs.commentBox.msgs = []
  1303. this.$refs.commentBox.pageNum = 1
  1304. this.$refs.commentBox.getComments()
  1305. }
  1306. } else {
  1307. setTimeout(()=>{
  1308. this.scrollTop = 0
  1309. },100)
  1310. }
  1311. },
  1312. handleRefresher() {
  1313. this.triggered = true;
  1314. if (!this.isMore&&this.currentTab==2&&this.openCommentStatus==1) {
  1315. this.$nextTick(()=>{
  1316. this.$refs.commentBox&&this.$refs.commentBox.getComments()
  1317. })
  1318. }
  1319. setTimeout(() => {
  1320. this.triggered = false;
  1321. }, 500);
  1322. },
  1323. getMore(val) {
  1324. this.triggered = false;
  1325. this.isMore = val == 1
  1326. },
  1327. handleChatInput() {
  1328. this.inputText = this.inputText.trim()
  1329. if (this.inputText == "" || this.inputText.trim() == "") {
  1330. uni.showToast({
  1331. title: '请输入评论',
  1332. icon: "none"
  1333. })
  1334. return;
  1335. }
  1336. if(this.openCommentStatus==1) {
  1337. this.$refs.commentBox&&this.$refs.commentBox.handleInput(this.inputText)
  1338. } else if(this.openCommentStatus==2) {
  1339. this.$refs.danmuBox&&this.$refs.danmuBox.handleInput(this.inputText)
  1340. }
  1341. },
  1342. setInputText() {
  1343. this.inputText = ""
  1344. if(this.openCommentStatus==2) {
  1345. this.$refs.danmuPopup.close()
  1346. }
  1347. },
  1348. getActiveDanmus(val) {
  1349. this.activeDanmus = val
  1350. },
  1351. animationend(moveItem, i) {
  1352. // 移除动画结束的弹幕(性能优化)
  1353. if(this.openCommentStatus==2) {
  1354. this.$refs.danmuBox&&this.$refs.danmuBox.animationend(moveItem, i)
  1355. }
  1356. },
  1357. feedback() {
  1358. const userId = this.user.userId || ''
  1359. const courseId = this.urlOption.courseId || ''
  1360. const videoId = this.urlOption.videoId || ''
  1361. uni.navigateTo({
  1362. url: './feedback?userId='+userId+'&courseId='+courseId+'&videoId='+videoId
  1363. })
  1364. },
  1365. getBox(data) {
  1366. if(data.fsUserCourseRewardRoundStatusVO&&data.fsUserCourseRewardRoundStatusVO.length>0) {
  1367. const list = data.fsUserCourseRewardRoundStatusVO.map(item=>({
  1368. ...item,
  1369. time: Math.round(this.duration * Number(item.question || 0) * 0.01)
  1370. }))
  1371. return list
  1372. } else {
  1373. return []
  1374. }
  1375. },
  1376. claimFun(val) {
  1377. claim({
  1378. ...this.urlOption,
  1379. second: val.time,
  1380. rewardId: val.rewardId,
  1381. status: val.status
  1382. }).then(res=>{
  1383. if(res.code == 200) {
  1384. this.$refs.treasureChest.claimSuccess(val.status)
  1385. } else {
  1386. this.$refs.treasureChest.close()
  1387. }
  1388. if(res.msg!="success") {
  1389. uni.showToast({
  1390. title: res.msg,
  1391. icon: 'none',
  1392. duration: 3000
  1393. })
  1394. }
  1395. })
  1396. }
  1397. }
  1398. }
  1399. </script>
  1400. <style scoped>
  1401. .full-width-popup {
  1402. width: 100%;
  1403. }
  1404. </style>
  1405. <style lang="scss" scoped>
  1406. @mixin u-flex($flexD, $alignI, $justifyC) {
  1407. display: flex;
  1408. flex-direction: $flexD;
  1409. align-items: $alignI;
  1410. justify-content: $justifyC;
  1411. }
  1412. .footer-tips {
  1413. margin-top: 14rpx;
  1414. text-align: center;
  1415. font-family: PingFang SC,PingFang SC;
  1416. font-weight: 500;
  1417. font-size: 12px;
  1418. color: #bbb;
  1419. }
  1420. .textOne {
  1421. overflow: hidden;
  1422. white-space: nowrap;
  1423. text-overflow: ellipsis;
  1424. }
  1425. .textTwo {
  1426. overflow: hidden;
  1427. text-overflow: ellipsis;
  1428. display: -webkit-box;
  1429. -webkit-line-clamp: 2;
  1430. -webkit-box-orient: vertical;
  1431. }
  1432. .header-nav {
  1433. height: 88rpx;
  1434. @include u-flex(row, center, flex-start);
  1435. overflow: hidden;
  1436. background-color: #fff;
  1437. box-sizing: border-box;
  1438. .header-title {
  1439. text-align: center;
  1440. overflow: hidden;
  1441. white-space: nowrap;
  1442. text-overflow: ellipsis;
  1443. padding: 0 10rpx 0 100rpx;
  1444. font-family: PingFang SC,PingFang SC;
  1445. font-weight: 500;
  1446. font-size: 15px;
  1447. color: #000;
  1448. box-sizing: border-box;
  1449. }
  1450. }
  1451. .reward-list {
  1452. width: 100%;
  1453. margin-top: 20rpx;
  1454. margin-bottom: -40rpx;
  1455. &-group {
  1456. font-family: PingFang SC, PingFang SC;
  1457. font-weight: 400;
  1458. font-size: 14px;
  1459. color: #222222;
  1460. @include u-flex(row, center, flex-start);
  1461. flex-wrap: wrap;
  1462. }
  1463. &-option {
  1464. @include u-flex(row, center, flex-start);
  1465. flex-shrink: 0;
  1466. width: 50%;
  1467. }
  1468. }
  1469. .err {
  1470. color: #f56c6c !important;
  1471. }
  1472. .kfqrcode-box {
  1473. background-color: #fff;
  1474. border-radius: 16rpx;
  1475. max-width: 560rpx;
  1476. padding: 60rpx 40rpx;
  1477. margin-top: -100rpx;
  1478. box-sizing: border-box;
  1479. @include u-flex(column, center, flex-start);
  1480. font-family: PingFang SC, PingFang SC;
  1481. font-weight: 400;
  1482. font-size: 34rpx;
  1483. color: #222;
  1484. position: relative;
  1485. text-align: center;
  1486. .kfqrcode {
  1487. height: 460rpx;
  1488. width: 460rpx;
  1489. }
  1490. }
  1491. .kfqrcode-close {
  1492. width: 64rpx;
  1493. height: 64rpx;
  1494. position: absolute;
  1495. bottom: -100rpx;
  1496. left: 50%;
  1497. transform: translateX(-50%);
  1498. }
  1499. .tipsPopup-mask {
  1500. position: relative;
  1501. width: 560rpx;
  1502. background-color: transparent;
  1503. .red_envelope_top {
  1504. width: 480rpx;
  1505. height: 360rpx;
  1506. margin: 0 auto;
  1507. display: inherit;
  1508. }
  1509. }
  1510. .tipsPopup-btn-box {
  1511. width: 456rpx;
  1512. height: 104rpx;
  1513. padding: 4rpx;
  1514. box-sizing: border-box;
  1515. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  1516. border-radius: 52rpx;
  1517. }
  1518. .tipsPopup-btn {
  1519. width: 100%;
  1520. height: 100%;
  1521. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  1522. border-radius: 52rpx 52rpx 52rpx 52rpx;
  1523. font-family: PingFang SC, PingFang SC;
  1524. font-weight: 500;
  1525. font-size: 36rpx;
  1526. color: #FFFFFF;
  1527. line-height: 96rpx;
  1528. text-align: center;
  1529. }
  1530. .tipsPopup {
  1531. width: 560rpx;
  1532. padding: 12rpx;
  1533. margin-top: -72rpx;
  1534. box-sizing: border-box;
  1535. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1536. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1537. position: relative;
  1538. &-close {
  1539. width: 64rpx;
  1540. height: 64rpx;
  1541. position: absolute;
  1542. right: 0;
  1543. top: -188rpx;
  1544. }
  1545. &-line {
  1546. padding: 3rpx;
  1547. box-sizing: border-box;
  1548. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  1549. border-radius: 24rpx;
  1550. }
  1551. &-box {
  1552. padding: 0 40rpx 40rpx 40rpx;
  1553. box-sizing: border-box;
  1554. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1555. border-radius: 24rpx;
  1556. @include u-flex(column, center, flex-start);
  1557. }
  1558. &-head {
  1559. @include u-flex(row, center, center);
  1560. &-title {
  1561. width: 364rpx;
  1562. height: auto;
  1563. margin-top: -22rpx;
  1564. }
  1565. }
  1566. &-content {
  1567. margin: 48rpx 0;
  1568. font-family: PingFang SC, PingFang SC;
  1569. font-weight: 500;
  1570. font-size: 32rpx;
  1571. color: #222222;
  1572. text-align: center;
  1573. &-title {
  1574. margin-bottom: 26rpx;
  1575. font-weight: 600;
  1576. font-size: 40rpx;
  1577. color: #FF5C03;
  1578. }
  1579. }
  1580. }
  1581. .video-controls-box {
  1582. width: 100%;
  1583. height: 420rpx;
  1584. overflow: hidden;
  1585. position: absolute;
  1586. bottom: 0;
  1587. left: 0;
  1588. z-index: 2;
  1589. background: rgba(0, 0, 0, 0.2);
  1590. .video-play {
  1591. height: 72rpx;
  1592. width: 72rpx;
  1593. position: absolute;
  1594. top: 50%;
  1595. left: 50%;
  1596. transform: translate(-50%, -50%);
  1597. }
  1598. }
  1599. .video-controls {
  1600. width: 100%;
  1601. height: 80rpx;
  1602. padding: 0 28rpx;
  1603. box-sizing: border-box;
  1604. position: absolute;
  1605. bottom: 0;
  1606. left: 0;
  1607. display: flex;
  1608. align-items: center;
  1609. justify-content: space-between;
  1610. background: linear-gradient(to top, #222 0%, transparent 80%);
  1611. .video-icon {
  1612. height: 44rpx;
  1613. width: 44rpx;
  1614. }
  1615. }
  1616. .errQuesbox {
  1617. width: 100%;
  1618. max-height: 260rpx;
  1619. overflow-y: auto;
  1620. margin-top: 24rpx;
  1621. font-family: PingFang SC, PingFang SC;
  1622. font-weight: 500;
  1623. font-size: 30rpx;
  1624. color: #222222;
  1625. &-item {
  1626. width: 100%;
  1627. height: 128rpx;
  1628. line-height: 128rpx;
  1629. margin-bottom: 24rpx;
  1630. padding: 0 30rpx;
  1631. box-sizing: border-box;
  1632. overflow: hidden;
  1633. background: #fff;
  1634. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1635. position: relative;
  1636. &::after {
  1637. content: "题目";
  1638. min-width: 64rpx;
  1639. height: 36rpx;
  1640. padding: 0 12rpx;
  1641. line-height: 36rpx;
  1642. background: #FF5C03;
  1643. box-sizing: border-box;
  1644. border-radius: 0rpx 0rpx 16rpx 0rpx;
  1645. text-align: center;
  1646. font-family: PingFang SC, PingFang SC;
  1647. font-weight: 500;
  1648. font-size: 20rpx;
  1649. color: #fff;
  1650. position: absolute;
  1651. left: 0;
  1652. top: 0;
  1653. }
  1654. }
  1655. }
  1656. .bg {
  1657. background: #fff !important;
  1658. }
  1659. .answerPopup {
  1660. &-box {
  1661. width: 560rpx;
  1662. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  1663. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1664. background-color: #fff;
  1665. font-weight: 400;
  1666. padding: 32rpx;
  1667. box-sizing: border-box;
  1668. position: relative;
  1669. @include u-flex(column, center, flex-start);
  1670. font-family: PingFang SC, PingFang SC;
  1671. font-weight: 400;
  1672. .tipimg {
  1673. width: 206rpx;
  1674. height: 206rpx;
  1675. margin-bottom: 16rpx;
  1676. }
  1677. }
  1678. &-title {
  1679. font-weight: 600;
  1680. font-size: 36rpx;
  1681. color: #222222;
  1682. }
  1683. &-desc {
  1684. margin-top: 10rpx;
  1685. font-size: 28rpx;
  1686. color: #757575;
  1687. }
  1688. &-btn {
  1689. width: 464rpx;
  1690. height: 84rpx;
  1691. margin-top: 54rpx;
  1692. margin-bottom: 16rpx;
  1693. background: #FF5C03;
  1694. border-radius: 42rpx;
  1695. font-weight: 500;
  1696. font-size: 32rpx;
  1697. color: #FFFFFF;
  1698. text-align: center;
  1699. line-height: 84rpx;
  1700. }
  1701. }
  1702. .popupbox {
  1703. width: 100%;
  1704. background-color: #fff;
  1705. border-radius: 16rpx 16rpx 0 0;
  1706. padding: 24rpx 32rpx;
  1707. position: relative;
  1708. &-head {
  1709. height: 60rpx;
  1710. margin-bottom: 30rpx;
  1711. text-align: center;
  1712. overflow-y: auto;
  1713. color: #414858;
  1714. font-size: 32rpx;
  1715. font-weight: bold;
  1716. position: relative;
  1717. .close-icon {
  1718. position: absolute;
  1719. right: 0;
  1720. top: 0;
  1721. height: 40rpx;
  1722. width: 40rpx;
  1723. }
  1724. }
  1725. &-content {
  1726. height: 20vh;
  1727. overflow-y: auto;
  1728. display: flex;
  1729. align-items: flex-start;
  1730. flex-wrap: wrap;
  1731. gap: 32rpx;
  1732. .line-item {
  1733. display: inline-block;
  1734. min-width: 200rpx;
  1735. min-height: 60rpx;
  1736. padding: 0 20rpx;
  1737. box-sizing: border-box;
  1738. border-radius: 50rpx;
  1739. overflow: hidden;
  1740. background-color: #f7f7f7;
  1741. text-align: center;
  1742. color: #414858;
  1743. font-size: 28rpx;
  1744. line-height: 60rpx;
  1745. }
  1746. .line-active {
  1747. color: #f56c6c !important;
  1748. background-color: #fef0f0 !important;
  1749. }
  1750. }
  1751. }
  1752. .content {
  1753. padding-bottom: calc(var(--window-bottom));
  1754. .video-box {
  1755. width: 100%;
  1756. height: 420rpx;
  1757. overflow: hidden;
  1758. position: relative;
  1759. #myVideo {
  1760. width: 100%;
  1761. height: 100%;
  1762. }
  1763. }
  1764. .video-poster {
  1765. width: 100%;
  1766. height: 420rpx;
  1767. }
  1768. .miantitlebox {
  1769. padding: 30rpx 0;
  1770. border-bottom: 2rpx solid #F5F7FA;
  1771. font-family: PingFang SC, PingFang SC;
  1772. font-weight: 500;
  1773. font-size: 36rpx;
  1774. color: #222222;
  1775. }
  1776. .subtitlebox {
  1777. padding: 30rpx 0;
  1778. border-bottom: 2rpx solid #F5F7FA;
  1779. font-family: PingFang SC, PingFang SC;
  1780. font-weight: 500;
  1781. font-size: 36rpx;
  1782. color: #222222;
  1783. }
  1784. .title-content {
  1785. padding: 0 32rpx;
  1786. background-color: #fff;
  1787. font-size: 28rpx;
  1788. line-height: 1.6;
  1789. box-sizing: border-box;
  1790. @include u-flex(row, center, space-between);
  1791. .title {
  1792. font-size: 36rpx;
  1793. font-weight: 500;
  1794. color: #414858;
  1795. }
  1796. .time-or-subtitle {
  1797. margin-top: 12rpx;
  1798. color: #666666;
  1799. }
  1800. }
  1801. .warning {
  1802. flex-shrink: 0;
  1803. color: #888;
  1804. font-size: 24rpx;
  1805. @include u-flex(column, center, center);
  1806. image {
  1807. flex-shrink: 0;
  1808. height: 36rpx;
  1809. width: 36rpx;
  1810. }
  1811. }
  1812. .video-line {
  1813. min-width: 140rpx;
  1814. max-width: 200rpx;
  1815. height: 60rpx;
  1816. padding: 0 20rpx;
  1817. box-sizing: border-box;
  1818. border-radius: 50rpx 0 0 50rpx;
  1819. overflow: hidden;
  1820. background-color: #fff;
  1821. text-align: center;
  1822. color: #888;
  1823. font-size: 28rpx;
  1824. line-height: 60rpx;
  1825. display: inline-flex;
  1826. align-items: center;
  1827. justify-content: center;
  1828. position: fixed;
  1829. right: 0;
  1830. z-index: 9;
  1831. bottom: calc(var(--window-bottom) + 280rpx);
  1832. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  1833. image {
  1834. flex-shrink: 0;
  1835. height: 34rpx;
  1836. width: 34rpx;
  1837. margin-right: 6rpx;
  1838. }
  1839. }
  1840. .danmu-line {
  1841. bottom: calc(var(--window-bottom) + 370rpx);
  1842. word-break: keep-all;
  1843. .set_image {
  1844. height: 40rpx;
  1845. width: 40rpx;
  1846. }
  1847. }
  1848. .footer {
  1849. border-top: 1rpx solid #ededef;
  1850. background: #fff;
  1851. width: 100%;
  1852. position: fixed;
  1853. bottom: 0;
  1854. padding: 32rpx;
  1855. padding-bottom: calc(var(--window-bottom) + 14rpx);
  1856. box-sizing: border-box;
  1857. z-index: 9;
  1858. &-btn {
  1859. width: 100%;
  1860. height: 98rpx;
  1861. background: #FF5C03;
  1862. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1863. line-height: 98rpx;
  1864. text-align: center;
  1865. font-family: PingFang SC, PingFang SC;
  1866. font-weight: 600;
  1867. font-size: 32rpx;
  1868. color: #FFFFFF;
  1869. @include u-flex(row, center, center);
  1870. &-img {
  1871. flex-shrink: 0;
  1872. width: 144rpx;
  1873. height: 144rpx;
  1874. margin-right: 8rpx;
  1875. margin-top: -24rpx;
  1876. }
  1877. }
  1878. &-btn-border {
  1879. position: relative;
  1880. &::after {
  1881. content: "";
  1882. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  1883. position: absolute;
  1884. top: -2rpx;
  1885. left: 0;
  1886. height: 103rpx;
  1887. width: 100%;
  1888. z-index: -1;
  1889. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1890. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  1891. overflow: hidden;
  1892. }
  1893. }
  1894. }
  1895. }
  1896. .agreement {
  1897. display: inline-flex;
  1898. margin-top: 16rpx;
  1899. font-size: 24rpx;
  1900. color: #525252;
  1901. align-items: center;
  1902. justify-content: center;
  1903. }
  1904. .video-danmu-btnbox {
  1905. width: 50px;
  1906. height: 50px;
  1907. border-radius: 50%;
  1908. overflow: hidden;
  1909. position: absolute;
  1910. right: 10px;
  1911. bottom: calc(50% - 50px);
  1912. transform: translateY(-50%);
  1913. padding: 8px;
  1914. box-sizing: border-box;
  1915. }
  1916. .video-danmu-image {
  1917. width: 100%;
  1918. height: 100%;
  1919. }
  1920. .danmuPopup {
  1921. background-color: #fff;
  1922. padding-bottom: calc(var(--window-bottom) + 10px);
  1923. .u-border {
  1924. flex: 1;
  1925. @include u-flex(row,center,flex-start);
  1926. padding: 0 6rpx;
  1927. border-radius: 6px;
  1928. }
  1929. &-head {
  1930. width: 100%;
  1931. padding: 10px;
  1932. box-sizing: border-box;
  1933. overflow: hidden;
  1934. @include u-flex(row,center,flex-start);
  1935. .danmu-icon {
  1936. height: 24px;
  1937. width: 24px;
  1938. margin-right: 10px;
  1939. }
  1940. }
  1941. &-input {
  1942. flex: 1;
  1943. height: 35px;
  1944. }
  1945. &-send {
  1946. flex-shrink: 0;
  1947. height: 35px;
  1948. display: flex;
  1949. align-items: center;
  1950. justify-content: center;
  1951. padding: 5px 15px;
  1952. box-sizing: border-box;
  1953. background: #FF5C03 !important;
  1954. border-radius: 6px;
  1955. font-family: PingFang SC, PingFang SC;
  1956. font-weight: 500;
  1957. font-size: 15px;
  1958. color: #fff !important;
  1959. margin-left: 12px;
  1960. &::after {
  1961. border: none;
  1962. }
  1963. }
  1964. &-con {
  1965. background-color: #F5F7FA;
  1966. padding: 24px 12px 48px 12px;
  1967. font-family: PingFang SC, PingFang SC;
  1968. font-weight: 400;
  1969. font-size: 14px;
  1970. color: #757575;
  1971. }
  1972. }
  1973. .danmu-icon{
  1974. height: 24px;
  1975. width: 24px;
  1976. margin-right: 12px;
  1977. }
  1978. .logo {
  1979. display: inline-block;
  1980. width: 30px;
  1981. height: auto;
  1982. margin: 20px 0 0 10px;
  1983. pointer-events: none;
  1984. object-fit: cover;
  1985. }
  1986. .logo-full {
  1987. display: inline-block;
  1988. width: 40px;
  1989. height: auto;
  1990. margin: 50px 0 0 30px;
  1991. pointer-events: none;
  1992. object-fit: cover;
  1993. }
  1994. .tabbox-bar {
  1995. @include u-flex(row, center, flex-start);
  1996. background-color: #fff;
  1997. .warning {
  1998. flex-shrink: 0;
  1999. padding-right: 20rpx;
  2000. }
  2001. }
  2002. .tabbox {
  2003. flex: 1;
  2004. @include u-flex(row, center, center);
  2005. border-bottom: 2rpx solid #F5F7FA;
  2006. height: 44px;
  2007. background-color: #fff;
  2008. view {
  2009. flex: 1;
  2010. padding: 20rpx 0;
  2011. margin-right: 40rpx;
  2012. text-align: center;
  2013. }
  2014. &-active {
  2015. position: relative;
  2016. &::after {
  2017. position: absolute;
  2018. bottom: 0;
  2019. left: 50%;
  2020. transform: translateX(-50%);
  2021. content: "";
  2022. width: 3rem;
  2023. border-bottom: 4px solid #FF5C03;
  2024. }
  2025. }
  2026. }
  2027. .chatinput {
  2028. position: fixed;
  2029. left: 32rpx;
  2030. right: 32rpx;
  2031. z-index: 999;
  2032. height: 96rpx;
  2033. background-color: green;
  2034. background: #FFFFFF;
  2035. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  2036. border-radius: 24rpx 24rpx 24rpx 24rpx;
  2037. @include u-flex(row, center, center);
  2038. padding: 0 24rpx;
  2039. box-sizing: border-box;
  2040. .uni-input {
  2041. flex: 1;
  2042. margin-right: 32rpx;
  2043. font-size: 30rpx;
  2044. }
  2045. .send {
  2046. font-family: PingFang SC, PingFang SC;
  2047. font-weight: 400;
  2048. font-size: 28rpx;
  2049. color: #FFFFFF !important;
  2050. flex-shrink: 0;
  2051. padding: 0 20rpx;
  2052. height: 72rpx;
  2053. background: #FF5C03 !important;
  2054. border-radius: 8rpx 8rpx 8rpx 8rpx;
  2055. &::after {
  2056. border: none;
  2057. }
  2058. }
  2059. }
  2060. .answerTip {
  2061. position: fixed;
  2062. right: 0;
  2063. z-index: 9;
  2064. bottom: calc(var(--window-bottom) + 380rpx);
  2065. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  2066. border-radius: 24rpx 24rpx 24rpx 24rpx;
  2067. background-color: #ff5c03;
  2068. color: #fff;
  2069. border-radius: 50%;
  2070. height: 100rpx;
  2071. width: 100rpx;
  2072. font-size: 25rpx;
  2073. text-align: center;
  2074. padding: 10rpx;
  2075. @include u-flex(row, center, center);
  2076. }
  2077. .danmu-item {
  2078. position: absolute;
  2079. top: 0;
  2080. white-space: nowrap;
  2081. font-size: 16px;
  2082. height: 20px;
  2083. display: inline-flex;
  2084. box-sizing: border-box;
  2085. align-items: center;
  2086. }
  2087. .danmuMove {
  2088. // animation: mymove 8s linear forwards;
  2089. // animation-duration: 8s;
  2090. animation-timing-function: linear;
  2091. animation-delay: 0s;
  2092. animation-iteration-count: 1;
  2093. animation-direction: normal;
  2094. animation-fill-mode: forwards;
  2095. animation-play-state: running;
  2096. animation-name: mymove;
  2097. will-change: transform;
  2098. }
  2099. @keyframes mymove {
  2100. from {
  2101. transform: translateX(100vw);
  2102. }
  2103. to {
  2104. transform: translateX(-100%);
  2105. }
  2106. }
  2107. .arrow-left-warning {
  2108. position: absolute;
  2109. left: 24rpx;
  2110. height: 88rpx;
  2111. overflow: hidden;
  2112. color: #888;
  2113. font-size: 24rpx;
  2114. @include u-flex(column, center, center);
  2115. image {
  2116. flex-shrink: 0;
  2117. height: 36rpx;
  2118. width: 36rpx;
  2119. }
  2120. }
  2121. </style>