diff --git a/src/views/recharge/addCoinRecharge.vue b/src/views/recharge/addCoinRecharge.vue index 2c4e0ce..4829d3a 100644 --- a/src/views/recharge/addCoinRecharge.vue +++ b/src/views/recharge/addCoinRecharge.vue @@ -187,6 +187,13 @@ const rules = reactive({ return; } + // 检查整数位数 + const integerPart = value.split('.')[0]; + if (integerPart.length > 6) { + callback(new Error('整数位数不能超过6位')); + return; + } + // 检查小数位数 if (value.includes('.')) { const decimalPart = value.split('.')[1]; @@ -218,6 +225,13 @@ const rules = reactive({ return; } + // 检查整数位数 + const integerPart = value.split('.')[0]; + if (integerPart.length > 6) { + callback(new Error('整数位数不能超过6位')); + return; + } + // 检查小数位数 if (value.includes('.')) { const decimalPart = value.split('.')[1]; @@ -255,6 +269,13 @@ const rules = reactive({ return; } + // 检查整数位数 + const integerPart = value.split('.')[0]; + if (integerPart.length > 6) { + callback(new Error('整数位数不能超过6位')); + return; + } + // 检查小数位数 if (value.includes('.')) { const decimalPart = value.split('.')[1];