Commit 3dc02f72 by 卢越

【功能修复】修复拼团的价格显示

parent 7d60b5a6
......@@ -16,6 +16,7 @@ export interface CombinationActivityVO {
virtualGroup?: number
status?: number
limitDuration?: number
combinationPrice?: number
products: CombinationProductVO[]
}
......
......@@ -152,13 +152,12 @@ watch(
// 更新 SPU 的最低价格
combinationActivityList.value.forEach((activity) => {
activity.products.forEach((product) => {
const spu = spuList.value.find((spu) => spu.id === product.spuId)
if (spu) {
// 哪个最便宜就赋值哪个
spu.price = Math.min(product.combinationPrice || Infinity, spu.price || Infinity)
}
})
// 匹配spuId
const spu = spuList.value.find((spu) => spu.id === activity.spuId)
if (spu) {
// 赋值活动价格,哪个最便宜就赋值哪个
spu.price = Math.min(activity.combinationPrice || Infinity, spu.price || Infinity)
}
})
}
} catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment