|
@@ -1,5 +1,8 @@
|
|
<template>
|
|
<template>
|
|
- <div class="rule-desc">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="rule-desc"
|
|
|
|
+ @keydown.enter="submit"
|
|
|
|
+ >
|
|
<div class="wrapper-1">
|
|
<div class="wrapper-1">
|
|
<button
|
|
<button
|
|
class="close"
|
|
class="close"
|
|
@@ -11,42 +14,65 @@
|
|
|
|
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
<img
|
|
<img
|
|
- class=""
|
|
|
|
|
|
+ :class="{
|
|
|
|
+ animate__animated: ifTipUserName,
|
|
|
|
+ animate__headShake: ifTipUserName
|
|
|
|
+ }"
|
|
src="@/assets/images/username-icon.png"
|
|
src="@/assets/images/username-icon.png"
|
|
alt=""
|
|
alt=""
|
|
draggable="false"
|
|
draggable="false"
|
|
>
|
|
>
|
|
<input
|
|
<input
|
|
|
|
+ ref="first-focus"
|
|
|
|
+ v-model.trim="userName"
|
|
type="text"
|
|
type="text"
|
|
placeholder="请输入账号..."
|
|
placeholder="请输入账号..."
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
<img
|
|
<img
|
|
- class=""
|
|
|
|
|
|
+ :class="{
|
|
|
|
+ animate__animated: ifTipPassword,
|
|
|
|
+ animate__headShake: ifTipPassword
|
|
|
|
+ }"
|
|
src="@/assets/images/password-icon.png"
|
|
src="@/assets/images/password-icon.png"
|
|
alt=""
|
|
alt=""
|
|
draggable="false"
|
|
draggable="false"
|
|
>
|
|
>
|
|
<input
|
|
<input
|
|
- type="text"
|
|
|
|
|
|
+ v-model="password"
|
|
|
|
+ type="password"
|
|
placeholder="请输入密码..."
|
|
placeholder="请输入密码..."
|
|
|
|
+ @keydown.stop
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <div class="form-item">
|
|
|
|
|
|
+ <div class="form-item form-item-password-repeat">
|
|
<img
|
|
<img
|
|
- class=""
|
|
|
|
|
|
+ :class="{
|
|
|
|
+ animate__animated: ifTipPasswordRepeat,
|
|
|
|
+ animate__headShake: ifTipPasswordRepeat
|
|
|
|
+ }"
|
|
src="@/assets/images/password-icon.png"
|
|
src="@/assets/images/password-icon.png"
|
|
alt=""
|
|
alt=""
|
|
draggable="false"
|
|
draggable="false"
|
|
>
|
|
>
|
|
<input
|
|
<input
|
|
- type="text"
|
|
|
|
- placeholder="请输入密码..."
|
|
|
|
|
|
+ v-model="passwordRepeat"
|
|
|
|
+ type="password"
|
|
|
|
+ placeholder="请再次输入密码..."
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-show="ifTipPasswordRepeatText"
|
|
|
|
+ class="tip-text"
|
|
>
|
|
>
|
|
|
|
+ 两次输入密码不一致!
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <button class="login">
|
|
|
|
|
|
+ <button
|
|
|
|
+ class="submit"
|
|
|
|
+ @click="submit"
|
|
|
|
+ >
|
|
<div class="text-wrapper">
|
|
<div class="text-wrapper">
|
|
立即注册
|
|
立即注册
|
|
</div>
|
|
</div>
|
|
@@ -67,18 +93,73 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- visitNum: 1939,
|
|
|
|
- yingZaoZhuanJiaNum: 56,
|
|
|
|
- liShiDaRen: 424,
|
|
|
|
- huShuShiZhe: 32,
|
|
|
|
|
|
+ userName: '',
|
|
|
|
+ password: '',
|
|
|
|
+ passwordRepeat: '',
|
|
|
|
+
|
|
|
|
+ ifTipUserName: false,
|
|
|
|
+ ifTipPassword: false,
|
|
|
|
+ ifTipPasswordRepeat: false,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ifTipPasswordRepeatText() {
|
|
|
|
+ if (this.password && this.passwordRepeat && this.password !== this.passwordRepeat) {
|
|
|
|
+ return true
|
|
|
|
+ } else {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
window.ifPreventKeyOperationInScene = true
|
|
window.ifPreventKeyOperationInScene = true
|
|
|
|
+ this.$refs['first-focus'].focus()
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
window.ifPreventKeyOperationInScene = false
|
|
window.ifPreventKeyOperationInScene = false
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ submit: globalUtils.throttle(function() {
|
|
|
|
+ if (this.userName.length === 0) {
|
|
|
|
+ this.ifTipUserName = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.ifTipUserName = false
|
|
|
|
+ }, 1000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.password.length === 0) {
|
|
|
|
+ this.ifTipPassword = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.ifTipPassword = false
|
|
|
|
+ }, 1000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.passwordRepeat === 0 || this.ifTipPasswordRepeatText) {
|
|
|
|
+ this.ifTipPasswordRepeat = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.ifTipPasswordRepeat = false
|
|
|
|
+ }, 1000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ globalApi.signUp(this.userName, this.password).then((res) => {
|
|
|
|
+ this.$alert('即将为您自动登录...', '注册成功!', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ callback: action => {
|
|
|
|
+ if (action === 'confirm') {
|
|
|
|
+ globalApi.login(this.userName, this.password).then((res) => {
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ window.alert(error)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ window.alert(error)
|
|
|
|
+ })
|
|
|
|
+ }, 1500),
|
|
|
|
+ },
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
@@ -149,8 +230,17 @@ export default {
|
|
color: #9A2D0A;
|
|
color: #9A2D0A;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ > .form-item-password-repeat {
|
|
|
|
+ position: relative;
|
|
|
|
+ > .tip-text {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: calc(100% + 3px);
|
|
|
|
+ color: red;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- > button.login {
|
|
|
|
|
|
+ > button.submit {
|
|
background-image: url(@/assets/images/button-border-long-transparent.png);
|
|
background-image: url(@/assets/images/button-border-long-transparent.png);
|
|
background-size: contain;
|
|
background-size: contain;
|
|
background-repeat: no-repeat;
|
|
background-repeat: no-repeat;
|
|
@@ -196,15 +286,6 @@ export default {
|
|
color: #955D4B;
|
|
color: #955D4B;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- > .statistics {
|
|
|
|
- margin-top: 30px;
|
|
|
|
- font-size: 16px;
|
|
|
|
- font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
|
|
- font-weight: 400;
|
|
|
|
- color: #693D2F;
|
|
|
|
- line-height: 26px;
|
|
|
|
- letter-spacing: 1px;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|