|
@@ -5,70 +5,68 @@
|
|
|
<template #prepend>+86</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="yzm" style="margin-bottom: 35px;">
|
|
|
+ <el-form-item prop="yzm" style="margin-bottom: 35px">
|
|
|
<div class="login-msg-yzm">
|
|
|
- <el-input v-model="form.yzm" prefix-icon="el-icon-unlock" clearable :placeholder="$t('login.smsPlaceholder')"></el-input>
|
|
|
- <el-button @click="getYzm" :disabled="disabled">{{this.$t('login.smsGet')}}<span v-if="disabled"> ({{time}})</span></el-button>
|
|
|
+ <el-input v-model="form.yzm" prefix-icon="unlock" clearable :placeholder="$t('login.smsPlaceholder')"></el-input>
|
|
|
+ <el-button :disabled="disabled" @click="getYzm"
|
|
|
+ >{{ $t('login.smsGet') }}<span v-if="disabled"> ({{ time }})</span></el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" style="width: 100%;" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
|
|
|
+ <el-button type="primary" style="width: 100%" :loading="islogin" round @click="login">{{ $t('login.signIn') }}</el-button>
|
|
|
</el-form-item>
|
|
|
- <div class="login-reg" v-if="false">
|
|
|
- {{$t('login.noAccount')}} <router-link to="/user_register">{{$t('login.createAccount')}}</router-link>
|
|
|
+ <div v-if="false" class="login-reg">
|
|
|
+ {{ $t('login.noAccount') }} <router-link to="/user_register">{{ $t('login.createAccount') }}</router-link>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- form: {
|
|
|
- phone: "",
|
|
|
- yzm: "",
|
|
|
- },
|
|
|
- rules: {
|
|
|
- phone: [
|
|
|
- {required: true, message: this.$t('login.mobileError')}
|
|
|
- ],
|
|
|
- yzm: [
|
|
|
- {required: true, message: this.$t('login.smsError')}
|
|
|
- ]
|
|
|
- },
|
|
|
- disabled: false,
|
|
|
- time: 0,
|
|
|
- islogin: false,
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {
|
|
|
+ phone: '',
|
|
|
+ yzm: ''
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ phone: [{ required: true, message: this.$t('login.mobileError') }],
|
|
|
+ yzm: [{ required: true, message: this.$t('login.smsError') }]
|
|
|
+ },
|
|
|
+ disabled: false,
|
|
|
+ time: 0,
|
|
|
+ islogin: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {},
|
|
|
+ methods: {
|
|
|
+ async getYzm() {
|
|
|
+ var validate = await this.$refs.loginForm.validateField('phone').catch(() => {})
|
|
|
+ if (!validate) {
|
|
|
+ return false
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
|
|
|
+ this.$message.success(this.$t('login.smsSent'))
|
|
|
+ this.disabled = true
|
|
|
+ this.time = 60
|
|
|
+ var t = setInterval(() => {
|
|
|
+ this.time -= 1
|
|
|
+ if (this.time < 1) {
|
|
|
+ clearInterval(t)
|
|
|
+ this.disabled = false
|
|
|
+ this.time = 0
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
},
|
|
|
- methods: {
|
|
|
- async getYzm(){
|
|
|
- var validate = await this.$refs.loginForm.validateField("phone").catch(()=>{})
|
|
|
- if(!validate){ return false }
|
|
|
-
|
|
|
- this.$message.success(this.$t('login.smsSent'))
|
|
|
- this.disabled = true
|
|
|
- this.time = 60
|
|
|
- var t = setInterval(() => {
|
|
|
- this.time -= 1
|
|
|
- if(this.time < 1){
|
|
|
- clearInterval(t)
|
|
|
- this.disabled = false
|
|
|
- this.time = 0
|
|
|
- }
|
|
|
- },1000)
|
|
|
- },
|
|
|
- async login(){
|
|
|
- var validate = await this.$refs.loginForm.validate().catch(()=>{})
|
|
|
- if(!validate){ return false }
|
|
|
+ async login() {
|
|
|
+ var validate = await this.$refs.loginForm.validate().catch(() => {})
|
|
|
+ if (!validate) {
|
|
|
+ return false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style></style>
|