navaddress.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. $(document).ready(function () {
  2. let url = window.location.search;
  3. let id;
  4. let data;
  5. var theRequest = new Object();
  6. if (url.indexOf("?") != -1) {
  7. var str = url.substr(1);
  8. strs = str.split("&");
  9. for (var i = 0; i < strs.length; i++) {
  10. theRequest[strs[i].split("=")[0]] = unescape(
  11. decodeURI(strs[i].split("=")[1])
  12. );
  13. }
  14. }
  15. let tabId = theRequest.TabId || 1;
  16. // 接口调用-数据获取-反差列表
  17. function getData() {
  18. $.ajax({
  19. type: "post",
  20. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/home_url_list",
  21. dataType: "json",
  22. data: {
  23. //async: false,
  24. token: "b8e3bb6ef8747d7",
  25. page: tabId,
  26. size: 50,
  27. },
  28. success: function (res) {
  29. console.log(res);
  30. let arr = ["永久地址1", "永久地址2", "安卓客户端", "苹果客户端", "苹果客户端2", "苹果客户端3", "导航通知", "游戏1", "游戏2", "游戏3", "游戏4", "游戏5", "游戏6", "游戏7", "游戏8"];
  31. data = res.data;
  32. $(".SLHeader p").text(`反差内容( ${res.all_count} )`);
  33. let AppleListHTML = "";
  34. $.each(data, function (index, value) {
  35. AppleListHTML += `
  36. <div id="${value.id}" class="HoutaiContainerBottomAppleListHeaders">
  37. <p class="HoutaiContainerBottomAppleListHeaderNR">${arr[index]}</p>
  38. <p class="HoutaiContainerBottomAppleListHeaderSJ">${value.url}</p>
  39. <div class="HoutaiContainerBottomAppleListHeaderCZ">`;
  40. AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderCZhf " id="${value.id}" content = "${value.url}">修改</p>`;
  41. AppleListHTML += `</div>
  42. </div>`;
  43. });
  44. $("#AppleList").html(AppleListHTML);
  45. },
  46. complete: function (res, status) {
  47. // console.log(res);
  48. // $("#page").paging({
  49. // pageNo: tabId,
  50. // totalPage: Math.ceil(res.responseJSON.all_count / 50),
  51. // callback: function (num) {
  52. // window.location.href =
  53. // "https://api.9169kkxstzsjkdd222.app/feedback?TabId=" + num;
  54. // },
  55. // });
  56. $(".HoutaiContainerBottomAppleListHeaderCZhf").on("click", function () {
  57. id = $(this).attr("id");
  58. let content = $(this).attr("content");
  59. $(".HoutaiContainerDialogAdd").show();
  60. $("#feedbackContent").val(content);
  61. });
  62. },
  63. });
  64. }
  65. getData();
  66. // 功能-新增-反差内容-弹窗隐藏
  67. $(".HoutaiContainerDialogLine5LeftAdd").on("click", function () {
  68. $(".HoutaiContainerDialogAdd").hide();
  69. });
  70. // 功能-新增-反差内容-确认新增
  71. $(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
  72. var formFile = new FormData();
  73. formFile.append("id", id);
  74. formFile.append(
  75. "url",
  76. $("#feedbackContent").val()
  77. );
  78. formFile.append("token", "b8e3bb6ef8747d7");
  79. $.ajax({
  80. type: "post",
  81. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/update_home_url",
  82. dataType: "json",
  83. data: formFile,
  84. async: true,
  85. cache: false,
  86. contentType: false,
  87. processData: false,
  88. success: function (res) {
  89. // alert("添加成功");
  90. console.log(res);
  91. window.location.reload();
  92. },
  93. });
  94. });
  95. });