vip功能修改

This commit is contained in:
liuyuan
2025-02-19 10:19:18 +08:00
parent 6d86076b90
commit 341321af5f
6 changed files with 267 additions and 1024 deletions

View File

@@ -5,7 +5,7 @@
<z-nav-bar title="课程介绍"></z-nav-bar>
<view class="contentBox commonPageContentBox">
<view v-if="goBuyTitle && isAndorid" class="describe_block">
<view style=" display: flex; justify-content: center;">
<view style=" display: flex;">
<uni-icons type="info" size="20" color="#fff"></uni-icons>
<text>{{goBuyTitle}}</text>
</view>
@@ -13,7 +13,7 @@
立即购买
</button>
</view>
<view class="curseImg" style="padding-top: 80rpx">
<view class="curseImg" :style="isAndorid?'padding-top:80rpx;':''">
<image v-if="!course.image" src="/static/nobg.jpg" mode="widthFix"></image>
<image v-else :src="course.image" mode="widthFix"></image>
</view>
@@ -554,7 +554,9 @@
newPaymentProList:[],
isFudu:false, // 是否复读
//是否有vip
userVip: null
userVip: null,
courseVipModule: [], //该课程需要什么类型的vip
textList: [], //转化文字集合
};
},
//第一次加载
@@ -920,7 +922,6 @@
}
},
haveSelected(data) {
console.log(data, " 选择的是");
if (data.index == 0) {
// 分享到好友
uni.share({
@@ -1182,15 +1183,51 @@
this.goBuyTitle = '尊贵的'+role+'VIP您的有效期到'+res.userVip.endTime;
this.goBuyType = 1;
}else{ //否则没有开通vip
this.goBuyTitle = '购买VIP即可畅享更多专属权益';
this.goBuyTitle = '';
this.goBuyType = 0;
this.getCourseVipModule();
}
}
})
},
//判断需要什么类型的vip
getCourseVipModule(){
this.$http.request({
url: 'common/userVip/getCourseVipModule',
method: "POST",
data: {
courseId: this.courseId,
},
header: {
"Content-Type": "application/json",
},
})
.then((res) => {
if (res.code == 0) {
this.courseVipModule = res.list;
let text = '';
this.courseVipModule.forEach((item, index) => {
if(item=='4'){
text = '中医学';
}else if(item=='5'){
text = '针灸学';
}else if(item=='6'){
text = '肿瘤学';
}else if(item=='7'){
text = '国学';
}else if(item=='8'){
text = '心理学';
}
this.textList.push(text);
});
const joinedText = this.textList.join('/');
this.goBuyTitle = '购买'+joinedText+'VIP即可畅享更多专属权益';
}
})
},
// 评论
showSayModule(data) {
console.log(data, "父级收到值了");
this.fatherSay = data.item;
this.fatherIndex = data.index;
console.log(this.fatherSay, this.fatherIndex, "父级收到值了");
@@ -3028,13 +3065,15 @@
}
.describe_block text{
display: block;
font-size: 28rpx;
font-size: 26rpx;
padding-right: 10rpx;
}
.describe_block button{
font-size: 26rpx;
display: inline-block;
text-align: center;
width: 150rpx;
font-size: 24rpx;
color: #fff;
padding: 0 15rpx;
border-radius: 10rpx;
line-height: 50rpx;
height: 50rpx;