Skip to content

Commit 8a225e6

Browse files
committed
【功能修复】商城:满减送的条件类型的满足价格不对的问题
1 parent 48e78c3 commit 8a225e6

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/views/mall/promotion/rewardActivity/RewardForm.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ const open = async (type: string, id?: number) => {
119119
// 规则分转元
120120
data.rules?.forEach((item: any) => {
121121
item.discountPrice = fenToYuan(item.discountPrice || 0)
122+
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
123+
item.limit = fenToYuan(item.limit || 0)
124+
}
122125
})
123126
formData.value = data
124127
// 获得商品范围
@@ -151,6 +154,9 @@ const submitForm = async () => {
151154
// 规则元转分
152155
data.rules.forEach((item) => {
153156
item.discountPrice = yuanToFen(item.discountPrice || 0)
157+
if (data.conditionType === PromotionConditionTypeEnum.PRICE.type) {
158+
item.limit = yuanToFen(item.limit || 0)
159+
}
154160
})
155161
// 设置商品范围
156162
setProductScopeValues(data)

src/views/mall/promotion/rewardActivity/components/RewardRule.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,25 @@
1010
<el-form ref="formRef" :model="rule">
1111
<el-form-item label="优惠门槛:" label-width="100px" prop="limit">
1212
13+
<el-input-number
14+
v-if="PromotionConditionTypeEnum.PRICE.type === formData.conditionType"
15+
v-model="rule.limit"
16+
:min="0"
17+
:precision="2"
18+
:step="0.1"
19+
class="w-150px! p-x-20px!"
20+
placeholder=""
21+
type="number"
22+
controls-position="right"
23+
/>
1324
<el-input
25+
v-else
1426
v-model="rule.limit"
1527
:min="0"
1628
class="w-150px! p-x-20px!"
1729
placeholder=""
1830
type="number"
1931
/>
20-
<!-- TODO @puhui999:走字典数据? -->
2132
{{ PromotionConditionTypeEnum.PRICE.type === formData.conditionType ? '元' : '件' }}
2233
</el-form-item>
2334
<el-form-item label="优惠内容:" label-width="100px">

0 commit comments

Comments
 (0)