...
|
...
|
@@ -29,6 +29,7 @@ var $remember = $('.remember-me'); |
|
|
|
|
|
var captchaUrl = '/passport/images?t='; // /passport/images?t=1454464125
|
|
|
|
|
|
var showCaptcha = false;
|
|
|
var $captchaWrap = $('.captcha-wrap'),
|
|
|
$captchaImg = $captchaWrap.find('#captcha-img');
|
|
|
|
...
|
...
|
@@ -47,6 +48,10 @@ var selectedIcon = ''; |
|
|
|
|
|
require('yoho-jquery-placeholder');
|
|
|
|
|
|
function refreshCaptcha() {
|
|
|
$captchaImg.attr('src', captchaUrl + $.now());
|
|
|
}
|
|
|
|
|
|
function errTip(ele, msg) {
|
|
|
var $errTip = ele.next('.tips');
|
|
|
var $errMsg = $errTip.find('.content');
|
...
|
...
|
@@ -189,6 +194,7 @@ function validateCaptchaLocal() { |
|
|
// 密码错误次数,超过三次显示验证码
|
|
|
function showAccountErrTimes() {
|
|
|
$captchaWrap.removeClass('hide');
|
|
|
showCaptcha = true;
|
|
|
$captchaImg.attr('src', captchaUrl + $.now());
|
|
|
$imgCaptchaInput.val('');
|
|
|
}
|
...
|
...
|
@@ -425,3 +431,27 @@ $('input.va').on('keypress', function(e) { |
|
|
|
|
|
// 首次触发
|
|
|
$imgCaptchaInput.triggerHandler('blur');
|
|
|
|
|
|
|
|
|
$('.login-page .switch > div').off().on('click', function() {
|
|
|
var type = $(this).data('type');
|
|
|
|
|
|
if (type === 'PasswordLogin') {
|
|
|
$('.pwd-wrap').toggleClass('hide');
|
|
|
$('.sms-code-wrap').toggleClass('hide');
|
|
|
if (!showCaptcha) {
|
|
|
$('.captcha-wrap').addClass('hide');
|
|
|
} else {
|
|
|
refreshCaptcha();
|
|
|
}
|
|
|
} else if (type === 'SMSLogin') {
|
|
|
$('.pwd-wrap').toggleClass('hide');
|
|
|
$('.sms-code-wrap').toggleClass('hide');
|
|
|
$('.captcha-wrap').removeClass('hide');
|
|
|
refreshCaptcha();
|
|
|
}
|
|
|
|
|
|
$('.login-page .switch > div').removeClass('selected');
|
|
|
$(this).addClass('selected');
|
|
|
|
|
|
}); |
...
|
...
|
|