detail.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720
  1. <template>
  2. <view>
  3. <view style="position: fixed;width: 100%;z-index: 999;background: #FFFFFF;top: 0;" id="top">
  4. <view class="video_box" v-if="!startStatus">
  5. <image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
  6. <image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
  7. </view>
  8. <view v-else>
  9. <view class="video_box" style="width: 100%;height: 460rpx;" v-if="playVID">
  10. <polyv-player
  11. id="playerVideo"
  12. playerId="playerVideo"
  13. height="460rpx"
  14. :vid="vid"
  15. :showSettingBtn="true"
  16. :enablePlayGesture="true"
  17. @statechange="onStateChange"
  18. :autoplay="autoplay"
  19. :isAllowSeek="isAllowSeek"
  20. :playbackRate="playbackRate"
  21. :startTime="startTime"
  22. ></polyv-player>
  23. </view>
  24. <view class="video_box" style="width: 100%;height: 460rpx;" v-if="playChannelId>0">
  25. <player
  26. class="plv-mp-demo-player"
  27. :videoOption="videoOption"
  28. @onLiveStatusChange="playerLiveStatusChange"
  29. />
  30. </view>
  31. </view>
  32. <view>
  33. <u-row>
  34. <u-col span="10">
  35. <view class="video_t1">{{ detail.courseName }}</view>
  36. </u-col>
  37. <u-col span="2" v-if="false">
  38. <view class="video_t1_t" @click="openJY">
  39. <image src="/static/icon/jy_icon.png" style="width: 40rpx;height: 40rpx;"></image>
  40. 讲义
  41. </view>
  42. </u-col>
  43. </u-row>
  44. </view>
  45. <u-line color="#D6D6DB" />
  46. <view style="display: flex;justify-content: center;">
  47. <view><u-tabs :list="list" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
  48. </view>
  49. <u-line color="#D6D6DB" />
  50. </view>
  51. <view class="box">
  52. <!--目录 -->
  53. <view v-show="current == 0">
  54. <view class="menuBox" v-for="(item, index) in menuList" :key="index">
  55. <!--模块 -->
  56. <view v-if="item.type == 1"><courseModule :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  57. <!--章 -->
  58. <view v-if="item.type == 2"><courseChapter :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
  59. <!--节 -->
  60. <view v-if="item.type == 3"><courseSection :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
  61. </view>
  62. </view>
  63. <!--笔记 -->
  64. <view v-show="current == 1">
  65. <view v-if="noteList.length == 0" style="text-align: center;">暂无笔记</view>
  66. <view class="inputBottom">
  67. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  68. <view style="width: 73%;height: 100%;padding: 10rpx 0;">
  69. <u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
  70. </view>
  71. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
  72. </view>
  73. <view v-for="(item, index) in noteList" :key="index">
  74. <view class="dateBox">{{ $method.timestampToTime(item.dateNote) }}</view>
  75. <view class="noteBox">
  76. <view v-for="(item1, index1) in item.userNotes" :key="index1" style="margin-top: 30rpx;" @click="jumpNote(item1)">
  77. <view style="display: flex;">
  78. <view>
  79. <view>
  80. <image src="/static/icon/note2.png" v-if="noteId != item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  81. <image src="/static/icon/note1.png" v-if="noteId == item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  82. </view>
  83. <view class="title" style="width: 39rpx;height: 39rpx;margin:0 29rpx;">{{ $method.secondToDate(item1.noteSecond) }}</view>
  84. </view>
  85. <view style="margin-left: 10rpx;">
  86. <view class="t2Content leftPadding">{{ item1.sectionName }}</view>
  87. <view class="tBox2">{{ item1.noteText }}</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <!--答疑 -->
  95. <view v-show="current == 2">
  96. <view class="inputBottom">
  97. <view class="flex_auto">
  98. <u-input height="60" fixed="true" :placeholder="placeholder" type="textarea" :custom-style="inputStyle" v-model="ctxValue" />
  99. </view>
  100. <view class="btn" @click="postContent">提交</view>
  101. </view>
  102. <view v-for="(item, index) in answerList" :key="index" style="background-color: #FFFFFF;margin-bottom: 20rpx;">
  103. <view class="chat_box" @click.stop="clearCtx">
  104. <view style="display: flex;">
  105. <view><image :src="$method.splitImgHost(item.avatar)" style="width: 64rpx;height: 64rpx;"></image></view>
  106. <view style="margin-left: 15rpx;">
  107. <view class="chat1">{{ item.realname }}</view>
  108. <view class="chat2">{{ $method.timestampToTime(item.createTime) }}</view>
  109. <view class="chat3">
  110. <text v-if="item.assignUserId > 0">回复</text>
  111. <text v-if="item.assignUserId > 0" style="color: #007AFF;">@{{ item.assignRealname }}</text>
  112. {{ item.answerText }}
  113. </view>
  114. </view>
  115. </view>
  116. <view class="btnReply" @click.stop="replyContent(item)" v-if="item.userId != userInfo.userId">回复</view>
  117. <view v-else class="btnDel" @click.stop="delContent(item)">删除</view>
  118. </view>
  119. <u-line color="#D6D6DB" />
  120. </view>
  121. <view v-if="answerList.length == 0" style="text-align: center;">暂无记录</view>
  122. </view>
  123. <!--目录 -->
  124. <view v-show="current == 3" >
  125. <view class="menuBox" v-for="(item, index) in reMenuList" :key="index">
  126. <!--模块 -->
  127. <view v-if="item.type == 1"><courseModule :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  128. <!--章 -->
  129. <view v-if="item.type == 2">
  130. <courseChapter :courseId="courseId" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>
  131. </view>
  132. <!--节 -->
  133. <view v-if="item.type == 3">
  134. <courseSection :courseId="courseId" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <!-- 播放前拍照end -->
  140. <u-popup v-model="showSet" :mask-close-able="false" mode="center" border-radius="24">
  141. <view style="align-items:center;padding: 0 40rpx;display: flex;flex-direction: column;justify-content:center;">
  142. <view style="font-weight: bold;color: #333333;font-size: 30rpx;margin-top: 30rpx;">温馨提示</view>
  143. <view style="width: 457rpx;color: #666666;font-size: 30rpx;margin-top: 30rpx;">学习过程中需要拍照验证学员身份,
  144. 拍照功能需要使用您的相机。
  145. 是否授权使用?</view>
  146. <view style="margin: 40rpx 0;">
  147. <button open-type="openSetting" @bindopensetting="openSetting" class="btnSet">去授权</button>
  148. </view>
  149. </view>
  150. </u-popup>
  151. <u-mask :show="photoPopup" >
  152. <!-- 播放前拍照start -->
  153. <view v-if="photoPopup" :mask-close-able="false" style="bottom: 0;position: fixed;width: 100%;z-index: 999;">
  154. <view class="photoBox">
  155. <view class="photoTop">
  156. <view class="sqzz" v-if="false"><u-icon name="close" color="#333333" size="30" @click="closePhoto"></u-icon></view>
  157. <view class="centersq">请正视手机屏幕</view>
  158. <view class="sqzz"></view>
  159. </view>
  160. <view class="photoCenter">
  161. <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
  162. <camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
  163. </view>
  164. <view class="custom"><image src="/static/zhezhao.png" mode=""></image></view>
  165. </view>
  166. <view class="btnResult" @click="takePhoto">拍照</view>
  167. </view>
  168. </view>
  169. </u-mask>
  170. </view>
  171. </template>
  172. <script>
  173. import plv from '../static/polyv-sdk/index';
  174. import courseModule from '@/components/course/courseModule.vue';
  175. import courseChapter from '@/components/course/courseChapter.vue';
  176. import courseSection from '@/components/course/courseSection.vue';
  177. import { mapGetters } from 'vuex';
  178. export default {
  179. components: {
  180. courseModule,
  181. courseChapter,
  182. courseSection
  183. },
  184. data() {
  185. return {
  186. initLiveOk:false,
  187. livePlay:false, //是否正在播放直播,不含暂停
  188. liveDuration:0, //直播观看时长
  189. videoOption:{
  190. mode: 'live',
  191. uid: '',
  192. cid: '',
  193. openId: '',
  194. isAutoChange: false,
  195. forceVideo: false,
  196. },
  197. liveDetail:{},
  198. showSet:false,
  199. startStatus: false,
  200. detail: {},
  201. courseId: 0,
  202. placeholder: '您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记',
  203. inputStyle: {
  204. background: 'rgba(244, 244, 244, 0.98)',
  205. borderRadius: '24rpx',
  206. padding: '8rpx',
  207. marginBottom: '10rpx'
  208. },
  209. list: [],
  210. menuList: [],
  211. current: 0,
  212. vid: '',
  213. goodsId: 0,
  214. goodsData: {},
  215. photoPopup: false,
  216. goodsPlayConfig: null,
  217. autoplay: false,
  218. isAllowSeek: 'no',
  219. playbackRate: [1.0],
  220. timer: null,
  221. goodsPhotographConfig: null,
  222. intervalTimeList: [], // 间隔拍照时长
  223. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  224. playTime: 0, //页面播放时长,不含暂停
  225. currentTime: 0,
  226. avatarUrl: '',
  227. ossAvatarUrl: '',
  228. studyDuration: 0, // 当前视频时长
  229. gradeId: 0,
  230. chapterId: 0,
  231. moduleId: 0,
  232. reMenuList: [],
  233. answerList: [],
  234. assignUserId: 0,
  235. placeholder: '您可以在这里输入答疑内容',
  236. ctxValue: '',
  237. noteList: [],
  238. noteValue: '',
  239. noteId: 0,
  240. recordObj: 0,
  241. gradeDetail:{},
  242. needSeek: false, //第一次播放是否需要跳转
  243. needProfileModal:false, //是否需要资料审核弹框
  244. liveObj:{},
  245. photoNum:0,
  246. photoList:[], //拍照的时间点
  247. photoConfig:false, //是否配置好拍照次数
  248. photoIndex:0, //当前位于拍照的区间下标 从0开始
  249. photoHistoryList:[], //已拍照历史的下标点
  250. };
  251. },
  252. computed: { ...mapGetters(['userInfo', 'playSectionId','playChannelId','playVID']) },
  253. onLoad(option) {
  254. console.log(this.userInfo,789)
  255. this.courseId = Number(option.id);
  256. this.goodsId = Number(option.goodsId);
  257. this.courseDetail();
  258. this.getGoodsDetail();
  259. this.getAnswerList();
  260. let noteSecond = Number(option.noteSecond);
  261. if(noteSecond>0){
  262. //我的消息跳过来,播放节
  263. let item = {
  264. sectionId:Number(option.sectionId),
  265. recordingUrl:option.recordingUrl,
  266. noteSecond:noteSecond
  267. }
  268. this.$store.commit('setPlaySectionId', {playSectionId :item.sectionId});
  269. this.playNoteVideo(item);
  270. }
  271. },
  272. onShow() {
  273. var self = this;
  274. //相机授权
  275. this.getCameraSetting()
  276. this.$api.getbaseprofiletplists({ goodsId: self.goodsId }).then(res => {
  277. if (res.data.code === 200 && res.data.rows.length) {
  278. if (res.data.rows[0].keyValue) {
  279. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId }).then(result => {
  280. if (result.data.code === 200) {
  281. if (!result.data.data || (result.data.data.status === 3 && result.data.data.changeStatus === 1)) {
  282. if (!result.data.data) {
  283. self.needProfileModal = true
  284. uni.showModal({
  285. content: '请前往填写资料',
  286. cancelText: '返回',
  287. success: function(resultst) {
  288. if (resultst.confirm) {
  289. self.$navTo.togo('/pages2/verify/input', {
  290. id: self.goodsId
  291. });
  292. }
  293. if (resultst.cancel) {
  294. uni.navigateBack();
  295. }
  296. }
  297. });
  298. } else {
  299. self.needProfileModal = true
  300. uni.showModal({
  301. content: '资料审核不通过,请前往重新填写',
  302. cancelText: '返回',
  303. success: function(resultst) {
  304. if (resultst.confirm) {
  305. self.$navTo.togo('/pages2/verify/input', {
  306. id: self.goodsId
  307. });
  308. }
  309. if (resultst.cancel) {
  310. uni.navigateBack();
  311. }
  312. }
  313. });
  314. }
  315. } else if (result.data.data.status === 1 && res.data.rows[0].keyValue2) {
  316. self.$api.getbaseprofileStampgetInfo({ goodsId: self.goodsId }).then(k => {
  317. if (k.data.code === 200) {
  318. if (!k.data.data || (k.data.data.status === 3 && k.data.data.changeStatus === 1)) {
  319. if (!k.data.data) {
  320. self.needProfileModal = true
  321. uni.showModal({
  322. cancelText: '返回',
  323. content: '请前往填写盖章资料',
  324. success: function(resultst) {
  325. if (resultst.confirm) {
  326. self.$navTo.togo('/pages2/verify/input2', {
  327. id: self.goodsId
  328. });
  329. }
  330. if (resultst.cancel) {
  331. uni.navigateBack();
  332. }
  333. }
  334. });
  335. } else {
  336. self.needProfileModal = true
  337. uni.showModal({
  338. cancelText: '返回',
  339. content: '资料盖章审核不通过,请前往重新填写',
  340. success: function(resultst) {
  341. if (resultst.confirm) {
  342. self.$navTo.togo('/pages2/verify/input2', {
  343. id: self.goodsId
  344. });
  345. }
  346. if (resultst.cancel) {
  347. uni.navigateBack();
  348. }
  349. }
  350. });
  351. }
  352. }
  353. }
  354. });
  355. }
  356. }
  357. });
  358. }
  359. }
  360. });
  361. console.log(this.gradeId,7512)
  362. if(this.gradeId>0){
  363. //提交完资料返回判断是否已开班
  364. this.getGradeInfo()
  365. }
  366. },
  367. onUnload() {
  368. if (this.playSectionId > 0) {
  369. //退出提交记录
  370. this.postStudyRecord();
  371. }
  372. //清除正在播放的节ID
  373. this.$store.commit('setPlaySectionId', { playSectionId: 0 });
  374. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  375. this.$store.commit('setPlayVID', { playVID: null });
  376. this.closePlv()
  377. //移除所有的事件监听器
  378. uni.$off();
  379. if (this.timer) {
  380. clearInterval(this.timer);
  381. }
  382. },
  383. mounted() {
  384. uni.$on('changeSection', oldSectionId => {
  385. console.log(this.playVID)
  386. //清除直播
  387. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  388. this.postStudyRecord(0, oldSectionId);
  389. });
  390. uni.$on('getSection', item => {
  391. //清除直播
  392. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  393. this.playVideo(item);
  394. });
  395. uni.$on('levelId', item => {
  396. let arr = item.split('-');
  397. //点击节获取的各层级ID
  398. this.moduleId = arr[0];
  399. this.chapterId = arr[1];
  400. });
  401. uni.$on('getChannel', item => {
  402. //清除录播
  403. this.$store.commit('setPlayVID', {playVID :null});
  404. this.playChannel(item);
  405. });
  406. },
  407. methods: {
  408. getPhotoLastRecord() {
  409. let self = this;
  410. let data = {
  411. sectionId: parseInt(self.playSectionId),
  412. goodsId: parseInt(self.goodsId),
  413. courseId: parseInt(self.courseId),
  414. gradeId: parseInt(self.gradeId)}
  415. this.$api.getPhotoLastRecord(data).then(res => {
  416. if(res.data.code==200){
  417. self.photoHistoryList = []
  418. for(let i=0;i<res.data.data.length;i++){
  419. self.photoHistoryList.push(res.data.data[i].photoIndex)
  420. }
  421. console.log(self.photoHistoryList,789)
  422. }
  423. });
  424. },
  425. postCoursePhotoRecord() {
  426. let currentTime = 0;
  427. var polyvPlayerContext = this.selectComponent('#playerVideo');
  428. if (polyvPlayerContext) {
  429. currentTime = polyvPlayerContext.getCurrentTime();
  430. }
  431. let self = this;
  432. let data = {
  433. photo: self.ossAvatarUrl,
  434. sectionId: parseInt(self.playSectionId),
  435. goodsId: parseInt(self.goodsId),
  436. courseId: parseInt(self.courseId),
  437. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  438. gradeId: parseInt(self.gradeId),
  439. photoIndex: parseInt(self.photoIndex-1),//从0算起
  440. photoNum:parseInt(self.photoNum)
  441. };
  442. console.log('提交接口', data);
  443. this.$api.coursePhotoRecord(data).then(res => {
  444. console.log(res);
  445. });
  446. },
  447. randomNum(minNum,maxNum){
  448. switch(arguments.length){
  449. case 1:
  450. return parseInt(Math.random()*minNum+1,10);
  451. break;
  452. case 2:
  453. return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
  454. break;
  455. default:
  456. return 0;
  457. break;
  458. }
  459. },
  460. //配置随机拍照时间
  461. configPhoto(){
  462. var polyvPlayerContext = this.selectComponent('#playerVideo');
  463. let totalVideoTime = polyvPlayerContext.getDuration()
  464. let duration = polyvPlayerContext.getCurrentTime()
  465. if(!this.photoConfig){
  466. this.photoConfig = true
  467. let spaceTime = Math.floor(totalVideoTime/this.photoNum) //拍照时间区间
  468. if(spaceTime<5){//区间小于5秒
  469. this.photoNum = Math.floor(totalVideoTime/5)
  470. spaceTime = 5
  471. }
  472. if(this.photoNum<1){
  473. this.photoNum = 1 //只要设置,至少拍一次
  474. spaceTime = totalVideoTime
  475. }
  476. let initSpace = 2
  477. for(let i=0;i<this.photoNum;i++){
  478. let s = this.randomNum(initSpace,initSpace+spaceTime)
  479. if(s>totalVideoTime){
  480. s = totalVideoTime-1
  481. }
  482. this.photoList.push(s)
  483. initSpace+=spaceTime
  484. }
  485. console.log(this.photoList,7856)
  486. console.log(duration,7856)
  487. //兼容已有观看历史
  488. for(let i=0;i<this.photoList.length-1;i++){
  489. if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
  490. this.photoIndex = i+1
  491. break
  492. }
  493. if(duration>this.photoList[this.photoList.length-1]){
  494. this.photoIndex = this.photoList.length-1 //取最后一个下标
  495. break
  496. }
  497. }
  498. }
  499. },
  500. getLiveUid(channelId) {
  501. let self = this;
  502. return new Promise(resolve => {
  503. let data = {
  504. channelId: channelId
  505. };
  506. self.$api.polyvSign(data).then(res => {
  507. resolve(res.data.data);
  508. });
  509. });
  510. },
  511. timeEventLiving() {
  512. if (plv != null) {
  513. if(this.livePlay){
  514. this.liveDuration = this.liveDuration +1.5 //每隔1.5秒
  515. if(this.liveDuration==1.5){ //第6秒拍照
  516. if(this.goodsPhotographConfig){
  517. if(this.goodsPhotographConfig.livephotograph==1){
  518. //开启直播拍照
  519. this.openPhoto();
  520. }
  521. }
  522. }
  523. }
  524. }
  525. },
  526. playerLiveStatusChange(e) {
  527. const status = e.detail.status;
  528. console.log('直播状态',status);
  529. if (status === 'live') {
  530. console.log('开始直播');
  531. //开始播放
  532. if (this.timer) {
  533. clearInterval(this.timer);
  534. }
  535. this.livePlay = true
  536. this.timer = setInterval(this.timeEventLiving, 1500); //定时器
  537. }
  538. if (status === 'end') {
  539. this.livePlay = false
  540. // 未开始
  541. console.log('结束直播');
  542. }
  543. },
  544. closePlv(){
  545. if(plv){
  546. plv.destroy();
  547. }
  548. },
  549. playChannel(item){
  550. if (this.timer) {
  551. clearInterval(this.timer);
  552. }
  553. this.startStatus = true
  554. this.initLive()
  555. },
  556. setLiveOption(status) {
  557. const { userId, channelId, recordFileSimpleModel, playbackEnabled } = this.detail;
  558. const playRecordFile = playbackEnabled && recordFileSimpleModel && status === 'end';
  559. this.videoOption = {
  560. mode: 'live',
  561. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  562. cid: this.playChannelId,
  563. openId: this.userInfo.userAccount,
  564. isAutoChange: false,
  565. forceVideo: false,
  566. }
  567. },
  568. async initLive(){
  569. console.log(this.playChannelId,7111)
  570. this.liveObj = await this.getLiveUid(this.playChannelId);
  571. this.initLiveOk = true
  572. let optionsData = {}
  573. optionsData.mode = 'live';
  574. optionsData.forceVideo = false;
  575. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  576. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  577. optionsData.userId = this.liveObj.uid // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  578. let self = this
  579. this.closePlv()
  580. plv.init(optionsData)
  581. .then(({ detail, chat }) => {
  582. self.liveDetail = detail
  583. // 设置mode为live的videoOption
  584. this.setLiveOption();
  585. if (detail.isPPT) {
  586. chat.on(chat.events.SLICESTART, () => {
  587. // 开始直播
  588. });
  589. } else {
  590. plv.api.getOrdinaryLiveStatus(detail.stream);
  591. }
  592. });
  593. },
  594. openSetting(res){
  595. console.log(res,98)
  596. },
  597. getCameraSetting () {
  598. const self = this
  599. wx.getSetting({
  600. success: res => {
  601. if (res.authSetting['scope.camera']) {
  602. // 用户已经授权
  603. self.showSet = false
  604. } else {
  605. // 用户还没有授权,向用户发起授权请求
  606. wx.authorize({
  607. scope: 'scope.camera',
  608. success() { // 用户同意授权
  609. self.showSet = false
  610. },
  611. fail() { // 用户不同意授权
  612. self.showSet = true
  613. /* wx.showToast({
  614. title: '摄像头授权失败',
  615. icon: 'none',
  616. duration: 3000
  617. }) */
  618. }
  619. })
  620. }
  621. },
  622. fail: res => {
  623. }
  624. })
  625. },
  626. openJY(){
  627. this.$u.toast('此功能正在开发中');
  628. },
  629. //播放笔记视频
  630. async playNoteVideo(item) {
  631. if (this.timer) {
  632. clearInterval(this.timer);
  633. }
  634. if (this.vid) {
  635. //切换视频
  636. var polyvPlayerContext = this.selectComponent('#playerVideo');
  637. polyvPlayerContext.changeVid(item.recordingUrl);
  638. } else {
  639. this.vid = item.recordingUrl;
  640. }
  641. this.recordObj = {studyDuration:item.noteSecond}
  642. if (this.recordObj.studyDuration) {
  643. this.needSeek = true; //需要跳转到播放记录
  644. }
  645. this.startStatus = true;
  646. //获取节笔记
  647. this.getNoteList();
  648. },
  649. //正常播放视频
  650. async playVideo(item) {
  651. if (this.timer) {
  652. clearInterval(this.timer);
  653. }
  654. if (this.vid) {
  655. //切换视频
  656. var polyvPlayerContext = this.selectComponent('#playerVideo');
  657. polyvPlayerContext.changeVid(item.recordingUrl);
  658. } else {
  659. this.vid = item.recordingUrl;
  660. }
  661. this.recordObj = await this.getRecordLast();
  662. if (this.recordObj.studyDuration) {
  663. this.needSeek = true; //需要跳转到播放记录
  664. }
  665. this.startStatus = true;
  666. //获取节笔记
  667. this.getNoteList();
  668. },
  669. getRecordLast() {
  670. let self = this;
  671. return new Promise(resolve => {
  672. let data = {
  673. gradeId: Number(self.gradeId),
  674. goodsId: Number(self.goodsId),
  675. sectionId: Number(self.playSectionId),
  676. courseId: Number(self.courseId)
  677. };
  678. self.$api.recordLast(data).then(res => {
  679. resolve(res.data.data);
  680. });
  681. });
  682. },
  683. jumpNote(item) {
  684. this.noteId = item.noteId;
  685. //没视频播放
  686. if(this.playSectionId==0){
  687. this.$u.toast('即将跳到笔记位置');
  688. this.$store.commit('setPlaySectionId', {playSectionId :item.sectionId});
  689. this.playNoteVideo(item);
  690. }else{
  691. //正在看当前笔记视频
  692. this.$u.toast('即将跳到笔记位置');
  693. //跳到笔记时刻
  694. var polyvPlayerContext = this.selectComponent('#playerVideo');
  695. polyvPlayerContext.seek(item.noteSecond);
  696. polyvPlayerContext.play();
  697. }
  698. },
  699. postNote() {
  700. let self = this;
  701. if (!(this.playSectionId > 0)) {
  702. this.$u.toast('目前无播放视频');
  703. return;
  704. }
  705. if (!this.noteValue) {
  706. this.$u.toast('请输入内容');
  707. return;
  708. }
  709. if(!this.gradeId){
  710. this.$u.toast('暂无班级数据');
  711. return;
  712. }
  713. var polyvPlayerContext = this.selectComponent('#playerVideo');
  714. let noteDate = this.$method.getZeroTime();
  715. let noteSecond = polyvPlayerContext.getCurrentTime();
  716. console.log(noteSecond,698)
  717. if (!noteSecond) {
  718. if(noteSecond==0){
  719. //播放结束
  720. noteSecond = polyvPlayerContext.getDuration();
  721. console.log(noteSecond,63398)
  722. }
  723. if(!noteSecond){
  724. this.$u.toast('视频暂未开始');
  725. return;
  726. }
  727. }
  728. let data = {
  729. gradeId: this.gradeId,
  730. goodsId: this.goodsId,
  731. sectionId: this.playSectionId,
  732. courseId: this.courseId,
  733. noteText: this.noteValue,
  734. noteDate: noteDate,
  735. noteSecond: noteSecond
  736. };
  737. this.$api.postNote(data).then(res => {
  738. if (res.data.code == 200) {
  739. this.$u.toast('发布成功');
  740. self.getNoteList();
  741. this.noteValue = '';
  742. }
  743. });
  744. },
  745. getGradeInfo() {
  746. let self = this;
  747. this.$store.state.allowLoading = false;
  748. this.$api.goodsGradeInfo(this.gradeId).then(res => {
  749. if (res.data.code == 200) {
  750. self.gradeDetail = res.data.data;
  751. if(self.gradeDetail.learningStatus==2){
  752. uni.showModal({
  753. showCancel:false,
  754. cancelText: '返回',
  755. content: '当前课程正在申请中,请耐心等待',
  756. success: function(resultst) {
  757. uni.navigateBack();
  758. }
  759. });
  760. }
  761. if(self.gradeDetail.learningStatus==3&&(Number(self.gradeDetail.learningTimeStart)>Number((new Date())/1000))){
  762. uni.showModal({
  763. showCancel:false,
  764. cancelText: '返回',
  765. content: '当前课程正在申请中,请耐心等待',
  766. success: function(resultst) {
  767. uni.navigateBack();
  768. }
  769. });
  770. }
  771. }
  772. });
  773. this.$store.state.allowLoading = true;
  774. },
  775. getNoteList() {
  776. let self = this;
  777. self.noteList = [];
  778. let data = { courseId: this.courseId, gradeId: this.gradeId, goodsId: this.goodsId }
  779. if(this.playSectionId>0){
  780. data.sectionId = this.playSectionId
  781. }
  782. this.$api.noteList(data).then(res => {
  783. if (res.data.code == 200) {
  784. self.noteList = res.data.rows;
  785. }
  786. });
  787. },
  788. delAnswer(answerId) {
  789. let self = this;
  790. let data = { answerId: answerId, status: -1 };
  791. this.$api.delAnswer(data).then(res => {
  792. if (res.data.code == 200) {
  793. self.getAnswerList();
  794. }
  795. });
  796. },
  797. clearCtx() {
  798. console.log(4234);
  799. this.placeholder = '您可以在这里输入答疑内容';
  800. this.ctxValue = '';
  801. this.assignUserId = 0;
  802. },
  803. replyContent(item) {
  804. this.assignUserId = item.userId;
  805. this.placeholder = '@' + item.realname;
  806. },
  807. delContent(item) {
  808. this.delAnswer(item.answerId);
  809. },
  810. postAnswer() {
  811. let self = this;
  812. let data = { courseId: this.courseId, answerText: this.ctxValue };
  813. if (this.assignUserId > 0) {
  814. data.assignUserId = this.assignUserId;
  815. }
  816. this.$api.postAnswer(data).then(res => {
  817. if (res.data.code == 200) {
  818. this.$u.toast('发布成功');
  819. self.getAnswerList();
  820. this.placeholder = '您可以在这里输入答疑内容';
  821. this.ctxValue = '';
  822. this.assignUserId = 0;
  823. }
  824. });
  825. },
  826. postContent() {
  827. if (!this.ctxValue||this.ctxValue=='') {
  828. this.$u.toast('请输入内容');
  829. return
  830. }
  831. this.postAnswer();
  832. },
  833. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  834. let currentTime = 0;
  835. var polyvPlayerContext = this.selectComponent('#playerVideo');
  836. if (polyvPlayerContext) {
  837. currentTime = polyvPlayerContext.getCurrentTime();
  838. }
  839. let self = this;
  840. console.log(self.ossAvatarUrl,"准备提交,照片地址")
  841. let data = {
  842. photo: self.ossAvatarUrl,
  843. sectionId: parseInt(sectionId),
  844. goodsId: parseInt(self.goodsId),
  845. courseId: parseInt(self.courseId),
  846. studyDuration: parseInt(currentTime > 0 ? currentTime : self.studyDuration),
  847. gradeId: parseInt(self.gradeId),
  848. chapterId: parseInt(self.chapterId),
  849. moduleId: parseInt(self.moduleId)
  850. };
  851. if (data.studyDuration <= 5) {
  852. //5秒内不上传记录
  853. return;
  854. }
  855. if (status > 0) {
  856. data.status = status;
  857. }
  858. console.log('提交接口', data);
  859. this.$api.studyRecord(data).then(res => {
  860. self.ossAvatarUrl = ''
  861. console.log(res);
  862. });
  863. },
  864. uploadFile(options, int) {
  865. var self = this;
  866. return new Promise((resolve, reject) => {
  867. var data = {
  868. imageStatus: int
  869. };
  870. self.$api.aliyunpolicy(data).then(res => {
  871. if (res.data.code != 200) {
  872. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  873. return;
  874. }
  875. var ossToken = res.data.data.resultContent;
  876. if (ossToken.host == null || ossToken.host == undefined) {
  877. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  878. return;
  879. }
  880. uni.uploadFile({
  881. url: ossToken.host,
  882. name: 'file',
  883. filePath: options,
  884. fileType: 'image',
  885. header: {
  886. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  887. },
  888. formData: {
  889. key: ossToken.dir,
  890. OSSAccessKeyId: ossToken.accessid,
  891. policy: ossToken.policy,
  892. Signature: ossToken.signature,
  893. callback: ossToken.callback,
  894. success_action_status: 200
  895. },
  896. success: result => {
  897. if (result.statusCode === 200) {
  898. self.ossAvatarUrl = ossToken.dir;
  899. resolve();
  900. } else {
  901. uni.showToast({
  902. title: '上传失败',
  903. icon: 'none'
  904. });
  905. return;
  906. }
  907. },
  908. fail: error => {
  909. uni.showToast({
  910. title: '上传接口报错' + error,
  911. icon: 'none'
  912. });
  913. return;
  914. }
  915. });
  916. });
  917. });
  918. },
  919. imageInfos() {
  920. var self = this;
  921. return new Promise((resolve, reject) => {
  922. uni.getImageInfo({
  923. src: self.avatarUrl,
  924. success: async res => {
  925. let canvasWidth = res.width; //图片原始长宽
  926. let canvasHeight = res.height;
  927. if (canvasWidth > 1000 || canvasHeight > 1000) {
  928. uni.compressImage({
  929. src: self.avatarUrl,
  930. quality: 75,
  931. width: '50%',
  932. height: '50%',
  933. success: async rest => {
  934. const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
  935. resolve();
  936. }
  937. });
  938. } else {
  939. console.log('无需压缩');
  940. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  941. resolve();
  942. }
  943. }
  944. });
  945. });
  946. },
  947. timeEvent() {
  948. let self = this;
  949. var polyvPlayerContext = this.selectComponent('#playerVideo');
  950. if (polyvPlayerContext != null) {
  951. this.playTime = polyvPlayerContext.getCurrentTime() //播放时刻
  952. //判断是否需要拍照
  953. if (this.photoNum > 0) {
  954. this.configPhoto()
  955. if(this.photoIndex<this.photoList.length){
  956. let photoTime = Number(this.photoList[this.photoIndex]); //获取拍照秒数
  957. let nextIndex = this.photoIndex+1
  958. let nextTime = 0
  959. if(nextIndex<this.photoList.length){
  960. nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
  961. }
  962. if (photoTime < this.playTime) {
  963. if(this.photoHistoryListr.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
  964. //启动拍照
  965. //暂停
  966. polyvPlayerContext.exitFullScreen();
  967. polyvPlayerContext.pause();
  968. this.openPhoto();
  969. this.photoIndex++;
  970. }
  971. }
  972. }
  973. }
  974. }
  975. },
  976. onStateChange(newstate, oldstate) {
  977. if (newstate.detail.newstate == 'playing') {
  978. //获取拍照历史
  979. this.getPhotoLastRecord()
  980. if (this.needSeek) {
  981. var polyvPlayerContext = this.selectComponent('#playerVideo');
  982. polyvPlayerContext.seek(this.recordObj.studyDuration);
  983. polyvPlayerContext.play();
  984. this.needSeek = false;
  985. }
  986. //开始播放
  987. if (this.timer) {
  988. clearInterval(this.timer);
  989. }
  990. this.timer = setInterval(this.timeEvent, 1500); //定时器
  991. }
  992. if (newstate.detail.newstate == 'pause') {
  993. //暂停提交记录
  994. /* this.ossAvatarUrl = ""
  995. this.postStudyRecord() */
  996. }
  997. if (newstate.detail.newstate == 'ended') {
  998. this.postStudyRecord(1);
  999. }
  1000. },
  1001. //拍照
  1002. openPhoto() {
  1003. this.photoPopup = true;
  1004. uni.authorize({
  1005. scope: 'scope.camera',
  1006. success() {
  1007. }
  1008. })
  1009. },
  1010. async submit() {
  1011. const waitYS = await this.imageInfos();
  1012. this.postCoursePhotoRecord()
  1013. this.postStudyRecord(); //提交记录
  1014. //恢复播放
  1015. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1016. if (polyvPlayerContext != null) {
  1017. polyvPlayerContext.play();
  1018. }
  1019. console.log(this.ossAvatarUrl, '拍照完成456');
  1020. },
  1021. //确认拍照
  1022. takePhoto() {
  1023. var self = this;
  1024. const ctx = uni.createCameraContext();
  1025. ctx.takePhoto({
  1026. quality: 'high',
  1027. success: res => {
  1028. console.log(res.tempImagePath);
  1029. self.avatarUrl = res.tempImagePath;
  1030. self.submit();
  1031. self.photoPopup = false;
  1032. },
  1033. fail: err => {
  1034. console.log(err);
  1035. }
  1036. });
  1037. },
  1038. //拍照报错
  1039. error(e) {
  1040. console.log(e.detail);
  1041. },
  1042. //关闭相机
  1043. closePhoto() {
  1044. this.photoPopup = false;
  1045. },
  1046. getGoodsDetail() {
  1047. let self = this;
  1048. this.$api.goodsDetail(this.goodsId).then(res => {
  1049. self.goodsData = res.data.data;
  1050. self.gradeId = self.goodsData.gradeId;
  1051. console.log(self.gradeId, "班级ID");
  1052. self.getMenuList();
  1053. self.getReMenuList(); //获取重修目录
  1054. setTimeout(function(){
  1055. if(!self.needProfileModal){
  1056. self.getGradeInfo()
  1057. }
  1058. },500)
  1059. //获取节笔记
  1060. this.getNoteList();
  1061. if (self.goodsData.goodsPlayConfig) {
  1062. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  1063. if (self.goodsPlayConfig.autoPlay > 0) {
  1064. self.autoplay = true;
  1065. }
  1066. if (self.goodsPlayConfig.drag > 0) {
  1067. self.isAllowSeek = 'yes';
  1068. }
  1069. if (self.goodsPlayConfig.speed > 0) {
  1070. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  1071. }
  1072. }
  1073. if (self.goodsData.goodsPhotographConfig) {
  1074. self.goodsPhotographConfig = JSON.parse(self.goodsData.goodsPhotographConfig);
  1075. if (self.goodsPhotographConfig.photoNum>0) {
  1076. self.photoNum = self.goodsPhotographConfig.photoNum
  1077. console.log(self.photoNum,777777)
  1078. }
  1079. }
  1080. });
  1081. },
  1082. startVideo() {
  1083. this.startStatus = true;
  1084. },
  1085. getAnswerList() {
  1086. let self = this;
  1087. this.$api.answerList({ courseId: this.courseId }).then(res => {
  1088. if (res.data.code == 200) {
  1089. self.answerList = res.data.rows;
  1090. }
  1091. });
  1092. },
  1093. getReMenuList() {
  1094. let self = this;
  1095. this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
  1096. if (res.data.code == 200) {
  1097. for (let i = 0; i < res.data.rows.length; i++) {
  1098. let item = res.data.rows[i];
  1099. item.down = true;
  1100. item.id = item.menuId;
  1101. item.name = item.menuName;
  1102. }
  1103. self.reMenuList = res.data.rows;
  1104. if(self.reMenuList.length>0){
  1105. self.list = [
  1106. {
  1107. name: '目录'
  1108. },
  1109. {
  1110. name: '笔记'
  1111. },
  1112. {
  1113. name: '答疑'
  1114. },{name:'重修目录'}
  1115. ];
  1116. this.current = 0;
  1117. } else {
  1118. self.list = [
  1119. {
  1120. name: '目录'
  1121. },
  1122. {
  1123. name: '笔记'
  1124. },
  1125. {
  1126. name: '答疑'
  1127. }
  1128. ];
  1129. this.current = 0;
  1130. }
  1131. }
  1132. });
  1133. },
  1134. getMenuList() {
  1135. let self = this;
  1136. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  1137. if (res.data.code == 200) {
  1138. for (let i = 0; i < res.data.rows.length; i++) {
  1139. let item = res.data.rows[i];
  1140. item.down = true;
  1141. item.id = item.menuId;
  1142. item.name = item.menuName;
  1143. }
  1144. self.menuList = res.data.rows;
  1145. }
  1146. });
  1147. },
  1148. courseDetail() {
  1149. let self = this;
  1150. this.$api.courseDetail(this.courseId).then(res => {
  1151. if (res.data.code == 200) {
  1152. self.detail = res.data.data;
  1153. }
  1154. });
  1155. },
  1156. open(item) {
  1157. item.showChildren = !item.showChildren;
  1158. },
  1159. change(index) {
  1160. this.current = index;
  1161. }
  1162. }
  1163. };
  1164. </script>
  1165. <style lang="scss" scope>
  1166. .btnSet{
  1167. width: 440rpx;
  1168. height: 80rpx;
  1169. background: #007AFF;
  1170. border-radius: 40rpx;
  1171. color: #FFFFFF;
  1172. font-size: 28rpx;
  1173. line-height: 80rpx;
  1174. }
  1175. .btnReply {
  1176. width: 80rpx;
  1177. height: 40rpx;
  1178. background: #e3f0ff;
  1179. border-radius: 16rpx;
  1180. text-align: center;
  1181. color: #007aff;
  1182. }
  1183. .btnDel {
  1184. width: 80rpx;
  1185. height: 40rpx;
  1186. background: #ffedf0;
  1187. border-radius: 16rpx;
  1188. text-align: center;
  1189. color: #ff2d55;
  1190. }
  1191. .btnReply {
  1192. width: 80rpx;
  1193. height: 40rpx;
  1194. background: #e3f0ff;
  1195. border-radius: 16rpx;
  1196. font-size: 24rpx;
  1197. }
  1198. .photoBox {
  1199. background-color: #FFFFFF;
  1200. border-radius: 32px 32px 0px 0px;
  1201. .photoTop {
  1202. height: 74upx;
  1203. display: flex;
  1204. align-items: center;
  1205. justify-content: space-between;
  1206. padding: 0upx 38upx;
  1207. .sqzz {
  1208. width: 28upx;
  1209. height: 28upx;
  1210. display: flex;
  1211. align-items: center;
  1212. justify-content: center;
  1213. }
  1214. .centersq {
  1215. color: #333;
  1216. font-size: 30upx;
  1217. font-weight: 500;
  1218. }
  1219. }
  1220. .photoCenter {
  1221. width: 750upx;
  1222. height: 979upx;
  1223. position: relative;
  1224. .custom {
  1225. width: 750upx;
  1226. height: 979upx;
  1227. position: absolute;
  1228. z-index: 1000;
  1229. top: 0;
  1230. left: 0;
  1231. image {
  1232. width: 100%;
  1233. height: 100%;
  1234. }
  1235. }
  1236. }
  1237. .btnResult {
  1238. height: 100rpx;
  1239. width: 100%;
  1240. background-color: #07c160;
  1241. text-align: center;
  1242. line-height: 100upx;
  1243. color: #fff;
  1244. font-size: 32upx;
  1245. font-weight: bold;
  1246. }
  1247. }
  1248. .chat_box {
  1249. display: flex;
  1250. padding: 20rpx;
  1251. justify-content: space-between;
  1252. }
  1253. .chat3 {
  1254. font-size: 30rpx;
  1255. font-family: PingFang SC;
  1256. font-weight: 500;
  1257. color: #666666;
  1258. margin-top: 10rpx;
  1259. }
  1260. .chat2 {
  1261. font-size: 20rpx;
  1262. font-family: PingFang SC;
  1263. font-weight: 500;
  1264. color: #999999;
  1265. margin-top: 10rpx;
  1266. }
  1267. .chat1 {
  1268. font-size: 24rpx;
  1269. font-family: PingFang SC;
  1270. font-weight: 500;
  1271. color: #333333;
  1272. }
  1273. .leftPadding {
  1274. margin-left: 8rpx;
  1275. }
  1276. .t2Content {
  1277. font-size: 28rpx;
  1278. font-family: PingFang SC;
  1279. font-weight: bold;
  1280. color: #999999;
  1281. line-height: 48rpx;
  1282. }
  1283. .tBox2 {
  1284. display: flex;
  1285. padding-top: 10rpx;
  1286. color: #333333;
  1287. font-size: 30rpx;
  1288. }
  1289. .tBox {
  1290. display: flex;
  1291. align-items: center;
  1292. padding-top: 10rpx;
  1293. }
  1294. .title {
  1295. font-size: 24rpx;
  1296. color: #999999;
  1297. }
  1298. page {
  1299. padding-top: 10px;
  1300. padding-top: constant(safe-area-inset-top);
  1301. padding-top: env(safe-area-inset-top);
  1302. }
  1303. .inputBottom {
  1304. position: fixed;
  1305. left: 0;
  1306. bottom: 0;
  1307. background: #ffffff;
  1308. height: 98rpx;
  1309. display: flex;
  1310. align-items: center;
  1311. width: 100%;
  1312. .flex_auto {
  1313. flex:1;
  1314. margin-left: 10% ;
  1315. .input {
  1316. height:60rpx;
  1317. }
  1318. }
  1319. .btn {
  1320. color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;
  1321. }
  1322. }
  1323. .noteBox {
  1324. width: 100%;
  1325. background: #ffffff;
  1326. padding: 10rpx;
  1327. border-radius: 16rpx;
  1328. }
  1329. .dateBox {
  1330. width: 216rpx;
  1331. height: 48rpx;
  1332. background: #ffffff;
  1333. border-radius: 24rpx;
  1334. font-size: 24rpx;
  1335. color: #666666;
  1336. text-align: center;
  1337. line-height: 48rpx;
  1338. margin: 20rpx 0;
  1339. }
  1340. .t_content1 {
  1341. color: #007aff;
  1342. margin-left: 10rpx;
  1343. }
  1344. .tag1 {
  1345. border: 2rpx solid #007aff;
  1346. border-radius: 8rpx;
  1347. font-size: 20rpx;
  1348. color: #007aff;
  1349. padding: 5rpx;
  1350. }
  1351. .b_title {
  1352. color: #333333;
  1353. font-size: 30rpx;
  1354. font-weight: bold;
  1355. }
  1356. page {
  1357. background: #eaeef1;
  1358. }
  1359. .menuBox {
  1360. width: 100%;
  1361. background: #ffffff;
  1362. border-radius: 16rpx;
  1363. padding: 20rpx;
  1364. margin-bottom: 20rpx;
  1365. }
  1366. .btnspric {
  1367. border-top: 1rpx solid #eee;
  1368. display: flex;
  1369. align-items: center;
  1370. justify-content: space-between;
  1371. height: 108rpx;
  1372. padding-left: 43rpx;
  1373. padding-right: 32rpx;
  1374. }
  1375. .btnspric > .lefprL {
  1376. font-size: 36rpx;
  1377. color: #0c141f;
  1378. font-weight: bold;
  1379. }
  1380. .btnspric > .lefprR {
  1381. padding: 0rpx 24rpx;
  1382. height: 60rpx;
  1383. line-height: 60rpx;
  1384. text-align: center;
  1385. color: #fff;
  1386. background: #32467b;
  1387. border-radius: 24rpx;
  1388. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1389. }
  1390. .yhj,
  1391. .hdyhj {
  1392. padding: 24rpx 29rpx 24rpx 34rpx;
  1393. }
  1394. .yhj {
  1395. border-bottom: 16rpx solid #f9f9f9;
  1396. }
  1397. .yhjtit {
  1398. font-size: 30rpx;
  1399. color: #0c141f;
  1400. font-weight: 500;
  1401. margin-bottom: 14rpx;
  1402. }
  1403. .yhjList {
  1404. display: flex;
  1405. align-items: center;
  1406. justify-content: space-between;
  1407. margin-bottom: 14rpx;
  1408. }
  1409. .yhjList > .yhjLefts {
  1410. display: flex;
  1411. align-items: center;
  1412. }
  1413. .yhjLefts > .yhl {
  1414. color: #32467b;
  1415. font-size: 30rpx;
  1416. margin-right: 31rpx;
  1417. }
  1418. .yhjLefts > .yhbq {
  1419. font-size: 24rpx;
  1420. color: #ff9500;
  1421. border-radius: 18rpx;
  1422. background-color: rgba(255, 149, 0, 0.2);
  1423. border: 2rpx solid #ff9500;
  1424. height: 38rpx;
  1425. line-height: 38rpx;
  1426. padding: 0rpx 16rpx;
  1427. }
  1428. .ts {
  1429. font-size: 24rpx;
  1430. color: #999;
  1431. margin: 14rpx 0rpx;
  1432. padding-right: 29rpx;
  1433. padding-left: 34rpx;
  1434. }
  1435. .yh {
  1436. padding-top: 20rpx;
  1437. }
  1438. .yh > .yhtitle {
  1439. display: flex;
  1440. align-items: center;
  1441. justify-content: space-between;
  1442. padding-right: 29rpx;
  1443. padding-left: 34rpx;
  1444. }
  1445. .priceBxs {
  1446. display: flex;
  1447. align-items: center;
  1448. }
  1449. .priceBxs > .pricleft {
  1450. border-radius: 24rpx;
  1451. border: 1rpx solid #e91313;
  1452. background-color: rgba(233, 19, 19, 0.1);
  1453. padding: 0rpx 18rpx;
  1454. height: 49rpx;
  1455. line-height: 49rpx;
  1456. text-align: center;
  1457. font-size: 30rpx;
  1458. font-weight: 500;
  1459. color: #e91313;
  1460. margin-right: 13rpx;
  1461. }
  1462. .topBox {
  1463. padding: 32rpx 32rpx 24rpx;
  1464. border-bottom: 1rpx solid #eeeeee;
  1465. }
  1466. .topBox > .boldFonstType {
  1467. font-weight: 500;
  1468. font-size: 30rpx;
  1469. margin: 16rpx 0rpx 23rpx;
  1470. }
  1471. .topBox > .firstTopL {
  1472. display: flex;
  1473. align-items: center;
  1474. }
  1475. .topBox > .firstTopL > .imageBs {
  1476. width: 331rpx;
  1477. height: 160rpx;
  1478. border-radius: 6rpx;
  1479. overflow: hidden;
  1480. margin-right: 8rpx;
  1481. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  1482. }
  1483. .topBox > .firstTopL > .imageBs > image {
  1484. width: 100%;
  1485. height: 100%;
  1486. }
  1487. .topBox > .firstTopL > .textBs {
  1488. font-size: 30rpx;
  1489. font-weight: bold;
  1490. color: #0c141f;
  1491. }
  1492. .content {
  1493. padding: 24rpx;
  1494. text-align: left;
  1495. }
  1496. .catalogBox {
  1497. display: flex;
  1498. align-items: center;
  1499. flex-wrap: nowrap;
  1500. overflow-x: auto;
  1501. padding-left: 38rpx;
  1502. max-height: 305rpx;
  1503. overflow-y: auto;
  1504. transition: all 0.4s;
  1505. }
  1506. .catalogBox > .catalogA {
  1507. min-width: 200rpx;
  1508. height: 48rpx;
  1509. line-height: 48rpx;
  1510. // text-align: center;
  1511. border: 2rpx solid transparent;
  1512. white-space: nowrap;
  1513. text-overflow: ellipsis;
  1514. overflow: hidden;
  1515. word-break: break-all;
  1516. border-radius: 10rpx;
  1517. background: rgba(22, 119, 255, 0.05);
  1518. padding-left: 19rpx;
  1519. box-sizing: border-box;
  1520. padding-right: 15rpx;
  1521. margin-right: 16rpx;
  1522. margin-bottom: 20rpx;
  1523. margin-top: 15rpx;
  1524. font-size: 24rpx;
  1525. color: #666;
  1526. }
  1527. .catalogBox > .activesq {
  1528. border-color: #1677ff;
  1529. }
  1530. .changeCatalogBox {
  1531. display: block;
  1532. }
  1533. .catalogBox::-webkit-scrollbar {
  1534. display: none; /* Chrome Safari */
  1535. }
  1536. .box {
  1537. position: relative;
  1538. top: 650rpx;
  1539. padding-bottom: 88rpx;
  1540. margin: 20rpx;
  1541. }
  1542. .price_t2 {
  1543. font-size: 18rpx;
  1544. font-family: PingFang SC;
  1545. font-weight: 500;
  1546. text-decoration: line-through;
  1547. color: #999999;
  1548. }
  1549. .price_t1 {
  1550. font-size: 33rpx;
  1551. font-family: PingFang SC;
  1552. font-weight: bold;
  1553. color: #e91313;
  1554. }
  1555. .sc_t {
  1556. font-size: 22rpx;
  1557. color: #000000;
  1558. }
  1559. .sc {
  1560. width: 29rpx;
  1561. height: 29rpx;
  1562. }
  1563. .buy {
  1564. width: 138rpx;
  1565. height: 48rpx;
  1566. line-height: 48rpx;
  1567. background: #32467b;
  1568. border-radius: 10rpx;
  1569. color: #ffffff;
  1570. font-size: 28rpx;
  1571. text-align: center;
  1572. vertical-align: middle;
  1573. position: absolute;
  1574. right: 30rpx;
  1575. }
  1576. .video_body {
  1577. padding-bottom: 96rpx;
  1578. }
  1579. .footer_tab {
  1580. position: fixed;
  1581. bottom: 0;
  1582. height: 96rpx;
  1583. width: 100%;
  1584. background-color: #ffffff;
  1585. }
  1586. .tj_box {
  1587. width: 50%;
  1588. display: inline-block;
  1589. text-align: center;
  1590. margin: 10rpx 0;
  1591. }
  1592. .teacher_t {
  1593. font-size: 24rpx;
  1594. font-family: PingFang SC;
  1595. font-weight: 400;
  1596. color: #666666;
  1597. line-height: 36rpx;
  1598. margin-left: 15rpx;
  1599. }
  1600. .teacher_img {
  1601. width: 87rpx;
  1602. height: 129rpx;
  1603. }
  1604. .t2 {
  1605. font-size: 24rpx;
  1606. font-family: PingFang SC;
  1607. color: #666666;
  1608. line-height: 36rpx;
  1609. margin: 15rpx;
  1610. }
  1611. .r_t2 {
  1612. width: 201rpx;
  1613. height: 49rpx;
  1614. background: rgba(22, 119, 255, 0.05);
  1615. border: 1rpx solid #32467b;
  1616. border-radius: 16rpx;
  1617. color: #666666;
  1618. font-size: 23rpx;
  1619. text-align: center;
  1620. display: flex;
  1621. align-items: center;
  1622. padding: 5rpx;
  1623. }
  1624. .scroll_box {
  1625. width: 100%;
  1626. height: 60rpx;
  1627. background: #ffffff;
  1628. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1629. white-space: nowrap;
  1630. overflow: hidden;
  1631. margin: 15rpx 0;
  1632. }
  1633. .r_sliper {
  1634. padding: 0 20rpx;
  1635. }
  1636. .top_line {
  1637. width: 6rpx;
  1638. height: 22rpx;
  1639. background: #32467b;
  1640. margin-right: 10rpx;
  1641. }
  1642. .video_t2 {
  1643. font-size: 24rpx;
  1644. font-family: PingFang SC;
  1645. font-weight: 500;
  1646. color: #666666;
  1647. }
  1648. .video_t1 {
  1649. height: 80rpx;
  1650. color: #333333;
  1651. line-height: 80rpx;
  1652. font-size: 30rpx;
  1653. font-family: PingFang SC;
  1654. font-weight: bold;
  1655. color: #333333;
  1656. overflow: hidden;
  1657. text-overflow: ellipsis;
  1658. white-space: nowrap;
  1659. }
  1660. .video_t1_t {
  1661. display: flex;
  1662. flex-direction: column;
  1663. height: 80rpx;
  1664. color: #333333;
  1665. text-align: center;
  1666. align-items: center;
  1667. border-left: solid 1px #d6d6db;
  1668. }
  1669. .video_play {
  1670. position: absolute;
  1671. width: 95rpx;
  1672. height: 95rpx;
  1673. top: 0;
  1674. left: 0;
  1675. right: 0;
  1676. bottom: 0;
  1677. margin: auto;
  1678. }
  1679. .video_box {
  1680. position: relative;
  1681. }
  1682. .rotoct {
  1683. transform: rotate(90deg);
  1684. }
  1685. </style>