File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
api/mall/promotion/combination
components/DiyEditor/components/mobile/PromotionCombination Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export interface CombinationActivityVO {
16
16
virtualGroup ?: number
17
17
status ?: number
18
18
limitDuration ?: number
19
+ combinationPrice ?: number
19
20
products : CombinationProductVO [ ]
20
21
}
21
22
Original file line number Diff line number Diff line change @@ -152,13 +152,12 @@ watch(
152
152
153
153
// 更新 SPU 的最低价格
154
154
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
+ }
162
161
})
163
162
}
164
163
} catch (error ) {
You can’t perform that action at this time.
0 commit comments