bind.vue
3.06 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
<div v-if="showBind" class="third-bind-wrapper">
<div class="bind-dialog">
<div class="under-row">
<i class="iconfont iconphone2"></i>
<div class="select-block">
<CubeSelect class="area-code-select" v-model="code" :options="options"></CubeSelect>
</div>
<CubeInput class="bind-input" v-model="phone" placeholder="请输入手机号"></CubeInput>
</div>
<div class="under-row">
<i class="iconfont iconyanzhengma"></i>
<CubeInput class="bind-input" v-model="smsCode" placeholder="请输入验证码"></CubeInput>
<CubeButton class="send-sms-btn" :disabled="!!sendBtnText" @click="sendSMS">{{sendBtnText || '获取验证码'}}</CubeButton>
</div>
<div class="submit-row">
<CubeButton class="bind-btn">登录</CubeButton>
</div>
</div>
</div>
</template>
<script>
import { Button, Input, Select } from 'cube-ui';
export default {
name: 'ThirdBind',
data() {
return {
showBind: false,
code: '+86',
options: ['+86', '+8700', '+88'],
phone: '',
smsCode: '',
sendBtnText: ''
}
},
methods: {
show() {
this.showBind = true;
},
sendSMS() {
let total = 60;
let timer = setInterval(() => {
if (--total) {
this.sendBtnText = '重新获取 ' + total;
} else {
this.sendBtnText = '';
clearInterval(timer)
}
}, 1000);
this.sendBtnText = '重新获取 ' + total;
}
},
components: {
CubeInput: Input,
CubeSelect: Select,
CubeButton: Button
}
};
</script>
<style lang="scss" scoped>
.third-bind-wrapper {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 99;
display: flex;
justify-content: center;
align-items: center;
}
.bind-dialog {
width: 670px;
height: 600px;
padding: 100px 60px;
font-size: 24px;
box-sizing: border-box;
background-color: #fff;
color: #444;
}
.under-row {
line-height: 80px;
border-bottom: 1px solid #eaeaea;
margin-bottom: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.iconfont {
font-size: 40px;
margin-right: 10px;
vertical-align: middle;
}
.select-block {
width: 130px;
position: relative;
margin-right: 10px;
&:after {
content: "";
width: 1px;
background-color: #eaeaea;
position: absolute;
right: 0;
top: 30%;
bottom: 30%;
}
}
.area-code-select {
display: inline-block;
&:after {
border: 0;
}
/deep/ .cube-select-text {
font-size: 12px;
}
}
.bind-input {
flex-grow: 1;
&:after {
border: 0;
}
/deep/ .cube-input-field {
font-size: 12px;
}
}
.send-sms-btn {
width: 180px;
height: 54px;
line-height: 54px;
padding: 0;
font-size: 12px;
border-radius: 27px;
transform: scale(0.9);
&:after {
border: 0;
}
}
.submit-row {
margin-top: 80px;
}
.bind-btn {
height: 120px;
font-size: 28px;
background: #022c46;
&.cube-btn_disabled {
background: #ccc;
}
}
</style>