video.vue 57 KB

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