commission--yt-commit
This commit is contained in:
@ -122,6 +122,17 @@ Page({
|
||||
return false;
|
||||
}
|
||||
|
||||
// 正则表达式,匹配非汉字字符
|
||||
const reg = /[^\u4e00-\u9fa5]/;
|
||||
// 判断输入的值是否含有非汉字字符
|
||||
if (reg.test(cardHolder)) {
|
||||
wx.showToast({
|
||||
title: '姓名必须为汉字',
|
||||
icon: 'none',
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查手机号是否为 11 位且只包含数字
|
||||
const phonePattern = /^[0-9]{11}$/;
|
||||
if (!phonePattern.test(phoneNumber)) {
|
||||
|
Reference in New Issue
Block a user