login.vue
3.12 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
<template>
<div class="login_container">
<UserCommon>
<template slot="top">
<NafmHeader :isBgImg="false" bgColor="transparent" />
</template>
</UserCommon>
<div class="login_content">
<van-tabs @click="switchTab" :border="false" class="login_tabs" v-model="tabActive" swipeable>
<van-tab title="手机号登录" :name="1">
<div class="login_form">
<van-field v-model="userName" clearable type="tel" maxlength="11" :left-icon="userNameIcon" placeholder="请输入手机号" />
<van-field v-model="password" clearable label="" maxlength="16" :left-icon="passwordIcon" placeholder="请输入6-16位密码">
<template #button>
<SendVerificationCode :phone="userName" />
</template>
</van-field>
<div>
<van-button></van-button>
</div>
</div>
</van-tab>
<van-tab title="账号密码登录" :name="2">
<div class="login_form">
<van-field v-model="userName" clearable type="tel" maxlength="11" :left-icon="userNameIcon" placeholder="请输入手机号" />
<van-field v-model="password" clearable label="" maxlength="16" :left-icon="passwordIcon" placeholder="请输入6-16位密码" />
<div class="form_second">
<van-checkbox v-model="checked" checked-color="#106abc" class="checkbox" shape="square" icon-size="12px">记住密码</van-checkbox>
<span class="forget">忘记密码</span>
</div>
</div>
</van-tab>
</van-tabs>
</div>
<div class="login_others">
<div>其他登录方式</div>
<div>
<img src="require('@/assets/icon/wechat.png')" alt="">
</div>
</div>
</div>
</template>
<script>
import UserCommon from '@/components/UserCommon'
import SendVerificationCode from '@/components/SendVerificationCode'
export default {
name: 'Login',
components: {
UserCommon,
SendVerificationCode
},
data() {
return {
tabActive: 1,
userName: null,
password: "",
checked: false,
userNameIcon: require('@/assets/icon/user.png'),
passwordIcon: require('@/assets/icon/password.png'),
}
},
methods: {
handleBack() {
this.$router.back()
},
switchTab(name) {
this.tabActive = name
},
}
}
</script>
<style lang="less" scoped>
.login-container {
width: 100%;
height: 100%;
font-size: 40px;
}
.login_content {
margin-top: 40px;
}
/deep/ .van-tabs__nav--line {
width: 60%;
margin: 0 auto;
}
/deep/ .van-tab {
border-bottom: 1px solid #b8cfe5;
}
/deep/ .van-tabs__line {
bottom: 4px;
}
.login_form {
margin: 30px 42px 0 42px;
}
/deep/ .van-cell:not(:last-child)::after {
border-bottom: 1px solid #efefef;
}
.form_second {
margin-top: 10px;
display: flex;
justify-content: space-between;
color: #999;
.checkbox {
margin-left: 20px;
/deep/ .van-checkbox__label {
color: #999;
}
}
.forget {
text-decoration: underline;
}
}
// /deep/ .van-field__body input::-webkit-input-placeholder {
// color: #8F9196;
// }
</style>