【代码优化】】MALL: 修复满减送活动规则优惠券回显逻辑

pull/525/head
puhui999 2024-08-23 17:18:11 +08:00
parent e9510f50f8
commit d81ca6e8e3
1 changed files with 5 additions and 2 deletions

View File

@ -38,6 +38,7 @@ import { DICT_TYPE } from '@/utils/dict'
import { discountFormat } from '@/views/mall/promotion/coupon/formatter'
import { isEmpty } from '@/utils/is'
import { useVModel } from '@vueuse/core'
import { findIndex } from '@/utils'
defineOptions({ name: 'RewardRuleCouponShowcase' })
@ -88,9 +89,11 @@ const initGiveCouponList = async () => {
}
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({
...data[i],
giveCount: rewardRule.value.couponCounts![i]
...coupon,
giveCount: rewardRule.value.couponCounts![index]
})
}
}