2015-10-13 06:26:47 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html class="login-bg">
|
|
|
|
<head>
|
|
|
|
<title><?=$title?></title>
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
|
|
|
|
<!-- bootstrap -->
|
|
|
|
<link href="View/public/css/bootstrap/bootstrap.css" rel="stylesheet" />
|
|
|
|
<link href="View/public/css/bootstrap/bootstrap-responsive.css"
|
|
|
|
rel="stylesheet" />
|
|
|
|
<link href="View/public/css/bootstrap/bootstrap-overrides.css"
|
|
|
|
type="text/css" rel="stylesheet" />
|
|
|
|
|
|
|
|
<!-- global styles -->
|
|
|
|
<link rel="stylesheet" type="text/css" href="View/public/css/layout.css" />
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="View/public/css/elements.css" />
|
|
|
|
<link rel="stylesheet" type="text/css" href="View/public/css/icons.css" />
|
|
|
|
|
|
|
|
<!-- libraries -->
|
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="View/public/css/lib/font-awesome.css" />
|
|
|
|
|
|
|
|
<!-- this page specific styles -->
|
|
|
|
<link rel="stylesheet" href="View/public/css/compiled/signup.css"
|
|
|
|
type="text/css" media="screen" />
|
|
|
|
<!--[if lte IE 6]><script>alert('请升级浏览器 如:Chrome,Firefox!')</script><![endif]-->
|
|
|
|
<!--[if lte IE 7]><script>alert('请升级浏览器 如:Chrome,Firefox')</script><![endif]-->
|
|
|
|
<!--[if lte IE 8]><script>alert('请升级浏览器 如:Chrome,Firefox')</script><![endif]-->
|
|
|
|
<!--[if lte IE 9]><script>alert('请升级浏览器 如:Chrome,Firefox')</script><![endif]-->
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="header">
|
2015-10-20 13:05:15 +00:00
|
|
|
<a href="<?=Url('index','index')?>"> <img
|
|
|
|
src="View/public/img/logo.png" class="logo" />
|
2015-10-13 06:26:47 +00:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="row-fluid login-wrapper col-xs-12 col-md-12 col-lg-12">
|
|
|
|
<div class="box">
|
|
|
|
<div class="content-wrap">
|
|
|
|
<h6>注册中心</h6>
|
|
|
|
<input class="span12" type="text" placeholder="用户帐号" id="username" />
|
|
|
|
<input class="span12" type="password" placeholder="游戏密码"
|
|
|
|
id="password"> <input class="span12" type="text" placeholder="邮箱地址"
|
|
|
|
id="email" />
|
|
|
|
<div class="action">
|
|
|
|
<button type="button" id="register" class="btn btn-primary signup">注册属于你的Mc帐号</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="span4 already">
|
|
|
|
<p>已经有了帐号?</p>
|
|
|
|
<a href="<?=Url('index','login')?>">点击这里登陆</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- scripts -->
|
|
|
|
<script src="View/public/js/jquery-1.7.2.min.js"></script>
|
|
|
|
<script src="http://libs.useso.com/js/jquery/1.8.3/jquery.min.js"></script>
|
|
|
|
<!--
|
|
|
|
<script src="View/public/js/jquery-latest.js"></script>-->
|
|
|
|
|
|
|
|
<script src="View/public/js/bootstrap.min.js"></script>
|
|
|
|
<script src="View/public/js/theme.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
$("#register").click(function(){
|
2015-10-13 13:00:48 +00:00
|
|
|
var RegexEmail = /^(?:\w+\.?)*\w+@(?:\w+\.)*\w+$/;
|
|
|
|
var RegexUserName = /^[a-zA-Z0-9_?]*$/;
|
2015-10-13 06:26:47 +00:00
|
|
|
var username = $("#username");
|
|
|
|
var pass = $("#password");
|
|
|
|
var email = $("#email");
|
|
|
|
if(username.val()==""){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("用户名不能为空!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(username.val().length < 3){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("帐号长度不得低于3位!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if(username.val().length > 10){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("帐号长度不得超过10位!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(pass.val()==""){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("密码不能为空!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(pass.val().length < 6){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("密码强度不能低于6位!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if(email.val()==""){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("邮箱不能为空!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return false;
|
|
|
|
}
|
2015-10-13 13:00:48 +00:00
|
|
|
if(!RegexUserName.test(username.val())){
|
|
|
|
alert("帐号必须以小写字母+数字+下划线组成!");
|
2015-10-13 06:26:47 +00:00
|
|
|
return;
|
|
|
|
}
|
2015-10-13 13:00:48 +00:00
|
|
|
if(!RegexEmail.test(email.val())){
|
|
|
|
alert("邮箱格式不正确!");
|
2015-10-13 06:26:47 +00:00
|
|
|
$('#email').val("");
|
|
|
|
return false;
|
|
|
|
}
|
2015-10-13 07:05:23 +00:00
|
|
|
$.ajax({ url:"<?=Url('user_public','user_check')?>", type:"GET", data:{user:username.val()}, dataType:"json",
|
|
|
|
success:function(rdata){
|
|
|
|
switch(rdata.status){
|
2015-10-20 13:05:15 +00:00
|
|
|
case "success":
|
|
|
|
$.ajax({url:"<?=Url('user_public','mail_check')?>",
|
|
|
|
type:"GET",
|
|
|
|
data:{mail:email.val()},
|
|
|
|
dataType:"json",
|
|
|
|
success:function(s){
|
|
|
|
switch(s.status){
|
2015-10-13 07:05:23 +00:00
|
|
|
case "success":
|
|
|
|
$.ajax({
|
2015-10-20 13:05:15 +00:00
|
|
|
type:"POST",
|
|
|
|
data:{user:username.val(), mail:email.val(),pass:pass.val()},
|
|
|
|
dataType:"json",
|
|
|
|
url:"<?=Url('user_public','register')?>",
|
2015-10-13 07:05:23 +00:00
|
|
|
success:function(C){
|
2015-10-20 13:05:15 +00:00
|
|
|
alert(C.info);
|
|
|
|
location.href = "<?=Url('index','index')?>";
|
|
|
|
}
|
|
|
|
})
|
2015-10-13 07:05:23 +00:00
|
|
|
break;
|
|
|
|
case "error":
|
|
|
|
alert(s.info);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2015-10-20 13:05:15 +00:00
|
|
|
break;
|
|
|
|
case "error":
|
|
|
|
alert(rdata.info);
|
|
|
|
return false;
|
2015-10-13 07:05:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
error:function(){
|
2015-10-13 13:00:48 +00:00
|
|
|
alert("注册失败 请检查网络是否通畅!");
|
2015-10-20 13:05:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
2015-10-13 09:09:13 +00:00
|
|
|
})
|
2015-10-13 06:26:47 +00:00
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|