Skip to content

Commit ed54cfe

Browse files
author
puhui999
committed
【代码优化】商城: 限时折扣活动新增 spu 保存 fix
1 parent 7bb482a commit ed54cfe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/views/mall/promotion/discountActivity/DiscountActivityForm.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,19 @@ const formRef = ref() // 表单 Ref
7878
7979
const spuSelectRef = ref() // 商品和属性选择 Ref
8080
const spuAndSkuListRef = ref() // sku 限时折扣 配置组件Ref
81-
const ruleConfig: RuleConfig[] = []
81+
const ruleConfig: RuleConfig[] = [
82+
{
83+
name: 'productConfig.discountPrice',
84+
rule: (arg) => arg > 0,
85+
message: '商品优惠金额不能为 0 !!!'
86+
}
87+
]
8288
const spuList = ref<DiscountActivityApi.SpuExtension[]>([]) // 选择的 spu
8389
const spuPropertyList = ref<SpuProperty<DiscountActivityApi.SpuExtension>[]>([])
8490
const spuIds = ref<number[]>([])
8591
const selectSpu = (spuId: number, skuIds: number[]) => {
92+
// TODO puhui999: 艿艿现在限时折扣活动可以选择多个 spu ,那么 spuId 是不是得改成 spuIds 来存放多个?🤣
93+
formRef.value.setValues({ spuId })
8694
getSpuDetails(spuId, skuIds)
8795
}
8896
/**

0 commit comments

Comments
 (0)