video.vue 54 KB

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