courseSection.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <view style="display: flex;justify-content: space-between;align-items: center;" @click="getVideo">
  3. <view style="display: flex;justify-content: space-between; align-items: center;margin: 20rpx 0;width: 100%;">
  4. <view style="display: flex;align-items: center;flex:1;">
  5. <view class="tag tagColor1" v-if="menuItem.sectionType==1">视频</view>
  6. <view class="tag tagColor2" v-if="menuItem.sectionType==2">直播</view>
  7. <view class="tag tagColor3" v-if="menuItem.sectionType==3">回放</view>
  8. <view class="t_content">
  9. <view v-if="menuItem.sectionType==1" :class="playSectionId==newId && playNextId==playId?'color1':''">{{menuItem.name || ''}}</view>
  10. <view v-if="menuItem.sectionType==2" :class="playSectionId==newId && playNextId==playId?'color2':''">{{menuItem.name || ''}}</view>
  11. <view v-if="menuItem.sectionType==3" :class="playSectionId==newId && playNextId==playId?'color3':''">{{menuItem.name || ''}}</view>
  12. <view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.sectionType==2 && menuItem.liveStartTime">
  13. <view v-if="menuItem.liveStartTime>nowTime || !isBuy">
  14. <text>{{$method.timestampToTime(menuItem.liveStartTime, isDay =false)}}</text>-
  15. <text>{{$method.timestampToTime(menuItem.liveEndTime, isDay =false)}}</text>
  16. </view>
  17. <template v-if="isLast()">
  18. <view v-if="liveLast.watchStatus == 'live'">
  19. <text>直播中</text>
  20. </view>
  21. <view v-if="liveLast.watchStatus == 'end'">
  22. <text>当前直播回放视频请稍后再查看</text>
  23. </view>
  24. </template>
  25. <!-- <view v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
  26. <text>直播中</text>
  27. </view>
  28. <view v-if="menuItem.liveEndTime<nowTime">
  29. <text>回放</text>
  30. </view> -->
  31. </view>
  32. <view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.sectionType == 3">
  33. <view v-if="!menuItem.recordingUrl">
  34. <text>当前直播回放视频请稍后再查看</text>
  35. </view>
  36. <view v-else>
  37. 回放中
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="menuItem.sectionType==null">{{menuItem.name || ''}}</view>
  42. <!-- 学习中 -->
  43. <view v-if="playSectionId==newId && playNextId==playId" class="learnings">
  44. <image src="/pages3/static/imgs/learning_icon.gif" class="learning_icon"></image>
  45. <text>学习中</text>
  46. </view>
  47. </view>
  48. <view style="font-size: 20rpx;color: #FF3B30;" v-if="menuItem.liveStartTime && menuItem.sectionType != 3 && isBuy">
  49. <template v-if="!isLast() && !isLive">
  50. <view class="tagWillPlay" v-if="menuItem.liveStartTime>nowTime">
  51. <text>待开播</text>
  52. </view>
  53. <view class="tagPlaying" v-if="menuItem.liveStartTime<=nowTime&&menuItem.liveEndTime>nowTime">
  54. <text>直播中</text>
  55. </view>
  56. <view class="tagPlayed" v-if="menuItem.liveEndTime<nowTime">
  57. <text>已结束</text>
  58. </view>
  59. </template>
  60. </view>
  61. <!-- 直播课程没有学习状态 -->
  62. <template v-if="!isLive">
  63. <view v-if="(isRebuild||menuItem.rebuild>0)" class="tagRe">待重修</view>
  64. <view v-else>
  65. <view v-if="menuItem.learning==1" class="tagGreen">已学完</view>
  66. </view>
  67. </template>
  68. <view v-if="checkTest()" class="exercises" @click.stop="toDoSectionExam()">
  69. <text class="exe_w">习题</text>
  70. <u-icon name="arrow-right" color="#498AFE" size="28"></u-icon>
  71. </view>
  72. </view>
  73. <view v-if="menuItem.tryListen&&!isBuy" class="tryBox">
  74. 试看
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import { mapGetters } from 'vuex';
  80. import {WEBVIEW_URL} from '@/common/request.js'
  81. export default {
  82. name: 'courseSection',
  83. props: {
  84. isLive:false, //是否是直播课
  85. orderGoodsId:{
  86. default:0
  87. },
  88. preItem:{
  89. default:undefined,
  90. },
  91. learningOrder:{ //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
  92. type:Number,
  93. default:0
  94. },
  95. courseId: {
  96. type: Number,
  97. default: 0
  98. },
  99. goodsId: {
  100. type: Number,
  101. default: 0
  102. },
  103. menuItem: {
  104. type: Object,
  105. default: {}
  106. },
  107. isBuy: {
  108. type: Boolean,
  109. default: false
  110. },
  111. levelId: {
  112. type: String,
  113. default: ""
  114. },
  115. isRebuild: {
  116. type: Boolean,
  117. default: false
  118. },
  119. gradeId: {
  120. type: Number,
  121. default: 0
  122. },
  123. nextMenuItem: {
  124. type: Object,
  125. default: {}
  126. },
  127. sectionMaxNum:{
  128. default:undefined,
  129. },
  130. // 章->所有节试卷列表
  131. ChapterSectionExam: {
  132. type: Array,
  133. default: () => [],
  134. },
  135. // 区分是模块试卷还是章试卷,3是模块试卷
  136. testType: {
  137. type: Number,
  138. default: 0,
  139. },
  140. menuAllList: { // 课程所有子目录结构列表
  141. type: Array,
  142. default: () => []
  143. }
  144. },
  145. watch:{
  146. menuItem(val) {
  147. console.log(val,'val')
  148. }
  149. },
  150. data() {
  151. return {
  152. nowTime:0,
  153. newId:0,
  154. playId:'',
  155. clickLock:false, //点击锁,防止连续点击多次
  156. moduleSectionExam: [], // 模块下的所有节试卷列表
  157. chapterExams: {},
  158. moduleExams: {},
  159. // newMenuAllList: [],
  160. };
  161. },
  162. onLoad() {
  163. },
  164. created() {
  165. if (this.testType == 3) {
  166. // 模块下的所有节试卷列表
  167. this.$api.reSectionExamList({
  168. chapterId: 0,
  169. courseId: this.courseId,
  170. gradeId: this.gradeId
  171. }).then((res) => {
  172. if (res.data.code == 200) {
  173. this.moduleSectionExam = res.data.data || []
  174. }
  175. })
  176. }
  177. },
  178. mounted() {
  179. // console.log('节的播放---menuItem', this.menuItem, 'playSectionId:', this.playSectionId, 'isBuy:', this.isBuy)
  180. this.nowTime = Number(new Date().getTime()/1000).toFixed(0)
  181. this.newId= this.menuItem.sectionId>0?this.menuItem.sectionId:this.menuItem.menuId
  182. let moduleId = this.menuItem.moduleId || 0;
  183. let chapterId = this.menuItem.chapterId || 0;
  184. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  185. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}${this.isRebuild?'isRebuild':''}`;
  186. this.playId = playNextId;
  187. console.log('playNextId:', this.playNextId, 'playId:', this.playId);
  188. uni.$off('playNext'+playNextId) //绑定前先移除之前的事件
  189. uni.$once('playNext'+playNextId, async (data) => {
  190. //到时会触发每个节的监听事件,只允许当前节的接收
  191. let self = this
  192. if(this.nextMenuItem.recordingUrl&&this.isRebuild&&(this.newId==this.playSectionId) && data.fromRebuild){ // fromRebuild 来自重修目录的点击才弹出播放下一节
  193. //重修存在下一节
  194. uni.showModal({
  195. title: '提示',
  196. content: '是否播放下一节',
  197. success: function (res) {
  198. if (res.confirm) {
  199. let nextId= self.nextMenuItem.sectionId>0?self.nextMenuItem.sectionId:self.nextMenuItem.menuId
  200. //设置播放的节ID
  201. self.$store.commit('setPlaySectionId', {playSectionId :nextId});
  202. self.$store.commit('setPlayVID', {playVID :self.nextMenuItem.recordingUrl});
  203. let ids = self.levelId.split('-');
  204. ids[2] = nextId
  205. uni.$emit('levelId', ids.join('-'))
  206. uni.$emit('getSection', self.nextMenuItem)
  207. self.$emit('playEnd',{isRebuild:self.isRebuild})
  208. } else {
  209. let nextId= self.nextMenuItem.sectionId>0?self.nextMenuItem.sectionId:self.nextMenuItem.menuId
  210. //设置播放的节ID
  211. self.$store.commit('setPlaySectionId', {playSectionId :nextId});
  212. self.$store.commit('setPlayVID', {playVID :self.nextMenuItem.recordingUrl});
  213. let ids = self.levelId.split('-');
  214. ids[2] = nextId
  215. self.$emit('playEnd',{isRebuild:self.isRebuild})
  216. }
  217. }
  218. });
  219. } else {
  220. console.log('播放结束--节的');
  221. this.$emit('playEnd',{isRebuild:this.isRebuild})
  222. }
  223. });
  224. uni.$off('playNextSection') //绑定前先移除之前的事件
  225. // uni.$once('playNextSection', (data) => {
  226. // console.log('监听到播放结束的点:', data, this.menuAllList);
  227. // let nextItem = {}
  228. // if (data + 1 == this.menuAllList.length) {
  229. // this.$u.toast('已学完所有视频课程!')
  230. // return
  231. // } else {
  232. // nextItem = this.menuAllList[data + 1]
  233. // }
  234. // console.log('nextItem:', nextItem)
  235. // uni.showModal({
  236. // title: '温馨提示',
  237. // content: '当前节视频已学完,继续学习下一节?',
  238. // success: (res) => {
  239. // if (res.confirm) {
  240. // //设置播放的节ID
  241. // if(this.playSectionId>0){
  242. // console.log('切换视频1111', this.playSectionId);
  243. // //切换视频
  244. // uni.$emit('changeSection', this.playSectionId)
  245. // }
  246. // this.newId = nextItem.sectionId
  247. // this.playId = `moduleId${nextItem.moduleId || 0}chapterId${nextItem.chapterId || 0}sectionId${nextItem.sectionId || 0}`
  248. // this.$store.commit('setPlaySectionId', {playSectionId: nextItem.sectionId});
  249. // this.$store.commit('setPlayVID', {playVID: nextItem.recordingUrl}); // nextItem.recordingUrl
  250. // this.$store.commit('updatePlayNextId',this.playId)
  251. // console.log('====');
  252. // let ids = this.levelId.split('-');
  253. // ids[2] = nextItem.sectionId
  254. // uni.$emit('levelId', ids.join('-'))
  255. // uni.$emit('getSection', nextItem)
  256. // this.$emit('playEnd',{isRebuild:this.isRebuild})
  257. // } else {
  258. // //设置播放的节ID
  259. // this.$store.commit('setPlaySectionId', {playSectionId: nextItem.sectionId});
  260. // this.$store.commit('setPlayVID', {playVID: nextItem.recordingUrl});
  261. // let ids = this.levelId.split('-');
  262. // ids[2] = nextItem.sectionId
  263. // this.$emit('playEnd',{isRebuild:this.isRebuild})
  264. // }
  265. // }
  266. // });
  267. // })
  268. },
  269. methods: {
  270. isLast() {
  271. if(this.liveLast) {
  272. let sectionASame = this.liveLast.sectionId == (this.menuItem.sectionId || this.menuItem.menuId)
  273. let chapterSame = this.liveLast.chapterId == (this.menuItem.chapterId || 0)
  274. let moduleSame = this.liveLast.moduleId == (this.menuItem.moduleId || 0);
  275. return sectionASame && chapterSame && moduleSame
  276. } else {
  277. return false;
  278. }
  279. },
  280. toDoSectionExam() {
  281. // this.$emit('togoBack', 1)
  282. if (this.testType == 3) {
  283. this.ModuleExam()
  284. } else {
  285. this.ChapterExam()
  286. }
  287. },
  288. checkTest() {
  289. let data = this.testType == 3 ? this.moduleSectionExam : this.ChapterSectionExam
  290. let id = this.testType == 3 ? this.menuItem.menuId : this.menuItem.sectionId
  291. if (!data) {
  292. return false
  293. }
  294. return data.some((e) => e.sectionId == id)
  295. },
  296. ChapterExam() {
  297. this.chapterExams = this.ChapterSectionExam.find((e) => e.sectionId == this.menuItem.sectionId)
  298. let moduleId = this.chapterExams.moduleId || 0
  299. let chapterId = this.chapterExams.chapterId || 0
  300. let sectionId = this.chapterExams.sectionId || this.chapterExams.menuId
  301. uni.navigateTo({
  302. url:"/pages2/class/questionBank?courseId=" + this.courseId + "&gradeId=" + this.gradeId + "&isFromVideo=1&id=" + this.chapterExams.typeId +
  303. "&goodsid=" + this.goodsId + "&moduleId=" + moduleId + "&chapterId=" + chapterId + "&sectionId=" + sectionId + "&orderGoodsId=" +
  304. this.orderGoodsId + "&type=2",
  305. });
  306. },
  307. ModuleExam() {
  308. let sectionId = this.menuItem.sectionId || this.menuItem.menuId
  309. this.moduleExams = this.moduleSectionExam.find((e) => e.sectionId == sectionId)
  310. let moduleId = this.moduleExams.moduleId || 0
  311. let chapterId = this.moduleExams.chapterId || 0
  312. uni.navigateTo({
  313. url:"/pages2/class/questionBank?courseId=" + this.courseId + "&gradeId=" + this.gradeId + "&isFromVideo=1&id=" + this.moduleExams.typeId +
  314. "&goodsid=" + this.goodsId + "&moduleId=" + moduleId + "&chapterId=" + chapterId + "&sectionId=" + sectionId + "&orderGoodsId=" +
  315. this.orderGoodsId + "&type=2",
  316. });
  317. },
  318. studyRecordMenuAllList() {
  319. return new Promise(resolve => {
  320. this.$api.studyRecordMenuAllList({
  321. courseId:this.courseId,
  322. gradeId:this.gradeId,
  323. goodsId:this.goodsId
  324. }).then(res => {
  325. if(res.data.code == 200) {
  326. resolve(res.data.data)
  327. }
  328. })
  329. })
  330. },
  331. gradeCheckGoodsStudy() {
  332. return new Promise(resolve => {
  333. this.$api.gradeCheckGoodsStudy({
  334. goodsId:this.goodsId,
  335. gradeId:this.gradeId,
  336. moduleId:this.menuItem.moduleId || 0,
  337. chapterId:this.menuItem.chapterId || 0,
  338. sectionId:this.menuItem.sectionId || this.menuItem.menuId
  339. }).then( res => {
  340. resolve(res.data.data)
  341. })
  342. })
  343. },
  344. goodsTodayStudySectionNum() {
  345. return new Promise(resolve => {
  346. this.$api.goodsTodayStudySectionNum({goodsId:this.goodsId,gradeId:this.gradeId}).then(res => {
  347. if(res.data.code == 200) {
  348. resolve(res.data.data)
  349. }
  350. })
  351. })
  352. },
  353. getVideo(){
  354. console.log('this.this.newMenuAllList:', this.menuAllList);
  355. if(this.clickLock) {
  356. return;
  357. }
  358. this.clickLock = true;
  359. if(this.learningOrder == 2 && !this.menuItem.isRebuild && !this.isLive) { //要按从头到尾顺序学习, 且不是重修课程
  360. if(this.preItem) {
  361. // let rows = await this.studyRecordMenuAllList();
  362. let rows = this.menuAllList
  363. let newRows = [];
  364. for(let i = 0; i < rows.length; i++ ) {
  365. let moduleTrue = rows[i].moduleId == this.menuItem.moduleId || rows[i].moduleId == 0
  366. let chapterTrue = rows[i].chapterId == this.menuItem.chapterId || rows[i].chapterId == 0;
  367. let sectionTrue = (rows[i].sectionId == this.menuItem.sectionId) || (rows[i].sectionId == this.menuItem.menuId);
  368. if(moduleTrue && chapterTrue && sectionTrue) {
  369. break;
  370. } else {
  371. if(rows[i].sectionType != 2) {
  372. newRows.push(rows[i])
  373. }
  374. }
  375. }
  376. let isAllLearn = newRows.every(item => {
  377. return item.studyStatus == 1;
  378. })
  379. console.log('isAllLearn:', isAllLearn);
  380. if(isAllLearn) {
  381. this.playVideo();
  382. } else {
  383. uni.showToast({
  384. icon:'none',
  385. title:'请按顺序学习视频课程'
  386. })
  387. }
  388. } else { //第一章第一节
  389. this.playVideo();
  390. }
  391. } else {
  392. this.playVideo();
  393. }
  394. setTimeout(() => {
  395. this.clickLock = false;
  396. },3000)
  397. },
  398. studyRecordGetChannelBasicInfo(channelId) {
  399. return new Promise((resolve) => {
  400. this.$api
  401. .studyRecordGetChannelBasicInfo({
  402. channelId,
  403. })
  404. .then((res) => {
  405. resolve(res.data.data);
  406. });
  407. });
  408. },
  409. async playVideo() {
  410. if(this.menuItem.sectionType==1 || this.menuItem.sectionType == 3){
  411. //1视频 3回放
  412. if(!this.isBuy){
  413. //非购买
  414. if(!this.menuItem.tryListen){
  415. //不允许试听
  416. this.clickLock = false;
  417. return
  418. } else {
  419. this.$store.commit('setPlaySectionId', {playSectionId :this.newId});
  420. this.$store.commit('setPlayVID', {playVID :this.menuItem.recordingUrl});
  421. this.menuItem.courseId = this.courseId;
  422. uni.$emit('getSection', this.menuItem)
  423. return;
  424. }
  425. }
  426. let learnNum = await this.goodsTodayStudySectionNum()
  427. let hasLearn = await this.gradeCheckGoodsStudy();
  428. if(this.sectionMaxNum > 0) {
  429. if(learnNum >= this.sectionMaxNum && !hasLearn) {
  430. uni.showToast({
  431. icon:'none',
  432. title:`每天最多学习${this.sectionMaxNum}节`
  433. })
  434. this.clickLock = false;
  435. return;
  436. }
  437. }
  438. if(!this.menuItem.recordingUrl){
  439. uni.showToast({
  440. title: '暂无播放地址数据',
  441. icon: 'none'
  442. });
  443. this.clickLock = false;
  444. return;
  445. }
  446. /* if(this.playSectionId==this.newId){
  447. //切换为同一节
  448. return
  449. } */
  450. // 回放
  451. if (this.menuItem.sectionType == 3) {
  452. let moduleId = this.menuItem.moduleId || 0;
  453. let chapterId = this.menuItem.chapterId || 0;
  454. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  455. let uuid = new Date().valueOf() + ""
  456. // buyCourse 是否购买课程:1是 0否,type=vod是回放
  457. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+
  458. '&channelId='+this.menuItem.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+
  459. '&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=3'+'&vid='+this.menuItem.recordingUrl)
  460. uni.navigateTo({
  461. url:`../../pages/webview/index?url=`+encode
  462. })
  463. return
  464. }
  465. if(this.playSectionId>0){
  466. //切换视频
  467. let oldSectionId = this.playSectionId
  468. uni.$emit('changeSection', oldSectionId)
  469. }
  470. // console.log('===设置播放的节IDthis.menuItem,', this.menuItem, this.playId);
  471. //设置播放的节ID
  472. this.$store.commit('setPlaySectionId', {playSectionId :this.newId});
  473. this.$store.commit('setPlayVID', {playVID :this.menuItem.recordingUrl});
  474. this.$store.commit('updatePlayNextId',this.playId)
  475. uni.$emit('levelId', this.levelId)
  476. uni.$emit('getSection', this.menuItem)
  477. uni.$emit('isRebuild',this.isRebuild)
  478. }
  479. if(this.menuItem.sectionType==2){
  480. //直播
  481. if(!this.isBuy){
  482. //非购买
  483. this.clickLock = false;
  484. return
  485. }
  486. let learnNum = await this.goodsTodayStudySectionNum()
  487. let hasLearn = await this.gradeCheckGoodsStudy();
  488. if(this.sectionMaxNum > 0 && !this.isLive) {
  489. if(learnNum >= this.sectionMaxNum && !hasLearn) {
  490. uni.showToast({
  491. icon:'none',
  492. title:`每天最多学习${this.sectionMaxNum}节`
  493. })
  494. this.clickLock = false;
  495. return;
  496. }
  497. }
  498. if(!this.menuItem.liveUrl){
  499. uni.showToast({
  500. title: '暂无直播地址数据',
  501. icon: 'error'
  502. });
  503. return;
  504. }
  505. let data = await this.studyRecordGetChannelBasicInfo(this.menuItem.liveUrl);
  506. let nowTime = +this.$method.timest();
  507. if (this.menuItem.liveStartTime > nowTime) {
  508. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  509. this.clickLock = false;
  510. uni.showToast({
  511. title: '直播未开始',
  512. icon: 'none'
  513. });
  514. return;
  515. }
  516. } else if (
  517. this.menuItem.liveStartTime < nowTime &&
  518. this.menuItem.liveEndTime > nowTime
  519. ) {
  520. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  521. this.clickLock = false;
  522. uni.showToast({
  523. title: '暂无直播',
  524. icon: 'none'
  525. });
  526. return;
  527. }
  528. } else if (this.menuItem.liveEndTime < nowTime) {
  529. if (!data) {
  530. uni.showToast({
  531. title: '直播已结束',
  532. icon: 'none'
  533. });
  534. return;
  535. }
  536. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  537. this.clickLock = false;
  538. uni.showToast({
  539. title: '直播已结束',
  540. icon: 'none'
  541. });
  542. return;
  543. }
  544. }
  545. let moduleId = this.menuItem.moduleId || 0;
  546. let chapterId = this.menuItem.chapterId || 0;
  547. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  548. let uuid = new Date().valueOf() + ""
  549. // buyCourse 是否购买课程:1是 0否
  550. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+
  551. '&channelId='+this.menuItem.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+
  552. '&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=2')
  553. uni.navigateTo({
  554. url:`../../pages/webview/index?url=`+encode
  555. })
  556. return;
  557. }
  558. }
  559. },
  560. computed: { ...mapGetters(['playSectionId','playChannelId','playVID','playNextId','userInfo','liveLast']) }
  561. };
  562. </script>
  563. <style scoped lang="scss">
  564. .tagGreen{
  565. width: 80rpx;
  566. height: 28rpx;
  567. background: #34C759;
  568. border-radius: 8rpx;
  569. font-size: 20rpx;
  570. color: #FFFFFF;
  571. text-align: center;
  572. }
  573. .tagWillPlay{
  574. width: 80rpx;
  575. height: 28rpx;
  576. background: #EBF4FF;
  577. border-radius: 8rpx;
  578. font-size: 20rpx;
  579. color: #007AFF;
  580. text-align: center;
  581. }
  582. .tagPlaying{
  583. width: 80rpx;
  584. height: 28rpx;
  585. background: #FFF7EB;
  586. border-radius: 8rpx;
  587. font-size: 20rpx;
  588. color: #FF9500;
  589. text-align: center;
  590. }
  591. .tagPlayed{
  592. width: 80rpx;
  593. height: 28rpx;
  594. background: #EEEEEE;
  595. border-radius: 8rpx;
  596. font-size: 20rpx;
  597. color: #666666;
  598. text-align: center;
  599. }
  600. .tagRe{
  601. width: 80rpx;
  602. height: 28rpx;
  603. background: #FF3B30;
  604. border-radius: 8rpx;
  605. font-size: 20rpx;
  606. color: #FFFFFF;
  607. text-align: center;
  608. }
  609. .tryBox{
  610. width: 103rpx;
  611. height: 48rpx;
  612. background: #fff;
  613. border-radius: 24rpx;
  614. color: #3577E8;
  615. font-size: 24rpx;
  616. line-height: 48rpx;
  617. text-align: center;
  618. border: 1rpx solid #3577E8;
  619. }
  620. .icon_up{
  621. width: 24rpx;
  622. height: 24rpx;
  623. }
  624. .t_content3{
  625. color: #007AFF;
  626. }
  627. .t_content2{
  628. color: #007AFF;
  629. }
  630. .t_content1{
  631. color: #007AFF;
  632. }
  633. .t_content{
  634. font-size: 30rpx;
  635. margin-left: 10rpx;
  636. color: #666666;
  637. flex:1;
  638. }
  639. .tagColor3{
  640. border: 2rpx solid #FF9500;
  641. color: #FF9500;
  642. }
  643. .tagColor2{
  644. border: 2rpx solid #FF3B30;
  645. color: #FF3B30;
  646. }
  647. .tagColor1{
  648. border: 2rpx solid #007AFF;
  649. color: #007AFF;
  650. }
  651. .color3{
  652. color: #FF9500;
  653. }
  654. .color2{
  655. color: #FF3B30;
  656. }
  657. .color1{
  658. color: #007AFF;
  659. }
  660. .tag{
  661. border-radius: 8rpx;
  662. font-size: 20rpx;
  663. padding: 4rpx 10rpx;
  664. }
  665. .exercises {
  666. margin-left: 10rpx;
  667. font-size: 26rpx;
  668. color: #498AFE;
  669. >text {
  670. margin-right: 6rpx;
  671. }
  672. }
  673. .learnings {
  674. font-size: 24rpx;
  675. color: #0A7DDA;
  676. display: flex;
  677. align-items: center;
  678. margin-right: 8rpx;
  679. .learning_icon {
  680. width: 40rpx;
  681. height: 40rpx;
  682. margin-right: 4rpx;
  683. }
  684. }
  685. </style>