learningNewApp.vue 52 KB

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