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 {