$(document).ready(function () {
let url = window.location.search;
let id;
let data;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(
decodeURI(strs[i].split("=")[1])
);
}
}
let tabId = theRequest.TabId || 1;
// 接口调用-数据获取-反差列表
function getData() {
$.ajax({
type: "post",
url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/home_url_list",
dataType: "json",
data: {
//async: false,
token: "b8e3bb6ef8747d7",
page: tabId,
size: 50,
},
success: function (res) {
console.log(res);
let arr = ["永久地址1", "永久地址2", "安卓客户端", "苹果客户端", "苹果客户端2", "苹果客户端3", "导航通知", "游戏1", "游戏2", "游戏3", "游戏4", "游戏5", "游戏6", "游戏7", "游戏8"];
data = res.data;
$(".SLHeader p").text(`反差内容( ${res.all_count} )`);
let AppleListHTML = "";
$.each(data, function (index, value) {
AppleListHTML += `
`;
});
$("#AppleList").html(AppleListHTML);
},
complete: function (res, status) {
// console.log(res);
// $("#page").paging({
// pageNo: tabId,
// totalPage: Math.ceil(res.responseJSON.all_count / 50),
// callback: function (num) {
// window.location.href =
// "https://api.9169kkxstzsjkdd222.app/feedback?TabId=" + num;
// },
// });
$(".HoutaiContainerBottomAppleListHeaderCZhf").on("click", function () {
id = $(this).attr("id");
let content = $(this).attr("content");
$(".HoutaiContainerDialogAdd").show();
$("#feedbackContent").val(content);
});
},
});
}
getData();
// 功能-新增-反差内容-弹窗隐藏
$(".HoutaiContainerDialogLine5LeftAdd").on("click", function () {
$(".HoutaiContainerDialogAdd").hide();
});
// 功能-新增-反差内容-确认新增
$(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
var formFile = new FormData();
formFile.append("id", id);
formFile.append(
"url",
$("#feedbackContent").val()
);
formFile.append("token", "b8e3bb6ef8747d7");
$.ajax({
type: "post",
url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/update_home_url",
dataType: "json",
data: formFile,
async: true,
cache: false,
contentType: false,
processData: false,
success: function (res) {
// alert("添加成功");
console.log(res);
window.location.reload();
},
});
});
});