lxf
2025-07-11 2a95677853ec636b4c568d0045a8bb1d4ef13097
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<template>
    <div class="login">
        <!-- <div class="top" @click="onRoute('/my/index')"><img src="../../assets/image/icon-close.png" alt="" /></div> -->
        <!-- <div class="title textColor">{{ $t('login') }}</div> -->
        <!-- <div class="flex login-tab">
            <div class="textColor1" :class="activeIndex == 0 ? 'active' : ''" @click="changeIndex(0)">{{
                $t('account')
            }}
            </div>
            <div class="textColor1" :class="activeIndex == 1 ? 'active' : ''" @click="changeIndex(1)">{{ $t('email') }}
            </div>
            <div class="textColor1" :class="activeIndex == 2 ? 'active' : ''" @click="changeIndex(2)">{{
                $t('phoneNum')
            }}
            </div>
        </div> -->
        <!-- <ExInput :label="getRegType(activeIndex, true)" :placeholderText="getRegType(activeIndex, false)"
            v-model="username" :dialCode="dialCode" @selectArea="onSelectArea" :area="isArea" :icon="icon" />
        <ExInput style="padding-bottom:0!important;" :label="$t('password')" :placeholderText="$t('entryPassword')"
            v-model="password" typeText="password" />
        <div class="forget colorMain" @click="$router.push('/forget')">{{ $t('forgetPassword') }}</div>
        <van-button class="w-full" style="margin-top:50px;" type="primary" @click="verifyLogin">{{ $t('login') }}
        </van-button>
        <div class="noTips textColor">{{ $t('noAccount') }}<span class="colorMain" @click="$router.push('/register')">
                {{ $t('goRegister') }}</span>
        </div>
        <nationality-list ref='controlChildRef' :title="$t('selectArea')" @getName="getName"></nationality-list> -->
 
        <div class="h-100vh px-26 text-white"
            style="background: url(&quot;/static/img/bg-login.png&quot;) 0% 0% / cover fixed;">
            <div class="w-22 h-22 mt-80" @click="handleLanguageClick">
                <div
                    style="background-image: url(&quot;/static/img/icon-language.png&quot;); background-position: 0% 0%; background-size: 100% 100%;">
                </div>
                <img src="../../assets/img/icon-language.png" draggable="false">
            </div>
            <span class="text-40 font-bold mt-43 block">{{ $t('login') }}</span>
            <span class="text-15 font-medium block mt-10">{{ $t('登陆后继续') }}</span>
            <div class="mt-40">
                <div class="bg-white p-14 rounded-10 flex items-center">
                    <div class="w-26 h-26">
                        <div
                            style="background-image: url(&quot;/static/tabbar/mine-select.png&quot;); background-position: 0% 0%; background-size: 100% 100%;">
                        </div><span></span><img src="../../assets/img/mine-select.png" draggable="false">
                    </div>
                    <div class="ml-9 text-black flex-1">
                        <div class="uni-input-wrapper">
                            <input type="text" maxlength="140" v-model="username" step="" enterkeyhint="done"
                                class="uni-input-input" autocomplete="off" :placeholder="$t('请输入账号')">
                        </div>
                    </div>
                </div>
                <div class="mt-15 bg-white p-14 rounded-10 flex items-center">
                    <div class="w-22 h-22">
                        <div
                            style="background-image: url(&quot;/static/img/icon-password.png&quot;); background-position: 0% 0%; background-size: 100% 100%;">
                        </div><span></span><img src="../../assets/img/icon-password.png" draggable="false">
                    </div>
                    <div class="ml-9 text-black flex-1">
                        <div class="uni-input-wrapper">
                            <input type="password" v-model="password" maxlength="140" step="" enterkeyhint="done"
                                class="uni-input-input" autocomplete="off" :placeholder="$t('密码')">
                        </div>
                    </div>
                </div>
            </div>
            <div class="py-17 text-center bg-black mt-120 rounded-10 text-19 font-700" @click="verifyLogin">{{
                $t('login') }}</div>
            <div class="mt-20 text-center">
                <span>{{ $t('还没有账号') }}</span>
                <span class="font-bold ml-5" @click="$router.push('/register')">{{ $t('去注册') }}</span>
            </div>
            <span class="block text-center mt-20" @click="$router.push('/forget')">{{ $t('修改密码') }}</span>
        </div>
    </div>
