交易所前端蓝色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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<template>
    <div class="register">
        <div class="top" @click="$router.go(-1)"><img :src="require(`../../assets/theme/${theme}/image/Union.png`)" alt="">
        </div>
        <div class="title textColor">{{ $t('试用账号申请') }}</div>
        <ExInput :label="$t('账号')" :placeholderText="$t('请输入账号')" v-model="username" />
        <ExInput :label="$t('密码')" :placeholderText="$t('密码(6-12个字符)')" v-model="password" typeText="password" />
        <ExInput :label="$t('确认密码')" :placeholderText="$t('请确认密码')" v-model="repassword" typeText="password" />
        <ExInput :label="$t('试用码')" :placeholderText="$t('试用码')" v-model="usercode" />
        <p><span @click="$router.push('/customerService')" style="text-decoration: underline" class="colorMain">{{
            $t('点此联系客服') }}</span>,{{ $t('取得试用码') }}</p>
        <div class="btn btnMain activeBKClick" @click="register">{{ $t('确认') }}</div>
    </div>
</template>
 
<script>
import { Popup } from "vant";
import ExInput from "@/components/ex-input";
import Axios from "@/API/login.js";
import { mapActions, mapGetters } from 'vuex';
import { GET_USERINFO } from '@/store/const.store';
export default {
    components: {
        [Popup.name]: Popup,
        ExInput,
    },
    data() {
        return {
            username: '',
            password: "",
            repassword: '',
            usercode: ''
        }
    },
    computed: {
        ...mapGetters({
            theme: 'home/theme'
        }),
    },
    mounted() {
    },
    methods: {
        ...mapActions('user', [GET_USERINFO]),
        register() {
            if (this.username == '') {
                this.$toast(this.$t('请输入账号'));
                return;
            }
            if (this.username.length < 6 || this.username.length > 30) {
                this.$toast(this.$t('账号长度必须6-30位'));
                return;
            }
 
            if (this.password == '') {
                this.$toast(this.$t('请输入密码'));
                return
            }
            if (this.password.length < 6) {
                this.$toast(this.$t('密码(6-12个字符)'));
                return
            }
            if (this.repassword !== this.password) {
                this.$toast(this.$t('密码不一致'));
                return
            }
            if (this.usercode == '') {
                this.$toast(this.$t('请输入试用码'));
                return
            }
 
            //this.show = true
            this.testLogin();
        },
        testLogin() {
            Axios.registerTest({
                username: this.username,
                password: this.password,
                re_password: this.repassword,
                usercode: this.usercode,
            }).then((res) => {
                this.GET_USERINFO(res.data)
                this.$router.push('/home')
            }).catch((error) => {
                if (error.code === 'ECONNABORTED') { this.$toast(this.$t('网络超时!')); }
                else if (error.msg !== undefined) { this.$toast(this.$t(error.msg)); }
            });
        },
    }
}
</script>
 
<style lang="scss" scoped>
.activeBKClick {
    &:active {
        @include themify() {
            background: themed("color_main");
        }
 
        opacity: 0.5;
    }
}
 
.activeClick {
    &:active {
        background: #fff;
        opacity: 0.5;
    }
}
 
.register {
    width: 100%;
    box-sizing: border-box;
    padding: 32px;
    font-size: 26px;
}
 
.top {
    padding-left: 18px;
    padding-top: 18px;
 
    img {
        width: 37px;
        height: 37px;
    }
}
 
.title {
    font-weight: 700;
    font-size: 52px;
    margin-top: 54px;
    margin-bottom: 66px;
}
 
.re-tab {
    margin-bottom: 44px;
 
    div {
        padding: 0 36px;
        height: 68px;
        line-height: 68px;
        text-align: center;
        border-radius: 8px;
        margin-right: 20px;
    }
 
    .active {
        @include themify() {
            background: themed("tab_background");
        }
 
        @include themify() {
            color: themed("text_color");
        }
    }
}
 
.forget {
    color: #1D91FF;
    font-size: 24px;
    line-height: 28px;
}
 
.btn {
    color: #fff;
    height: 88px;
    line-height: 88px;
    text-align: center;
    font-size: 32px;
    margin-top: 40px;
    border-radius: 10px;
}
 
.noTips {
    margin-top: 48px;
}
 
.protocol {
    display: flex;
    align-items: center;
    height: 30px;
 
    i {
        width: 30px;
        height: 30px;
        margin-right: 18px;
 
        img {
            width: 100%;
            height: 100%;
        }
    }
}
</style>