From 01ef172b4dda68e0c2d3c397f98cf0bbcb7edf1c Mon Sep 17 00:00:00 2001 From: gyq <875626088@qq.com> Date: Thu, 13 Nov 2025 18:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E5=AE=A2=E4=B8=8B?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/store/modules/carts.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f7d5241..31888ad 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "vue-clipboard3": "^2.0.0", "vue-i18n": "^11.1.0", "vue-router": "^4.5.0", - "ysk-utils": "^1.0.68" + "ysk-utils": "^1.0.69" }, "devDependencies": { "@commitlint/cli": "^19.7.1", diff --git a/src/store/modules/carts.ts b/src/store/modules/carts.ts index 60ddf66..4d46a56 100644 --- a/src/store/modules/carts.ts +++ b/src/store/modules/carts.ts @@ -156,6 +156,7 @@ export const useCartsStore = defineStore("carts", () => { .flat() .map(convertToBaseCartItem); + if (cart.length || history.length) { WebSocketManager.sendMessage({ type: "shopping", @@ -164,15 +165,17 @@ export const useCartsStore = defineStore("carts", () => { shop_id: localStorage.getItem("shopId"), data: { cart: cart.map(item => { + console.log('cart.111111', item); return { id: item.id, - is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value) ? 1 : 0 + is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'product_id') ? 1 : 0 } }), history: history.map(item => { + console.log('history.222222', item); return { id: item.id, - is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value) ? 1 : 0 + is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'productId') ? 1 : 0 } }) }, @@ -785,6 +788,7 @@ export const useCartsStore = defineStore("carts", () => { sku_name: v.skuName, sku_id: v.skuId, product_type: v.productType, + product_id: v.productId, is_time_discount: limitUtils.canUseLimitTimeDiscount(v, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'productId'), time_discount_price: limitUtils.returnPrice({ goods: { ...v, ...skuData },