xuqiaoying vor 3 Jahren
Ursprung
Commit
d40e25f1a2
4 geänderte Dateien mit 46 neuen und 25 gelöschten Zeilen
  1. 19 3
      components/course/courseSection.vue
  2. 1 1
      pages/learn/index.vue
  3. 19 13
      pages/webview/index.vue
  4. 7 8
      pages3/live/detail.vue

+ 19 - 3
components/course/courseSection.vue

@@ -361,7 +361,7 @@ export default {
 		},
 		async playVideo() {
 			console.log('直播的课程:',this.menuItem)
-			if(this.menuItem.sectionType==1||this.menuItem.sectionType==3){
+			if(this.menuItem.sectionType==1 || this.menuItem.sectionType == 3){
 				//1录播 3回放
 				if(!this.isBuy){
 					//非购买
@@ -406,7 +406,22 @@ export default {
 					//切换为同一节
 					return
 				} */
-				
+				// 回放
+				if (this.menuItem.sectionType == 3) {
+					// return
+					let moduleId = this.menuItem.moduleId || 0;
+					let chapterId = this.menuItem.chapterId || 0;
+					let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
+					let uuid = new Date().valueOf() + ""
+					// buyCourse 是否购买课程:1是 0否,type=vod是回放
+					let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+
+					'&channelId='+this.menuItem.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+
+					'&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=3'+'&vid='+this.menuItem.recordingUrl)
+					uni.navigateTo({
+						url:`../../pages/webview/index?url=`+encode
+					})
+					return
+				}
 				if(this.playSectionId>0){
 					//切换视频
 					let oldSectionId = this.playSectionId
@@ -529,7 +544,7 @@ export default {
          		 // buyCourse 是否购买课程:1是 0否
 				let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+
 				'&channelId='+this.menuItem.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+
-				'&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
+				'&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=2')
 				uni.navigateTo({
 					url:`../../pages/webview/index?url=`+encode
 				})
@@ -550,6 +565,7 @@ export default {
 				// })
 			
 			}
+			
 		}
 	},
 	computed: { ...mapGetters(['playSectionId','playChannelId','playVID','playNextId','userInfo','liveLast']) }

+ 1 - 1
pages/learn/index.vue

@@ -636,7 +636,7 @@ export default {
           	// buyCourse 是否购买课程:1是 0否
 			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
 			+item.liveUrl+'&gradeId='+0+'&courseId='+item.courseId+'&goodsId='+item.goodsId+'&orderGoodsId='+item.orderGoodsId+'&sectionId='+sectionId+'&chapterId='
-			+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
+			+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid+'&sectionType=2')
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 19 - 13
pages/webview/index.vue

@@ -4,7 +4,7 @@
       <web-view :webview-styles="webviewStyles" :src="url"></web-view>
     </template>
     
-    <u-popup v-model="showAuth" mode="center" border-radius="50">
+    <u-popup v-model="showAuth" mode="center" border-radius="30">
       <view class="popCentent">
         <view class="tips">您还没有开通直播课程,无法观看</view>
         <view class="btns" @click="toAuth()">立即开通</view>
@@ -35,11 +35,10 @@ export default {
       sectionId: 0,
       orderGoodsId: 0,
       paramObj: {},
-      showAuth: true,
+      showAuth: false,
       checkStatus: 0, // 0没有权限,1有权限
-      checkMsg: '',
       goodsStatus: 0, // 0未上架,1上架
-
+      sectionType: 2, // 2直播
     };
   },
   onShareAppMessage() {
@@ -51,7 +50,7 @@ export default {
     // buyCourse 是否购买课程:1是 0否
     let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
     +item.liveUrl+'&gradeId='+0+'&courseId='+item.courseId+'&goodsId='+item.goodsId+'&orderGoodsId='+item.orderGoodsId+'&sectionId='+sectionId+'&chapterId='
-    +chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid)
+    +chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid+'&sectionType='+this.sectionType)
 		return {
 			title: '直播',
 			path: `/pages/webview/index?url=` + encode
@@ -65,12 +64,14 @@ export default {
     if (this.$method.isGoLogin()) { // 扫二维码进来的没登录需要跳到登录页,登录后返回
       return;
     }
-    this.optObj = {}
-    let arrs = decodeURIComponent(this.options.scene).split('&')
-    for (let i = 0; i < arrs.length; i++) {
-        this.optObj[arrs[i].split('=')[0]] = arrs[i].split('=')[1]
+    if (this.options.scene) {
+      this.optObj = {}
+      let arrs = decodeURIComponent(this.options.scene).split('&')
+      for (let i = 0; i < arrs.length; i++) {
+          this.optObj[arrs[i].split('=')[0]] = arrs[i].split('=')[1]
+      }
+      console.log('this.optObj', this.optObj)
     }
-    console.log('this.optObj', this.optObj)
     // 有a字段是标识是扫二维码进来的
     if (this.optObj.a == 1) {
       this.getParam()
@@ -84,6 +85,7 @@ export default {
           paramObj[paramArr[i].split('=')[0]] = paramArr[i].split('=')[1]
       }
       this.paramObj = paramObj
+      this.sectionType = this.paramObj.sectionType || 2 // 默认直播,回放的加了sectionType=3
       console.log('paramObj', paramObj)
       this.studyLog(paramObj)
     }
@@ -109,6 +111,7 @@ export default {
           this.paramObj = item
           this.goodsId = item.goodsId
           this.goodsStatus = item.goodsStatus
+          this.sectionType = item.sectionType
           if (item.checkStatus == 1) { // 有权限
             let moduleId = item.moduleId || 0
             let chapterId = item.chapterId || 0
@@ -118,17 +121,20 @@ export default {
             // buyCourse 是否购买课程:1是 0否
             this.url = WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
             +item.channelId+'&gradeId='+0+'&courseId='+item.courseId+'&goodsId='+item.goodsId+'&orderGoodsId='+item.orderGoodsId+'&sectionId='+sectionId
-            +'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid
+            +'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid+'&sectionType='+ this.sectionType
             console.log('url:', this.url)
             this.studyLog(item)
           } else {
+            // 没有权限
             this.url = ''
-            
+            this.showAuth = true
           }
           
         } else {
           this.$u.toast(res.data.msg)
-
+          uni.switchTab({
+            url:'/pages/index/index'
+          })
         }
       })
 

+ 7 - 8
pages3/live/detail.vue

@@ -724,7 +724,7 @@ export default {
     ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
   },
   onLoad(option) {
-    console.log('====option', option)
+    console.log('====option', option, this.playChannelId)
     this.options = option
     this.courseId = option.courseId || ''
     this.goodsId = Number(option.goodsId);
@@ -742,18 +742,13 @@ export default {
     this.courseCourseList();
     this.$store.getters.dictObj;
 
-
-		
   },
   onShow() {
     //相机授权
 		// this.userConfirmInfoDetail().then(res => {
 			
 		// })
-		
-		// this.getbaseprofiletplists();
-    
-    console.log(this.gradeId, 7512);
+		// this.getbaseprofiletplists();    
   },
   onUnload() {
     if (this.playSectionId > 0 && this.hasStart) {
@@ -1343,6 +1338,7 @@ export default {
         clearInterval(this.timer);
       }
       this.startStatus = true;
+      console.log('11111111111')
       this.initLive();
     },
     setLiveOption(status) {
@@ -1374,7 +1370,6 @@ export default {
 			// }
     },
     async initLive() {
-      console.log(this.playChannelId, 7111);
       this.liveObj = await this.getLiveUid(this.playChannelId);
       this.initLiveOk = true;
       let optionsData = {};
@@ -1453,6 +1448,7 @@ export default {
         this.needSeek = true; //需要跳转到播放记录
       }
       this.startStatus = true;
+      console.log('222222222222')
       //获取节笔记
       this.getNoteList();
     },
@@ -1475,6 +1471,7 @@ export default {
       this.recordObj = await this.getRecordLast();
       this.needSeek = true; //跳转到播放记录
       this.startStatus = true;
+      console.log('3333333333333')
 
       //获取节笔记
       this.getNoteList();
@@ -2121,6 +2118,7 @@ export default {
     },
     startVideo() {
       this.startStatus = true;
+      console.log('444444444')
     },
     getAnswerList() {
       let self = this;
@@ -2134,6 +2132,7 @@ export default {
     },
     getMenuList() {
       // let self = this;
+      // /course/menuList
       this.$api
         .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
         .then((res) => {