【代码评审】商城:满减送活动的实现

This commit is contained in:
YunaiV 2024-08-23 18:28:37 +08:00
parent 814f9ba9c6
commit a02712ca95
3 changed files with 7 additions and 5 deletions

View File

@ -9,10 +9,11 @@ export interface RewardActivityVO {
remark?: string
conditionType?: number
productScope?: number
productScopeValues?: number[] // 商品范围:值为 品类编号列表 或 商品编号列表 ,用于提交
productCategoryIds?: number[] // 仅用于表单,不提交
productSpuIds?: number[] // 仅用于表单,不提交
rules: RewardRule[]
// 如下仅用于表单,不提交
productScopeValues?: number[] // 商品范围:值为品类编号列表、商品编号列表
productCategoryIds?: number[]
productSpuIds?: number[]
}
// 优惠规则

View File

@ -169,6 +169,7 @@ const getProductScope = async () => {
formData.value.productSpuIds = formData.value.productScopeValues
break
case PromotionProductScopeEnum.CATEGORY.scope:
// TODO @puhui999 await nextTick()
await nextTick(() => {
let productCategoryIds = formData.value.productScopeValues as any
if (Array.isArray(productCategoryIds) && productCategoryIds.length > 0) {

View File

@ -19,6 +19,7 @@
placeholder=""
type="number"
/>
<!-- TODO @puhui999走字典数据 -->
{{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }}
</el-form-item>
<el-form-item label="优惠内容:" label-width="100px">
@ -26,6 +27,7 @@
订单金额优惠
<el-form-item>
<!-- TODO @puhui999需要考虑 100 换算哈 -->
<el-input
v-model="rule.discountPrice"
class="w-150px! p-x-20px!"
@ -91,8 +93,6 @@ import { RewardActivityVO } from '@/api/mall/promotion/reward/rewardActivity'
import { PromotionConditionTypeEnum } from '@/utils/constants'
import { useVModel } from '@vueuse/core'
defineOptions({ name: 'RewardRule' })
const props = defineProps<{
modelValue: RewardActivityVO
}>()