From 949fe99610d321b089923b0ab62e4d2e89bc73a1 Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Tue, 29 Jul 2025 15:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A1=E7=89=87=E5=8F=96=E6=B6=88=E5=8D=95?= =?UTF-8?q?=E9=9D=A2=E5=8D=B0=E5=88=B7=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=9D=A1?= =?UTF-8?q?=E5=B9=85=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/lingtao/net/util/PriceUtils.java | 7 +++++-- src/main/webapp/views/product/coupon.jsp | 3 +-- src/main/webapp/views/product/waterGauge.jsp | 14 +++++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/lingtao/net/util/PriceUtils.java b/src/main/java/lingtao/net/util/PriceUtils.java index ef98959..2d5620b 100644 --- a/src/main/java/lingtao/net/util/PriceUtils.java +++ b/src/main/java/lingtao/net/util/PriceUtils.java @@ -3542,11 +3542,14 @@ public class PriceUtils { } } if (startIndex == endIndex && startIndex == 0) { - price = price_list[endIndex]; + price = price_list[endIndex] * area; } else if (startIndex == endIndex) { price = (price_list[endIndex] * areas[endIndex] / areas[endIndex]) * area; } else { - price = (price_list[startIndex] * areas[startIndex] + price_list[endIndex] * areas[endIndex]) / (areas[startIndex] + areas[endIndex]) * area; + double end_price = price_list[endIndex]*areas[endIndex]; + double start_price = price_list[startIndex]*areas[startIndex]; + price = ((areas[endIndex] - area) / (areas[endIndex] - areas[startIndex])) * start_price + ((area - areas[startIndex]) / (areas[endIndex] - areas[startIndex])) * end_price; + } price = islast ? last_price * area : price; return Math.ceil(price); diff --git a/src/main/webapp/views/product/coupon.jsp b/src/main/webapp/views/product/coupon.jsp index 86b113a..6c16618 100644 --- a/src/main/webapp/views/product/coupon.jsp +++ b/src/main/webapp/views/product/coupon.jsp @@ -532,8 +532,7 @@ 工艺