From 0fdb6c88db6da4de100c2acfb283eb50189ffd43 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 17 Oct 2024 17:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/user/cartSubmitSelect.vue | 46 +++++++++++++++++++--- config.js | 2 +- pages/index/order.vue | 5 +++ .../components/product/submitUnitSelect.vue | 15 ++++--- pages_order/mine/lease.vue | 2 +- 5 files changed, 57 insertions(+), 13 deletions(-) diff --git a/components/user/cartSubmitSelect.vue b/components/user/cartSubmitSelect.vue index 444a475..b672652 100644 --- a/components/user/cartSubmitSelect.vue +++ b/components/user/cartSubmitSelect.vue @@ -51,16 +51,18 @@ 租金:¥{{ rentPrice }} - - 优惠:-¥{{ coupon.couponPrice }} + + 优惠:-¥{{ getPrice().coupon }} - - 实付款:¥{{ (price - coupon.couponPrice).toFixed(2) }} + + 实付款:¥{{ getPrice().price }} + + + + + @@ -153,6 +168,27 @@ } }) }, + // 计算优惠金额 + getPrice(){ + // 减免押金 + if(this.coupon.couponFlag && + this.coupon.couponCondition <= this.depositPrice){ + return { + coupon : this.coupon.couponPrice, + price : (this.price - this.coupon.couponPrice).toFixed(2), + } + } + // 减免租金 + if(this.coupon.leaseCouponFlag && + this.coupon.leaseCouponCondition <= this.rentPrice){ + return { + coupon : this.coupon.leaseCouponPrice, + price : (this.price - this.coupon.leaseCouponPrice).toFixed(2), + } + } + + return {} + }, // 选择优惠劵 selectCoupon(e){ this.couponText = e.couponName diff --git a/config.js b/config.js index 5c66fe2..d26ae7a 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'prod' +const type = 'dev' // 环境配置 diff --git a/pages/index/order.vue b/pages/index/order.vue index edc9fbc..a96934c 100644 --- a/pages/index/order.vue +++ b/pages/index/order.vue @@ -70,6 +70,10 @@ {{ item.userPhone }} {{ item.userAddress }} + + 下单时间: + {{ item.createTime }} + @@ -380,6 +384,7 @@ .userInfo{ font-size: 24rpx; + margin-bottom: 10rpx; text{ margin-right: 26rpx; } diff --git a/pages_order/components/product/submitUnitSelect.vue b/pages_order/components/product/submitUnitSelect.vue index 1a70286..bc95fa7 100644 --- a/pages_order/components/product/submitUnitSelect.vue +++ b/pages_order/components/product/submitUnitSelect.vue @@ -21,7 +21,7 @@ - 您有桌布吗? + 您有物品吗? - 桌布租赁 + 物品租赁 @@ -96,16 +96,19 @@ 押金:¥{{ price }} - + 优惠:-¥{{ coupon.couponPrice }} - + 实付款:¥{{ (price - coupon.couponPrice).toFixed(2) }}