【修复】当无优惠价格时,商品无法显示的问题

Signed-off-by: 杨宇庆 <hiyyq@qq.com>
pull/114/head
杨宇庆 2024-10-16 16:51:52 +00:00 committed by Gitee
parent 3051aed6b2
commit 959fe83d72
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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;