...
|
...
|
@@ -7,6 +7,7 @@ |
|
|
var $ = require('yoho-jquery');
|
|
|
var tip = require('../plugin/tip');
|
|
|
var checkCard = require('./bind-card-check');
|
|
|
var loading = require('../plugin/loading');
|
|
|
var applyButton = $('.open-btn');
|
|
|
var flag = true;
|
|
|
var formData = {
|
...
|
...
|
@@ -48,9 +49,6 @@ setInterval(function() { |
|
|
}, 500);
|
|
|
|
|
|
applyButton.on('click', function() {
|
|
|
var self = this;
|
|
|
var ret = false;
|
|
|
|
|
|
if (!flag || $(this).hasClass('disabled') || !validateForm()) {
|
|
|
return false;
|
|
|
}
|
...
|
...
|
@@ -60,13 +58,14 @@ applyButton.on('click', function() { |
|
|
return false;
|
|
|
}
|
|
|
|
|
|
loading.showLoadingMask();
|
|
|
|
|
|
flag = false;
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/home/installment/post-account',
|
|
|
data: formData,
|
|
|
async: false,
|
|
|
success: function(data) {
|
|
|
var params = {
|
|
|
action: 'go.bindCardResult',
|
...
|
...
|
@@ -83,24 +82,25 @@ applyButton.on('click', function() { |
|
|
|
|
|
if (data.code === 200) {
|
|
|
params.params.status = 1;
|
|
|
ret = true;
|
|
|
} else if (data.code === 500) {
|
|
|
tip.show('连接超时');
|
|
|
flag = true;
|
|
|
} else {
|
|
|
params.params.message = data.message;
|
|
|
ret = true;
|
|
|
}
|
|
|
|
|
|
url += encodeURIComponent(JSON.stringify(params));
|
|
|
|
|
|
$(self).attr('href', url);
|
|
|
loading.hideLoadingMask();
|
|
|
|
|
|
$('body').append('<a href=' + url + '><span class="jump">&npsb;</span></a>');
|
|
|
|
|
|
$('.jump').click();
|
|
|
},
|
|
|
error: function() {
|
|
|
loading.hideLoadingMask();
|
|
|
tip.show('网络断开连接了~');
|
|
|
flag = true;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return ret;
|
|
|
}); |
...
|
...
|
|