From 567b1e9d8131527621c0f1dff9e4c89faf38c22a Mon Sep 17 00:00:00 2001 From: whitechiina <1293616053@qq.com> Date: Tue, 15 Apr 2025 14:41:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B7=B3=E8=BD=AC=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../b-rx-commodity-item.vue | 26 ++++++++------- manifest.json | 2 +- .../orders-settlement/orders-settlement.vue | 33 ++++++++++++------- static/js/mixin/PayMixin.js | 2 ++ static/js/mixin/restaurantmixins.js | 3 ++ 5 files changed, 42 insertions(+), 24 deletions(-) diff --git a/components/b-rx-commodity-item/b-rx-commodity-item.vue b/components/b-rx-commodity-item/b-rx-commodity-item.vue index 57ae944..5766ea1 100644 --- a/components/b-rx-commodity-item/b-rx-commodity-item.vue +++ b/components/b-rx-commodity-item/b-rx-commodity-item.vue @@ -37,21 +37,19 @@ ¥{{RetainDecimalPoint(item['adj_pay'] * (item['num']?item['num']:item['amount']))}} --> - - ¥{{item['pay_price']}} + + ¥{{item.pay_price}} - - ¥{{item['bt_price'] * (item['num']?item['num']:item['amount'])}} - ¥{{item['pay_price'] * (item['num']?item['num']:item['amount'])}} + + ¥{{(item.bt_price * (item.num || item.amount))}} + ¥{{(item.pay_price * (item.num || item.amount))}} - + - ¥{{item['bt_price'] * (item['num']?item['num']:item['amount'])}} - (+{{item['add_price']}}) + ¥{{ toFixed((item.bt_price + item.add_price) * (item.num || item.amount)) }} - ¥{{item['adj_pay'] * (item['num']?item['num']:item['amount'])}} - (+{{item['add_price']}}) + ¥{{item.adj_pay * (item.num ? item.num : item.amount).toFixed(2)}} @@ -75,6 +73,12 @@ return { }; + }, + methods: { + toFixed(value) { + if (!value) return '0.00' + return parseFloat(value).toFixed(2) + } } } @@ -152,7 +156,7 @@ .quantity { flex: 1; display: flex; - justify-content: space-between; + justify-content: end; font-size: 30rpx; color: #3A6FE7; .num { diff --git a/manifest.json b/manifest.json index 0c9ebdd..c54fa7f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "消费补贴卡", + "name" : "在线点餐", "appid" : "__UNI__A669A40", "description" : "", "versionName" : "1.0.1", diff --git a/pages/restaurant/order/orders-settlement/orders-settlement.vue b/pages/restaurant/order/orders-settlement/orders-settlement.vue index 96130dd..0d2cf67 100644 --- a/pages/restaurant/order/orders-settlement/orders-settlement.vue +++ b/pages/restaurant/order/orders-settlement/orders-settlement.vue @@ -87,8 +87,8 @@ - 抵用券 - (¥{{ computedTotal.coin_balance }} ) + 抵用券: + (¥{{ computedTotal.coin_balance? computedTotal.coin_balance:'0.00' }} ) @@ -166,15 +166,15 @@ 抵用券抵扣 - - - {{computedTotal.used_coin}} + - + {{ZeroData.used_coin}} 余额抵扣 - - - {{computedTotal.used_broker}} + - + {{ZeroData.used_broker}} @@ -182,12 +182,12 @@ 实付 - - 获得:{{computedTotal.integral}} 积分 + + 获得:{{ZeroData.integral}} 积分 - ¥{{computedTotal.real_pay_price}} + ¥{{realPayment}} @@ -348,8 +348,10 @@ // 修改数据格式 item['pay_price'] = item['product_price']; - // 星巴克计算补贴 - item['bt_price'] = item['bt_price']; + // if (this['BrandInfor']['brand_id'] == 10) { + // // 星巴克计算补贴 + // } + item['bt_price'] = Number(item['bt_price']); products.push(item); this['shoptotalnum'] += item['num']; @@ -397,7 +399,7 @@ } // 判断如果是0元购提示弹窗 - if (this.computedTotal.real_pay_price == 0) { + if (this.realPayment == 0) { this['zeroshow'] = true } else { this['show'] = true; @@ -452,6 +454,13 @@ shop: this.BrandInfor.brand_name, id: this.BrandInfor.brand_id, }, + amountInfo: { + actualpayment: this.YingPrice, // 支付总额 + paymoney: this.realPayment, // 实际支付 + coin_balance: this.ZeroData.used_coin, // 抵用券抵扣 + broker_balance: this.ZeroData.used_broker // 余额抵扣 + }, + payData: from, HeadersData: this.GetShopInfor, shopInfo: from.products, diff --git a/static/js/mixin/PayMixin.js b/static/js/mixin/PayMixin.js index ce49927..fa4912d 100644 --- a/static/js/mixin/PayMixin.js +++ b/static/js/mixin/PayMixin.js @@ -28,6 +28,7 @@ class Payment { shopInfo, computedTotal, GetShopInfor, + amountInfo, return_url, payData, HeadersData, @@ -56,6 +57,7 @@ class Payment { data: OrderData, shopInfo: shopInfo, GetShopInfor: GetShopInfor, + amountInfo: amountInfo, token: store.getters.GetToken, payData: data.payData, HeadersData: data.HeadersData diff --git a/static/js/mixin/restaurantmixins.js b/static/js/mixin/restaurantmixins.js index bb8e276..5e80122 100644 --- a/static/js/mixin/restaurantmixins.js +++ b/static/js/mixin/restaurantmixins.js @@ -311,7 +311,10 @@ const restaurantmixins = { // 佣金计算 computedOfflineOrder(this.FormInfor).then(res => { this.loading = false; + + // 0元购弹窗数据 this.realPayment = res.data.real_pay_price; + this.ZeroData = res.data; /* * 仅赋值一次