Showing
9 changed files
with
61 additions
and
13 deletions
No preview for this file type
... | @@ -539,7 +539,6 @@ function initMatching(){ | ... | @@ -539,7 +539,6 @@ function initMatching(){ |
539 | if (result.code == -10) { | 539 | if (result.code == -10) { |
540 | // 未登录,跳转的登录界面 | 540 | // 未登录,跳转的登录界面 |
541 | } else if (result.code == 0) { | 541 | } else if (result.code == 0) { |
542 | - | ||
543 | if (func && typeof func == "function") { | 542 | if (func && typeof func == "function") { |
544 | context ? func.call(context, result) : func(result); | 543 | context ? func.call(context, result) : func(result); |
545 | } | 544 | } |
... | @@ -549,7 +548,8 @@ function initMatching(){ | ... | @@ -549,7 +548,8 @@ function initMatching(){ |
549 | } | 548 | } |
550 | if ($obj[0].tagName == "FORM") { | 549 | if ($obj[0].tagName == "FORM") { |
551 | $obj[0].disabled = false; | 550 | $obj[0].disabled = false; |
552 | - $obj.find("input, button").attr('disabled', null); | 551 | + $obj.find("input[type='text'],input[type='password'],input[name='password'], button").attr('disabled', null); |
552 | + | ||
553 | var $but_input = $obj.find('[type=submit]'); | 553 | var $but_input = $obj.find('[type=submit]'); |
554 | if ($but_input.is('button')) { | 554 | if ($but_input.is('button')) { |
555 | $but_input.html(temp); | 555 | $but_input.html(temp); | ... | ... |
... | @@ -384,18 +384,28 @@ | ... | @@ -384,18 +384,28 @@ |
384 | 384 | ||
385 | 385 | ||
386 | that.$c.on('click', '[type=submit],.submit', function(e) { | 386 | that.$c.on('click', '[type=submit],.submit', function(e) { |
387 | + var passWordReg = /^[0-9a-zA-Z]+$/; | ||
387 | e.preventDefault(); | 388 | e.preventDefault(); |
388 | if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){ | 389 | if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){ |
389 | Core.showTips("账号不能有大写字母!"); | 390 | Core.showTips("账号不能有大写字母!"); |
390 | }else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){ | 391 | }else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){ |
391 | Core.showTips("密码不能有大写字母!"); | 392 | Core.showTips("密码不能有大写字母!"); |
393 | + }else if(that.$c.find("input[name='password']").val().length<6 || that.$c.find("input[name='password']").val().length>16){ | ||
394 | + Core.showTips("密码长度为6-16位字符!"); | ||
392 | }else if(!that.$c.find('.checkbox-2').length>0){ | 395 | }else if(!that.$c.find('.checkbox-2').length>0){ |
393 | Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1); | 396 | Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1); |
397 | + }else if(!passWordReg.test(that.$c.find("input[name='password']").val())){ | ||
398 | + Core.showTips('请输入数字字母组成的密码!', true); | ||
399 | + return false; | ||
394 | }else{ | 400 | }else{ |
395 | //如果是游客的话则调用安卓截屏方法 | 401 | //如果是游客的话则调用安卓截屏方法 |
396 | if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){ | 402 | if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){ |
397 | window.android.screenShot(); | 403 | window.android.screenShot(); |
398 | } | 404 | } |
405 | + $(this).attr("disabled",true); | ||
406 | + $(this).css({"background":"#999"}); | ||
407 | + $(this).parent("li").css({"background":"#999"}); | ||
408 | + | ||
399 | Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that); | 409 | Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that); |
400 | } | 410 | } |
401 | return false; | 411 | return false; |
... | @@ -418,21 +428,30 @@ | ... | @@ -418,21 +428,30 @@ |
418 | that.$c.find('[name="old_usernmae"]').val(random_name) | 428 | that.$c.find('[name="old_usernmae"]').val(random_name) |
419 | that.$c.find('[name="password"]').val(random_passwd) | 429 | that.$c.find('[name="password"]').val(random_passwd) |
420 | that.$c.find('[name="type"]').val(-1) | 430 | that.$c.find('[name="type"]').val(-1) |
431 | + that.$c.find("input#btn-regist").attr('disabled', null); | ||
432 | + that.$c.find('.submit').css({"background":"#00beef"}); | ||
433 | + that.$c.find('.submit').parent("li").css({"background":"#00beef"}); | ||
421 | 434 | ||
422 | } | 435 | } |
423 | Register.prototype.cache = Login.prototype.cache; | 436 | Register.prototype.cache = Login.prototype.cache; |
424 | 437 | ||
425 | Register.prototype.register_cb = function(result) { | 438 | Register.prototype.register_cb = function(result) { |
426 | Core.updateData(result.msg); | 439 | Core.updateData(result.msg); |
427 | - Core.first_user = this.$c.find('[name="username"]').val() | 440 | + Core.first_user = this.$c.find('[name="username"]').val(); |
428 | - Core.first_password = this.$c.find('[name="password"]').val() | 441 | + Core.first_password = this.$c.find('[name="password"]').val(); |
442 | + | ||
429 | // 显示一个注册成功信息,并跳转到home | 443 | // 显示一个注册成功信息,并跳转到home |
430 | this.cache(); | 444 | this.cache(); |
431 | Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台'); | 445 | Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台'); |
432 | Core.updateMod('home'); | 446 | Core.updateMod('home'); |
447 | + | ||
448 | + this.$c.find("input#btn-regist").attr('disabled', null); | ||
449 | + this.$c.find('.submit').css({"background":"#00beef"}); | ||
450 | + this.$c.find('.submit').parent("li").css({"background":"#00beef"}); | ||
433 | } | 451 | } |
434 | Register.prototype.show_after = function() { | 452 | Register.prototype.show_after = function() { |
435 | this.set_random(); | 453 | this.set_random(); |
454 | + | ||
436 | } | 455 | } |
437 | Core.registerMod('register', Register); | 456 | Core.registerMod('register', Register); |
438 | 457 | ||
... | @@ -587,9 +606,14 @@ | ... | @@ -587,9 +606,14 @@ |
587 | that.$c.on("click","#js_confirm_resetnewpsw",function(){ | 606 | that.$c.on("click","#js_confirm_resetnewpsw",function(){ |
588 | var NewPsw = that.$c.find("#js_reset_newpsw").val(), | 607 | var NewPsw = that.$c.find("#js_reset_newpsw").val(), |
589 | NewKey = that.$c.find("input[name='pwd_code']").val(), | 608 | NewKey = that.$c.find("input[name='pwd_code']").val(), |
609 | + passWordReg = /^[0-9a-zA-Z]+$/, | ||
590 | account = $("input[name='loginUserName']").val(); | 610 | account = $("input[name='loginUserName']").val(); |
591 | var names = localStorage.getItem('user_names'); | 611 | var names = localStorage.getItem('user_names'); |
592 | names = JSON.parse(names); | 612 | names = JSON.parse(names); |
613 | + if(!passWordReg.test(NewPsw)){ | ||
614 | + Core.showTips('请输入数字字母组成的密码!', true); | ||
615 | + return false; | ||
616 | + } | ||
593 | Core.ajax({ | 617 | Core.ajax({ |
594 | type:"post", | 618 | type:"post", |
595 | url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw, | 619 | url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw, | ... | ... |
... | @@ -159,7 +159,7 @@ | ... | @@ -159,7 +159,7 @@ |
159 | <input type="hidden" name="type" value="-1"> | 159 | <input type="hidden" name="type" value="-1"> |
160 | <ul class="inline-btn"> | 160 | <ul class="inline-btn"> |
161 | <li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li> | 161 | <li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li> |
162 | - <li><a class="submit btn larg " >确定注册</a></li> | 162 | + <li><input type="button" class="submit btn larg" id="btn-regist" value="确定注册"></li> |
163 | </ul> | 163 | </ul> |
164 | </form> | 164 | </form> |
165 | </div> | 165 | </div> |
... | @@ -654,7 +654,7 @@ | ... | @@ -654,7 +654,7 @@ |
654 | <i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i> | 654 | <i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i> |
655 | <label> | 655 | <label> |
656 | 656 | ||
657 | - <input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入6-18位字母或数字{{??}}请输入旧密码{{?}}" required/> | 657 | + <input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入3-18位字母或数字{{??}}请输入旧密码{{?}}" required/> |
658 | </label> | 658 | </label> |
659 | </div> | 659 | </div> |
660 | <div class="input new-sdk-psw clearfix"> | 660 | <div class="input new-sdk-psw clearfix"> | ... | ... |
No preview for this file type
... | @@ -539,7 +539,6 @@ function initMatching(){ | ... | @@ -539,7 +539,6 @@ function initMatching(){ |
539 | if (result.code == -10) { | 539 | if (result.code == -10) { |
540 | // 未登录,跳转的登录界面 | 540 | // 未登录,跳转的登录界面 |
541 | } else if (result.code == 0) { | 541 | } else if (result.code == 0) { |
542 | - | ||
543 | if (func && typeof func == "function") { | 542 | if (func && typeof func == "function") { |
544 | context ? func.call(context, result) : func(result); | 543 | context ? func.call(context, result) : func(result); |
545 | } | 544 | } |
... | @@ -549,7 +548,8 @@ function initMatching(){ | ... | @@ -549,7 +548,8 @@ function initMatching(){ |
549 | } | 548 | } |
550 | if ($obj[0].tagName == "FORM") { | 549 | if ($obj[0].tagName == "FORM") { |
551 | $obj[0].disabled = false; | 550 | $obj[0].disabled = false; |
552 | - $obj.find("input, button").attr('disabled', null); | 551 | + $obj.find("input[type='text'],input[type='password'],input[name='password'], button").attr('disabled', null); |
552 | + | ||
553 | var $but_input = $obj.find('[type=submit]'); | 553 | var $but_input = $obj.find('[type=submit]'); |
554 | if ($but_input.is('button')) { | 554 | if ($but_input.is('button')) { |
555 | $but_input.html(temp); | 555 | $but_input.html(temp); | ... | ... |
... | @@ -384,18 +384,28 @@ | ... | @@ -384,18 +384,28 @@ |
384 | 384 | ||
385 | 385 | ||
386 | that.$c.on('click', '[type=submit],.submit', function(e) { | 386 | that.$c.on('click', '[type=submit],.submit', function(e) { |
387 | + var passWordReg = /^[0-9a-zA-Z]+$/; | ||
387 | e.preventDefault(); | 388 | e.preventDefault(); |
388 | if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){ | 389 | if(/[A-Z]/.test(that.$c.find("input[name='username']").val())){ |
389 | Core.showTips("账号不能有大写字母!"); | 390 | Core.showTips("账号不能有大写字母!"); |
390 | }else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){ | 391 | }else if(/[A-Z]/.test(that.$c.find("input[name='password']").val())){ |
391 | Core.showTips("密码不能有大写字母!"); | 392 | Core.showTips("密码不能有大写字母!"); |
393 | + }else if(that.$c.find("input[name='password']").val().length<6 || that.$c.find("input[name='password']").val().length>16){ | ||
394 | + Core.showTips("密码长度为6-16位字符!"); | ||
392 | }else if(!that.$c.find('.checkbox-2').length>0){ | 395 | }else if(!that.$c.find('.checkbox-2').length>0){ |
393 | Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1); | 396 | Core.showTips('请同意'+Core.PLATFORM_NAME+'网络协议',1); |
397 | + }else if(!passWordReg.test(that.$c.find("input[name='password']").val())){ | ||
398 | + Core.showTips('请输入数字字母组成的密码!', true); | ||
399 | + return false; | ||
394 | }else{ | 400 | }else{ |
395 | //如果是游客的话则调用安卓截屏方法 | 401 | //如果是游客的话则调用安卓截屏方法 |
396 | if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){ | 402 | if (that.$c.find('[name="username"]').val() == that.$c.find('[name="old_usernmae"]').val() && window.android != undefined && window.android.screenShot != undefined ){ |
397 | window.android.screenShot(); | 403 | window.android.screenShot(); |
398 | } | 404 | } |
405 | + $(this).attr("disabled",true); | ||
406 | + $(this).css({"background":"#999"}); | ||
407 | + $(this).parent("li").css({"background":"#999"}); | ||
408 | + | ||
399 | Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that); | 409 | Core.ajax_do(that.$c.find('.ajax'), that.register_cb, that); |
400 | } | 410 | } |
401 | return false; | 411 | return false; |
... | @@ -418,21 +428,30 @@ | ... | @@ -418,21 +428,30 @@ |
418 | that.$c.find('[name="old_usernmae"]').val(random_name) | 428 | that.$c.find('[name="old_usernmae"]').val(random_name) |
419 | that.$c.find('[name="password"]').val(random_passwd) | 429 | that.$c.find('[name="password"]').val(random_passwd) |
420 | that.$c.find('[name="type"]').val(-1) | 430 | that.$c.find('[name="type"]').val(-1) |
431 | + that.$c.find("input#btn-regist").attr('disabled', null); | ||
432 | + that.$c.find('.submit').css({"background":"#00beef"}); | ||
433 | + that.$c.find('.submit').parent("li").css({"background":"#00beef"}); | ||
421 | 434 | ||
422 | } | 435 | } |
423 | Register.prototype.cache = Login.prototype.cache; | 436 | Register.prototype.cache = Login.prototype.cache; |
424 | 437 | ||
425 | Register.prototype.register_cb = function(result) { | 438 | Register.prototype.register_cb = function(result) { |
426 | Core.updateData(result.msg); | 439 | Core.updateData(result.msg); |
427 | - Core.first_user = this.$c.find('[name="username"]').val() | 440 | + Core.first_user = this.$c.find('[name="username"]').val(); |
428 | - Core.first_password = this.$c.find('[name="password"]').val() | 441 | + Core.first_password = this.$c.find('[name="password"]').val(); |
442 | + | ||
429 | // 显示一个注册成功信息,并跳转到home | 443 | // 显示一个注册成功信息,并跳转到home |
430 | this.cache(); | 444 | this.cache(); |
431 | Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台'); | 445 | Core.showTips('成功注册,欢迎使用' + Core.PLATFORM_NAME + '手游平台'); |
432 | Core.updateMod('home'); | 446 | Core.updateMod('home'); |
447 | + | ||
448 | + this.$c.find("input#btn-regist").attr('disabled', null); | ||
449 | + this.$c.find('.submit').css({"background":"#00beef"}); | ||
450 | + this.$c.find('.submit').parent("li").css({"background":"#00beef"}); | ||
433 | } | 451 | } |
434 | Register.prototype.show_after = function() { | 452 | Register.prototype.show_after = function() { |
435 | this.set_random(); | 453 | this.set_random(); |
454 | + | ||
436 | } | 455 | } |
437 | Core.registerMod('register', Register); | 456 | Core.registerMod('register', Register); |
438 | 457 | ||
... | @@ -587,9 +606,14 @@ | ... | @@ -587,9 +606,14 @@ |
587 | that.$c.on("click","#js_confirm_resetnewpsw",function(){ | 606 | that.$c.on("click","#js_confirm_resetnewpsw",function(){ |
588 | var NewPsw = that.$c.find("#js_reset_newpsw").val(), | 607 | var NewPsw = that.$c.find("#js_reset_newpsw").val(), |
589 | NewKey = that.$c.find("input[name='pwd_code']").val(), | 608 | NewKey = that.$c.find("input[name='pwd_code']").val(), |
609 | + passWordReg = /^[0-9a-zA-Z]+$/, | ||
590 | account = $("input[name='loginUserName']").val(); | 610 | account = $("input[name='loginUserName']").val(); |
591 | var names = localStorage.getItem('user_names'); | 611 | var names = localStorage.getItem('user_names'); |
592 | names = JSON.parse(names); | 612 | names = JSON.parse(names); |
613 | + if(!passWordReg.test(NewPsw)){ | ||
614 | + Core.showTips('请输入数字字母组成的密码!', true); | ||
615 | + return false; | ||
616 | + } | ||
593 | Core.ajax({ | 617 | Core.ajax({ |
594 | type:"post", | 618 | type:"post", |
595 | url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw, | 619 | url:"/user/reset_passwd?pwd_code="+NewKey+"&password="+NewPsw, | ... | ... |
... | @@ -159,7 +159,7 @@ | ... | @@ -159,7 +159,7 @@ |
159 | <input type="hidden" name="type" value="-1"> | 159 | <input type="hidden" name="type" value="-1"> |
160 | <ul class="inline-btn"> | 160 | <ul class="inline-btn"> |
161 | <li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li> | 161 | <li><a class="btn btn_pri_block btn-orange" href="#home">返回</a></li> |
162 | - <li><a class="submit btn larg " >确定注册</a></li> | 162 | + <li><input type="button" class="submit btn larg" id="btn-regist" value="确定注册"></li> |
163 | </ul> | 163 | </ul> |
164 | </form> | 164 | </form> |
165 | </div> | 165 | </div> |
... | @@ -654,7 +654,7 @@ | ... | @@ -654,7 +654,7 @@ |
654 | <i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i> | 654 | <i>{{? Core.Data.is_guest == 1}}正式账号:{{??}}旧密码:{{?}}</i> |
655 | <label> | 655 | <label> |
656 | 656 | ||
657 | - <input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入6-18位字母或数字{{??}}请输入旧密码{{?}}" required/> | 657 | + <input {{? Core.Data.is_guest == 1}}type="text"{{??}}type="password"{{?}} class="old_pwd required " name="{{? Core.Data.is_guest >= 1}}username{{??}}password{{?}}" value="{{? Core.Data.new_pwd}}{{=Core.Data.new_pwd}}{{?}}" required="required" placeholder="{{? Core.Data.is_guest == 1}}请输入3-18位字母或数字{{??}}请输入旧密码{{?}}" required/> |
658 | </label> | 658 | </label> |
659 | </div> | 659 | </div> |
660 | <div class="input new-sdk-psw clearfix"> | 660 | <div class="input new-sdk-psw clearfix"> | ... | ... |
-
Please register or login to post a comment