File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
src/components/DiyEditor/components/mobile Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,8 @@ watch(
86
86
// 循环活动信息,赋值拼团价格
87
87
activity .products .forEach ((product : CombinationProductVO ) => {
88
88
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 的最低价格
94
91
})
95
92
});
96
93
},
Original file line number Diff line number Diff line change @@ -84,14 +84,10 @@ watch(
84
84
if (! activity ?.spuId ) return
85
85
spuList .value = [await ProductSpuApi .getSpu (activity .spuId )]
86
86
spuList .value = [await ProductSpuApi .getSpu (activity .spuId )]
87
- // 循环活动信息,赋值拼团价格
87
+ // 循环活动信息,赋值秒杀最低价格
88
88
activity .products .forEach ((product : SeckillProductVO ) => {
89
89
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 的最低价格
95
91
})
96
92
});
97
93
},
You can’t perform that action at this time.
0 commit comments