修改未登录可以看两级的功能

This commit is contained in:
duan
2025-01-08 13:25:17 +08:00
parent 6284515bad
commit 9fb3e0e16c
5 changed files with 74 additions and 30 deletions

View File

@@ -852,11 +852,17 @@ export default {
console.log('has this.courseId getDataList()');
this.getDataList(this.courseId, this.courseDetailsId);
}
this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => {
if (res.code == 0) {
this.getRedEnvelopeTips = res.data;
}
});
if( uni.getStorageSync('token')){
this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => {
if (res.code == 0) {
this.getRedEnvelopeTips = res.data;
}
});
}
// uni.$on('back', (data) => {
// if (data.flag == true) {
@@ -971,14 +977,19 @@ export default {
},
//点击封面打开弹窗
openShowPay(val, inx, url) {
console.log(val);
console.log(inx);
console.log(url);
console.log(this.videoList[this.current]);
if( uni.getStorageSync('token')){
this.zongPrice = this.info.price;
this.countPrice = this.videoList[this.current].price;
this.showPay = true;
this.noBuyVideoIndex = this.current;
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
},
// 获取收藏状态
getMyLoveStatus() {
@@ -986,7 +997,18 @@ export default {
id: this.courseId,
token: uni.getStorageSync('token')
};
this.$Request.getT('/app/course/selectCourseDetailsById', data).then((res) => {
let obj ={}
if ( uni.getStorageSync('token')) {
obj = data
} else {
obj = {
id: this.courseId,
token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNDI5NSIsImlhdCI6MTczNjMwNDUzMCwiZXhwIjoxNzM2OTA5MzMwfQ.kCnqu3S23kOog8OBA2GUwRWhC-dmBsYmPz5mHdaCIvaoJstm0KmYnZFxssHjx562ziFOfENXDg_OQWyzBIC5xg'
}
}
this.$Request.getT('/app/course/selectCourseDetailsById', obj).then((res) => {
if (res.code == 0) {
if (res.data && res.data.isCollect && res.data.isCollect > 0) {
this.isCollect = true;
@@ -1995,11 +2017,21 @@ export default {
});
}
} else {
//没有视频链接则表示没有权限,需要购买 弹出购买弹窗
this.zongPrice = this.info.price;
this.countPrice = this.videoList[this.current].price;
this.showPay = true;
this.noBuyVideoIndex = this.current;
if( uni.getStorageSync('token')){
//没有视频链接则表示没有权限,需要购买 弹出购买弹窗
this.zongPrice = this.info.price;
this.countPrice = this.videoList[this.current].price;
this.showPay = true;
this.noBuyVideoIndex = this.current;
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
}
},
//播放时的回掉

View File

@@ -473,6 +473,7 @@
this.getDataList(this.courseId, this.courseDetailsId);
}
console.log(11111)
httpsRequest.getT('/app/course/getRedEnvelopeTips').then(res => {
if (res.code === 0) {
this.getRedEnvelopeTips = res.data