diff --git a/src/api/mall/promotion/coupon/couponTemplate.ts b/src/api/mall/promotion/coupon/couponTemplate.ts index 50ae226c..7e0a68c7 100755 --- a/src/api/mall/promotion/coupon/couponTemplate.ts +++ b/src/api/mall/promotion/coupon/couponTemplate.ts @@ -74,7 +74,7 @@ export function getCouponTemplatePage(params: PageParam) { } // 获得优惠劵模板分页 -export function getCouponTemplateList(ids: number[]) { +export function getCouponTemplateList(ids: number[]): Promise { return request.get({ url: `/promotion/coupon-template/list?ids=${ids}` }) diff --git a/src/utils/is.ts b/src/utils/is.ts index eec86a93..cd2dcc37 100644 --- a/src/utils/is.ts +++ b/src/utils/is.ts @@ -18,8 +18,8 @@ export const isObject = (val: any): val is Record => { return val !== null && is(val, 'Object') } -export const isEmpty = (val: T): val is T => { - if (val === null) { +export const isEmpty = (val: any): boolean => { + if (val === null || val === undefined || typeof val === 'undefined') { return true } if (isArray(val) || isString(val)) { diff --git a/src/views/mall/promotion/coupon/components/CouponSelect.vue b/src/views/mall/promotion/coupon/components/CouponSelect.vue index c232095e..c7dc3b86 100644 --- a/src/views/mall/promotion/coupon/components/CouponSelect.vue +++ b/src/views/mall/promotion/coupon/components/CouponSelect.vue @@ -176,6 +176,7 @@ const queryParams = reactive({ createTime: [] }) const queryFormRef = ref() // 搜索的表单 +const selectedCouponList = ref([]) // 选择的数据 /** 查询列表 */ const getList = async () => { @@ -214,11 +215,11 @@ const handleSelectionChange = (val: CouponTemplateApi.CouponTemplateVO[]) => { emit('update:multipleSelection', val) return } - emit('change', val) + selectedCouponList.value = val } const submitForm = () => { dialogVisible.value = false + emit('change', selectedCouponList.value) } -// TODO @puhui999:提前 todo,先不用改;未来单独成组件,其它模块可以服用;例如说,满减送,可以选择优惠劵; diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue index 2d3f37e9..6261180a 100644 --- a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue +++ b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue @@ -2,13 +2,11 @@ - + 添加优惠规则 diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue b/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue index 79e3a832..b4f356da 100644 --- a/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue +++ b/src/views/mall/promotion/rewardActivity/components/RewardRuleCouponShowcase.vue @@ -1,57 +1,61 @@ - +