fix: 处理积分最低0.01的问题

This commit is contained in:
lzhizhao 2025-08-18 23:59:17 +08:00
parent e0d48b59f6
commit bebbcab19b
1 changed files with 11 additions and 8 deletions

View File

@ -72,7 +72,10 @@
</el-form-item>
<el-form-item label="积分类型" prop="exchangePointsType" required>
<el-radio-group v-model="configForm.exchangePointsType">
<el-radio-group
v-model="configForm.exchangePointsType"
@change="handleChangeRadio"
>
<el-radio :label="2">积分优惠购</el-radio>
<el-radio :label="1">积分换购</el-radio>
</el-radio-group>
@ -132,7 +135,8 @@
>
<el-input
v-model="configForm.exchangeRequiredAmount"
placeholder="请输入优惠购价格"
placeholder="请输入最低兑换金额"
:readonly="true"
style="width: 200px"
></el-input>
</el-form-item>
@ -210,6 +214,11 @@ export default {
},
methods: {
handleChangeRadio() {
if (this.configForm.exchangePointsType === 1) {
this.configForm.exchangeRequiredAmount = 0.01;
}
},
show(productData, editData = null, exchangeType = 1) {
this.visible = true;
this.isEdit = !!editData;
@ -289,12 +298,6 @@ export default {
: 0.01 // 0.01
};
}
console.log(submitData);
if (submitData.exchangeRequiredAmount < 0.01) {
this.$message.error("请输入正确的优惠购价格, 不能小于0.01");
this.submitting = false;
return;
}
// API
const apiCall = this.isEdit