From de750590f16b7d69fa588cb19cf65e5ebcd7052f Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Sat, 27 Jan 2024 11:35:35 +0800 Subject: [PATCH] bug --- .../service/impl/OilOrderServiceImpl.java | 20 +++++------ gasStation-uni/pagesMy/VIP/vip.vue | 35 ++++++++++++------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java index 01b2e0d24..38e4f61b5 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/order/service/impl/OilOrderServiceImpl.java @@ -1339,16 +1339,16 @@ public class OilOrderServiceImpl extends ServiceImpl i this.insertGrowthValueChange(userid,storeId,addGrowthVal,growthAfter,orderNo); - CardBalanceChange cardBalanceChange = new CardBalanceChange(); -// 添加余额记录信息 - cardBalanceChange.setUserId(userid); - cardBalanceChange.setChangeType("0"); - cardBalanceChange.setFromType("油品订单消费"); - cardBalanceChange.setBalance(oilAmount - oilActualPay); - cardBalanceChange.setOrderNo(orderNo); - cardBalanceChange.setStoreId(storeId); - - cardBalanceChangeService.insertCardBalance(cardBalanceChange); +// CardBalanceChange cardBalanceChange = new CardBalanceChange(); +//// 添加余额记录信息 +// cardBalanceChange.setUserId(userid); +// cardBalanceChange.setChangeType("0"); +// cardBalanceChange.setFromType("油品订单消费"); +// cardBalanceChange.setBalance(oilAmount - oilActualPay); +// cardBalanceChange.setOrderNo(orderNo); +// cardBalanceChange.setStoreId(storeId); +// +// cardBalanceChangeService.insertCardBalance(cardBalanceChange); } } diff --git a/gasStation-uni/pagesMy/VIP/vip.vue b/gasStation-uni/pagesMy/VIP/vip.vue index a7ca90c9f..65a559424 100644 --- a/gasStation-uni/pagesMy/VIP/vip.vue +++ b/gasStation-uni/pagesMy/VIP/vip.vue @@ -214,18 +214,26 @@ methods: { getPercentage(id){ let grade = {} - this.userGradeList.forEach(i => { - if (this.member.gradeId = i.id){ - grade = i - } - }) - console.log(this.member); - this.userGradeList.forEach(item => { - console.log(item); - if (item.id == id){ - // this.percentage = - } + request({ + url: "business/userManager/userGrade/" + this.member.gradeId, + method: 'get', + }).then((res) => { + grade = res.data + this.userGradeList.forEach(item => { + if (item.id == id){ + if (grade.grade > item.grade){ + this.percentage = 100 + } + if (grade.grade < item.grade){ + this.percentage = 0 + } + if (grade.grade == item.grade){ + this.percentage = ((this.member.growthValue / item.growthValue) * 100).toFixed(0) + } + } + }) }) + }, // 获取当前登入用户的等级信息 getMember(){ @@ -234,7 +242,7 @@ method: 'get', }).then((res) => { this.member = res.data - console.log(this.member,1111); + this.getPercentage(this.userGrade.id) }) }, getChainConfig(storeId){ @@ -272,7 +280,7 @@ this.dieselRule = JSON.parse(res.data[0].dieselRule) this.naturalGasRule = JSON.parse(res.data[0].naturalGasRule) } - this.getPercentage(res.data[0].id) + // this.getPercentage(res.data[0].id) }else{ this.isExist = false } @@ -286,6 +294,7 @@ this.dieselRule = JSON.parse(this.userGradeList[this.current].dieselRule) this.naturalGasRule = JSON.parse(this.userGradeList[this.current].naturalGasRule) } + this.getPercentage(this.userGrade.id) }, goBack() { uni.navigateBack()