【逻辑优化】更新活动的库存(拼团库存可能有逻辑问题)
parent
28faf73c62
commit
d37b848307
|
@ -128,6 +128,8 @@
|
|||
activity.products.forEach((product) => {
|
||||
spu.price = Math.min(spu.price, product.combinationPrice); // 设置 SPU 的最低价格
|
||||
});
|
||||
// 将活动总限购数量赋值给库存
|
||||
spu.stock = activity.totalLimitCount
|
||||
productList.value = [spu];
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -133,6 +133,10 @@
|
|||
activity.products.forEach((product) => {
|
||||
spu.price = Math.min(spu.price, product.seckillPrice); // 设置 SPU 的最低价格
|
||||
});
|
||||
// 将活动库存赋值给商品库存
|
||||
spu.stock = activity.stock
|
||||
// 活动总库存 - 活动库存 = 销量
|
||||
spu.salesCount = activity.totalStock - activity.stock
|
||||
productList.value = [spu];
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue