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

Merge pull request !114 from 杨宇庆/N/A
pull/113/MERGE
芋道源码 2024-10-27 08:34:04 +00:00 committed by Gitee
commit 90b6ae7d40
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 // promotionPrice
state.settlementSku = state.goodsInfo.skus state.settlementSku = state.goodsInfo.skus
.filter((sku) => sku.stock > 0 && sku.promotionPrice > 0) .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) { if (data.rewardActivity) {

View File

@ -416,7 +416,7 @@ export function appendSettlementProduct(spus, settlementInfos) {
// 选择价格最小的 SKU 设置到 SPU 上 // 选择价格最小的 SKU 设置到 SPU 上
const settlementSku = settlementInfo.skus const settlementSku = settlementInfo.skus
.filter((sku) => sku.promotionPrice > 0) .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) { if (settlementSku) {
spu.promotionType = settlementSku.promotionType; spu.promotionType = settlementSku.promotionType;
spu.promotionPrice = settlementSku.promotionPrice; spu.promotionPrice = settlementSku.promotionPrice;