diff --git a/pages.json b/pages.json
index b95ce29..55e7b0a 100644
--- a/pages.json
+++ b/pages.json
@@ -19,7 +19,7 @@
{
"path": "pages/mine/vip/index",
"style": {
- "navigationBarTitleText": "VIP定制",
+ "navigationBarTitleText": "VIP",
"enablePullDownRefresh": true,
"onReachBottomDistance": 100,
"app-plus": {
diff --git a/pages/course/courseDetail.vue b/pages/course/courseDetail.vue
index b9e76ad..cf6b90a 100644
--- a/pages/course/courseDetail.vue
+++ b/pages/course/courseDetail.vue
@@ -5,7 +5,7 @@
-
+
{{goBuyTitle}}
@@ -13,7 +13,7 @@
立即购买
-
+
@@ -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;
diff --git a/pages/mine/mine/index.vue b/pages/mine/mine/index.vue
index c384a29..dcd53bf 100644
--- a/pages/mine/mine/index.vue
+++ b/pages/mine/mine/index.vue
@@ -17,30 +17,31 @@
-
-
+
医学
国学心理学
-
+
{{ userMes.nickname ? userMes.nickname : "未设置" }}
手机号:({{ userMes.tel }})
-
+
- {{item}}
+
+ {{item}}
+
-
@@ -53,25 +54,21 @@
-
-
-
- VIP
-
-
-
-
-
-
- {{item.text}}VIP({{item.endTime.split(' ')[0]}} 到期)
+
+
+
+ VIP
+
+
+ {{item.text}}VIP
+ ({{item.endTime.split(' ')[0]}} 已到期)
+ (有效期到 {{item.endTime.split(' ')[0]}})
+
+
+ 办理VIP,畅享更多专属权益
- 定制VIP,畅享更多专属权益
-
+
@@ -251,10 +248,8 @@
onLoad(e) {
// 隐藏原生的tabbar
uni.hideTabBar();
- // #ifdef APP-PLUS
this.getOS();
this.platform = uni.getSystemInfoSync().platform;
- // #endif
},
computed: {
...mapState(["userInfo"]),
@@ -388,6 +383,12 @@
url: url,
});
},
+ //判断过期的vip
+ isExpired(dateString){
+ const date = new Date(dateString);
+ const now = new Date();
+ return date < now;
+ },
// 获取用户的角色信息
getUserRole() {
this.$http.post("common/class/getRoleType").then((res) => {
@@ -532,36 +533,54 @@
this.vipList = res.list;
this.hasVipType1 = this.vipList.some(item => item.type === 1);
this.hasVipType2 = this.vipList.some(item => item.type === 2);
- //普通 vip 角色展示逻辑
- let text = '';
- if(this.vipList.length>0){
- this.vipList.forEach((item, index) => {
- if(item.type=='4'){
- item.text = '中医学';
- this.textList.push(item.text);
- }else if(item.type=='5'){
- item.text = '针灸学';
- this.textList.push(item.text);
- }else if(item.type=='6'){
- item.text = '肿瘤学';
- this.textList.push(item.text);
- }else if(item.type=='7'){
- item.text = '国学';
- this.textList.push(item.text);
- }else if(item.type=='8'){
- item.text = '心理学';
- this.textList.push(item.text);
- }else if(item.type=='1'){
- item.text = '医学S';
- }else if(item.type=='2'){
- item.text = '国学心理学S';
- }
- });
+
+ //筛选出来已过期的
+ let listAll = this.vipList;
+ let list = this.vipList.filter(item => !this.isExpired(item.endTime.split(' ')[0]));
+
+ //全部的 vip模块展示
+ if(listAll.length>0){
+ listAll = this.showDataList(listAll);
}
+
+ console.log('-------listAll',listAll)
+ //筛选过期以后的 昵称模块展示需要
+ if(list.length>0){
+ list = this.showDataList(list);
+ }
+ console.log('-------list',list)
}
});
},
- },
+ //分情况展示逻辑
+ showDataList(list){
+ this.textList = [];
+ list.forEach((item, index) => {
+ if(item.type=='4'){
+ item.text = '中医学';
+ this.textList.push(item.text);
+ }else if(item.type=='5'){
+ item.text = '针灸学';
+ this.textList.push(item.text);
+ }else if(item.type=='6'){
+ item.text = '肿瘤学';
+ this.textList.push(item.text);
+ }else if(item.type=='7'){
+ item.text = '国学';
+ this.textList.push(item.text);
+ }else if(item.type=='8'){
+ item.text = '心理学';
+ this.textList.push(item.text);
+ }else if(item.type=='1'){
+ item.text = '医学S';
+ }else if(item.type=='2'){
+ item.text = '国学心理学S';
+ }
+ });
+
+ return this.textList;
+ },
+ }
};
\ No newline at end of file
diff --git a/pages/mine/vip/index.vue b/pages/mine/vip/index.vue
index 7c9139e..aaa88e5 100644
--- a/pages/mine/vip/index.vue
+++ b/pages/mine/vip/index.vue
@@ -1,22 +1,39 @@
-
+
-
- {{item.title}}
- 已定制
-
-
+
+
+ {{item.title}}
+ 还有{{item.tip}}天到期
+
+ 已过期
+
+
+
+
+ 课程价格:
+ 一年{{item.originalPrice||0}}元
+
+
+ 去办理
+ 去续费
+
+
超级VIP价格:
VIP价格:
{{item_price.year}}年{{item_price.rebateFee}}元
-
+
延期价格:
-
+
{{item_yq.year}}年{{item_yq.rebateFee}}元
@@ -95,13 +112,29 @@ export default{
//点击购买
openorderModal(item,type) {
let text = '';
+ //如果是右侧按钮点击展示
+ //判断点击类型是vip价格还是延期价格
if(type==0){
- text = '(续费)';
+ if(item.state==null){ //没有vip
+ this.selectVipData.list = item.vcbList;
+ this.selectVipData.id = item.vcbList[0].id;
+ }else{
+ this.selectVipData.list = item.yanqiList;
+ this.selectVipData.id = item.yanqiList[0].id;
+ }
+ }else{
+ this.selectVipData.id = item.id;
}
- this.selectVipData.id = item.id;
- this.selectVipData.title = item.title + '-' + item.year + '年'+text;
+
+ if(type){
+ this.selectVipData.type = type;
+ }
+
+ this.selectVipData.title = item.title + '-' + item.year + '年';
this.selectVipData.lastFee = item.rebateFee;
+
this.orderModalShow = true;
+ console.log('-----selectVipData-----',this.selectVipData)
this.$nextTick(() => {
this.$refs.orderPay.initPrepareOrder();
});
@@ -118,20 +151,16 @@ export default{
\ No newline at end of file
diff --git a/pages/mine/vip/index123.vue b/pages/mine/vip/index123.vue
deleted file mode 100644
index bcb0c38..0000000
--- a/pages/mine/vip/index123.vue
+++ /dev/null
@@ -1,926 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.title }}
- ¥{{ item.lastFee }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/mine/vip/order.vue b/pages/mine/vip/order.vue
index df0a8f1..bc0f0c8 100644
--- a/pages/mine/vip/order.vue
+++ b/pages/mine/vip/order.vue
@@ -6,10 +6,19 @@
支付方式
-
+
+
+ {{dataInfo.list[0].title}}价格:
+ {{item.year}}年
+
+
+
@@ -139,6 +148,14 @@
this.$forceUpdate();
},
},
+ lastFee:{
+ immediate: true,
+ handler(newRoute) {
+ if(this.dataInfo.list&&this.dataInfo.list.length>0){
+ this.dataInfo.lastFee = this.dataInfo.list[0].rebateFee
+ }
+ }
+ }
},
data() {
return {
@@ -247,6 +264,7 @@
backgroundColor: "linear-gradient(90deg, #3C77BE 0%,#258feb 100%)",
color: "#fff",
}, ],
+ activeIndex: 0, //选择付款 下标
};
},
async onLoad(options) {
@@ -526,7 +544,14 @@
}
});
},
-
+ //切换年份选项
+ chooseYear(item,index){
+ this.activeIndex = index;
+ this.dataInfo.lastFee = item.rebateFee;
+
+
+ console.log('----this.dataInfo',this.dataInfo);
+ },
radioChange(index) {
this.selectPayIndex = index;
this.payType = this.payList[this.selectPayIndex].type;
@@ -1281,4 +1306,19 @@
/deep/.commonDetailPage {
height: 100vh !important;
}
+
+ .list_choose{
+ display: inline-block;
+ border:1rpx solid #999;
+ color: #999;
+ border-radius: 10rpx;
+ margin: 20rpx 30rpx 20rpx 0;
+ padding: 0 30rpx;
+ font-size: 28rpx;
+ line-height: 50rpx;
+ }
+ .list_choose_active{
+ border:1rpx solid #ff1f00;
+ color: #ff1f00;
+ }
\ No newline at end of file