commission--yt-commit

This commit is contained in:
2025-06-06 13:16:14 +08:00
parent b00256ba06
commit 017cb7b0e9
13 changed files with 104 additions and 22 deletions

View File

@ -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)) {