Merge branch 'hotfix/verifybtnstatus' into feature/passback
Showing
4 changed files
with
44 additions
and
30 deletions
@@ -43,19 +43,22 @@ class InternationalNew extends Page { | @@ -43,19 +43,22 @@ class InternationalNew extends Page { | ||
43 | this.selector.clearMobile.on('click', this.clearMobile.bind(this)); | 43 | this.selector.clearMobile.on('click', this.clearMobile.bind(this)); |
44 | this.selector.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); | 44 | this.selector.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); |
45 | this.selector.internationalLoginBtn.on('click', this.internationalLogin.bind(this)); | 45 | this.selector.internationalLoginBtn.on('click', this.internationalLogin.bind(this)); |
46 | - this.selector.mobileInput.bind('input', this.changeLoginBtnStatus.bind(this)); | 46 | + this.selector.mobileInput.bind('input', this.changeLoginBtnStatus.bind(this, 'mobile')); |
47 | this.selector.passwordInput.bind('input', this.changeLoginBtnStatus.bind(this)); | 47 | this.selector.passwordInput.bind('input', this.changeLoginBtnStatus.bind(this)); |
48 | } | 48 | } |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * 改变登录按钮的状态 | 51 | * 改变登录按钮的状态 |
52 | + * witch | ||
52 | */ | 53 | */ |
53 | - changeLoginBtnStatus() { | ||
54 | - // 清除手机号按钮 | ||
55 | - if (this.selector.mobileInput.val()) { | ||
56 | - this.selector.clearMobile.removeClass('hide'); | ||
57 | - } else { | ||
58 | - this.selector.clearMobile.addClass('hide'); | 54 | + changeLoginBtnStatus(witch) { |
55 | + if (witch === 'mobile') { | ||
56 | + // 清除手机号按钮 | ||
57 | + if (this.selector.mobileInput.val()) { | ||
58 | + this.selector.clearMobile.removeClass('hide'); | ||
59 | + } else { | ||
60 | + this.selector.clearMobile.addClass('hide'); | ||
61 | + } | ||
59 | } | 62 | } |
60 | 63 | ||
61 | // 登录按钮 | 64 | // 登录按钮 |
@@ -34,7 +34,7 @@ class Login { | @@ -34,7 +34,7 @@ class Login { | ||
34 | this.view.getPswrdBtn.on('click', this.showGetPasswordBox.bind(this)); | 34 | this.view.getPswrdBtn.on('click', this.showGetPasswordBox.bind(this)); |
35 | this.view.getPasswordBox.on('click', this.hiddenGetPasswordBox.bind(this)); | 35 | this.view.getPasswordBox.on('click', this.hiddenGetPasswordBox.bind(this)); |
36 | this.view.showYohoFamilyTip.on('click', this.showYohoFamilyTip.bind(this)); | 36 | this.view.showYohoFamilyTip.on('click', this.showYohoFamilyTip.bind(this)); |
37 | - this.view.usernameInput.bind('input', this.changeBtnStatus.bind(this)); | 37 | + this.view.usernameInput.bind('input', this.changeBtnStatus.bind(this, 'username')); |
38 | this.view.passwordInput.bind('input', this.changeBtnStatus.bind(this)); | 38 | this.view.passwordInput.bind('input', this.changeBtnStatus.bind(this)); |
39 | 39 | ||
40 | if ($captcha.data('userverify')) { | 40 | if ($captcha.data('userverify')) { |
@@ -44,13 +44,17 @@ class Login { | @@ -44,13 +44,17 @@ class Login { | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * 输入监听,改变按钮状态 | 46 | * 输入监听,改变按钮状态 |
47 | + * witch | ||
47 | */ | 48 | */ |
48 | - changeBtnStatus() { | ||
49 | - // 清除按钮 | ||
50 | - if (this.view.usernameInput.val()) { | ||
51 | - this.view.clearUsrname.removeClass('hide'); | ||
52 | - } else { | ||
53 | - this.view.clearUsrname.addClass('hide'); | 49 | + changeBtnStatus(witch) { |
50 | + | ||
51 | + if (witch === 'username') { | ||
52 | + // 清除按钮 | ||
53 | + if (this.view.usernameInput.val()) { | ||
54 | + this.view.clearUsrname.removeClass('hide'); | ||
55 | + } else { | ||
56 | + this.view.clearUsrname.addClass('hide'); | ||
57 | + } | ||
54 | } | 58 | } |
55 | 59 | ||
56 | // 登录按钮 | 60 | // 登录按钮 |
@@ -36,7 +36,7 @@ class RegisterNew { | @@ -36,7 +36,7 @@ class RegisterNew { | ||
36 | 36 | ||
37 | this.view.clearMobile.on('click', this.clearMobile.bind(this)); | 37 | this.view.clearMobile.on('click', this.clearMobile.bind(this)); |
38 | this.view.regBtn.on('click', this.register.bind(this)); | 38 | this.view.regBtn.on('click', this.register.bind(this)); |
39 | - this.view.mobileInput.bind('input', this.changeBtnStatus.bind(this)); | 39 | + this.view.mobileInput.bind('input', this.changeBtnStatus.bind(this, 'mobile')); |
40 | this.view.verifyCodeInput.bind('input', this.changeBtnStatus.bind(this)); | 40 | this.view.verifyCodeInput.bind('input', this.changeBtnStatus.bind(this)); |
41 | this.view.passwordInput.bind('input', this.changeBtnStatus.bind(this)); | 41 | this.view.passwordInput.bind('input', this.changeBtnStatus.bind(this)); |
42 | this.view.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); | 42 | this.view.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this)); |
@@ -93,15 +93,19 @@ class RegisterNew { | @@ -93,15 +93,19 @@ class RegisterNew { | ||
93 | 93 | ||
94 | /** | 94 | /** |
95 | * 输入监听,改变按钮状态 | 95 | * 输入监听,改变按钮状态 |
96 | + * witch | ||
96 | */ | 97 | */ |
97 | - changeBtnStatus() { | 98 | + changeBtnStatus(witch) { |
99 | + | ||
98 | // 获取验证码按钮 | 100 | // 获取验证码按钮 |
99 | - if (this.view.mobileInput.val()) { | ||
100 | - this.view.getVerifyCodeBtn.addClass('active'); | ||
101 | - this.view.clearMobile.removeClass('hide'); | ||
102 | - } else { | ||
103 | - this.view.getVerifyCodeBtn.removeClass('active'); | ||
104 | - this.view.clearMobile.addClass('hide'); | 101 | + if (witch === 'mobile') { |
102 | + if (this.view.mobileInput.val()) { | ||
103 | + this.view.getVerifyCodeBtn.addClass('active'); | ||
104 | + this.view.clearMobile.removeClass('hide'); | ||
105 | + } else { | ||
106 | + this.view.getVerifyCodeBtn.removeClass('active'); | ||
107 | + this.view.clearMobile.addClass('hide'); | ||
108 | + } | ||
105 | } | 109 | } |
106 | 110 | ||
107 | // 登录按钮 | 111 | // 登录按钮 |
@@ -49,7 +49,7 @@ class SmsLoginNew extends Page { | @@ -49,7 +49,7 @@ class SmsLoginNew extends Page { | ||
49 | */ | 49 | */ |
50 | bindEvents() { | 50 | bindEvents() { |
51 | this.selector.clearMobile.on('click', this.clearMobile.bind(this)); | 51 | this.selector.clearMobile.on('click', this.clearMobile.bind(this)); |
52 | - this.selector.mobileInput.bind('input', this.changeBtnStatus.bind(this)); | 52 | + this.selector.mobileInput.bind('input', this.changeBtnStatus.bind(this, 'mobile')); |
53 | this.selector.verifyCode.bind('input', this.changeBtnStatus.bind(this)); | 53 | this.selector.verifyCode.bind('input', this.changeBtnStatus.bind(this)); |
54 | this.selector.smsLoginBtn.on('click', this.login.bind(this)); | 54 | this.selector.smsLoginBtn.on('click', this.login.bind(this)); |
55 | this.selector.getPswrdBtn.on('click', this.showGetPasswordBox.bind(this)); | 55 | this.selector.getPswrdBtn.on('click', this.showGetPasswordBox.bind(this)); |
@@ -91,15 +91,18 @@ class SmsLoginNew extends Page { | @@ -91,15 +91,18 @@ class SmsLoginNew extends Page { | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | * 输入监听,改变按钮状态 | 93 | * 输入监听,改变按钮状态 |
94 | + * witch | ||
94 | */ | 95 | */ |
95 | - changeBtnStatus() { | 96 | + changeBtnStatus(witch) { |
96 | // 获取验证码按钮 | 97 | // 获取验证码按钮 |
97 | - if (this.selector.mobileInput.val()) { | ||
98 | - this.selector.getVerifyCodeBtn.addClass('active'); | ||
99 | - this.selector.clearMobile.removeClass('hide'); | ||
100 | - } else { | ||
101 | - this.selector.getVerifyCodeBtn.removeClass('active'); | ||
102 | - this.selector.clearMobile.addClass('hide'); | 98 | + if (witch === 'mobile') { |
99 | + if (this.selector.mobileInput.val()) { | ||
100 | + this.selector.getVerifyCodeBtn.addClass('active'); | ||
101 | + this.selector.clearMobile.removeClass('hide'); | ||
102 | + } else { | ||
103 | + this.selector.getVerifyCodeBtn.removeClass('active'); | ||
104 | + this.selector.clearMobile.addClass('hide'); | ||
105 | + } | ||
103 | } | 106 | } |
104 | 107 | ||
105 | // 登录按钮 | 108 | // 登录按钮 |
-
Please register or login to post a comment