Commit 057e3fa2 by zhangzhen

细节优化

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