|
@@ -15,12 +15,14 @@ export default {
|
|
|
checkBox: false,
|
|
|
passwordType: false,
|
|
|
passwordConfirmType: false,
|
|
|
- result: true,
|
|
|
teamIds: '',
|
|
|
EmailCodeError: false,
|
|
|
verificationCodeError: false,
|
|
|
passwordError: false,
|
|
|
passwordConfirmError: false,
|
|
|
+ CountDown: 60, //倒计时
|
|
|
+ buttonName: 'send', //按钮初始化文字
|
|
|
+ isDisabled: false, //是否禁用按钮
|
|
|
ruleForm: {
|
|
|
email: '',
|
|
|
verificationCode: '',
|
|
@@ -136,17 +138,14 @@ export default {
|
|
|
})
|
|
|
} else if (
|
|
|
res.data.code === 700 &&
|
|
|
- res.data.msg === "Email has been created"
|
|
|
+ res.data.msg === 'Email has been created'
|
|
|
) {
|
|
|
this.EmailCodeError = true
|
|
|
this.$message.error({
|
|
|
duration: 5000,
|
|
|
message: 'Email has been created'
|
|
|
})
|
|
|
- } else if (
|
|
|
- res.data.code === 200 &&
|
|
|
- res.data.msg === '注册成功'
|
|
|
- ) {
|
|
|
+ } else if (res.data.code === 200 && res.data.msg === '注册成功') {
|
|
|
this.$message({
|
|
|
duration: 5000,
|
|
|
message: 'Create Success',
|
|
@@ -167,8 +166,18 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
sendEmail() {
|
|
|
- if (this.result) {
|
|
|
- console.log(this.ruleForm.email)
|
|
|
+ let timerId = setInterval(() => {
|
|
|
+ this.CountDown--
|
|
|
+ this.isDisabled = true
|
|
|
+ this.buttonName = 'Retry in ' + this.CountDown + ' seconds'
|
|
|
+ if (this.CountDown <= 0) {
|
|
|
+ clearInterval(timerId)
|
|
|
+ this.buttonName = 'resend'
|
|
|
+ this.CountDown = 60
|
|
|
+ this.isDisabled = false
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ if (!this.isDisabled) {
|
|
|
//发送邮件
|
|
|
get(
|
|
|
'/pdf-tech/auth/getVerifyCode?action=0&type=0&receiver=' +
|
|
@@ -178,7 +187,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- changeEmail(){
|
|
|
+ changeEmail() {
|
|
|
this.EmailCodeError = false
|
|
|
this.ruleForm = {
|
|
|
email: '',
|
|
@@ -196,7 +205,22 @@ export default {
|
|
|
|
|
|
<template>
|
|
|
<div class="bg w-full h-100vh flex justify-center items-center">
|
|
|
- <div v-show="loading" class="absolute z-100 flex justify-center items-center h-100vh w-full bg-[#fff] opacity-60"><Loading class="z-100" /></div>
|
|
|
+ <div
|
|
|
+ v-show="loading"
|
|
|
+ class="
|
|
|
+ absolute
|
|
|
+ z-100
|
|
|
+ flex
|
|
|
+ justify-center
|
|
|
+ items-center
|
|
|
+ h-100vh
|
|
|
+ w-full
|
|
|
+ bg-[#fff]
|
|
|
+ opacity-60
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <Loading class="z-100" />
|
|
|
+ </div>
|
|
|
<div class="h-auto m-auto">
|
|
|
<div class="w-404px h-auto rounded-8px p-24px bg-[#fff] loginBox">
|
|
|
<h1 class="text-24px font-bold my-24px">Create account</h1>
|
|
@@ -217,6 +241,7 @@ export default {
|
|
|
</el-input>
|
|
|
<button
|
|
|
type="button"
|
|
|
+ :disabled = isDisabled
|
|
|
@click="sendEmail()"
|
|
|
class="
|
|
|
absolute
|
|
@@ -227,12 +252,13 @@ export default {
|
|
|
right-0px
|
|
|
border-1px border-[#1460F3]
|
|
|
text-[#1460F3]
|
|
|
- w-64px
|
|
|
+ w-auto
|
|
|
+ px-5px
|
|
|
h-24px
|
|
|
rounded-4px
|
|
|
"
|
|
|
>
|
|
|
- Send
|
|
|
+ {{ buttonName }}
|
|
|
</button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
@@ -407,7 +433,9 @@ export default {
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="changeEmail">Change Email</el-button>
|
|
|
- <el-button type="primary" @click="$router.push('/login')">Sign in</el-button>
|
|
|
+ <el-button type="primary" @click="$router.push('/login')"
|
|
|
+ >Sign in</el-button
|
|
|
+ >
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -476,11 +504,11 @@ export default {
|
|
|
}
|
|
|
.el-message--success {
|
|
|
margin-top: 90px !important;
|
|
|
- background-color: #373A47 !important;
|
|
|
+ background-color: #373a47 !important;
|
|
|
height: 36px;
|
|
|
min-width: auto !important;
|
|
|
padding: 12px !important;
|
|
|
- p{
|
|
|
+ p {
|
|
|
color: #fff !important;
|
|
|
}
|
|
|
}
|