WechatLoginPage.vue
2.51 KB
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
<template>
<div class="auth-bg">
<div class="auth-container">
<!-- 返回按钮 -->
<div class="back-button" @click="goBack">
<img src="/zuo.svg" alt="goBack" class="input-icon-svg" />
</div>
<!-- 头部Logo与标题 -->
<div class="auth-header">
<div class="logo-container">
<img src="/newLogo.png" alt="Logo" class="logo-img" />
</div>
<h1 class="auth-title">{{ $t("login.wechatLogin") }}</h1>
<p class="auth-subtitle">{{ $t("login.wechatLoginTip") }}</p>
</div>
<!-- 内嵌二维码登录组件 -->
<WechatLogin />
</div>
</div>
</template>
<script setup lang="ts">
import { useRouter, useRoute } from "vue-router";
import WechatLogin from "@/components/auth/WechatLogin.vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
const router = useRouter();
const route = useRoute();
const goBack = () => {
const mode = (route.query["mode"] as string | undefined) || undefined;
if (mode === "bind") {
router.replace({ path: "/app/settings", query: { tab: "profile" } });
} else {
router.push("/auth");
}
};
</script>
<style scoped lang="scss">
.auth-bg {
min-height: 100vh;
background: var(--color-bg);
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.auth-container {
background: var(--color-bg);
border-radius: 20px;
padding: 40px 32px 32px 32px;
max-width: 420px;
width: 92vw;
box-shadow:
0 8px 32px rgba(0, 0, 0, 0.08),
0 4px 16px rgba(0, 0, 0, 0.04);
position: relative;
z-index: 1;
}
.back-button {
position: absolute;
top: 16px;
left: 16px;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
backdrop-filter: blur(10px);
&:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(0, 0, 0, 0.15);
transform: translateY(-1px);
}
.input-icon-svg {
width: 16px;
height: 16px;
opacity: 0.8;
}
}
.auth-header {
text-align: center;
margin-bottom: 16px;
}
.logo-container {
width: auto;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 16px;
}
.logo-img {
width: auto;
height: 100%;
object-fit: contain;
}
.auth-title {
font-size: 22px;
font-weight: 700;
margin-bottom: 6px;
color: #1e6fff;
line-height: 1.3;
}
.auth-subtitle {
font-size: 13px;
color: #909399;
}
</style>