添加了修改头像的功能

This commit is contained in:
2025-08-08 13:48:37 +08:00
parent 990f1850b1
commit 85df7bfc4e
8 changed files with 107 additions and 27 deletions

View File

@ -157,6 +157,16 @@ Page({
wx.showToast({ title: '姓名只能为中英文', icon: 'none' });
return;
}
// 校验身份证号
const idCardReg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
if (!idCardReg.test(idcard)) {
wx.showToast({
title: '身份证号格式不正确',
icon: 'none'
})
return ;
}
// 提交表单数据到后端
wx.request({
@ -175,7 +185,7 @@ Page({
success: res => {
console.log('后端返回的申请---->', res);
if (res.data.code === 1) {
wx.showToast({ title: '验证通过,提交成功', icon: 'success' });
wx.showToast({ title: '提交成功', icon: 'success' });
// 清空表单内容
this.setData({
@ -189,7 +199,7 @@ Page({
credential: '' // 清空凭证
});
} else {
wx.showToast({ title: '系统错误', icon: 'error' });
wx.showToast({ title: res.data.message, icon: 'none' });
}
}
});