|
@@ -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+'§ionId='+sectionId+'&chapterId='
|
|
|
- +chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid)
|
|
|
+ +chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid+'§ionType='+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+'§ionId='+sectionId
|
|
|
- +'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid
|
|
|
+ +'&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse='+item.buyCourse+'&ident='+uuid+'§ionType='+ 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'
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
|