xuqiaoying 3 жил өмнө
parent
commit
d25cf481bf

+ 1 - 2
common/httpList/login.js

@@ -2,7 +2,6 @@ import {
 	myRequest
 } from '../request.js'
 import store from '@/store/index.js'    
-import { data } from 'uview-ui/libs/mixin/mixin.js'
 export default {
 	
 	//我的列表数据
@@ -24,7 +23,7 @@ export default {
 		})
 	},
 	//登录用户信息
-	getInfo() {
+	getInfo(data) {
 		return myRequest({
 			url: '/app/user/getInfo',
 			method: 'get',

+ 2 - 2
common/request.js

@@ -5,12 +5,12 @@ import api from './api.js'
 var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
-export const BASE_URL = 'https://test.xyyxt.net'   //预发布
+// export const BASE_URL = 'https://test.xyyxt.net'   //预发布
 // export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 5 - 1
components/course/courseSection.vue

@@ -524,7 +524,11 @@ export default {
 				let moduleId = this.menuItem.moduleId || 0;
 				let chapterId = this.menuItem.chapterId || 0;
 				let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
-				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)
+				let uuid = new Date().valueOf() + ""
+         		 // 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)
 				uni.navigateTo({
 					url:`../../pages/webview/index?url=`+encode
 				})

+ 5 - 1
pages/learn/index.vue

@@ -588,7 +588,11 @@ export default {
 			let moduleId = item.moduleId || 0
 			let chapterId = item.chapterId || 0
 			let sectionId = item.sectionId || item.menuId
-			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)
+			let uuid = new Date().valueOf() + ""
+          	// 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)
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 56 - 3
pages/webview/index.vue

@@ -5,6 +5,8 @@
 </template>
 
 <script>
+import { WEBVIEW_URL } from '@/common/request.js'
+import { mapGetters } from 'vuex'
 export default {
   components: {},
   data() {
@@ -15,13 +17,64 @@ export default {
           color: "#007AFF",
         },
       },
+      options: {},
+      optObj: {},
     };
   },
   onLoad(option) {
-    this.url = decodeURIComponent(option.url);
-    console.log(this.url);
+    this.options = option
+  },
+  onShow() {
+    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]
+    }
+    console.log('this.optObj', this.optObj)
+    // 有a字段是标识是扫二维码进来的
+    if (this.optObj.a == 1) {
+      this.getParam()
+    } else {
+      this.url = decodeURIComponent(this.options.url);
+    }
+  },
+  computed: {
+		...mapGetters(['userInfo']),
+	},
+  methods: {
+    // 获取直播间跳转参数的接口
+    getParam() {
+      const { cid, gid, sid} = this.optObj
+      this.$http({
+        url: '/course/check/watch/per',
+        method: 'get',
+        data: {
+          courseId: cid, //课程ID	
+          goodsId: gid, // 商品id
+          sectionId: sid, // 节id
+        },
+      }).then((res) => {
+        if (res.data.code == 200) {
+          let item = res.data.data
+          let moduleId = item.moduleId || 0
+          let chapterId = item.chapterId || 0
+          let sectionId = item.sectionId || item.menuId
+          let uuid = new Date().valueOf() + ""
+          // 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
+          console.log('url:', this.url)
+        } else {
+          this.$u.toast(res.data.msg)
+        }
+      })
+
+    },
   },
-  methods: {},
 };
 </script>
 

+ 5 - 1
pages2/wd/course.vue

@@ -70,9 +70,12 @@ export default {
       businessData: {},
       itemIndex: "",
       informId: '', //消息id,从公众号消息模板进来的才有
+      options: {},
     };
   },
   onLoad(option) {
+    console.log('onload的', option)
+    this.options = option
     this.goodsId = Number(option.id);
     this.gradeId = Number(option.gid);
     this.orderGoodsId = Number(option.orderGoodsId);
@@ -87,7 +90,8 @@ export default {
     this.courseCourseList();
     this.$store.getters.dictObj;
   },
-  onShow() {
+  onShow(option) {
+    console.log('onshow的', option, this.options)
     if (this.itemIndex !== "") {
       this.refreshByIndex();
     }

+ 5 - 1
pages3/live/detail.vue

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

+ 5 - 1
pages3/polyv/detail.vue

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

+ 4 - 1
pages5/exam/index.vue

@@ -52,7 +52,10 @@ export default {
 	},
 	methods: {
 		goLive() {
-			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+this.livingInfo.liveUrl)
+			let uuid = new Date().valueOf() + ""
+      		// buyCourse 是否购买课程:1是 0否
+			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
+			+this.livingInfo.liveUrl+'&buyCourse=1'+'&ident='+uuid)
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 4 - 1
pages5/examList/index.vue

@@ -317,7 +317,10 @@ export default {
 		},
 		
 		goLive(item) {
-			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+item.liveUrl)
+			let uuid = new Date().valueOf() + ""
+      		// buyCourse 是否购买课程:1是 0否
+			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
+			+item.liveUrl+'&buyCourse=1'+'&ident='+uuid)
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 4 - 1
pages5/examReport/index.vue

@@ -285,7 +285,10 @@ export default {
 	methods: {
 		...mapActions(['setSystemTime']),
 		goLive() {
-			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+this.subscribeInfo.liveUrl)
+			let uuid = new Date().valueOf() + ""
+      		// buyCourse 是否购买课程:1是 0否
+			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
+			+this.subscribeInfo.liveUrl+'&buyCourse=1'+'&ident='+uuid)
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 5 - 1
pages5/liveDetail/list.vue

@@ -120,7 +120,11 @@ export default {
 			let moduleId = item.moduleId || 0;
 			let chapterId = item.chapterId || 0;
 			let sectionId = item.sectionId || item.menuId;
-			let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+item.liveUrl+'&gradeId='+0+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+'&chapterId='+chapterId+'&moduleId='+moduleId)
+			let uuid = new Date().valueOf() + ""
+      		// 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='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+'&chapterId='
+			+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
 			uni.navigateTo({
 				url:`../../pages/webview/index?url=`+encode
 			})

+ 4 - 1
pages5/liveList/index.vue

@@ -161,7 +161,10 @@ export default {
 	methods: {
 		goLive(item) {
 			if(item.liveStatus == 0) { //直播中
-				let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+item.liveUrl)
+				let uuid = new Date().valueOf() + ""
+				// buyCourse 是否购买课程:1是 0否
+				let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+
+				'&channelId='+item.liveUrl+'&buyCourse=1'+'&ident='+uuid)
 				uni.navigateTo({
 					url:`../../pages/webview/index?url=`+encode
 				})