...
|
...
|
@@ -9,7 +9,7 @@ var $resendBtn, |
|
|
var page = {
|
|
|
disableAjax: false,
|
|
|
|
|
|
time: 30,
|
|
|
time: 60,
|
|
|
resendText: '重发验证码',
|
|
|
timerId: null,
|
|
|
init: function() {
|
...
|
...
|
@@ -119,9 +119,12 @@ var page = { |
|
|
},
|
|
|
|
|
|
submit: function() {
|
|
|
var self = this;
|
|
|
var code = $.trim($smsCode.val());
|
|
|
|
|
|
if ($nextBtn.prop('disabled')) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
$nextBtn.prop('disabled', this.disableAjax = true);
|
|
|
$.get('/passport/sms_login/check.json', {
|
|
|
code: code
|
...
|
...
|
@@ -129,7 +132,7 @@ var page = { |
|
|
.done(function(res) {
|
|
|
if (res.code === 200) {
|
|
|
location.href = res.redirect;
|
|
|
self.disableAjax = true; // 成功后 disabled, 执行跳转
|
|
|
$nextBtn.off();
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -137,10 +140,9 @@ var page = { |
|
|
})
|
|
|
.fail(function() {
|
|
|
tip.show('出错了, 请重试');
|
|
|
self.disableAjax = false; // 失败后 允许再次 请求
|
|
|
})
|
|
|
.always(function() {
|
|
|
$nextBtn.prop('disabled', self.disableAjax);
|
|
|
$nextBtn.prop('disabled', false);
|
|
|
});
|
|
|
}
|
|
|
};
|
...
|
...
|
|