【代码优化】】MALL: 修复满减送活动规则优惠券回显逻辑
parent
e9510f50f8
commit
d81ca6e8e3
|
@ -38,6 +38,7 @@ import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { discountFormat } from '@/views/mall/promotion/coupon/formatter'
|
import { discountFormat } from '@/views/mall/promotion/coupon/formatter'
|
||||||
import { isEmpty } from '@/utils/is'
|
import { isEmpty } from '@/utils/is'
|
||||||
import { useVModel } from '@vueuse/core'
|
import { useVModel } from '@vueuse/core'
|
||||||
|
import { findIndex } from '@/utils'
|
||||||
|
|
||||||
defineOptions({ name: 'RewardRuleCouponShowcase' })
|
defineOptions({ name: 'RewardRuleCouponShowcase' })
|
||||||
|
|
||||||
|
@ -88,9 +89,11 @@ const initGiveCouponList = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0, len = data.length; i < len; i++) {
|
for (let i = 0, len = data.length; i < len; i++) {
|
||||||
|
const coupon = data[i]
|
||||||
|
const index = findIndex(rewardRule.value.couponIds!, (item) => item.id === coupon.id)
|
||||||
list.value.push({
|
list.value.push({
|
||||||
...data[i],
|
...coupon,
|
||||||
giveCount: rewardRule.value.couponCounts![i]
|
giveCount: rewardRule.value.couponCounts![index]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue