From b5f621c980cfe61e3bc31eb4420e8b81675376d9 Mon Sep 17 00:00:00 2001 From: Agent Date: Fri, 27 Mar 2026 13:44:23 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=A2=E5=8D=95=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=94=B9=E7=94=A8=E4=BC=98=E6=83=A0=E9=87=91=E9=A2=9D=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E4=BF=9D=E7=95=99=E6=8A=98=E6=89=A3=E7=8E=87?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/order/create.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/pages/order/create.vue b/src/pages/order/create.vue index 11a2caa..cab28dd 100644 --- a/src/pages/order/create.vue +++ b/src/pages/order/create.vue @@ -72,14 +72,14 @@ 优惠设置 - 折扣率 + 优惠金额 - % + @@ -176,9 +176,10 @@ export default { searchKeyword: '', // 金额相关 - discountRate: 100, // 折扣率 + discountRate: 100, // 折扣率(保留逻辑,默认100%不打折) + discountMoney: 0, // 优惠金额 totalAmount: 0, // 原价 - discountAmount: 0, // 优惠金额 + discountAmount: 0, // 优惠金额(计算结果) actualAmount: 0, // 实付金额 // 其他 @@ -277,8 +278,8 @@ export default { return sum + (item.price * item.quantity) }, 0) - // 2. 计算优惠金额 = 原价 × (100 - 折扣率) / 100 - this.discountAmount = this.totalAmount * (100 - this.discountRate) / 100 + // 2. 优惠金额直接使用用户输入的值 + this.discountAmount = parseFloat(this.discountMoney) || 0 // 3. 计算实付金额 = 原价 - 优惠金额 this.actualAmount = this.totalAmount - this.discountAmount @@ -296,7 +297,8 @@ export default { quantity: item.quantity, price: item.price })), - discountRate: parseFloat(this.discountRate), + discountRate: 100, // 保留折扣率逻辑,默认100% + discountMoney: parseFloat(this.discountMoney) || 0, remark: this.remark, paymentMethod: this.paymentMethod }