Authored by shijian

save

... ... @@ -162,8 +162,10 @@ function validateImgCaptcha() {
}()).then(function() {
hideTip($imgCaptchaInput);
ep.emit('captcha-img', true);
return true;
}).fail(function() {
ep.emit('captcha-img', false);
return false;
});
}
... ... @@ -466,8 +468,7 @@ function disableSMSBtn() {
}
exports.init = function() {
$smsCaptchaCtrl.removeClass('disable');
$smsCaptchaCtrl.removeClass('disable')
// 验证手机输入
// $phoneNumInput.on('blur', function() {
// validatePhoneNum();
... ... @@ -479,7 +480,7 @@ exports.init = function() {
// 验证图形输入
$imgCaptchaInput.on('blur', function() {
validateImgCaptcha();
//validateImgCaptcha();
$imgCaptchaInput.removeClass('focus');
}).on('focus', function() {
hideTip($imgCaptchaInput);
... ... @@ -570,19 +571,23 @@ exports.init = function() {
// 点击发送验证码
$smsCaptchaCtrl.on('click', function() {
if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
return;
}
$smsCaptchaCtrl.addClass('disable');
disableSMSBtn();
sendSMSCaptcha().then((data)=>{
if (data.code !== 200) {
errTip($imgCaptchaInput, data.message);
refreshImgCaptcha();
} else {
hideTip($smsCaptchaInput);
// if ($smsCaptchaCtrl.hasClass('disable') || $smsCaptchaCtrl.hasClass('second-progress')) {
// return;
// }
validateImgCaptcha().then(allow=>{
if (allow) {
$smsCaptchaCtrl.addClass('disable');
disableSMSBtn();
sendSMSCaptcha().then((data)=>{
if (data.code !== 200) {
errTip($imgCaptchaInput, data.message);
refreshImgCaptcha();
} else {
hideTip($smsCaptchaInput);
}
});
}
});
});
... ...