|
|
|
@ -378,10 +378,10 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input-code">
|
|
|
|
|
<div>
|
|
|
|
|
<img src="/mobile.php?s=/Common/verify.html" alt="">
|
|
|
|
|
<img src="__IMG__/20191225/yanzhengma.png" alt="">
|
|
|
|
|
<input name="verify_code" type="text" placeholder="请输入验证码">
|
|
|
|
|
</div>
|
|
|
|
|
<img src="" alt="">
|
|
|
|
|
<img src="/mobile.php?s=/Common/verify.html" alt="">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="register-btn">
|
|
|
|
|
<div class="loginBtn">登录</div>
|
|
|
|
@ -764,6 +764,92 @@ var PhoneObj = {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//普通注册
|
|
|
|
|
$("#userreg").on("click", function(){
|
|
|
|
|
var box = $('#register-box')
|
|
|
|
|
var account = box.find('[name=account]').val()
|
|
|
|
|
var password = box.find('[name=password]').val()
|
|
|
|
|
var repassword = box.find('[name=repassword]').val()
|
|
|
|
|
var verifyCode = box.find('[name=verify_code]').val()
|
|
|
|
|
|
|
|
|
|
var pwdRegex = new RegExp('(?=.*[0-9])(?=.*[a-zA-Z])');
|
|
|
|
|
if(account.length < 6 || account.length > 15){
|
|
|
|
|
alert('账号长度必须是6-15位');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (!pwdRegex.test(account)) {
|
|
|
|
|
alert("账号必须是6-15位字母数字组合!");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(password.length < 6 || password.length > 12){
|
|
|
|
|
alert('密码长度6-12个字符');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(password != repassword){
|
|
|
|
|
alert('两次密码不一样');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST',
|
|
|
|
|
url: 'mobile.php?s=/Ssg/userRegister.html',
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
data:{
|
|
|
|
|
account: account,
|
|
|
|
|
password: regpassword,
|
|
|
|
|
promote_id: promoteId
|
|
|
|
|
},
|
|
|
|
|
success: function (result) {
|
|
|
|
|
if (result.return_code == 'fail') {
|
|
|
|
|
alert(result.return_msg);
|
|
|
|
|
} else {
|
|
|
|
|
//成功
|
|
|
|
|
$("#alert_box").show();
|
|
|
|
|
setTimeout(hideAndLogin,2500)
|
|
|
|
|
// alert("注册并登陆成功");
|
|
|
|
|
// window.location.href = "mobile.php?s=/Ssg/index.html"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
//忘记密码
|
|
|
|
|
$("#forgetBtn").on("click",function(){
|
|
|
|
|
var box = $('#forget-box')
|
|
|
|
|
var phone = box.find('[name=mobile]').val()
|
|
|
|
|
var password = box.find('[name=password]').val()
|
|
|
|
|
var verifyCode = box.find('[name=verify_code]').val()
|
|
|
|
|
if(!PhoneObj.checkPhone(phone)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(!PhoneObj.checkPassword(password)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(verifyCode == ''){
|
|
|
|
|
alert('请输入验证码');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'POST',
|
|
|
|
|
url: '/mobile.php?s=/Common/forgetPassword.html',
|
|
|
|
|
dataType: 'JSON',
|
|
|
|
|
data:{
|
|
|
|
|
account: phone,
|
|
|
|
|
password: password,
|
|
|
|
|
verify_code: verifyCode
|
|
|
|
|
},
|
|
|
|
|
success: function (result) {
|
|
|
|
|
console.log(result)
|
|
|
|
|
if (result.return_code == 'fail') {
|
|
|
|
|
alert(result.return_msg);
|
|
|
|
|
} else {
|
|
|
|
|
$("#alert_content").html("密码修改成功,系统将在三秒后自动登录");
|
|
|
|
|
$("#alert_box").show();
|
|
|
|
|
setTimeout(hideAndLogin,2500)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|