From 8a225e66b78a28d19fc9d4e136578949a51be614 Mon Sep 17 00:00:00 2001 From: YunaiV <zhijiantianya@gmail.com> Date: Sun, 15 Sep 2024 20:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E3=80=91=E5=95=86=E5=9F=8E=EF=BC=9A=E6=BB=A1=E5=87=8F=E9=80=81?= =?UTF-8?q?=E7=9A=84=E6=9D=A1=E4=BB=B6=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=BB=A1?= =?UTF-8?q?=E8=B6=B3=E4=BB=B7=E6=A0=BC=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mall/promotion/rewardActivity/RewardForm.vue | 6 ++++++ .../rewardActivity/components/RewardRule.vue | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 9a48d857..64a2dd4a 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -119,6 +119,9 @@ const open = async (type: string, id?: number) => { // 规则分转元 data.rules?.forEach((item: any) => { item.discountPrice = fenToYuan(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = fenToYuan(item.limit || 0) + } }) formData.value = data // 获得商品范围 @@ -151,6 +154,9 @@ const submitForm = async () => { // 规则元转分 data.rules.forEach((item) => { item.discountPrice = yuanToFen(item.discountPrice || 0) + if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) { + item.limit = yuanToFen(item.limit || 0) + } }) // 设置商品范围 setProductScopeValues(data) diff --git a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue index 8dc37b32..2c63a427 100644 --- a/src/views/mall/promotion/rewardActivity/components/RewardRule.vue +++ b/src/views/mall/promotion/rewardActivity/components/RewardRule.vue @@ -10,14 +10,25 @@ <el-form ref="formRef" :model="rule"> <el-form-item label="优惠门槛:" label-width="100px" prop="limit"> 满 + <el-input-number + v-if="PromotionConditionTypeEnum.PRICE.type === formData.conditionType" + v-model="rule.limit" + :min="0" + :precision="2" + :step="0.1" + class="w-150px! p-x-20px!" + placeholder="" + type="number" + controls-position="right" + /> <el-input + v-else v-model="rule.limit" :min="0" class="w-150px! p-x-20px!" placeholder="" type="number" /> - <!-- TODO @puhui999:走字典数据? --> {{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }} </el-form-item> <el-form-item label="优惠内容:" label-width="100px">