交易所前端蓝色ui, 4.5 jiem
jhzh
2024-04-08 67357c691325dc3cf743267f1ef0e1f5c93d7528
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
    <div class="verify">
        <div class="header">
            <div @click="$router.go(-1)"><img src="../../assets/image/assets-center/left-arrow.png" alt=""
                    class="w-14 h-27" /></div>
        </div>
        <div class="content">
            <div class="title textColor">{{ $t('安全验证') }}</div>
            <p v-if="type == 3">{{ $t('verifyGoogleTips') }}</p>
            <span class="label textColor">{{ type == 2 ? $t('邮箱验证') : type == 1 ? $t('手机验证') : $t('谷歌验证') }}</span>
            <p v-if="type == 2">{{ $t('verifyEmailTips', { 'account': account }) }}</p>
            <p v-if="type == 1">{{ $t('verifyPhoneTips', { 'account': account }) }}</p>
            <div class="iptbox inputBackground">
                <input type="text" class="inputBackground textColor" :placeholder="$t('请输入验证码')" v-model="verifycode"
                    @input="changeInput">
                <span v-if="type != 3" @click="senCode">{{ $t('重新发送验证码') }}<template v-if="time"> ({{
                    time }})s</template></span>
            </div>
            <button :disabled="!hightLight" class="btn"
                @click="$router.push({ name: 'resetPassword', query: { type, account, verifycode, username } })"
                :class="hightLight ? 'hightLight' : ''">{{ $t('下一步')
                }}</button>
        </div>
    </div>
</template>
 
<script>
import API from "@/API/login.js";
import Axios from "@/API/userCenter.js";
export default {
    props: {
 
    },
    components: {
 
    },
    data() {
        return {
            verifycode: '',
            type: '',
            account: '',
            username: '',
            hightLight: false,
            timer: '',
            time: 0
        }
    },
    mounted() {
        let type = this.$route.query.type;
        this.type = type;
        this.account = this.$route.query.account;
        this.username = this.$route.query.username;
        if (this.type != 3) {
            clearInterval(this.timer)
            this.senCode()
        }
    },
    methods: {
        changeInput() {
            if (this.verifycode.length == 6) {
                this.hightLight = true;
            } else {
                this.hightLight = false;
            }
        },
        senCode() {
            if (this.time > 0) {
                return false
            }
            API.sendVerifyCode({
                target: this.account,
            }).then((res) => {
                this.time = 30;
                this.timer = setInterval(() => {
                    if (this.time > 0) {
                        this.time = this.time - 1
                    } else {
                        this.time = 0;
                        clearInterval(this.timer)
                    }
                }, 1000);
            }).catch((error) => {
                if (error.code === 'ECONNABORTED') { this.$toast(this.$t('网络超时!')); }
                else if (error.msg !== undefined) { this.$toast(this.$t(error.msg)); }
            });
        }
    },
    beforeDestroy() {
        clearInterval(this.timer)
    },
}
</script>
 
<style lang="scss" scoped>
.verify {
    font-size: 26px;
    padding: 0 32px;
}
 
.header {
    display: flex;
    justify-content: space-between;
    padding: 0 26px;
    font-size: 28px;
    height: 100px;
    line-height: 100px;
}
 
.title {
    font-weight: 700;
    font-size: 52px;
    margin-top: 54px;
    margin-bottom: 33px;
}
 
.label {
    margin-top: 23px;
}
 
.content {
    p {
        color: #868D9A;
        font-size: 30px;
        margin-bottom: 50px;
    }
 
    .iptbox {
        height: 88px;
        margin-top: 16px;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: 6px;
 
        input {
            flex: 1;
            height: 100%;
            border: none;
        }
 
        span {
            color: #1D91FF;
        }
    }
}
 
.btn {
    @include themify() {
        background: themed("bg_dark");
    }
 
    color: #C0C4CC;
    height: 88px;
    line-height: 88px;
    text-align: center;
    font-size: 32px;
    margin-top: 180px;
    border-radius: 10px;
    width: 100%;
    border: none;
}
 
.hightLight {
    @include themify() {
        background: themed("btn_main");
    }
 
    color: #fff;
}
</style>