Skip to content

Commit 4130b2f

Browse files
committed
【功能修复】修复装修页面的拼团价格和秒杀价格
1 parent 3b445d0 commit 4130b2f

File tree

2 files changed

+4
-11
lines changed
  • src/components/DiyEditor/components/mobile

2 files changed

+4
-11
lines changed

src/components/DiyEditor/components/mobile/PromotionCombination/index.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,8 @@ watch(
8686
// 循环活动信息,赋值拼团价格
8787
activity.products.forEach((product: CombinationProductVO) => {
8888
spuList.value.forEach((spu: Spu) => {
89-
// 如果商品 SpuId 匹配
90-
if (spu.id === product.spuId) {
91-
// 商品原售价和拼团价,哪个便宜就赋值哪个
92-
spu.combinationPrice = Math.min(spu.price || 0, product.combinationPrice); // 设置 SPU 的最低价格
93-
}
89+
// 商品原售价和拼团价,哪个便宜就赋值哪个
90+
spu.combinationPrice = Math.min(spu.combinationPrice || Infinity, product.combinationPrice); // 设置 SPU 的最低价格
9491
})
9592
});
9693
},

src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,10 @@ watch(
8484
if (!activity?.spuId) return
8585
spuList.value = [await ProductSpuApi.getSpu(activity.spuId)]
8686
spuList.value = [await ProductSpuApi.getSpu(activity.spuId)]
87-
// 循环活动信息,赋值拼团价格
87+
// 循环活动信息,赋值秒杀最低价格
8888
activity.products.forEach((product: SeckillProductVO) => {
8989
spuList.value.forEach((spu: Spu) => {
90-
// 如果商品 SpuId 匹配
91-
if (spu.id === product.spuId) {
92-
// 商品原售价和拼团价,哪个便宜就赋值哪个
93-
spu.seckillPrice = Math.min(spu.price || 0, product.seckillPrice); // 设置 SPU 的最低价格
94-
}
90+
spu.seckillPrice = Math.min(spu.seckillPrice || Infinity, product.seckillPrice); // 设置 SPU 的最低价格
9591
})
9692
});
9793
},

0 commit comments

Comments
 (0)