From 959fe83d72dfee137bb6c4c50a46c73f3f2282f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=AE=87=E5=BA=86?= Date: Wed, 16 Oct 2024 16:51:52 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E5=BD=93?= =?UTF-8?q?=E6=97=A0=E4=BC=98=E6=83=A0=E4=BB=B7=E6=A0=BC=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=95=86=E5=93=81=E6=97=A0=E6=B3=95=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杨宇庆 --- pages/goods/index.vue | 2 +- sheep/hooks/useGoods.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/goods/index.vue b/pages/goods/index.vue index 03298620..58f97b7c 100644 --- a/pages/goods/index.vue +++ b/pages/goods/index.vue @@ -361,7 +361,7 @@ // 选择有 promotionPrice 且最小的 state.settlementSku = state.goodsInfo.skus .filter((sku) => sku.stock > 0 && sku.promotionPrice > 0) - .reduce((prev, curr) => (prev.promotionPrice < curr.promotionPrice ? prev : curr)); + .reduce((prev, curr) => (prev.promotionPrice < curr.promotionPrice ? prev : curr), []); // 设置满减送活动 if (data.rewardActivity) { diff --git a/sheep/hooks/useGoods.js b/sheep/hooks/useGoods.js index 9bab54b5..9374cab8 100644 --- a/sheep/hooks/useGoods.js +++ b/sheep/hooks/useGoods.js @@ -416,7 +416,7 @@ export function appendSettlementProduct(spus, settlementInfos) { // 选择价格最小的 SKU 设置到 SPU 上 const settlementSku = settlementInfo.skus .filter((sku) => sku.promotionPrice > 0) - .reduce((prev, curr) => (prev.promotionPrice < curr.promotionPrice ? prev : curr)); + .reduce((prev, curr) => (prev.promotionPrice < curr.promotionPrice ? prev : curr), []); if (settlementSku) { spu.promotionType = settlementSku.promotionType; spu.promotionPrice = settlementSku.promotionPrice;