|
|
@@ -182,6 +182,11 @@ const rules = reactive({
|
|
|
return;
|
|
|
}
|
|
|
const strValue = value.toString().trim();
|
|
|
+ // 检查是否以小数点开头(如 ".1")
|
|
|
+ if (strValue.startsWith(".")) {
|
|
|
+ callback(new Error("最低消费金额格式不正确"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 检查是否有前导零(除了单独的"0"或"0."开头的小数)
|
|
|
if (strValue.length > 1 && strValue.startsWith("0") && strValue !== "0" && !strValue.startsWith("0.")) {
|
|
|
callback(new Error("最低消费金额必须为正数"));
|