...
|
...
|
@@ -37,6 +37,10 @@ function errTip(ele, msg) { |
|
|
}).removeClass('hide');
|
|
|
}
|
|
|
|
|
|
function hideTip() {
|
|
|
return $errTip.addClass('hide');
|
|
|
}
|
|
|
|
|
|
require('yoho-jquery-placeholder');
|
|
|
|
|
|
function refreshImgCaptcha() {
|
...
|
...
|
@@ -147,7 +151,7 @@ function validateImgCaptchaLocal() { |
|
|
}
|
|
|
|
|
|
function validateImgCaptchaAsync() {
|
|
|
$.ajax({
|
|
|
return $.ajax({
|
|
|
type: 'POST',
|
|
|
url: '/passport/images/check',
|
|
|
data: {
|
...
|
...
|
@@ -172,7 +176,7 @@ function validateImgCaptcha() { |
|
|
if (result) {
|
|
|
defer.resolve(true);
|
|
|
} else {
|
|
|
errTip($phone, '验证码不正确');
|
|
|
errTip($imgCaptchaInput, '验证码不正确');
|
|
|
defer.reject(false);
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -200,6 +204,7 @@ $imgCaptchaInput.attr('maxlength', 4); |
|
|
$('input').placeholder();
|
|
|
|
|
|
exports.init = function() {
|
|
|
|
|
|
ep.tail('phone-num', 'captcha-img', function(phoneAuth, imgAuth) {
|
|
|
if (phoneAuth && imgAuth) {
|
|
|
$nextBtn.removeClass('disable');
|
...
|
...
|
@@ -208,6 +213,18 @@ exports.init = function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
ep.on('phone-num', function(auth) {
|
|
|
if (auth) {
|
|
|
hideTip();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
ep.on('captcha-img', function(auth) {
|
|
|
if (auth) {
|
|
|
hideTip();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$imgCaptchaInput.on('blur', function() {
|
|
|
validateImgCaptcha();
|
|
|
});
|
...
|
...
|
@@ -234,10 +251,6 @@ exports.init = function() { |
|
|
nextStep(url);
|
|
|
});
|
|
|
|
|
|
$phoneNumInput.on('blur', function() {
|
|
|
validatePhoneNum();
|
|
|
});
|
|
|
|
|
|
$('.change-captcha, #captcha-img').on('click', function() {
|
|
|
refreshImgCaptcha();
|
|
|
});
|
...
|
...
|
|