Merge branch 'hotfix/verifybtnstatus' into feature/passback
Showing
4 changed files
with
22 additions
and
8 deletions
@@ -43,20 +43,23 @@ class InternationalNew extends Page { | @@ -43,20 +43,23 @@ 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 | + changeLoginBtnStatus(witch) { |
55 | + if (witch === 'mobile') { | ||
54 | // 清除手机号按钮 | 56 | // 清除手机号按钮 |
55 | if (this.selector.mobileInput.val()) { | 57 | if (this.selector.mobileInput.val()) { |
56 | this.selector.clearMobile.removeClass('hide'); | 58 | this.selector.clearMobile.removeClass('hide'); |
57 | } else { | 59 | } else { |
58 | this.selector.clearMobile.addClass('hide'); | 60 | this.selector.clearMobile.addClass('hide'); |
59 | } | 61 | } |
62 | + } | ||
60 | 63 | ||
61 | // 登录按钮 | 64 | // 登录按钮 |
62 | if (this.selector.mobileInput.val() && this.selector.passwordInput.val()) { | 65 | if (this.selector.mobileInput.val() && this.selector.passwordInput.val()) { |
@@ -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,14 +44,18 @@ class Login { | @@ -44,14 +44,18 @@ class Login { | ||
44 | 44 | ||
45 | /** | 45 | /** |
46 | * 输入监听,改变按钮状态 | 46 | * 输入监听,改变按钮状态 |
47 | + * witch | ||
47 | */ | 48 | */ |
48 | - changeBtnStatus() { | 49 | + changeBtnStatus(witch) { |
50 | + | ||
51 | + if (witch === 'username') { | ||
49 | // 清除按钮 | 52 | // 清除按钮 |
50 | if (this.view.usernameInput.val()) { | 53 | if (this.view.usernameInput.val()) { |
51 | this.view.clearUsrname.removeClass('hide'); | 54 | this.view.clearUsrname.removeClass('hide'); |
52 | } else { | 55 | } else { |
53 | this.view.clearUsrname.addClass('hide'); | 56 | this.view.clearUsrname.addClass('hide'); |
54 | } | 57 | } |
58 | + } | ||
55 | 59 | ||
56 | // 登录按钮 | 60 | // 登录按钮 |
57 | if (this.view.usernameInput.val() && this.view.passwordInput.val()) { | 61 | if (this.view.usernameInput.val() && this.view.passwordInput.val()) { |
@@ -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,9 +93,12 @@ class RegisterNew { | @@ -93,9 +93,12 @@ class RegisterNew { | ||
93 | 93 | ||
94 | /** | 94 | /** |
95 | * 输入监听,改变按钮状态 | 95 | * 输入监听,改变按钮状态 |
96 | + * witch | ||
96 | */ | 97 | */ |
97 | - changeBtnStatus() { | 98 | + changeBtnStatus(witch) { |
99 | + | ||
98 | // 获取验证码按钮 | 100 | // 获取验证码按钮 |
101 | + if (witch === 'mobile') { | ||
99 | if (this.view.mobileInput.val()) { | 102 | if (this.view.mobileInput.val()) { |
100 | this.view.getVerifyCodeBtn.addClass('active'); | 103 | this.view.getVerifyCodeBtn.addClass('active'); |
101 | this.view.clearMobile.removeClass('hide'); | 104 | this.view.clearMobile.removeClass('hide'); |
@@ -103,6 +106,7 @@ class RegisterNew { | @@ -103,6 +106,7 @@ class RegisterNew { | ||
103 | this.view.getVerifyCodeBtn.removeClass('active'); | 106 | this.view.getVerifyCodeBtn.removeClass('active'); |
104 | this.view.clearMobile.addClass('hide'); | 107 | this.view.clearMobile.addClass('hide'); |
105 | } | 108 | } |
109 | + } | ||
106 | 110 | ||
107 | // 登录按钮 | 111 | // 登录按钮 |
108 | if (this.view.mobileInput.val() && | 112 | if (this.view.mobileInput.val() && |
@@ -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,9 +91,11 @@ class SmsLoginNew extends Page { | @@ -91,9 +91,11 @@ class SmsLoginNew extends Page { | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | * 输入监听,改变按钮状态 | 93 | * 输入监听,改变按钮状态 |
94 | + * witch | ||
94 | */ | 95 | */ |
95 | - changeBtnStatus() { | 96 | + changeBtnStatus(witch) { |
96 | // 获取验证码按钮 | 97 | // 获取验证码按钮 |
98 | + if (witch === 'mobile') { | ||
97 | if (this.selector.mobileInput.val()) { | 99 | if (this.selector.mobileInput.val()) { |
98 | this.selector.getVerifyCodeBtn.addClass('active'); | 100 | this.selector.getVerifyCodeBtn.addClass('active'); |
99 | this.selector.clearMobile.removeClass('hide'); | 101 | this.selector.clearMobile.removeClass('hide'); |
@@ -101,6 +103,7 @@ class SmsLoginNew extends Page { | @@ -101,6 +103,7 @@ class SmsLoginNew extends Page { | ||
101 | this.selector.getVerifyCodeBtn.removeClass('active'); | 103 | this.selector.getVerifyCodeBtn.removeClass('active'); |
102 | this.selector.clearMobile.addClass('hide'); | 104 | this.selector.clearMobile.addClass('hide'); |
103 | } | 105 | } |
106 | + } | ||
104 | 107 | ||
105 | // 登录按钮 | 108 | // 登录按钮 |
106 | if (this.selector.mobileInput.val() && | 109 | if (this.selector.mobileInput.val() && |
-
Please register or login to post a comment