Showing
1 changed file
with
21 additions
and
16 deletions
@@ -162,8 +162,10 @@ function validateImgCaptcha() { | @@ -162,8 +162,10 @@ function validateImgCaptcha() { | ||
162 | }()).then(function() { | 162 | }()).then(function() { |
163 | hideTip($imgCaptchaInput); | 163 | hideTip($imgCaptchaInput); |
164 | ep.emit('captcha-img', true); | 164 | ep.emit('captcha-img', true); |
165 | + return true; | ||
165 | }).fail(function() { | 166 | }).fail(function() { |
166 | ep.emit('captcha-img', false); | 167 | ep.emit('captcha-img', false); |
168 | + return false; | ||
167 | }); | 169 | }); |
168 | } | 170 | } |
169 | 171 | ||
@@ -466,8 +468,7 @@ function disableSMSBtn() { | @@ -466,8 +468,7 @@ function disableSMSBtn() { | ||
466 | } | 468 | } |
467 | 469 | ||
468 | exports.init = function() { | 470 | exports.init = function() { |
469 | - $smsCaptchaCtrl.removeClass('disable'); | ||
470 | - | 471 | + $smsCaptchaCtrl.removeClass('disable') |
471 | // 验证手机输入 | 472 | // 验证手机输入 |
472 | // $phoneNumInput.on('blur', function() { | 473 | // $phoneNumInput.on('blur', function() { |
473 | // validatePhoneNum(); | 474 | // validatePhoneNum(); |
@@ -479,7 +480,7 @@ exports.init = function() { | @@ -479,7 +480,7 @@ exports.init = function() { | ||
479 | 480 | ||
480 | // 验证图形输入 | 481 | // 验证图形输入 |
481 | $imgCaptchaInput.on('blur', function() { | 482 | $imgCaptchaInput.on('blur', function() { |
482 | - validateImgCaptcha(); | 483 | + //validateImgCaptcha(); |
483 | $imgCaptchaInput.removeClass('focus'); | 484 | $imgCaptchaInput.removeClass('focus'); |
484 | }).on('focus', function() { | 485 | }).on('focus', function() { |
485 | hideTip($imgCaptchaInput); | 486 | hideTip($imgCaptchaInput); |
@@ -570,19 +571,23 @@ exports.init = function() { | @@ -570,19 +571,23 @@ exports.init = function() { | ||
570 | 571 | ||
571 | // 点击发送验证码 | 572 | // 点击发送验证码 |
572 | $smsCaptchaCtrl.on('click', function() { | 573 | $smsCaptchaCtrl.on('click', function() { |
573 | - if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) { | ||
574 | - return; | ||
575 | - } | ||
576 | - | ||
577 | - $smsCaptchaCtrl.addClass('disable'); | ||
578 | - disableSMSBtn(); | ||
579 | - | ||
580 | - sendSMSCaptcha().then((data)=>{ | ||
581 | - if (data.code !== 200) { | ||
582 | - errTip($imgCaptchaInput, data.message); | ||
583 | - refreshImgCaptcha(); | ||
584 | - } else { | ||
585 | - hideTip($smsCaptchaInput); | 574 | + // if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) { |
575 | + // return; | ||
576 | + // } | ||
577 | + | ||
578 | + validateImgCaptcha().then(allow=>{ | ||
579 | + if (allow) { | ||
580 | + $smsCaptchaCtrl.addClass('disable'); | ||
581 | + disableSMSBtn(); | ||
582 | + | ||
583 | + sendSMSCaptcha().then((data)=>{ | ||
584 | + if (data.code !== 200) { | ||
585 | + errTip($imgCaptchaInput, data.message); | ||
586 | + refreshImgCaptcha(); | ||
587 | + } else { | ||
588 | + hideTip($smsCaptchaInput); | ||
589 | + } | ||
590 | + }); | ||
586 | } | 591 | } |
587 | }); | 592 | }); |
588 | }); | 593 | }); |
-
Please register or login to post a comment