learningNewApp.vue 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074
  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.playDurationSeek = res.playDuration || 0
  695. this.tipsTime = res.tipsTime || 0
  696. let lineList = []
  697. if (res.course && res.course.lineOne) {
  698. lineList.push(res.course.lineOne)
  699. }
  700. if (res.course && res.course.lineTwo) {
  701. lineList.push(res.course.lineTwo)
  702. }
  703. if (res.course && res.course.lineThree) {
  704. lineList.push(res.course.lineThree)
  705. }
  706. this.lineList = lineList
  707. this.courseLogo = res.config&&res.config.courseLogo
  708. this.viewCommentNum = res.config&&res.config.viewCommentNum || 200
  709. if(this.openCommentStatus == 3) {
  710. this.$refs.commentBox&&this.$refs.commentBox.closeWSocket()
  711. this.$refs.danmuBox&&this.$refs.danmuBox.closeWSocket()
  712. }
  713. const status = res.config&&res.config.openCommentStatus || 3
  714. if(status != this.openCommentStatus) {
  715. this.openCommentStatus = status
  716. }
  717. if(this.openCommentStatus==1) {
  718. this.currentTab = 0
  719. } else {
  720. this.currentTab = 1
  721. }
  722. if (!this.player || type == 'error') {
  723. this.lineIndex = this.config.defaultLine
  724. this.videoUrl = lineList[this.lineIndex]
  725. this.poster= res.course && res.course.imgUrl ? res.course.imgUrl : ''
  726. this.playTime = this.playDuration >= this.duration ? 0 : this.playDuration
  727. setTimeout(()=>{
  728. this.player = uni.createVideoContext('video-content-box');
  729. this.player.seek(this.playTime)
  730. this.player.play();
  731. },500);
  732. } else {
  733. this.playTime = this.playTime > this.playDuration ? this.playTime : this.playDuration >= this.duration ? 0 : this.playDuration
  734. this.player.seek(this.playTime)
  735. this.player.play();
  736. }
  737. this.updateTime();
  738. this.quesList = res.questions && res.questions.length > 0 ? res.questions : [],
  739. this.quesList = this.quesList.map(item => ({
  740. ...item,
  741. questionOption: JSON.parse(item.question),
  742. answer: ''
  743. }))
  744. }
  745. this.getHeight()
  746. this.$nextTick(()=>{
  747. this.$refs.descInfo&&this.$refs.descInfo.getDescHeight()
  748. this.$refs.descInfoNav&&this.$refs.descInfoNav.getDescHeight()
  749. })
  750. },
  751. rej => {}
  752. )
  753. },
  754. handleAnswer(val) {
  755. let {item, option} = val
  756. let time = this.playTime
  757. if(this.isEnded) {
  758. time = this.duration
  759. } else {
  760. if(time < this.playDuration&&this.isFinish!=1) {
  761. // 没完课且小于续播的时间
  762. time = this.playDuration
  763. }
  764. }
  765. if(Number(this.duration || 0) == 0 || time < this.duration - 60) {
  766. uni.showToast({
  767. title: "请先观看完整课程再答题哦~",
  768. icon: "none"
  769. })
  770. return
  771. }
  772. if (item.type == 1) {
  773. // 单选option
  774. item.answer = option.name
  775. } else if (item.type == 2) {
  776. // 多选
  777. let answer = item.answer ? item.answer.split(',') : []
  778. if (answer.indexOf(option.name) === -1) {
  779. answer.push(option.name)
  780. item.answer = answer.join(',')
  781. } else {
  782. answer.splice(answer.indexOf(option.name), 1)
  783. item.answer = answer.join(',')
  784. }
  785. }
  786. },
  787. submit() {
  788. // 登录
  789. if (this.$isLogin()) {
  790. if (this.isAddKf == 1) {
  791. // 答题
  792. // 您已提交过答案,请领取红包
  793. this.courseAnswer()
  794. } else {
  795. // 添加客服
  796. if (this.videoId && this.qwUserId) {
  797. this.getIsAddKf()
  798. } else {
  799. uni.showToast({
  800. title: '请添加客服',
  801. icon: 'none'
  802. })
  803. }
  804. }
  805. } else {
  806. // 登录
  807. if (!this.checked) {
  808. uni.showToast({
  809. title: "请先勾选阅读并同意《用户协议》和《隐私协议》",
  810. icon: "none"
  811. })
  812. return
  813. }
  814. if(this.source == 'app') {
  815. this.postMessage({isFullscreen: false,login: 0})
  816. } else {
  817. // #ifdef H5
  818. if (isWechat) { //是否在微信浏览器中打开
  819. this.loginByMp()
  820. } else {
  821. uni.showToast({
  822. title: '请在微信浏览器中打开',
  823. icon: 'error'
  824. })
  825. }
  826. // #endif
  827. }
  828. }
  829. },
  830. // 答题
  831. courseAnswer() {
  832. let time = this.playTime
  833. if (this.isEnded) {
  834. time = this.duration
  835. } else {
  836. if (time < this.playDuration && this.isFinish != 1) {
  837. // 没完课且小于续播的时间
  838. time = this.playDuration
  839. }
  840. }
  841. if (Number(this.duration || 0) == 0 || time < this.duration - 60) {
  842. uni.showToast({
  843. title: "请先观看完整课程再答题哦~",
  844. icon: "none"
  845. })
  846. return
  847. }
  848. if (this.quesList.some(item => !item.answer)) {
  849. uni.showToast({
  850. title: "请确认是否答完所有题目",
  851. icon: "none"
  852. })
  853. return
  854. }
  855. const questions = this.quesList.map(obj => {
  856. const {
  857. questionOption,
  858. ...rest
  859. } = obj;
  860. return rest;
  861. });
  862. const param = {
  863. ...this.urlOption,
  864. questions: questions,
  865. videoId: this.videoId,
  866. duration: this.playTime
  867. }
  868. this.errTitle = ""
  869. this.errDesc = ""
  870. this.errQues = []
  871. courseAnswer(param).then(res => {
  872. if (res.code == 200) {
  873. if (res.incorrectQuestions) {
  874. // 答题失败
  875. if (res.incorrectQuestions.length > 0) {
  876. this.errQues = res.incorrectQuestions
  877. }
  878. this.remain = res.remain || 0
  879. if (res.remain > 0) {
  880. this.errTitle = "很遗憾答错了"
  881. this.errDesc = `<span style="color:#FF5C03">还有${res.remain}次机会,继续加油</span>`
  882. this.$refs.answerPopup.open("center")
  883. }
  884. } else {
  885. // 答题成功
  886. this.errTitle = "恭喜你,回答正确"
  887. this.errDesc = `您有一份奖励待领取哦~`
  888. if(this.source == "app") {
  889. this.getAppReward()
  890. } else {
  891. this.$refs.answerPopup.open("center")
  892. // this.closeAnswerPopup()
  893. }
  894. }
  895. } else {
  896. if (res.msg == "该课题到达答错次数限制") {
  897. this.errTitle = "答题次数超过限制"
  898. this.errDesc = "以后的课程要认真学习哦"
  899. this.$refs.answerPopup.open("center")
  900. } else {
  901. uni.showToast({
  902. title: res.msg,
  903. icon: "none"
  904. })
  905. }
  906. }
  907. },
  908. rej => {}
  909. )
  910. },
  911. // 选择
  912. rewardChange(e) {
  913. this.currentReward = e.detail.value
  914. },
  915. closeAnswerPopup() {
  916. this.$refs.answerPopup.close()
  917. if (this.errTitle == '恭喜你,回答正确') {
  918. const param = {
  919. ...this.urlOption,
  920. rewardType: Number(this.currentReward),
  921. }
  922. sendReward(param).then(res => {
  923. if(res.code == 200) {
  924. if(res.isNew&&res.isNew==1) {
  925. const packageInfo = res.data.packageInfo || ''
  926. if(packageInfo) {
  927. uni.setStorageSync('receive_package',packageInfo);
  928. if(res.mchId) uni.setStorageSync('mchId',res.mchId);
  929. uni.navigateTo({
  930. url: '/pages/course/reward'
  931. })
  932. }
  933. } else {
  934. uni.showToast({
  935. title: res.msg,
  936. icon: 'none'
  937. })
  938. }
  939. }else {
  940. uni.showToast({
  941. title: res.msg,
  942. icon: 'none'
  943. })
  944. }
  945. })
  946. }
  947. },
  948. // 线路
  949. openPop() {
  950. this.$refs.popup.open('bottom')
  951. },
  952. close() {
  953. this.$refs.popup.close()
  954. },
  955. handleLine(index) {
  956. var that=this;
  957. if (this.lineIndex == index && this.videoUrl == this.lineList[index]) {
  958. this.close()
  959. return
  960. } else {
  961. // let div = document.querySelector(".vjs-progress-control");
  962. // if(div) {
  963. // if (this.isFinish == 1 || this.isEnded || this.linkType == 1) {
  964. // div.style.pointerEvents = "auto";
  965. // } else {
  966. // div.style.pointerEvents = "none"; //禁止所有事件
  967. // }
  968. // }
  969. this.lineIndex = index
  970. this.videoUrl = this.lineList[index]
  971. this.tipsOpen = false
  972. this.playDurationSeek = this.playTime || 0
  973. this.player = uni.createVideoContext('video-content-box');
  974. setTimeout(function(){
  975. that.player.seek(that.playDurationSeek)
  976. that.player.play();
  977. },500);
  978. // this.player.src(this.lineList[index])
  979. // this.player.one('loadedmetadata', () => {
  980. // this.player.currentTime(this.playDurationSeek);
  981. // this.player.play();
  982. // });
  983. this.close()
  984. }
  985. },
  986. // 温馨提示
  987. openTipsPop() {
  988. this.$refs.tipsPopup.open()
  989. this.tipsOpen = true
  990. this.pause()
  991. },
  992. closeTipsPop() {
  993. this.$refs.tipsPopup.close()
  994. },
  995. // 客服
  996. getIsAddKf() {
  997. this.qrcode = ''
  998. this.qrcodeMsg = ''
  999. this.isAddKf = 0
  1000. // {videoId: this.videoId,qwUserId: this.qwUserId,corpId: this.corpId}
  1001. const param = {
  1002. ...this.urlOption
  1003. }
  1004. getIsAddKf(param).then(res => {
  1005. if (res.code == 200) {
  1006. if (this.urlOption.isRoom == 1 && res.qwExternalId) {
  1007. this.urlOption = {
  1008. ...this.urlOption,
  1009. qwExternalId: res.qwExternalId
  1010. }
  1011. }
  1012. this.isAddKf = 1
  1013. this.getH5CourseVideoDetails()
  1014. } else if (res.code == 400) {
  1015. this.isAddKf = 0
  1016. this.qrcode = res.qrcode
  1017. this.qrcodeMsg = res.msg
  1018. this.$refs.kfPopup.open()
  1019. } else if (res.code == 567) {
  1020. // 群聊通用链接
  1021. this.urlOption = {
  1022. ...this.urlOption,
  1023. qwExternalId: res.qwExternalId
  1024. }
  1025. this.isAddKf = 1
  1026. this.getH5CourseVideoDetails()
  1027. } else if (res.code == 504) {
  1028. if(this.source == 'app') {
  1029. this.postMessage({isFullscreen: false,login: 0})
  1030. } else {
  1031. // 登录
  1032. // #ifdef H5
  1033. if (isWechat) { //是否在微信浏览器中打开
  1034. this.loginByMp()
  1035. } else {
  1036. uni.navigateTo({
  1037. url: "/pages/auth/login"
  1038. });
  1039. }
  1040. // #endif
  1041. }
  1042. } else {
  1043. this.isAddKf = 0
  1044. uni.showToast({
  1045. title: res.msg,
  1046. icon: 'none'
  1047. });
  1048. }
  1049. },
  1050. err => {}
  1051. );
  1052. },
  1053. closeKFPop() {
  1054. this.$refs.kfPopup.close()
  1055. },
  1056. loginByMp() {
  1057. if(this.source == 'app') {
  1058. this.postMessage({isFullscreen: false,login: 0})
  1059. return
  1060. }
  1061. if (this.code == null||!this.code) {
  1062. if(this.sortLink) {
  1063. window.location.href = uni.getStorageSync('authDomainName') + '?sortLink='+this.sortLink
  1064. } else {
  1065. if(this.urlOption.link) {
  1066. window.location.href = uni.getStorageSync('authDomainName') + '?sortLink='+this.urlOption.link
  1067. } else {
  1068. this.isExpire = true
  1069. this.msg = '课程链接地址有误'
  1070. uni.showToast({
  1071. title: '课程链接地址有误',
  1072. icon: 'none'
  1073. });
  1074. }
  1075. }
  1076. return;
  1077. }
  1078. uni.showLoading({
  1079. title: "处理中..."
  1080. });
  1081. let that = this;
  1082. var data = {
  1083. code: this.code
  1084. }
  1085. loginByMp(data).then(res => {
  1086. uni.hideLoading();
  1087. if (res.code == 200) {
  1088. uni.setStorageSync(this.$TOKEN_KEY, res.token);
  1089. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  1090. this.isLogin = this.$isLogin()
  1091. if(this.isAddKf == 1) {
  1092. this.getH5CourseVideoDetails()
  1093. } else {
  1094. this.getIsAddKf()
  1095. }
  1096. } else {
  1097. uni.showToast({
  1098. title: res.msg,
  1099. icon: 'none'
  1100. });
  1101. }
  1102. },
  1103. err => {}
  1104. ).catch(err=>{
  1105. uni.hideLoading();
  1106. });
  1107. },
  1108. getFinishCourseVideo() {
  1109. if (!this.playTime||!this.$isLogin()||this.isAddKf != 1) return
  1110. // {videoId: this.videoId,duration:this.playTime}
  1111. const param = {
  1112. duration: this.playTime,
  1113. ...this.urlOption
  1114. }
  1115. getFinishCourseVideo(param)
  1116. },
  1117. // 每十分钟获得积分
  1118. getIntegralByH5Video() {
  1119. if (!this.$isLogin()||this.isAddKf != 1) return
  1120. const param = {
  1121. duration: this.playTime,
  1122. ...this.urlOption,
  1123. }
  1124. getIntegralByH5Video(param).then(res => {
  1125. if (res.code == 200) {
  1126. uni.showToast({
  1127. title: "积分+10",
  1128. icon: "none"
  1129. })
  1130. }
  1131. })
  1132. },
  1133. progressChange(e) {
  1134. this.bufferRate = Math.ceil(e.detail.buffered)
  1135. },
  1136. // 缓冲
  1137. getInternetTraffic() {
  1138. if (!this.$isLogin()||this.isAddKf != 1) return
  1139. const playVideoTime = Math.ceil(this.playTime / this.duration * 100) // 播放百分比
  1140. if(this.bufferRate == 0 || this.bufferRate < playVideoTime) {
  1141. this.bufferRate = playVideoTime
  1142. }
  1143. if(this.bufferRate == 0 || Number(this.bufferRate.toFixed(2)) == 0) return
  1144. const param = {
  1145. ...this.urlOption,
  1146. uuId: dayjs().format('YYYYMMDD') + this.uuId,
  1147. duration: this.playTime,
  1148. bufferRate: Number(this.bufferRate.toFixed(2)),
  1149. }
  1150. if(!param.bufferRate) return
  1151. internetTraffic(param)
  1152. },
  1153. getErrMsg(err,type) {
  1154. let msgerr = {
  1155. errType: type || 'error',
  1156. videoUrl: this.videoUrl,
  1157. lineIndex: this.lineIndex,
  1158. errTime: new Date(),
  1159. ip: this.ip,
  1160. errMsg: err || ''
  1161. }
  1162. getErrMsg({
  1163. msg: JSON.stringify(msgerr)
  1164. })
  1165. },
  1166. getLink() {
  1167. let that = this;
  1168. getRealLink({sortLink:this.sortLink}).then(res=>{
  1169. if(res.code == 200) {
  1170. this.isExpire = false
  1171. this.authDomainName = res.config.authDomainName || ''
  1172. if(this.authDomainName) {
  1173. uni.setStorageSync('authDomainName',this.authDomainName)
  1174. }
  1175. if(this.isLogin) {
  1176. window.location.replace(res.realLink)
  1177. } else{
  1178. const option = res.realLink.split('?course=')[1]
  1179. const urlOption = option ? JSON.parse(option) : {}
  1180. const videoId = urlOption.videoId || ''
  1181. this.getH5CourseByVideo(videoId)
  1182. }
  1183. } else {
  1184. this.isExpire = true
  1185. this.msg = '课程已过期或链接无效'
  1186. uni.showToast({
  1187. title: '课程已过期或链接无效',
  1188. icon: 'none'
  1189. });
  1190. }
  1191. }).catch(err=>{
  1192. this.isExpire = true
  1193. this.msg = '发生错误,请稍后再试'
  1194. uni.showToast({
  1195. title: '发生错误,请稍后再试',
  1196. icon: 'none'
  1197. });
  1198. })
  1199. },
  1200. /**
  1201. * 节流原理:在一定时间内,只能触发一次
  1202. *
  1203. * @param {Function} func 要执行的回调函数
  1204. * @param {Number} wait 延时的时间
  1205. * @param {Boolean} immediate 是否立即执行
  1206. * @return null
  1207. */
  1208. throttle(func, wait = 500, immediate = true) {
  1209. if (immediate) {
  1210. if (!this.flag) {
  1211. this.flag = true
  1212. // 如果是立即执行,则在wait毫秒内开始时执行
  1213. typeof func === 'function' && func()
  1214. this.timer = setTimeout(() => {
  1215. this.flag = false
  1216. }, wait)
  1217. }
  1218. } else if (!this.flag) {
  1219. this.flag = true
  1220. // 如果是非立即执行,则在wait毫秒内的结束处执行
  1221. this.timer = setTimeout(() => {
  1222. this.flag = false
  1223. typeof func === 'function' && func()
  1224. }, wait)
  1225. }
  1226. },
  1227. // 弹幕
  1228. keyboardHeightChange(res) {
  1229. // #ifndef H5
  1230. console.log("this.danmuboxHeight",this.danmuboxHeight)
  1231. this.danmuboxHeight = res.height
  1232. // #endif
  1233. },
  1234. openDanmu(type) {
  1235. this.openDanmuType = type
  1236. this.inputText = ''
  1237. if(type == 1) {
  1238. this.player.exitFullScreen()
  1239. }
  1240. this.$refs.danmuPopup.open()
  1241. },
  1242. changeShowPopup(val) {
  1243. this.focus = val.show
  1244. },
  1245. switchDanmu() {
  1246. this.showDanmu = this.showDanmu == 1 ? 0:1
  1247. if(this.showDanmu == 0&&this.$refs.danmuBox) {
  1248. this.$refs.danmuBox.activeDanmus = []
  1249. this.$refs.danmuBox.initTracks()
  1250. }
  1251. },
  1252. getScrollTop(res) {
  1253. if(this.currentTab == 2) {
  1254. this.scrollTop = res
  1255. } else {
  1256. this.scrollTop = 0
  1257. }
  1258. },
  1259. handleTab(index) {
  1260. this.currentTab = index
  1261. if(this.currentTab==2) {
  1262. if(this.$refs.commentBox) {
  1263. this.$refs.commentBox.msgs = []
  1264. this.$refs.commentBox.pageNum = 1
  1265. this.$refs.commentBox.getComments()
  1266. }
  1267. } else {
  1268. setTimeout(()=>{
  1269. this.scrollTop = 0
  1270. },100)
  1271. }
  1272. },
  1273. handleRefresher() {
  1274. this.triggered = true;
  1275. if (!this.isMore&&this.currentTab==2&&this.openCommentStatus==1) {
  1276. this.$nextTick(()=>{
  1277. this.$refs.commentBox&&this.$refs.commentBox.getComments()
  1278. })
  1279. }
  1280. setTimeout(() => {
  1281. this.triggered = false;
  1282. }, 500);
  1283. },
  1284. getMore(val) {
  1285. this.triggered = false;
  1286. this.isMore = val == 1
  1287. },
  1288. handleChatInput() {
  1289. this.inputText = this.inputText.trim()
  1290. if (this.inputText == "" || this.inputText.trim() == "") {
  1291. uni.showToast({
  1292. title: '请输入评论',
  1293. icon: "none"
  1294. })
  1295. return;
  1296. }
  1297. if(this.openCommentStatus==1) {
  1298. this.$refs.commentBox&&this.$refs.commentBox.handleInput(this.inputText)
  1299. } else if(this.openCommentStatus==2) {
  1300. this.$refs.danmuBox&&this.$refs.danmuBox.handleInput(this.inputText)
  1301. }
  1302. },
  1303. setInputText() {
  1304. this.inputText = ""
  1305. if(this.openCommentStatus==2) {
  1306. this.$refs.danmuPopup.close()
  1307. }
  1308. },
  1309. // app
  1310. postMessage(data) {
  1311. this.uniReady(() => {
  1312. uni.webView.postMessage({
  1313. data: data
  1314. });
  1315. })
  1316. },
  1317. uniReady(callback) {
  1318. if (uni.webView) {
  1319. callback()
  1320. } else {
  1321. document.addEventListener('UniAppJSBridgeReady', callback, { once: true })
  1322. }
  1323. },
  1324. plusReady(callback) {
  1325. if (window.plus) {
  1326. callback()
  1327. } else {
  1328. document.addEventListener('plusready', callback, { once: true })
  1329. }
  1330. },
  1331. handleGift() {
  1332. this.uniReady(() => {
  1333. uni.webView.postMessage({
  1334. data: {
  1335. isFullscreen: false,
  1336. login: 1,
  1337. productId: '',
  1338. pagesUrl:'/pages/user/integral/integralGoodsList'
  1339. }
  1340. });
  1341. })
  1342. },
  1343. // app奖励
  1344. getAppReward() {
  1345. const param = {
  1346. ...this.urlOption
  1347. }
  1348. sendAppReward(param).then(res => {
  1349. if(res.code == 200) {
  1350. this.$refs.appPopup.openPop()
  1351. } else {
  1352. uni.showToast({
  1353. title: res.msg,
  1354. icon: 'none'
  1355. })
  1356. }
  1357. })
  1358. },
  1359. }
  1360. }
  1361. </script>
  1362. <style scoped>
  1363. .full-width-popup {
  1364. width: 100%;
  1365. }
  1366. </style>
  1367. <style lang="scss" scoped>
  1368. @mixin u-flex($flexD, $alignI, $justifyC) {
  1369. display: flex;
  1370. flex-direction: $flexD;
  1371. align-items: $alignI;
  1372. justify-content: $justifyC;
  1373. }
  1374. .footer-tips {
  1375. margin-top: 14rpx;
  1376. text-align: center;
  1377. font-family: PingFang SC,PingFang SC;
  1378. font-weight: 500;
  1379. font-size: 12px;
  1380. color: #bbb;
  1381. }
  1382. .textOne {
  1383. overflow: hidden;
  1384. white-space: nowrap;
  1385. text-overflow: ellipsis;
  1386. }
  1387. .textTwo {
  1388. overflow: hidden;
  1389. text-overflow: ellipsis;
  1390. display: -webkit-box;
  1391. -webkit-line-clamp: 2;
  1392. -webkit-box-orient: vertical;
  1393. }
  1394. .expirebox {
  1395. height: 100vh;
  1396. @include u-flex(column, center, center);
  1397. font-family: PingFang SC, PingFang SC;
  1398. font-weight: 400;
  1399. font-size: 32rpx;
  1400. color: #757575;
  1401. image {
  1402. width: 428rpx;
  1403. height: 360rpx;
  1404. margin-bottom: 30rpx;
  1405. }
  1406. }
  1407. .reward-list {
  1408. width: 100%;
  1409. margin-top: 20rpx;
  1410. margin-bottom: -40rpx;
  1411. &-group {
  1412. font-family: PingFang SC, PingFang SC;
  1413. font-weight: 400;
  1414. font-size: 14px;
  1415. color: #222222;
  1416. @include u-flex(row, center, center);
  1417. }
  1418. &-option {
  1419. @include u-flex(row, center, flex-start);
  1420. &:first-child {
  1421. margin-right: 40rpx;
  1422. }
  1423. }
  1424. }
  1425. .err {
  1426. color: #f56c6c !important;
  1427. }
  1428. .kfqrcode-box {
  1429. background-color: #fff;
  1430. border-radius: 16rpx;
  1431. max-width: 560rpx;
  1432. padding: 60rpx 40rpx;
  1433. margin-top: -100rpx;
  1434. box-sizing: border-box;
  1435. @include u-flex(column, center, flex-start);
  1436. font-family: PingFang SC, PingFang SC;
  1437. font-weight: 400;
  1438. font-size: 34rpx;
  1439. color: #222;
  1440. position: relative;
  1441. text-align: center;
  1442. .kfqrcode {
  1443. height: 460rpx;
  1444. width: 460rpx;
  1445. }
  1446. }
  1447. .kfqrcode-close {
  1448. width: 64rpx;
  1449. height: 64rpx;
  1450. position: absolute;
  1451. bottom: -100rpx;
  1452. left: 50%;
  1453. transform: translateX(-50%);
  1454. }
  1455. .tipsPopup-mask {
  1456. position: relative;
  1457. width: 560rpx;
  1458. background-color: transparent;
  1459. .red_envelope_top {
  1460. width: 480rpx;
  1461. height: 360rpx;
  1462. margin: 0 auto;
  1463. display: inherit;
  1464. }
  1465. }
  1466. .tipsPopup-btn-box {
  1467. width: 456rpx;
  1468. height: 104rpx;
  1469. padding: 4rpx;
  1470. box-sizing: border-box;
  1471. background: linear-gradient(180deg, rgba(252, 209, 94, 1), rgba(254, 253, 251, 1));
  1472. border-radius: 52rpx;
  1473. }
  1474. .tipsPopup-btn {
  1475. width: 100%;
  1476. height: 100%;
  1477. background: linear-gradient(180deg, #FF9F22 0%, #FA1E05 100%);
  1478. border-radius: 52rpx 52rpx 52rpx 52rpx;
  1479. font-family: PingFang SC, PingFang SC;
  1480. font-weight: 500;
  1481. font-size: 36rpx;
  1482. color: #FFFFFF;
  1483. line-height: 96rpx;
  1484. text-align: center;
  1485. }
  1486. .tipsPopup {
  1487. width: 560rpx;
  1488. padding: 12rpx;
  1489. margin-top: -72rpx;
  1490. box-sizing: border-box;
  1491. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1492. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1493. position: relative;
  1494. &-close {
  1495. width: 64rpx;
  1496. height: 64rpx;
  1497. position: absolute;
  1498. right: 0;
  1499. top: -188rpx;
  1500. }
  1501. &-line {
  1502. padding: 3rpx;
  1503. box-sizing: border-box;
  1504. background: linear-gradient(180deg, rgba(247, 245, 220, 1), rgba(250, 220, 157, 1));
  1505. border-radius: 24rpx;
  1506. }
  1507. &-box {
  1508. padding: 0 40rpx 40rpx 40rpx;
  1509. box-sizing: border-box;
  1510. background: linear-gradient(180deg, #FFFBEF 0%, #FFFFF5 43%, #F5EAC2 100%);
  1511. border-radius: 24rpx;
  1512. @include u-flex(column, center, flex-start);
  1513. }
  1514. &-head {
  1515. @include u-flex(row, center, center);
  1516. &-title {
  1517. width: 364rpx;
  1518. height: auto;
  1519. margin-top: -22rpx;
  1520. }
  1521. }
  1522. &-content {
  1523. margin: 48rpx 0;
  1524. font-family: PingFang SC, PingFang SC;
  1525. font-weight: 500;
  1526. font-size: 32rpx;
  1527. color: #222222;
  1528. text-align: center;
  1529. &-title {
  1530. margin-bottom: 26rpx;
  1531. font-weight: 600;
  1532. font-size: 40rpx;
  1533. color: #FF5C03;
  1534. }
  1535. }
  1536. }
  1537. .video-controls-box {
  1538. width: 100%;
  1539. height: calc(100% - 44px);
  1540. overflow: hidden;
  1541. position: absolute;
  1542. top: 0;
  1543. left: 0;
  1544. z-index: 2;
  1545. // background: rgba(0, 0, 0, 0.2);
  1546. .video-play {
  1547. height: 72rpx;
  1548. width: 72rpx;
  1549. position: absolute;
  1550. top: calc(50% + 22px);
  1551. left: 50%;
  1552. transform: translate(-50%, -50%);
  1553. }
  1554. }
  1555. .video-controls {
  1556. width: 100%;
  1557. height: 80rpx;
  1558. padding: 0 28rpx;
  1559. box-sizing: border-box;
  1560. position: absolute;
  1561. bottom: 0;
  1562. left: 0;
  1563. display: flex;
  1564. align-items: center;
  1565. justify-content: space-between;
  1566. background: linear-gradient(to top, #222 0%, transparent 80%);
  1567. .video-icon {
  1568. height: 44rpx;
  1569. width: 44rpx;
  1570. }
  1571. }
  1572. .errQuesbox {
  1573. width: 100%;
  1574. max-height: 260rpx;
  1575. overflow-y: auto;
  1576. margin-top: 24rpx;
  1577. font-family: PingFang SC, PingFang SC;
  1578. font-weight: 500;
  1579. font-size: 30rpx;
  1580. color: #222222;
  1581. &-item {
  1582. width: 100%;
  1583. height: 128rpx;
  1584. line-height: 128rpx;
  1585. margin-bottom: 24rpx;
  1586. padding: 0 30rpx;
  1587. box-sizing: border-box;
  1588. overflow: hidden;
  1589. background: #fff;
  1590. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1591. position: relative;
  1592. &::after {
  1593. content: "题目";
  1594. min-width: 64rpx;
  1595. height: 36rpx;
  1596. padding: 0 12rpx;
  1597. line-height: 36rpx;
  1598. background: #FF5C03;
  1599. box-sizing: border-box;
  1600. border-radius: 0rpx 0rpx 16rpx 0rpx;
  1601. text-align: center;
  1602. font-family: PingFang SC, PingFang SC;
  1603. font-weight: 500;
  1604. font-size: 20rpx;
  1605. color: #fff;
  1606. position: absolute;
  1607. left: 0;
  1608. top: 0;
  1609. }
  1610. }
  1611. }
  1612. .bg {
  1613. background: #fff !important;
  1614. }
  1615. .answerPopup {
  1616. &-box {
  1617. width: 560rpx;
  1618. background: linear-gradient(180deg, #FFFAF6 0%, #FEECD8 100%);
  1619. border-radius: 32rpx 32rpx 32rpx 32rpx;
  1620. background-color: #fff;
  1621. font-weight: 400;
  1622. padding: 32rpx;
  1623. box-sizing: border-box;
  1624. position: relative;
  1625. @include u-flex(column, center, flex-start);
  1626. font-family: PingFang SC, PingFang SC;
  1627. font-weight: 400;
  1628. .tipimg {
  1629. width: 206rpx;
  1630. height: 206rpx;
  1631. margin-bottom: 16rpx;
  1632. }
  1633. }
  1634. &-title {
  1635. font-weight: 600;
  1636. font-size: 36rpx;
  1637. color: #222222;
  1638. }
  1639. &-desc {
  1640. margin-top: 10rpx;
  1641. font-size: 28rpx;
  1642. color: #757575;
  1643. }
  1644. &-btn {
  1645. width: 464rpx;
  1646. height: 84rpx;
  1647. margin-top: 54rpx;
  1648. margin-bottom: 16rpx;
  1649. background: #FF5C03;
  1650. border-radius: 42rpx;
  1651. font-weight: 500;
  1652. font-size: 32rpx;
  1653. color: #FFFFFF;
  1654. text-align: center;
  1655. line-height: 84rpx;
  1656. }
  1657. }
  1658. .popupbox {
  1659. width: 100%;
  1660. background-color: #fff;
  1661. border-radius: 16rpx 16rpx 0 0;
  1662. padding: 24rpx 32rpx;
  1663. position: relative;
  1664. &-head {
  1665. height: 60rpx;
  1666. margin-bottom: 30rpx;
  1667. text-align: center;
  1668. overflow-y: auto;
  1669. color: #414858;
  1670. font-size: 32rpx;
  1671. font-weight: bold;
  1672. position: relative;
  1673. .close-icon {
  1674. position: absolute;
  1675. right: 0;
  1676. top: 0;
  1677. height: 40rpx;
  1678. width: 40rpx;
  1679. }
  1680. }
  1681. &-content {
  1682. height: 20vh;
  1683. overflow-y: auto;
  1684. display: flex;
  1685. align-items: flex-start;
  1686. flex-wrap: wrap;
  1687. gap: 32rpx;
  1688. .line-item {
  1689. display: inline-block;
  1690. min-width: 200rpx;
  1691. min-height: 60rpx;
  1692. padding: 0 20rpx;
  1693. box-sizing: border-box;
  1694. border-radius: 50rpx;
  1695. overflow: hidden;
  1696. background-color: #f7f7f7;
  1697. text-align: center;
  1698. color: #414858;
  1699. font-size: 28rpx;
  1700. line-height: 60rpx;
  1701. }
  1702. .line-active {
  1703. color: #f56c6c !important;
  1704. background-color: #fef0f0 !important;
  1705. }
  1706. }
  1707. }
  1708. .content {
  1709. padding-bottom: calc(var(--window-bottom));
  1710. .video-box {
  1711. width: 100%;
  1712. height: 420rpx;
  1713. overflow: hidden;
  1714. position: relative;
  1715. #myVideo {
  1716. width: 100%;
  1717. height: 100%;
  1718. }
  1719. }
  1720. .video-poster {
  1721. width: 100%;
  1722. height: 420rpx;
  1723. }
  1724. .miantitlebox {
  1725. padding: 30rpx 0;
  1726. border-bottom: 2rpx solid #F5F7FA;
  1727. font-family: PingFang SC, PingFang SC;
  1728. font-weight: 500;
  1729. font-size: 36rpx;
  1730. color: #222222;
  1731. }
  1732. .subtitlebox {
  1733. padding: 30rpx 0;
  1734. border-bottom: 2rpx solid #F5F7FA;
  1735. font-family: PingFang SC, PingFang SC;
  1736. font-weight: 500;
  1737. font-size: 36rpx;
  1738. color: #222222;
  1739. }
  1740. .title-content {
  1741. padding: 0 32rpx;
  1742. background-color: #fff;
  1743. font-size: 28rpx;
  1744. line-height: 1.6;
  1745. @include u-flex(row, center, space-between);
  1746. .title {
  1747. font-size: 36rpx;
  1748. font-weight: 500;
  1749. color: #414858;
  1750. }
  1751. .time-or-subtitle {
  1752. margin-top: 12rpx;
  1753. color: #666666;
  1754. }
  1755. .giftbtn {
  1756. flex-shrink: 0;
  1757. padding: 6rpx 16rpx;
  1758. background: #FF5C03;
  1759. border-radius: 42rpx 42rpx 42rpx 42rpx;
  1760. @include u-flex(row, center, center);
  1761. font-family: PingFang SC;
  1762. font-weight: 500;
  1763. font-size: 28rpx;
  1764. color: #FFFFFF;
  1765. }
  1766. }
  1767. .video-line {
  1768. min-width: 140rpx;
  1769. max-width: 200rpx;
  1770. height: 60rpx;
  1771. padding: 0 20rpx;
  1772. box-sizing: border-box;
  1773. border-radius: 50rpx 0 0 50rpx;
  1774. overflow: hidden;
  1775. background-color: #fff;
  1776. text-align: center;
  1777. color: #888;
  1778. font-size: 28rpx;
  1779. line-height: 60rpx;
  1780. display: inline-flex;
  1781. align-items: center;
  1782. justify-content: center;
  1783. position: fixed;
  1784. right: 0;
  1785. z-index: 9;
  1786. bottom: calc(var(--window-bottom) + 280rpx);
  1787. box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, .12);
  1788. image {
  1789. flex-shrink: 0;
  1790. height: 34rpx;
  1791. width: 34rpx;
  1792. margin-right: 6rpx;
  1793. }
  1794. }
  1795. .footer {
  1796. border-top: 1rpx solid #ededef;
  1797. background: #fff;
  1798. width: 100%;
  1799. position: fixed;
  1800. bottom: 0;
  1801. padding: 18rpx 32rpx;
  1802. padding-bottom: calc(var(--window-bottom) + 18rpx);
  1803. box-sizing: border-box;
  1804. z-index: 9;
  1805. &-btn {
  1806. width: 100%;
  1807. height: 98rpx;
  1808. background: #FF5C03;
  1809. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1810. line-height: 98rpx;
  1811. text-align: center;
  1812. font-family: PingFang SC, PingFang SC;
  1813. font-weight: 600;
  1814. font-size: 32rpx;
  1815. color: #FFFFFF;
  1816. @include u-flex(row, center, center);
  1817. &-img {
  1818. flex-shrink: 0;
  1819. width: 144rpx;
  1820. height: 144rpx;
  1821. margin-right: 8rpx;
  1822. margin-top: -24rpx;
  1823. }
  1824. }
  1825. &-btn-border {
  1826. position: relative;
  1827. &::after {
  1828. content: "";
  1829. background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  1830. position: absolute;
  1831. top: -2rpx;
  1832. left: 0;
  1833. height: 103rpx;
  1834. width: 100%;
  1835. z-index: -1;
  1836. border-radius: 49rpx 49rpx 49rpx 49rpx;
  1837. box-shadow: 0rpx 8rpx 11rpx 0rpx rgba(255, 92, 3, 0.3);
  1838. overflow: hidden;
  1839. }
  1840. }
  1841. }
  1842. }
  1843. .agreement {
  1844. display: inline-flex;
  1845. margin-top: 16rpx;
  1846. font-size: 24rpx;
  1847. color: #525252;
  1848. align-items: center;
  1849. justify-content: center;
  1850. }
  1851. .logo {
  1852. display: inline-block;
  1853. width: 30px;
  1854. height: auto;
  1855. margin: 20px 0 0 10px;
  1856. pointer-events: none;
  1857. object-fit: cover;
  1858. }
  1859. .logo-full {
  1860. display: inline-block;
  1861. width: 40px;
  1862. height: auto;
  1863. margin: 50px 0 0 30px;
  1864. pointer-events: none;
  1865. object-fit: cover;
  1866. }
  1867. .tabbox {
  1868. @include u-flex(row, center, center);
  1869. border-bottom: 2rpx solid #F5F7FA;
  1870. height: 44px;
  1871. background-color: #fff;
  1872. view {
  1873. flex: 1;
  1874. padding: 20rpx 0;
  1875. margin-right: 40rpx;
  1876. text-align: center;
  1877. }
  1878. &-active {
  1879. position: relative;
  1880. &::after {
  1881. position: absolute;
  1882. bottom: 0;
  1883. left: 50%;
  1884. transform: translateX(-50%);
  1885. content: "";
  1886. width: 3rem;
  1887. border-bottom: 4px solid #FF5C03;
  1888. }
  1889. }
  1890. }
  1891. .chatinput {
  1892. position: fixed;
  1893. left: 32rpx;
  1894. right: 32rpx;
  1895. z-index: 999;
  1896. bottom: calc(var(--window-bottom) + 24rpx);
  1897. height: 96rpx;
  1898. background-color: green;
  1899. background: #FFFFFF;
  1900. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  1901. border-radius: 24rpx 24rpx 24rpx 24rpx;
  1902. @include u-flex(row, center, center);
  1903. padding: 0 24rpx;
  1904. box-sizing: border-box;
  1905. .uni-input {
  1906. flex: 1;
  1907. margin-right: 32rpx;
  1908. font-size: 30rpx;
  1909. }
  1910. .send {
  1911. font-family: PingFang SC, PingFang SC;
  1912. font-weight: 400;
  1913. font-size: 28rpx;
  1914. color: #FFFFFF !important;
  1915. flex-shrink: 0;
  1916. padding: 0 20rpx;
  1917. height: 72rpx;
  1918. background: #FF5C03 !important;
  1919. border-radius: 8rpx 8rpx 8rpx 8rpx;
  1920. &::after {
  1921. border: none;
  1922. }
  1923. }
  1924. }
  1925. .danmu-line {
  1926. bottom: calc(var(--window-bottom) + 370rpx) !important;
  1927. word-break: keep-all;
  1928. .set_image {
  1929. height: 40rpx;
  1930. width: 40rpx;
  1931. }
  1932. }
  1933. .video-danmu-btnbox {
  1934. width: 50px;
  1935. height: 50px;
  1936. border-radius: 50%;
  1937. overflow: hidden;
  1938. position: absolute;
  1939. right: 10px;
  1940. bottom: calc(50% - 50px);
  1941. transform: translateY(-50%);
  1942. padding: 8px;
  1943. box-sizing: border-box;
  1944. }
  1945. .video-danmu-image {
  1946. width: 100%;
  1947. height: 100%;
  1948. }
  1949. .danmuPopup-input {
  1950. flex: 1;
  1951. height: 35px;
  1952. border-radius: 35px;
  1953. border: 1rpx solid #eee;
  1954. padding: 0 24rpx;
  1955. }
  1956. .danmuPopup {
  1957. background-color: #fff;
  1958. padding-bottom: calc(var(--window-bottom) + 10px);
  1959. &-head {
  1960. width: 100%;
  1961. padding: 10px;
  1962. box-sizing: border-box;
  1963. overflow: hidden;
  1964. @include u-flex(row,center,flex-start);
  1965. .danmu-icon {
  1966. height: 24px;
  1967. width: 24px;
  1968. margin-right: 12px;
  1969. }
  1970. }
  1971. &-send {
  1972. flex-shrink: 0;
  1973. height: 35px;
  1974. display: flex;
  1975. align-items: center;
  1976. justify-content: center;
  1977. padding: 5px 15px;
  1978. box-sizing: border-box;
  1979. background: #FF5C03 !important;
  1980. border-radius: 22px;
  1981. font-family: PingFang SC, PingFang SC;
  1982. font-weight: 500;
  1983. font-size: 15px;
  1984. color: #fff !important;
  1985. margin-left: 12px;
  1986. &::after {
  1987. border: none;
  1988. }
  1989. }
  1990. &-con {
  1991. background-color: #F5F7FA;
  1992. padding: 24px 12px 48px 12px;
  1993. font-family: PingFang SC, PingFang SC;
  1994. font-weight: 400;
  1995. font-size: 14px;
  1996. color: #757575;
  1997. }
  1998. }
  1999. .answerTip {
  2000. position: fixed;
  2001. right: 0;
  2002. z-index: 9;
  2003. bottom: calc(var(--window-bottom) + 380rpx);
  2004. box-shadow: 0rpx 8rpx 21rpx 0rpx rgba(0, 0, 0, 0.1);
  2005. border-radius: 24rpx 24rpx 24rpx 24rpx;
  2006. background-color: #ff5c03;
  2007. color: #fff;
  2008. border-radius: 50%;
  2009. height: 90rpx;
  2010. width: 90rpx;
  2011. font-size: 25rpx;
  2012. text-align: center;
  2013. padding: 10rpx;
  2014. @include u-flex(column, center, center);
  2015. }
  2016. </style>