From d02948a936fe41a7b9aa38fbe920c2358ba49bd5 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 9 Dec 2025 09:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E7=A7=81=E5=9F=9F=E5=BC=95=E6=B5=81=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=90=8E=E4=BB=98?= =?UTF-8?q?=E8=B4=B9=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=A1=AE=E8=AE=A4=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drainage.vue | 8 +- pages/order/components/order-item.vue | 32 +- pages/order/components/orderInfo.vue | 47 +- pages/order/confirm-order.vue | 2694 +++++++++++++------------ pages/product/index.vue | 46 +- stores/carts.js | 3 +- 6 files changed, 1513 insertions(+), 1317 deletions(-) diff --git a/components/drainage.vue b/components/drainage.vue index 297888b..e0d1ceb 100644 --- a/components/drainage.vue +++ b/components/drainage.vue @@ -2,7 +2,7 @@ - ¥{{ item.salePrice }} + ¥{{ item.salePrice }} x{{ item.num }} @@ -110,16 +112,24 @@ const shopUserInfo = inject("shopUserInfo"); const shopInfo = inject("shopInfo"); function showLimitDiscount(item) { - if (!props.limitDiscount || !props.limitDiscount.id) { - return false; + if ( + (item.is_time_discount || item.isTimeDiscount) && + props.limitDiscount && + props.limitDiscount.id + ) { + return true; } - return orderUtils.canUseLimitTimeDiscount( - item, - props.limitDiscount, - shopInfo.value, - shopUserInfo.value, - "productId" - ); + return false; + // if (!props.limitDiscount || !props.limitDiscount.id) { + // return false; + // } + // return orderUtils.canUseLimitTimeDiscount( + // item, + // props.limitDiscount, + // shopInfo.value, + // shopUserInfo.value, + // "productId" + // ); } onMounted(() => { console.log("props.nowCarts"); @@ -542,4 +552,4 @@ const showOldPrice = computed(() => {}); text-decoration: line-through; text-align: right; } - \ No newline at end of file + diff --git a/pages/order/components/orderInfo.vue b/pages/order/components/orderInfo.vue index b5a3c14..5ae8db4 100644 --- a/pages/order/components/orderInfo.vue +++ b/pages/order/components/orderInfo.vue @@ -158,7 +158,10 @@ " > - + -¥{{ cartStore.orderCostSummary.fullReduction.actualAmount }}-¥{{ + cartStore.orderCostSummary.fullReduction.actualAmount + }} - + 0) { const canUseThresholds = res.thresholds @@ -874,8 +887,6 @@ function calcDiscountActivity() { return; } console.log("当前满减门槛", discountActivity.value); - - } async function getDiscountActivity() { const res = await discountActivityApi.config({ @@ -1593,4 +1604,4 @@ onMounted(async () => { z-index: 9; color: #fff; } - \ No newline at end of file + diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index 1d9329d..eab0664 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -1,188 +1,292 @@ diff --git a/pages/product/index.vue b/pages/product/index.vue index 2d19c32..b9a8b09 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -555,7 +555,8 @@ diff --git a/stores/carts.js b/stores/carts.js index f93df0b..421db17 100644 --- a/stores/carts.js +++ b/stores/carts.js @@ -11,7 +11,8 @@ import { defineStore } from "pinia"; // GoodsType // } = yskUtils -import { OrderPriceCalculator } from "@/utils/goods"; +import yskUtils from 'ysk-utils' +const {OrderPriceCalculator}=yskUtils import { ref, computed, reactive, watchEffect, watch } from "vue"; import {