10.10综合交易所原始源码_移动端
1
2026-05-26 0dbc7465447164fef24327b5d494870832d798dd
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<template>
    <div class="login">
        <van-loading color="#92D1FF" class="loading-box" v-if="isLoading" />
 
        <!-- 顶部导航栏 -->
        <div class="header">
            <div class="back-btn" @click="onRoute('/')">
                <img src="../../assets/image/icon_back2.png" alt="" />
            </div>
            <div class="sign-up " @click="$router.push('/register')">{{ $t('register') }}</div>
        </div>
 
        <!-- Logo -->
        <div class="logo-wrap">
            <img src="../../assets/image/login_logo.png" alt="logo" />
        </div>
 
        <!-- 标题 -->
        <div class="title textColor">{{ $t('letsStartLogin') }}</div>
 
        <!-- 账号输入 -->
        <ExInput :label="$t('account')" :placeholderText="$t('entryAccount')" v-model="username" />
 
        <!-- 密码输入 -->
        <ExInput style="padding-bottom:0!important;" :label="$t('password')" :placeholderText="$t('entryPassword')"
            v-model="password" typeText="password" />
 
        <!-- 登录按钮 -->
        <van-button class="w-full sign-in-btn" type="primary" @click="verifyLogin">
            {{ $t('login') }}
        </van-button>
 
        <!-- 钱包登录按钮 -->
        <!-- <van-button class="w-full wallet-btn" plain @click="onLoginByWallet">
            {{ $t('loginByWallet') }}
        </van-button> -->
 
        <!-- 忘记密码 -->
        <div class="forget-wrap textColor" @click="$router.push('/forget')">
            <span>{{ $t('forgot') }}</span>
            <span> {{ $t('password') }}</span>
        </div>
 
        <nationality-list ref='controlChildRef' :title="$t('selectArea')" @getName="getName"></nationality-list>
    </div>
</template>
 
<script setup>
import ExInput from "@/components/ex-input/index.vue";
import { _loginUser } from "@/service/login.api";
import { GET_USERINFO } from '@/store/types.store'
import { useUserStore } from '@/store/user';
import { useI18n } from 'vue-i18n'
import nationalityList from '../authentication/components/nationalityList.vue'
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { showToast } from "vant";
import store from '@/store/store'
 
const router = useRouter()
const { t } = useI18n()
 
const onRoute = (path) => {
    if (path == 'back') {
        router.go(-1)
    } else {
        router.push(path)
    }
}
 
let username = ref('')
let password = ref('')
let dialCode = ref(0)
let icon = ref('')
const type = ref(3)
 
const controlChildRef = ref(null)
const isLoading = ref(false)
 
const getName = (params) => {
    icon.value = params.code;
    dialCode.value = params.dialCode;
}
 
const verifyLogin = () => {
    if (username.value == '') {
        showToast(t('entryAccount'));
        return false
    }
    if (password.value == '') {
        showToast(t('entryPassword'));
        return false
    }
    loginUser()
}
 
const onLoginByWallet = () => {
    router.push('/walletLogin')
}
 
const userStore = useUserStore();
const loginUser = () => {
    isLoading.value = true
    _loginUser({
        userName: username.value,
        passWord: password.value,
        type: type.value
    }).then((res) => {
        console.log("reslogin")
        console.log(res)
        isLoading.value = false
        userStore[GET_USERINFO](res)
        store.commit('user/SET_USERINFO', res)
        router.push('/')
    }).catch((res) => {
        isLoading.value = false
        console.log(res)
    })
}
</script>
 
<style lang="scss" scoped>
:deep(.van-loading) {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
 
.login {
    width: 100%;
    min-height: 100vh;
    padding: 0 3rem 5rem;
    font-size: 1.62rem;
    box-sizing: border-box;
    background: #fff;
}
 
/* 顶部导航 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 3rem;
    padding-bottom: 1rem;
 
    .back-btn {
        width: 4rem;
        height: 4rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
 
        img {
            width: 100%;
        }
    }
 
    .sign-up {
        font-size: 2.4rem;
        font-weight: 500;
        cursor: pointer;
    }
}
 
/* Logo */
.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
 
    img {
        width: 18rem;
        object-fit: contain;
    }
}
 
/* 标题 */
.title {
    font-size: 3.6rem;
    text-align: center;
    margin-bottom: 4.5rem;
}
 
/* 登录按钮 */
.sign-in-btn {
    margin-top: 5.5rem;
    border-radius: 1rem !important;
    height: 7.5rem !important;
    font-size: 2.5rem;
}
 
/* 钱包登录按钮 */
.wallet-btn {
    margin-top: 1.75rem;
    border-radius: 1rem !important;
    height: 6.25rem !important;
    font-size: 2rem !important;
    font-weight: 500 !important;
    color: #333 !important;
    border-color: #333 !important;
    background: #fff !important;
 
    :deep(.van-button__text) {
        color: #333;
    }
}
 
/* 忘记密码 */
.forget-wrap {
    margin-top: 3rem;
    text-align: center;
    font-size: 2rem;
    cursor: pointer;
}
</style>