login.vue
3.1 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
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
<template>
<el-row class="login-box">
<div v-if="flag">
<h1>团 体 会 员 登 录</h1>
<div class="login-form">
<el-tabs
v-model="activeName"
>
<el-tab-pane label="密码登录" name="user" />
<el-tab-pane label="短信登录" name="phone" />
<!-- <el-tab-pane label="微信登录" name="wx" /> -->
</el-tabs>
<user v-if="activeName=='user'" @submit="login" @forgetPassword="flag=!flag" />
<phone v-if="activeName=='phone'" @submit="login" />
<weixin v-if="activeName=='wx'" @submit="login" />
</div>
</div>
<div v-if="!flag">
<h1>找 回 密 码</h1>
<forgetPassword @login="flag=!flag" />
</div>
</el-row>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue'
import _ from 'lodash'
import { useRoute, useRouter } from 'vue-router'
import cache from '@/plugins/cache'
import User from './components/user'
import Phone from './components/phone'
import Weixin from './components/weixin'
import forgetPassword from './components/forgetPassword'
const route = useRoute()
const router = useRouter()
const activeName = ref('user')
const flag = ref(true)
let redirect, query
onMounted(() => {
redirect = route.query.redirect || '/'
if (redirect && redirect.indexOf('?') > -1) {
const temp = redirect.split('?')
redirect = temp[0]
query = {}
_.each(temp[1].split('&'), (q) => {
const t = q.split('=')
query[t[0]] = t[1]
})
}
if (cache.local.get('activeName')) {
activeName.value = cache.local.get('activeName')
}
})
watch(activeName, (val) => {
cache.local.set('activeName', val)
})
function login() {
router.push({ path: redirect, query: query })
}
</script>
<style lang="scss" scoped>
.login-box {
display: flex;
justify-content: center;
align-items: center;
}
.text-center {
color: #fff;
font-size: 40px;
font-weight: 700;
margin-right: 40px;
}
.login-form {
width: 580px;
height: 450px;
background: #FFFFFF;
box-shadow: 0px 0px 38px 0px rgba(30,98,151,0.73);
border-radius: 15px;
padding: 30px 40px;
:deep(.el-input) {
height: 40px;
input {
height: 40px;
}
}
:deep(.input-icon) {
height: 39px;
width: 14px;
margin-left: 0px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.h3{
font-size: 36px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #FFFFFF;
text-align: center;
}
.wxBox{
position: relative;display: flex;align-items: center;
}
.img{
height: 20px;
}
.wx{
font-size: 16px;margin-left: 6px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #29343C;
}
// :deep(.el-form-item){
// width: 440px;
// height: 60px;
// background: #F6F6F6;
// border: 1px solid #EBEBEB;
// border-radius: 2px;
// margin-top: 20px;
// padding: 0;
// }
// :deep(.el-form-item){
// height: 60px;
// }
// :deep(.el-form-item__content){
// height: 60px;
// }
// :deep(.login-form .el-input){
// height: 60px;
// }
// :deep(.el-input__wrapper){
// background: #F6F6F6;
// }
h1{text-align: center; color: #fff;}
</style>