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

@ -94,11 +94,11 @@ Page({
async onRegister() {
// 调用通用校验,失败时已提示并 return
if (!validate(this.data, {
nickname: '请输入昵称',
phone: '请输入手机号',
captcha: '请输入验证码',
inviteCode: '请输入邀请码',
password: '请输入密码'
nickname: '昵称不能为空',
phone: '手机号不能为空',
captcha: '验证码不能为空',
inviteCode: '邀请码不能为空',
password: '密码不能为空'
})) {
return;
}
@ -108,6 +108,10 @@ Page({
return;
}
const { nickname, phone, captcha, inviteCode, password } = this.data;
wx.showLoading({
title: '加载中',
mask: true
})
const res = await requestAsync({
url: baseUrl + '/userInfo/register',
method: 'POST',
@ -120,12 +124,14 @@ Page({
userPassword: password
}
});
console.log('注册信息---->',res.data);
if (res.data.code === 1) {
wx.showToast({
title: '注册成功',
icon: 'success',
duration: 1000
duration: 1000,
});
wx.hideLoading()
setTimeout(() => {
wx.navigateTo({
url: '/pages/loginModule/pwdLogin/pwdLogin',
@ -139,6 +145,7 @@ Page({
title: res.data.message || '注册失败',
icon: 'none'
});
wx.hideLoading()
}
},