Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$('.tel').click(function (event) {
var url = getBaseUrl() + '/mip/index/telephone_recording';
var ajaxTimeoutTest = $.ajax({
type: 'POST',
timeout: 3000,
url: url,
data: {type: 'telephone'},
complete: function (XMLHttpRequest, status) {
if (status === 'timeout') {
ajaxTimeoutTest.abort();
// console.log("请求超时");
}
},
dataType: 'json'
});
});
};
function load() {
var requestId = $el.find('#requestId').val();
var questionType = $el.find('#questionType').val();
// $el.find('#loading_pop').addClass('alertactivefalse');
// if (paystart) {
// $el.find('#payalert').addClass('alertactivetrue');
// }
$.ajax({
type: 'GET',
// url: 'data.json'
url: hosturl + 'selectOrderV1?id=' + requestId + '&sessionId=' + sessionId,
async: false,
success: function (data) {
var qusetype = data.questionType;
$el.find('#questionType').val(qusetype);
function orderStatusLabel(status, unpaidAmount) {
if (unpaidAmount === 0) {
return status;
}
else {
return '待支付';
}
}
function getUserCommentContent(pag) {
// var usercomment_date = {};
// var usercomment_date.list = [];
$.ajax({
// url:"user/review",
url: 'user/review?from=index',
type: 'get',
// data: {
// from: pag
// },
success: function (data) {
var commentData = (data.data);
if (!data || !data.data || data.data.length < 1) {
$('.usercomment_div').hide();
return;
}
// for (var i = 0; i < data.data.length; i++) {
// var temp = data.data[i];
function dingComment(index, str, str2, ding, idname) {
var p = '/' + index + '.php?m=' + str2 + '&a=' + ding + '&id=' + str + '&now=' + Math.random();
var htmlobj = $.ajax({url: p, async: false});
$('#' + idname + str).html($.trim(htmlobj.responseText));
}
// 评论顶
}
else {
$('mip-form > form > div.form-group').each(function (k, v) {
if (k > i) {
if ($(this).find('select').length > 0) {
$(this).removeClass('show').addClass('hidden');
}
else {
return false;
}
}
});
}
});
// 初始化银行下拉列表
var ajaxTimeoutTest = $.ajax({
type: 'GET',
timeout: 3000,
url: getBaseUrl() + '/static/mobile/js/bankData.json',
data: {},
success: function (result) {
var option = '';
$.each(result, function (k, v) {
option += '<option value="' + v.bin + '">' + v.bankName + '</option>';
});
$('#anjiefangyinhang,#anjiecheyinhang').append(option);
},
complete: function (XMLHttpRequest, status) {
if (status === 'timeout') {
ajaxTimeoutTest.abort();
}
},
beginRequest: function (channelName, since) {
var url = this._getUrl([channelName], since);
this.ajax = $.ajax({
url: url,
dataType: "json",
context: this,
timeout: ajaxTimeout,
success: function (data, status, xhr) { this._handleResult(data, since); },
error: function (xhr, errorType, error) {
if (errorType !== "timeout" && errorType !== "abort") {
console.warn("Message polling failed: ", error || errorType);
}
if (errorType !== "abort") {
this._repeatRequest(channelName, since, errorType === "timeout" ? null : 5000);
}
}
});
},
ele.addEventListener('click', function () {
var options = {
url: mobileDomain + 'index.php?c=welfare&a=get_user_gift',
type: 'POST',
dataType: 'json',
data: {'gift_id': giftId},
success: function (data) {
if (data.code === 2) {
window.top.location.href = mobileDomain + 'account.php?c=account';
}
else {
showTip(data, 0);
}
}
};
$.ajax(options);
});
};
}
else if (data.code === 1) {
$('#rest_num_' + giftId).html($('#rest_num_' + giftId).html() - 1);
ele.className = ele.className.replace('get_welfare', 'have_getten');
ele.innerHTML = '已领取';
showTip(data, 0);
}
else if (data.code === 10) {
showTip(data, 1);
}
else {
showTip(data, 0);
}
}
};
$.ajax(options);
});
};
fetchFromServer: function(href) {
var req = $.ajax({
data: { ajax: true },
dataType: 'json',
context: this,
timeout: 6000,
url: href,
beforeSend: function() {
mediator.publish('content:get:before');
}
});
req.always(function() {
mediator.publish('content:get:always');
});
req.fail(function() {
mediator.publish('content:get:fail');
});
function jsonpPost(url, data, cb) {
return $.ajax({
type: 'POST',
data: data,
url: url,
dataType: 'jsonp',
success: cb
});
}