This commit is contained in:
commie
2025-11-23 01:01:52 +08:00
parent 6ec389ff41
commit 0783e46b4b
21 changed files with 6409 additions and 1264 deletions
+22 -9
View File
@@ -54,6 +54,7 @@
codeValue: "",
userInfo: {
phoneNumber: "",
email: "",
areaCode: "",
nickname: "",
password: "",
@@ -71,7 +72,7 @@
required: true,
message: "请输入密码",
trigger: ["blur", "change"],
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{7,}$/,
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/,
},
{
validator: (rule, value, callback) => {
@@ -86,7 +87,7 @@
required: true,
message: "请输入确认密码",
trigger: ["blur", "change"],
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{7,}$/,
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/,
},
{
validator: (rule, value, callback) => {
@@ -109,6 +110,12 @@
...JSON.parse(userInfo),
};
this.codeValue = codeValue;
if(process.env.NODE_ENV == 'development'){
this.userInfo.email = "commiu@outlook.com";
this.userInfo.nickname = "commiu";
this.userInfo.password = "qwe123";
this.userInfo.confirmPassword = "qwe123";
}
},
onBackPress() {
return true;
@@ -127,14 +134,13 @@
async doRegister() {
this.loading = true;
const options = {
verifyCode: this.codeValue,
code: this.codeValue,
platform: uni.$u.os() === "ios" ? 1 : 2,
autoLogin: true,
user: {
...this.userInfo,
areaCode: `+${this.userInfo.areaCode}`,
password: md5(this.userInfo.password),
},
...this.userInfo,
areaCode: `+${this.userInfo.areaCode}`,
password: md5(this.userInfo.password),
mobile: `+${this.userInfo.phoneNumber}`,
};
try {
await businessRegister(options);
@@ -143,7 +149,14 @@
uni.$u.route("/pages/login/index")
} catch (err) {
console.log(err);
uni.$u.toast(checkLoginError(err));
if(err.msg=="验证码过期" || err.msg=="验证码错误"){
uni.$u.route("/pages/login/verifyCode/index", {
userInfo: JSON.stringify(this.userInfo),
isRegister: true,
resend: 1,
})
return ;
}
// uni.$u.toast('注册失败')
} finally {
this.loading = false;