|
|
@ -88,6 +88,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import UButton from '../../uview-ui/components/u-button/u-button.vue' |
|
|
|
import api from '@/utils/api' |
|
|
|
export default { |
|
|
|
name: "register", |
|
|
|
data() { |
|
|
@ -109,37 +110,37 @@ |
|
|
|
payPassword: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.withdrawalPasswordMessage"), |
|
|
|
message: this.$t("login").withdrawalPasswordMessage, |
|
|
|
trigger: ["blur", "change"], |
|
|
|
}, |
|
|
|
email: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.emailInputMessage"), |
|
|
|
message: this.$t("login").emailInputMessage, |
|
|
|
trigger: ["blur", "change"], |
|
|
|
}, |
|
|
|
code: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.verificationCodeMessage"), |
|
|
|
message: this.$t("login").verificationCodeMessage, |
|
|
|
trigger: ["blur", "change"] |
|
|
|
}, |
|
|
|
password: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.passwordInputMessage"), |
|
|
|
message: this.$t("login").passwordInputMessage, |
|
|
|
trigger: ["blur", "change"] |
|
|
|
}, |
|
|
|
InvitationCode: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.InvitationCodeMessage"), |
|
|
|
message: this.$t("login").InvitationCodeMessage, |
|
|
|
trigger: ["blur", "change"] |
|
|
|
}, |
|
|
|
confirmPassword: { |
|
|
|
type: "string", |
|
|
|
required: true, |
|
|
|
message: this.$t("login.confirmPasswordMessage"), |
|
|
|
message: this.$t("login").confirmPasswordMessage, |
|
|
|
trigger: ["blur", "change"] |
|
|
|
}, |
|
|
|
|
|
|
@ -171,11 +172,11 @@ |
|
|
|
// 验证码获取 |
|
|
|
getCode() { |
|
|
|
if (!this.userInfo.email) { |
|
|
|
uni.$u.toast(this.$t("login.Emailempty")) |
|
|
|
uni.$u.toast(this.$t("login").Emailempty) |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.isCanGetCode) { |
|
|
|
uni.$u.toast(this.$t("login.Emailincorrect")) |
|
|
|
uni.$u.toast(this.$t("login").Emailincorrect) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.$refs.uCode.canGetCode) { |
|
|
@ -185,13 +186,14 @@ |
|
|
|
} |
|
|
|
// 模拟向后端请求验证码 |
|
|
|
uni.showLoading({ |
|
|
|
title: this.$t("login.GettingVerificationCode") |
|
|
|
title: this.$t("login").GettingVerificationCode |
|
|
|
}) |
|
|
|
this.$api.sendEmailCode(data).then(res => { |
|
|
|
if (res.code === 200) { |
|
|
|
uni.hideLoading(); |
|
|
|
console.log(123) |
|
|
|
api.sendEmailCode(data).then(res => { |
|
|
|
if (res.errCode === 'SUCCESS') { |
|
|
|
uni.hideLoading(this.$t("login").CodeHasSent); |
|
|
|
// 这里此提示会被this.start()方法中的提示覆盖 |
|
|
|
uni.$u.toast(this.$t("login.CodeHasSent")); |
|
|
|
uni.$u.toast(this.$t("login").CodeHasSent); |
|
|
|
// 通知验证码组件内部开始倒计时 |
|
|
|
this.$refs.uCode.start(); |
|
|
|
} else { |
|
|
@ -199,7 +201,7 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
uni.$u.toast(this.$t("login.SendAfter")); |
|
|
|
uni.$u.toast(this.$t("login").SendAfter); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 注册 |
|
|
@ -209,7 +211,7 @@ |
|
|
|
if (res.errCode === 'SUCCESS') { |
|
|
|
setTimeout(() => { |
|
|
|
uni.showToast({ |
|
|
|
title: this.$t("login.resSuccess") |
|
|
|
title: this.$t("login").resSuccess |
|
|
|
}) |
|
|
|
}, 600) |
|
|
|
uni.switchTab({ |
|
|
|