-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreset_password.html
189 lines (174 loc) · 6.43 KB
/
reset_password.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>找回密码</title>
<link href="css/sta.css" rel="stylesheet" type="text/css">
<link href="css/mui.css" rel="stylesheet" type="text/css">
<script src="js/mui.js"></script>
<script src="js/common.js"></script>
<script src="js/config.js"></script>
<script src="js/vue.js"></script>
</head>
<style>
input[type=radio] {
position: relative;
width: 15px;
height: 1px;
}
input[type=radio]::before,
input[type=radio]::after {
position: absolute;
display: block;
content: '';
border-radius: 50%;
transition: .3s all esae;
}
input[type=radio]::before {
top: 0;
left: 0;
width: 15px;
height: 15px;
border: 2px solid #ccc;
}
input[type=radio]::after {
top: 4px;
left: 4px;
width: 11px;
height: 11px;
background-color: #fff;
}
input[type=radio]:checked::before {
border-color: 1px solid #ccc;
}
input[type=radio]:checked::after {
background-color: #ccc;
}
.reg_ip3 {
width: 100%!important;
padding: 0!important;
text-align: center!important;
font-style: normal;
}
</style>
<body style="background:#F0F0F0;">
<div class="register_box" id="app">
<div class="register_ip" style="border:none;margin-bottom:10px;">
<p>
<span>手机号码</span>
<input type="text" v-model="mobile" placeholder="请输入11位手机号码" class="reg_ip2" id="add1">
<i><input type="submit" :style="wating ? 'background-color: #e6e6e6' : ''"
class="reg_ip3" v-model="text" @click="getVerifyCode()" class="reg_ip4"></i>
</p>
<div class="clr"></div>
</div>
<div class="register_ip" style="border:none;margin-bottom:10px;">
<p><span>短信验证</span><input type="text" placeholder="请输入验证码" class="reg_ip1" v-model="code"></p>
<div class="clr"></div>
</div>
<div class="register_ip" style="border:none;margin-bottom:10px;">
<p><span>密码类型</span>
<b><input type="radio" v-model="password_type" value="1" name="demo" class="register_radio">登录密码</b>
<b><input type="radio" v-model="password_type" value="2" name="demo" class="register_radio1">支付密码</b></p>
<div class="clr"></div>
</div>
<div class="register_ip" style="border:none;margin-bottom:10px;">
<p><span>新密码</span><input type="password" v-model="password" placeholder="输入不少于6位密码" class="reg_ip1"></p>
<div class="clr"></div>
</div>
<div class="register_ip" style="border:none;">
<p><span>确认密码</span><input type="password" v-model="password_confirmation" placeholder="请再次确认密码" class="reg_ip1"></p>
<div class="clr"></div>
</div>
<div class="register_bt">
<input type="submit" value="确认" @tap="submit">
</div>
</div>
<script>
var vm = new Vue({
el: '#app',
data: {
mobile: '',
code: '',
wating: false,
text: '获取验证码',
password_type: 1,
password: '',
password_confirmation: '',
},
watch: {
wating: function (newval, val) {
if (newval == true) {
this.text = 60;
var self = this;
var timeout = setInterval(function () {
if (--self.text == 0) {
clearInterval(timeout);
self.wating = false;
}
}, 1000);
} else {
this.text = '获取验证码'
}
},
},
methods: {
submit: function () {
if (this.password.length < 6) {
mui.toast('请输入不少于6位的密码');
return;
}
if (this.password != this.password_confirmation) {
mui.toast('密码和确认密码不一致');
return;
}
postJson(
'api/resetPasswordOrPayment',
{
phone: this.mobile,
code: this.code,
password_type: this.password_type,
password: this.password,
password_confirmation: this.password_confirmation,
},
function (ret) {
mui.toast(ret.message)
if (ret.code == 200) {
setTimeout(function () {
clicked('login.html');
}, 300)
}
},
null,
false
)
},
getVerifyCode: function () {
if (this.wating) {
return;
}
if (!/^1[0-9]{10}$/.test(this.mobile)) {
mui.toast('请输入正确的手机号码');
return;
}
var self = this;
self.wating = true;
mui.post(
config.host + 'api/user/sendSms',
{
phone: self.mobile
},
function (ret) {
mui.toast(ret.message);
if (ret.code == 200) {
}
}, 'json')
}
}
})
</script>
</body>
</html>