</template>
 
<script setup>
import ExInput from "@/components/ex-input/index.vue";
import { _loginUser } from "@/service/login.api";
import { _exchangerateuserconfig } from "@/service/trade.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 { t } = useI18n()
 
const router = useRouter()
const onRoute = (path) => {
    if (path == 'back') {
        router.go(-1)
    } else {
        router.push(path)
    }
}
 
const handleLanguageClick = () => {
    router.push('/language')
}
 
let username = ref('')
let password = ref('')
let activeIndex = ref(0)
let isArea = ref(false)
let dialCode = ref(0)
let icon = ref('')
const type = ref(3)
 
const getRegType = (activeIndex, bFlag) => {
    switch (activeIndex) {
        case 0:
            return bFlag ? t('account') : t('entryAccount');
        case 1:
            return bFlag ? t('email') : t('entryEmail');
        case 2:
            return bFlag ? t('phoneNum') : t('entryPhone');
    }
}
const controlChildRef = ref(null)
const onSelectArea = () => {
    controlChildRef.value.open();
}
 
//获取到当前选中国家的code值
const getName = (params) => {
    icon.value = params.code;
    dialCode.value = params.dialCode;
}
 
const changeIndex = (index) => {
    activeIndex.value = index;
    switch (index) {
        case 0:
        case 1: {
            isArea.value = false;
            break;
        }
        case 2: {
            isArea.value = true;
            break;
        }
    }
}
 
const verifyLogin = () => {
    switch (activeIndex.value) {
        case 0:
            {
                type.value = 3;
                break;
            }
        case 1:
            {
                type.value = 2;
                break;
            }
        case 2:
            {
                type.value = 1;
                break;
            }
    }
    if (username.value == '') {
        switch (activeIndex.value) {
            case 0:
                {
                    showToast(t('entryAccount'));
                    break;
                }
            case 1:
                {
                    showToast(t('entryEmail'));
                    break;
                }
            case 2:
                {
                    showToast(t('entryPhone'));
                    break;
                }
        }
        return false
    }
    if (password.value == '') {
        showToast(t('entryPassword'));
        return false
    }
    loginUser()
}
 
const userStore = useUserStore();
const loginUser = () => {
    _loginUser({
        userName: (activeIndex.value == 0 || activeIndex.value == 1) ? username.value : `${dialCode.value}${username.value}`,
        passWord: password.value,
        type: type.value
    }).then((res) => {
        userStore[GET_USERINFO](res)
        store.commit('user/SET_USERINFO', res)
        router.push('/')
    }).catch((res) => {
        console.log(res)
    })
}
</script>
 
<style lang="scss" scoped>
@import '@/assets/css/deepseek_css_20250625_30ff932.css';
 
.login {
    width: 100%;
    padding: 15px 0;
    font-size: 13px;
    box-sizing: border-box;
    background: url('../../assets/img/bg-login.png') 0% 0% / cover fixed;
}
 
.top {
    padding-left: 9px;
    padding-top: 9px;
 
    img {
        width: 18px;
        height: 18px;
    }
}
 
.title {
    font-weight: 700;
    font-size: 26px;
    margin-top: 27px;
    margin-bottom: 33px;
}
 
.login-tab {
    margin-bottom: 20px;
 
    div {
        padding: 0 20px;
        height: 34px;
        line-height: 34px;
        text-align: center;
        border-radius: 4px;
        margin-right: 10px;
    }
 
    .active {
        background: $US_tabActice_background;
        color: $color_main;
    }
}
 
.forget {
    font-size: 12px;
    line-height: 14px;
    margin-top: 30px;
}
 
.noTips {
    margin-top: 22px;
}
 
.colorMain {
    color: #1194F7;
}
</style>