|
@@ -7,6 +7,7 @@ |
|
@@ -7,6 +7,7 @@ |
7
|
var $ = require('yoho-jquery');
|
7
|
var $ = require('yoho-jquery');
|
8
|
var tip = require('../plugin/tip');
|
8
|
var tip = require('../plugin/tip');
|
9
|
var checkCard = require('./bind-card-check');
|
9
|
var checkCard = require('./bind-card-check');
|
|
|
10
|
+var loading = require('../plugin/loading');
|
10
|
var applyButton = $('.open-btn');
|
11
|
var applyButton = $('.open-btn');
|
11
|
var flag = true;
|
12
|
var flag = true;
|
12
|
var formData = {
|
13
|
var formData = {
|
|
@@ -48,9 +49,6 @@ setInterval(function() { |
|
@@ -48,9 +49,6 @@ setInterval(function() { |
48
|
}, 500);
|
49
|
}, 500);
|
49
|
|
50
|
|
50
|
applyButton.on('click', function() {
|
51
|
applyButton.on('click', function() {
|
51
|
- var self = this;
|
|
|
52
|
- var ret = false;
|
|
|
53
|
-
|
|
|
54
|
if (!flag || $(this).hasClass('disabled') || !validateForm()) {
|
52
|
if (!flag || $(this).hasClass('disabled') || !validateForm()) {
|
55
|
return false;
|
53
|
return false;
|
56
|
}
|
54
|
}
|
|
@@ -60,13 +58,14 @@ applyButton.on('click', function() { |
|
@@ -60,13 +58,14 @@ applyButton.on('click', function() { |
60
|
return false;
|
58
|
return false;
|
61
|
}
|
59
|
}
|
62
|
|
60
|
|
|
|
61
|
+ loading.showLoadingMask();
|
|
|
62
|
+
|
63
|
flag = false;
|
63
|
flag = false;
|
64
|
|
64
|
|
65
|
$.ajax({
|
65
|
$.ajax({
|
66
|
type: 'GET',
|
66
|
type: 'GET',
|
67
|
url: '/home/installment/post-account',
|
67
|
url: '/home/installment/post-account',
|
68
|
data: formData,
|
68
|
data: formData,
|
69
|
- async: false,
|
|
|
70
|
success: function(data) {
|
69
|
success: function(data) {
|
71
|
var params = {
|
70
|
var params = {
|
72
|
action: 'go.bindCardResult',
|
71
|
action: 'go.bindCardResult',
|
|
@@ -83,24 +82,25 @@ applyButton.on('click', function() { |
|
@@ -83,24 +82,25 @@ applyButton.on('click', function() { |
83
|
|
82
|
|
84
|
if (data.code === 200) {
|
83
|
if (data.code === 200) {
|
85
|
params.params.status = 1;
|
84
|
params.params.status = 1;
|
86
|
- ret = true;
|
|
|
87
|
} else if (data.code === 500) {
|
85
|
} else if (data.code === 500) {
|
88
|
tip.show('连接超时');
|
86
|
tip.show('连接超时');
|
89
|
flag = true;
|
87
|
flag = true;
|
90
|
} else {
|
88
|
} else {
|
91
|
params.params.message = data.message;
|
89
|
params.params.message = data.message;
|
92
|
- ret = true;
|
|
|
93
|
}
|
90
|
}
|
94
|
|
91
|
|
95
|
url += encodeURIComponent(JSON.stringify(params));
|
92
|
url += encodeURIComponent(JSON.stringify(params));
|
96
|
|
93
|
|
97
|
- $(self).attr('href', url);
|
94
|
+ loading.hideLoadingMask();
|
|
|
95
|
+
|
|
|
96
|
+ $('body').append('<a href=' + url + '><span class="jump">&npsb;</span></a>');
|
|
|
97
|
+
|
|
|
98
|
+ $('.jump').click();
|
98
|
},
|
99
|
},
|
99
|
error: function() {
|
100
|
error: function() {
|
|
|
101
|
+ loading.hideLoadingMask();
|
100
|
tip.show('网络断开连接了~');
|
102
|
tip.show('网络断开连接了~');
|
101
|
flag = true;
|
103
|
flag = true;
|
102
|
}
|
104
|
}
|
103
|
});
|
105
|
});
|
104
|
-
|
|
|
105
|
- return ret;
|
|
|
106
|
}); |
106
|
}); |