Skip to content

Commit b5c4da0

Browse files
YunaiVgitee-org
authored andcommitted
!539 【功能修复】修复拼团装修的价格显示
Merge pull request !539 from 卢越/master
2 parents 7d60b5a + 3dc02f7 commit b5c4da0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/api/mall/promotion/combination/combinationActivity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface CombinationActivityVO {
1616
virtualGroup?: number
1717
status?: number
1818
limitDuration?: number
19+
combinationPrice?: number
1920
products: CombinationProductVO[]
2021
}
2122

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,12 @@ watch(
152152
153153
// 更新 SPU 的最低价格
154154
combinationActivityList.value.forEach((activity) => {
155-
activity.products.forEach((product) => {
156-
const spu = spuList.value.find((spu) => spu.id === product.spuId)
157-
if (spu) {
158-
// 哪个最便宜就赋值哪个
159-
spu.price = Math.min(product.combinationPrice || Infinity, spu.price || Infinity)
160-
}
161-
})
155+
// 匹配spuId
156+
const spu = spuList.value.find((spu) => spu.id === activity.spuId)
157+
if (spu) {
158+
// 赋值活动价格,哪个最便宜就赋值哪个
159+
spu.price = Math.min(activity.combinationPrice || Infinity, spu.price || Infinity)
160+
}
162161
})
163162
}
164163
} catch (error) {

0 commit comments

Comments
 (0)