function ajax(b) {
app.ajaxLoading = true;
if ((b.loadShow || 2) == 1) { //1隐藏 2显示
app.ajaxLoading = false;
}
$.ajax({
type: b.type ? b.type : 'post',
url: b.url,
dataType: 'json',
data: b.data ? b.data : "",
timeout: 15000,
success: function (data) {
app.ajaxLoading = false;
if (data.result_code == 1) {
if (typeof b.callBack == "function") {
b.callBack(data)
}
} else {
if (typeof b.err == "function") {
b.err(data);
} else {
app.fadeAlert(data.result_msg);
}
}
},
error: function (xhr, type) {
app.ajaxLoading = false;
alert('网络超时,请刷新后再试!');
}
});
}