learningNewApp.vue 52 KB

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