no message

This commit is contained in:
2025-11-11 10:35:43 +08:00
parent a415522359
commit 83a7d6ef3c
16 changed files with 948 additions and 103 deletions
+24 -1
View File
@@ -58,6 +58,20 @@ export default {
}, wait)
}
},
checkInputNum(value,max = null,num = null){
if(max === 0){
return '';
}
// value = value.replace(/^0*/g, ''); // 第一个数不能为0 ,若为0替换为空
value = value.replace(/[^\d]/g,''); // 是否是数字,若是除数字之外的则替换为空
if(num && value.length > num){
value = value.substr(0, num);
}
if(max && (Number(value) >= Number(max))){
value = max;
}
return value;
},
checkInputPrice(value,max = null) {
if(max === 0){
return '';
@@ -72,7 +86,16 @@ export default {
value = max;
}
return value;
}
},
addressTurn(val,num = 9) {
if (val.length < 10) {
return val
} else {
let str = val.slice(num, val.length - num)
val = val.replace(str, '...')
return val
}
},
}