feat:【antd】【mall】rewardActivity 优化完善
This commit is contained in:
@@ -73,23 +73,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
item.limit = convertToInteger(item.limit || 0);
|
item.limit = convertToInteger(item.limit || 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// 设置 productScopeValues
|
// productScopeValues 已通过 data.ts 中的 dependencies.trigger 自动同步到表单值中
|
||||||
switch (data.productScope) {
|
|
||||||
// TODO @puhui999:这里要不要搞成类似优惠劵的
|
|
||||||
case PromotionProductScopeEnum.CATEGORY.scope: {
|
|
||||||
const categoryIds = data.productCategoryIds;
|
|
||||||
data.productScopeValues = Array.isArray(categoryIds)
|
|
||||||
? categoryIds
|
|
||||||
: categoryIds
|
|
||||||
? [categoryIds]
|
|
||||||
: [];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case PromotionProductScopeEnum.SPU.scope: {
|
|
||||||
data.productScopeValues = data.productSpuIds;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await (data.id
|
await (data.id
|
||||||
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
||||||
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
||||||
|
|||||||
Reference in New Issue
Block a user