-
Notifications
You must be signed in to change notification settings - Fork 0
/
reg.html
116 lines (112 loc) · 3.28 KB
/
reg.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>注册</title>
<link href="css/app.css" rel="stylesheet" />
</head>
<body>
<div class="ui-page">
<header class="ui-bar jy-bar" id="header">
<a href="javascript:;" class="icon-back icon"></a>
<div class="ui-title">注册</div>
<!--<a href="login.html" class="ui-link text-r">登录</a>-->
</header>
<div class="content">
<div class="jy-login">
<div class="item">
<div class="in phone icon"><input class="input" id="account" type="text" placeholder="请输入手机号码"/></div>
<button class="getcode" id="postCode">获取验证码</button>
</div>
<div class="item">
<div class="in"><input class="input" type="text" id="getcode" placeholder="请输入验证码"/></div>
</div>
<div class="item">
<div class="in password icon"><input class="input" id="password" type="password" placeholder="请输入登录密码"></div>
</div>
<div class="item mt20">
<button class="btn-submit" id='reg'>注册</button>
</div>
</div>
</div>
</div>
<script src="js/mui.min.js"></script>
<script src="js/config.js"></script>
<script src="js/app.js"></script>
<script src="js/mui.enterfocus.js"></script>
<script src="js/login.js"></script>
<script type="text/javascript" charset="utf-8">
(function($, doc) {
$.init({
statusBarBackground:'#393767'
});
function settime(val) {
if (countdown == 0) {
val.removeAttribute("disabled");
countdown = 60;
} else {
val.setAttribute("disabled", true);
val.value="重新发送(" + countdown + ")";
countdown--;
}
setTimeout(function() {
settime(val)
},1000)
}
$.plusReady(function() {
plus.navigator.setStatusBarStyle('UIStatusBarStyleBlackTranslucent');
var regButton = doc.getElementById('reg');
var accountBox = doc.getElementById('account');
var passwordBox = doc.getElementById('password');
var emailBox = doc.getElementById('email');
var getcode = doc.getElementById('getcode');
var postCode=doc.getElementById("postCode");
regButton.addEventListener('tap', function(event) {
var regInfo = {
account: accountBox.value,
password: passwordBox.value,
code: getcode.value
};
if(!regInfo.account.length){
plus.nativeUI.toast('手机号码不能为空');
return;
}
if(!regInfo.code.length){
plus.nativeUI.toast('验证码不能为空');
return;
}
if(loginaApp.code!=regInfo.code){
plus.nativeUI.toast('验证码不正确');
return;
}
loginaApp.reg(regInfo, function(err) {
if (err) {
plus.nativeUI.toast(err);
return;
}
plus.nativeUI.toast('注册成功');
$.openWindow({
id:'login.html',
url:'login.html',
show: {
aniShow: 'pop-in'
}
});
});
});
//获取验证码
postCode.addEventListener("tap",function(){
var code=accountBox.value;
loginaApp.getCode(code,function(err){
if(err){
plus.nativeUI.toast(err);
return;
}
})
})
});
}(mui, document));
</script>
</body>
</html>