mirror of
				https://gitee.com/hhyykk/ipms-sjy-ui.git
				synced 2025-11-04 20:28:45 +08:00 
			
		
		
		
	【代码评审】商城:满减送活动的实现
This commit is contained in:
		@@ -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[]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 优惠规则
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
}>()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user