Ver Código Fonte

登录,注册,找回密码修改

xuchunyang 7 anos atrás
pai
commit
50fe1ca7f6
5 arquivos alterados com 41 adições e 40 exclusões
  1. 9 8
      js/loginNew.js
  2. 28 28
      js/pwdFindNew.js
  3. 1 1
      js/register.js
  4. 2 2
      login.html
  5. 1 1
      pwdFindNew.html

+ 9 - 8
js/loginNew.js

@ -4,7 +4,6 @@ $(function() {
4 4
		$(this).parents("#container").find(".frmmsg span").text("");
5 5
		$(this).parents("#container").find("input").removeClass("frmmsg-warning");
6 6
		$(this).parents("#container").find(".loginSubmit").attr("disabled", true);
7
		$("#getcode").attr("disabled", true);
8 7
		$(this).addClass("liactive").siblings().removeClass("liactive");
9 8
		$(".loginWays ul").eq($(this).index()).removeClass("displayNone").siblings().addClass("displayNone");
10 9
	})
@ -13,6 +12,7 @@ var namePass = false;
13 12
var passwordPass = false;
14 13
var codePass = false;
15 14
var verification = false;
15
var namePasstt = false;
16 16
/*校验登录按钮显示状态*/
17 17
function checkLoginButtn(_this) {
18 18
	var username = $(_this).parents(".cmpCoverUl").find(".username").val();
@ -55,26 +55,25 @@ function nameVal(_this) {
55 55
}
56 56

57 57
//校验登录手机账户
58
function phoneVal(_this) {
58
function phoneVal(_this,org) {
59 59
	var loginName = $(_this).val();
60 60
	var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
61 61
	if(loginName.length == "") {
62 62
		$(_this).next().find("span").text("请输入您的手机号码");
63 63
		$(_this).addClass("frmmsg-warning");
64 64
	} else if(hunPhone.test(loginName.trim())) {
65
		userRegisterOk(_this);
65
		userRegisterOk(_this,org);
66 66
		$(_this).next().find("span").text("");
67 67
		$(_this).removeClass("frmmsg-warning");
68 68
		namePass = true;
69 69
	} else {
70 70
		$(_this).next().find("span").text("请输入正确的手机号码");
71 71
		$(_this).addClass("frmmsg-warning");
72
		$("#getcode").attr("disabled", true);
73 72
	}
74 73
}
75 74

76 75
//判断账号是否注册
77
function userRegisterOk(_this) {
76
function userRegisterOk(_this,org) {
78 77
	var loginName = $(_this).val();
79 78
	$.ajax("/ajax/isReg?key=" + loginName, {
80 79
		type: "GET",
@ -86,7 +85,10 @@ function userRegisterOk(_this) {
86 85
			} else {
87 86
				$(_this).next().find("span").text("");
88 87
				$(_this).removeClass("frmmsg-warning");
89
				$("#getcode").attr("disabled", false);
88
				if(org==1){
89
					doClick("#getcode");
90
					phoneVerificationCode("#getcode");
91
				}
90 92
			}
91 93
		},
92 94
		error: function() {
@ -130,8 +132,7 @@ function codeVerification(_this) {
130 132

131 133
//手机发送验证码
132 134
function phoneSend(_this) {
133
	doClick(_this);
134
	phoneVerificationCode(_this);
135
	phoneVal(".phoneuser",1)
135 136
}
136 137

137 138
function doClick(_this) {

+ 28 - 28
js/pwdFindNew.js

@ -11,7 +11,6 @@ $(function() {
11 11
		$(this).parents("#container").find(".frmmsg span").text("");
12 12
		$(this).parents("#container").find("input").removeClass("frmmsg-warning");
13 13
		$(this).parents("#container").find(".loginSubmit").attr("disabled", true);
14
		$("#getcode").attr("disabled", true);
15 14
		$(this).addClass("liactive").siblings().removeClass("liactive");
16 15
		$(".loginWays .waysThis").eq($(this).index()).removeClass("displayNone").siblings().addClass("displayNone");
17 16
	})
@ -50,14 +49,14 @@ function getFocus(_this) {
50 49
}
51 50

52 51
//校验邮箱账户
53
function emailVal(_this) {
52
function emailVal(_this,org) {
54 53
	var loginName = $(_this).val();
55 54
	var gunf = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
56 55
	if(loginName.length == "") {
57 56
		$(_this).next().find("span").text("请输入您的邮箱地址");
58 57
		$(_this).addClass("frmmsg-warning");
59 58
	} else if(gunf.test(loginName.trim())) {
60
		userRegisterOk(_this);
59
		userRegisterOk(_this,org);
61 60
		$(_this).next().find("span").text("");
62 61
		$(_this).removeClass("frmmsg-warning");
63 62
		isEmail = true;
@ -68,26 +67,25 @@ function emailVal(_this) {
68 67
}
69 68

70 69
//校验登录手机账户
71
function phoneVal(_this) {
70
function phoneVal(_this,org) {
72 71
	var loginName = $(_this).val();
73 72
	var hunPhone = /^1[3|4|5|7|8]\d{9}$/;
74 73
	if(loginName.length == "") {
75 74
		$(_this).next().find("span").text("请输入您的手机号码");
76 75
		$(_this).addClass("frmmsg-warning");
77 76
	} else if(hunPhone.test(loginName.trim())) {
78
		userRegisterOk(_this);
77
		userRegisterOk(_this,org);
79 78
		$(_this).next().find("span").text("");
80 79
		$(_this).removeClass("frmmsg-warning");
81 80
		namePass = true;
82 81
	} else {
83 82
		$(_this).next().find("span").text("请输入正确的手机号码");
84 83
		$(_this).addClass("frmmsg-warning");
85
		$("#getcode").attr("disabled", true);
86 84
	}
87 85
}
88 86

89 87
//判断账号是否注册
90
function userRegisterOk(_this) {
88
function userRegisterOk(_this,org) {
91 89
	var loginName = $(_this).val();
92 90
	$.ajax("/ajax/isReg?key=" + loginName, {
93 91
		type: "GET",
@ -99,7 +97,13 @@ function userRegisterOk(_this) {
99 97
			} else {
100 98
				$(_this).next().find("span").text("");
101 99
				$(_this).removeClass("frmmsg-warning");
102
				$("#getcode").attr("disabled", false);
100
				if(org==1){
101
					doClick("#getcode");
102
					phoneVerificationCode("#getcode");
103
				}
104
				if(org==2){
105
					findBack();
106
				}
103 107
			}
104 108
		},
105 109
		error: function() {
@ -147,8 +151,7 @@ function codeVerification(_this) {
147 151

148 152
//手机发送验证码
149 153
function phoneSend(_this) {
150
	doClick(_this);
151
	phoneVerificationCode(_this);
154
	phoneVal(".username",1)
152 155
}
153 156

154 157
function doClick(_this) {
@ -296,22 +299,20 @@ function submitCodeVal(_this){
296 299

297 300
//邮箱发送
298 301
function findBack(){
299
	if(isEmail){
300
		$.ajax("/ajax/reqRpWithEmail",{
301
			type:"GET",
302
			async: false,
303
			success:function(data){  
304
				if(data.success){
305
					$(".emailOne").addClass("displayNone");
306
					$(".emailTow").removeClass("displayNone");
307
					$("#emailShow").text($("#email").val());
308
				}
309
			},
310
			error:function(){$.MsgBox.Alert('消息', '服务器请求失败')},
311
			data:{"mail":$("#email").val()},
312
			dataType: 'json'
313
		});
314
	}
302
	$.ajax("/ajax/reqRpWithEmail",{
303
		type:"GET",
304
		async: false,
305
		success:function(data){  
306
			if(data.success){
307
				$(".emailOne").addClass("displayNone");
308
				$(".emailTow").removeClass("displayNone");
309
				$("#emailShow").text($("#email").val());
310
			}
311
		},
312
		error:function(){$.MsgBox.Alert('消息', '服务器请求失败')},
313
		data:{"mail":$("#email").val()},
314
		dataType: 'json'
315
	});
315 316
}
316 317

317 318
function findphone(_this){
@ -329,7 +330,6 @@ function findphone(_this){
329 330
						}
330 331
					}else{
331 332
						$(_this).parents(".cmpCoverUl").find(".msgCmp4 span").text("验证超时");
332
						al
333 333
					}
334 334
				},
335 335
				error:function(){$.MsgBox.Alert('消息', '服务器请求失败')},
@ -342,7 +342,7 @@ function findphone(_this){
342 342
//提交登录
343 343
function backPassword(_this, num) {
344 344
	if(num == 1) {
345
		findBack()
345
		emailVal("#email",2)
346 346
	} else if(num == 2) {
347 347
		var url = $("#emailShow").text().split('@')[1];
348 348
        for (var j in hash){  

+ 1 - 1
js/register.js

@ -323,7 +323,7 @@ $(document).ready(function(){
323 323
	function oEmail(){
324 324
		var email = $("#mailAddress").val();
325 325
		
326
		var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
326
		var gunf = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
327 327
		if(email.length==0) {
328 328
			$(".msgLog1").find("span").text("请输入您的邮箱地址");
329 329
			$("#mailAddress").addClass("frmmsg-warning");

+ 2 - 2
login.html

@ -46,7 +46,7 @@
46 46
						<!--短信登录-->
47 47
						<ul class="cmpAllUl cmpCoverUl displayNone">
48 48
							<li>
49
								<input type="phone" class="frmtype frmtypeW username" placeholder="请输入手机号码" onBlur="phoneVal(this)" onfocus="getFocus(this)" onkeyup="checkLoginButtn(this)" />
49
								<input type="phone" class="frmtype frmtypeW username phoneuser" placeholder="请输入手机号码" onBlur="phoneVal(this)" onfocus="getFocus(this)" onkeyup="checkLoginButtn(this)" />
50 50
			    				<div class="frmmsg msgLog1"><span></span></div>
51 51
							</li>
52 52
							<li>
@ -55,7 +55,7 @@
55 55
								    <div class="frmmsg msgCmp03"><span></span></div>
56 56
							    </div>
57 57
							    <div class="col-w-4">
58
							    	<button type="button" disabled class="frmtype frmtypeW btnModel" id="getcode" disabled  onclick="phoneSend(this)">获取验证码</button>
58
							    	<button type="button"  class="frmtype frmtypeW btnModel" id="getcode"   onclick="phoneSend(this)">获取验证码</button>
59 59
							    </div>
60 60
							</li>
61 61
							<li>

+ 1 - 1
pwdFindNew.html

@ -118,7 +118,7 @@
118 118
									    <div class="frmmsg msgCmp03"><span></span></div>
119 119
								    </div>
120 120
								    <div class="col-w-4">
121
								    	<button type="button" disabled class="frmtype frmtypeW btnModel headRadius" id="getcode" onclick="phoneSend(this)">获取验证码</button>
121
								    	<button type="button"  class="frmtype frmtypeW btnModel headRadius" id="getcode" onclick="phoneSend(this)">获取验证码</button>
122 122
								    </div>
123 123
								</li>
124 124
								<li>