-
Notifications
You must be signed in to change notification settings - Fork 81
/
register.html
403 lines (345 loc) · 17.3 KB
/
register.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>杭州北望生物技术有限公司信息管理系统</title>
<meta name="author" content="Binpeng Liu "/>
<meta name="description" content="杭州北望生物技术有限公司是一家集新药研发和新药研究技术服务、生物试剂开发与销售、食品药品相关试剂研发和销售为一体的高科技公司。">
<meta name="Keywords" content="杭州北望、响应式布局、信息管理系统、跨平台、iphone/ipad/mac..."/>
<meta name="author" content="杭城小刘"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!--引入基本css样式-->
<link href="admin/assets/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="admin/assets/css/font-awesome.min.css"/>
<link rel="stylesheet" href="admin/assets/css/select2.css"/>
<!--主框架style-->
<link rel="stylesheet" href="admin/assets/css/ace.min.css"/>
<link rel="stylesheet" href="admin/assets/css/ace-rtl.min.css"/>
<link rel="stylesheet" href="style/css/sweetalert.css"/>
<link rel="stylesheet" href="style/css/sweet-alert.css"/>
</head>
<body class="login-layout">
<div class="main-container">
<div class="main-content">
<div class="row">
<div class="col-xm-10 col-sm-10 col-md-10 col-sm-offset-1">
<div class="login-container">
<div class="center">
<h1>
<i class="icon-leaf green"></i>
<span class="red">杭州北望科技有限公司</span>
<span class="white"></span>
</h1>
</div>
<div class="space-6"></div>
<div class="position-relative">
<div id="resetPassword-box" class="login-box widget-box no-border">
<div class="widget-body">
<div class="widget-main">
<h4 class="header blue lighter bigger">
<i class="icon-coffee green"></i>
请重置密码
</h4>
<div class="space-6"></div>
<!--重置密码密码表单-->
<form action="controller/Account.php?action=reset" autocomplete="on"
method="post">
<fieldset>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="text" id="email" name="email" class="form-control" placeholder="邮箱" required="required"/>
<i class="icon-user"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="password" id="resetPassword" name="resetPassword" class="form-control" placeholder="请输入密码"
required="required"/>
<i class="icon-lock"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="password" id="resetVerPassword" name="resetVerPassword" class="form-control" placeholder="请再次输入密码"
required="required"/>
<i class="icon-lock"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="text" id="notice" class="form-control hidden" readonly=""/>
</span>
</label>
<div class="clearfix">
<input type="submit" value="请确认"
class="width-35 pull-right btn btn-sm btn-primary"/>
</div>
<div class="space-4"></div>
</fieldset>
</form>
</div><!-- /widget-main -->
</div><!-- /widget-body -->
</div><!-- /resetPassword-box -->
<div id="forgot-box" class="forgot-box widget-box no-border">
<div class="widget-body">
<div class="widget-main">
<h4 class="header red lighter bigger">
<i class="icon-key"></i>
密码找回
</h4>
<div class="space-6"></div>
<p>
输入你的邮箱来接收密码
</p>
<form action="controller/Account.php?action=seekPassword" autocomplete="true"
method="post">
<fieldset>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="email" name="seekEmail" id="seekEmail" class="form-control"
placeholder="输入注册邮箱" required="required"/>
<i class="icon-envelope"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<p id="seekEmailResult" style="color:#F33"></p>
</span>
</label>
<div class="clearfix">
<button id="seekPassword"
class="width-35 pull-right btn btn-sm btn-danger">提交
</button>
</div>
</fieldset>
</form>
<!--一段ajax来检测该邮箱是否被注册-->
</div><!-- /widget-main -->
<div class="toolbar center">
<a href="#" onclick="show_box('login-box'); return false;" class="back-to-login-link">
登陆
<i class="icon-arrow-right"></i>
</a>
</div>
</div><!-- /widget-body -->
</div><!-- /forgot-box -->
<div id="signup-box" class="signup-box widget-box no-border">
<div class="widget-body">
<div class="widget-main">
<h4 class="header green lighter bigger">
<i class="icon-group blue"></i>
新账户注册
</h4>
<div class="space-6"></div>
<p>输入你的详细信息: </p>
<!--注册表单-->
<form autocomplete="on">
<fieldset>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="text" id="username" name="username" required="required" class="form-control" placeholder="用户名"/>
<i class="icon-user"></i>
</span>
</label>
<span class="block input-icon input-icon-right"><p id="userResult"
style="color:#F33"></p></span>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="email" id="registerEmail" name="registerEmail" required="required" class="form-control" placeholder="邮箱"/>
<i class="icon-envelope"></i>
</span>
</label>
<span class="block input-icon input-icon-right"><p id="emailResult"
style="color:#F33"></p></span>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="tel" id="telephone" name="telephone" required class="form-control" placeholder="手机号"
required="required"/>
<i class="icon-phone"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="text" id="address" name="address" class="form-control" placeholder="收获地址"/>
<i class="icon-home"></i>
</span>
</label>
<label class="block clearfix">
<span class="block input-icon input-icon-right">
<input type="password" id="password" name="password" required class="form-control" placeholder="密码"
required="required"/>
<i class="icon-lock"></i>
</span>
</label>
<label class="block">
<input type="checkbox" class="ace"/>
<span class="lbl">
接受
<a href="#">用户协议</a>
</span>
</label>
<div class="clearfix">
<button type="reset" class="width-30 pull-left btn btn-sm">
<i class="icon-refresh"></i>
重置
</button>
<input type="button" value="注册" id="register"
class="width-65 pull-right btn btn-sm btn-success"/>
</div>
</fieldset>
</form>
</div>
<div class="toolbar center">
<a href="#" onclick="show_box('login-box'); return false;"
class="back-to-login-link">
<i class="icon-arrow-left"></i>
返回登录
</a>
</div>
</div><!-- /widget-body -->
</div><!-- /signup-box -->
</div><!-- /position-relative -->
</div>
</div><!-- /.col -->
</div><!-- /.row -->
</div>
</div><!-- /.main-container -->
<script type="text/javascript">
window.jQuery || document.write("<script src='admin/assets/js/jquery-2.0.3.min.js'>" + "<" + "/script>");
</script>
<script type="text/javascript">
if ("ontouchend" in document) document.write("<script src='admin/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
</script>
<script type="text/javascript" src="style/js/sweetalert.min.js"></script>
<script type="text/javascript">
function show_box(id) {
jQuery('.widget-box.visible').removeClass('visible');
jQuery('#' + id).addClass('visible');
}
//获取url参数
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null)
return decodeURIComponent(r[2]);
return null;
}
if(getQueryString("show") == "resetPassword-box"){
$("#email").val(getQueryString("email"));
}
show_box(getQueryString("show"));
$("#resetPassword").on("blur",function () {
if($(this).val() == ""){
swal("密码不能为空");
return ;
}
});
$("#resetVerPassword").on("blur",function () {
if($("#resetPassword").val() == ""){
swal("密码不能为空");
return ;
}
if($("#resetPassword").val() != $("#resetVerPassword").val()){
swal("2次密码不一致");
return ;
}
});
$("#username").on("blur", function () {
if ($(this).val() != "") {
$.ajax({
dataType: "json",
type: "get",
url: "controller/Account.php?action=checkUserName&username=" + $(this).val(),
success: function (data) {
if (data.code == 200) {
var datas = data.data;
if (datas.length <= 0) {
return;
}
$("#userResult").html("<a href='index.php'>该账号已存在,请登陆</a>或换个账号注册");
}
},
error: function (code, message, data) {
alert("发生错误:" + message);
}
});
}
});
$("#email").on("blur", function () {
if ($(this).val() != "") {
$.ajax({
dataType: "json",
type: "get",
url: "controller/Account.php?action=checkEmail&email=" + $(this).val(),
success: function (data) {
if (data.code == 200) {
var datas = data.data;
if (datas.length <= 0) {
return;
}
$("#emailResult").html("<a href='index.php'>该邮箱已存在,请登陆</a>或换个邮箱注册");
}
},
error: function (code, message, data) {
alert("发生错误:" + message);
}
});
}
});
$("#seekEmail").on("blur", function () {
$("#seekEmailResult").html("");
if ($(this).val() != "") {
$.ajax({
dataType: "json",
type: "get",
url: "controller/Account.php?action=checkEmail&email=" + $(this).val(),
success: function (data) {
if (data.code == 201) {
$("#seekEmailResult").html(data.message);
}
},
error: function (code, message, data) {
alert("发生错误:" + message);
}
});
}
});
$("#register").click(function () {
var data = {
"username": $("#username").val(),
"password": $("#password").val(),
"telephone": $("#telephone").val(),
"email": $("#registerEmail").val(),
"address": $("#address").val()
};
$.ajax({
dataType: "json",
type: "POST",
data: data,
url: "controller/Account.php?action=register",
success: function (data) {
if (data.code == 200) {
setTimeout(function () {
swal(data.message);
setTimeout(function () {
window.history.back();
}, 2000);
}, 1000);
} else {
setTimeout(function () {
swal(data.message);
setTimeout(function () {
window.location.reload();
}, 1000);
}, 1000);
}
},
error: function (code, message, data) {
console.log("发生错误" + message);
}
});
});
</script>
<div style="display:none"></div>
</body>
</html>