Commit 057e3fa2 by zhangzhen

细节优化

parent ed4394d1
......@@ -35,7 +35,7 @@
</view>
<view v-if="userInfo.consumerMember.isRights" class="tip-date">
<text>权益 <text class="text-bold">{{userInfo.consumerMember.expirationDate}}</text> 到期</text>
<text class="text-blue" @tap.stop="onGetEquityMembersList">续费</text>
<text class="text-blue" @tap.stop="onOpenEquityMembers">{{list && list.length?list[0].requiredAmount+'元':''}}续费</text>
</view>
</view>
<view class="nav-right" @tap.stop="onNavToSetUserInfo">
......@@ -58,43 +58,43 @@
<!-- <text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - userInfo.consumerWallet.remainingIntegral}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text> -->
<view class="flex-row">
<text class="text-3">当前积分</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral}}</text>
<text class="text-4">{{userInfo.consumerWallet? userInfo.consumerWallet.remainingIntegral : 0}}</text>
</view>
</view>
<view v-else-if="userInfo.memberConfig && userInfo.memberConfig.membershipLevel ===3" class="level level-3">
<text class="text-1">LV {{userInfo.memberConfig.levelName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral ||0)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<view class="flex-row">
<text class="text-3">当前积分</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral}}</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view>
</view>
<view v-else-if="userInfo.memberConfig && userInfo.memberConfig.membershipLevel ===2" class="level level-2">
<text class="text-1">LV {{userInfo.memberConfig.levelName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral ||0)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<view class="flex-row">
<text class="text-3">当前积分</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral}}</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view>
</view>
<view v-else-if="userInfo.memberConfig && userInfo.memberConfig.membershipLevel ===1" class="level level-1">
<text class="text-1">LV {{userInfo.memberConfig.levelName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral || 0)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<view class="flex-row">
<text class="text-3">当前积分</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral}}</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view>
</view>
<view v-else-if="userInfo.memberConfig && userInfo.memberConfig.membershipLevel === 0" class="level level-0">
<text class="text-1">LV 0</text>
<!-- <text class="text-2">您还没有会员等级!</text> -->
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<text class="text-2">还差 {{userInfo.memberConfig.nextLimitRequirements - Number(userInfo.consumerWallet.remainingIntegral || 0)}} 积分可升级为{{userInfo.memberConfig.nextMembershipName}}</text>
<view class="flex-row">
<text class="text-3">当前积分</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral}}</text>
<text class="text-4">{{userInfo.consumerWallet.remainingIntegral || 0}}</text>
</view>
</view>
<view v-else class="level level-0">
......@@ -456,7 +456,7 @@
equityDetail:"/setting/rule/rule?keyData=user_equity_details",
levelDetail:"/setting/levelDetail/index"
},
list:[],
list:'',
consumerMemberStatus:false
}
},
......@@ -499,9 +499,13 @@
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
this.userInfo = res.data.data;
this.userInfo = {
...res.data.data,
consumerWallet: res.data.data.consumerWallet? res.data.data.consumerWallet: {remainingIntegral:0}
}
if (this.userInfo.consumerMember && this.userInfo.consumerMember.isRights) {
this.consumerMemberStatus = true;
this.onGetEquityMembersList()
}
this.userName = this.userInfo.phone.slice(-4);
uni.setStorageSync('userInfo', this.userInfo)
......@@ -626,21 +630,23 @@
url:"/pages/vipCreate/vipCreate"
})
},
onOpenEquityMembers(){
if(this.list&&this.list.length){
this.$refs.popupPay.open();
}else{
uni.showToast({
icon:"none",
title:"暂时无法续费,请联系客服"
})
}
},
onGetEquityMembersList(){
equityMembersList().then(res => {
console.log(res, 999999)
if (res.data.code == 200 && res.data.rows) {
this.list = res.data.rows;
if(this.list&&this.list.length){
this.$refs.popupPay.open();
}else{
uni.showToast({
icon:"none",
title:"暂时无法续费,请联系客服"
})
}
this.$forceUpdate();
}
})
},
onCreateEquityMembers(){
......
......@@ -9,7 +9,7 @@
<text class="text-lg">{{orderInfo.startDate||'-'}}</text>
</view>
<view class="flex-col part-center">
<text class="text-xxl text-bold">{{orderInfo.timeLong || 0}}小时</text>
<text class="text-xl text-bold">{{orderInfo.timeLong || 0}}小时</text>
</view>
<view class="flex-col part-right">
<text class="text-xxl text-bold">{{orderInfo.endTime||'-'}}</text>
......
......@@ -20,7 +20,7 @@
</view>
<view class="VerticalBox" :style="{paddingTop:CustomBar+50+'px'}">
<view class="banner2">
<image :src="assetsPath+'/banner3.png'" mode="widthFix"></image>
<image :src="assetsPath+'/banner4.png'" mode="widthFix"></image>
</view>
<view class="room-content-box">
<!-- 展示所有房间列表 -->
......
......@@ -623,6 +623,7 @@
icon: "success",
title: "下单成功",
success: () => {
that.onGetUserInfo();
that.$refs.popupPay.close();
setTimeout(() => {
uni.switchTab({
......
......@@ -20,7 +20,7 @@
<view class="part-left">
<view class="level" :class="'level-'+item.membershipLevel">
<view class="text-label">
<text class="text-1">LV {{item.levelName}}</text>
<text class="text-1">LV {{item.membershipLevel?item.levelName: '0'}}</text>
<view v-if="item.discountRatio < 100" class="discount-ratio">
<text class="text-white"><text class="text-white text-xl text-bold">{{item.discountRatio}}</text></text>
......@@ -101,9 +101,8 @@
memberConfigList({
memberType: this.memberTypeList[this.index].value
}).then(res => {
console.log(res,9999)
if(res.data.code == 200 && res.data.data){
this.list = res.data.data.map(item =>{
let list = res.data.data.map(item =>{
let discountText = item.discountRatio;
if(discountText > 0 && discountText < 100){
discountText = Number(discountText.toString().split('').reverse().join('')).toString();
......@@ -111,19 +110,32 @@
discountText = item.discountRatio;
}
}
return {
...item,
discountRatio: discountText
}
})
list.sort((a,b)=> a.membershipLevel-b.membershipLevel)
this.list = []
if(this.userInfo.memberConfig && this.userInfo.memberConfig.membershipLevel>=0){
this.list.push(list.find(item => item.membershipLevel === this.userInfo.memberConfig.membershipLevel))
list.forEach(item => {
if(item.membershipLevel !== this.userInfo.memberConfig.membershipLevel){
this.list.push(item);
}
})
}
}
})
},
onGetUserInfo() {
getUserInfo().then(res => {
if (res.data.code == 200) {
this.userInfo = res.data.data;
this.userInfo = {
...res.data.data,
consumerWallet: res.data.data.consumerWallet? res.data.data.consumerWallet: {remainingIntegral:0}
}
if(this.userInfo.consumerMember && this.userInfo.consumerMember.isRights){
this.index = 1
}
......@@ -266,6 +278,7 @@
display: flex;
align-items: center;
justify-content: center;
width: 240upx;
height: 32upx;
border-radius: 4upx;
margin-top: 8upx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment