修改免费课程不能看的问题

This commit is contained in:
liuyuan
2025-03-21 18:57:19 +08:00
parent b0bc68ed8c
commit bf6816f7ba
2 changed files with 48 additions and 19 deletions

View File

@@ -212,7 +212,9 @@
</view>
</view>
</view>
<view v-else-if="librayList[curIndex].type == 0"></view>
<view v-else-if="librayList[curIndex].type == 0&& userVip == null" class="fdButtonBox aui-text-success">
<text @click="handleClickGetGoodsList(librayList[curIndex])">开始学习</text>
</view>
<view v-else style="padding: 20rpx; padding-bottom: 0;">
<view class="libOther">
<!-- 没有观看权限的时候 -->
@@ -1052,17 +1054,38 @@
this.currentCateIndex = courseIndex;
let _myurl = ''
_myurl = '/pages/course/chapterDetailAndorid'
if (this.librayList[this.curIndex].type == 0 ||this.librayList[this.curIndex].isBuy == 1 || v.isAudition == 1 || this.userVip!=null) {
let noRecored = false
v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ?
noRecored = true : ''
// if (this.librayList[this.curIndex].type == 0 ||this.librayList[this.curIndex].isBuy == 1 || v.isAudition == 1 || this.userVip!=null) {
// let noRecored = false
// v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ?
// noRecored = true : ''
// uni.navigateTo({
// url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
// });
// } else if (this.userVip==null && this.librayList[this.curIndex].type == 2) {
// this.$commonJS.showToast("请开通VIP后观看本课程");
// } else {
// this.$commonJS.showToast("请先购买课程");
// }
let noRecored = false;
v.isAudition == 1 && this.userVip==null && this.librayList[this.curIndex].isBuy == 0 ? noRecored = true : ''
if(this.userVip){
uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
} else if (this.userVip==null && this.librayList[this.curIndex].type == 2) {
this.$commonJS.showToast("请开通VIP后观看本课程");
} else {
this.$commonJS.showToast("请先购买课程");
}else{
if(v.isAudition == 1||this.librayList[this.curIndex].isBuy == 1){
console.log(11111111)
uni.navigateTo({
url: `${_myurl}?navTitle=${this.pageTitle}&title=${v.title}&courseId=${this.courseId}&id=${v.id}&conditions=${v.conditions}&noRecored=${noRecored}`,
});
}else{
if(this.librayList[this.curIndex].type != 0){
this.$commonJS.showToast("请先购买课程");
}else{
this.$commonJS.showToast("请先领取课程");
}
}
}
},
handleClickSelectGoods(data) {
@@ -1165,7 +1188,7 @@
})
.then(async (res) => {
if (res.code == 0) {
this.getCourseDescriptionData(v);
this.getData(this.courseId);
}
this.$forceUpdate();
});
@@ -2749,16 +2772,22 @@
}
.fdButtonBox {
border-radius: 50rpx !important;
border: 1rpx solid $themeColor;
height:40rpx;
padding: 10rpx 20rpx;
box-sizing: border-box;
}
.fdButtonBox text{
display: inline-block;
width: 100rpx;
border-radius:10rpx !important;
background-color: $themeColor;
color: #fff !important;
float: right;
padding: 4rpx 10rpx;
font-size: 20rpx;
font-size: 20rpx!important;
font-weight: 500;
line-height: 30rpx;
border-radius: 10rpx;
line-height: 40rpx;
height: 40rpx;
text-align: center;
float: right;
box-sizing: border-box;
}