learningNewApp.vue 52 KB

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