tabBtn11.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/Adminbackoneeight/error_video_list_show",
  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. data = res.data;
  31. $(".SLHeader p").text(`未解决( ${res.error_count} )`);
  32. let AppleListHTML = "";
  33. $.each(data, function (index, value) {
  34. AppleListHTML += `
  35. <div id="${value.id}" class="HoutaiContainerBottomAppleListHeaders">
  36. <p class="HoutaiContainerBottomAppleListHeaderID">${value.time_date}</p>
  37. <p content="${value.now_url}" class="HoutaiContainerBottomAppleListHeaderNR">${value.now_url} <span><img src="Public/Admin/img/copy.png" alt=""></span></p>
  38. <div class="HoutaiContainerBottomAppleListHeaderCZ">`;
  39. if (value.type == "0") {
  40. AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderCZhf " id="${value.v_id}">待解决</p>`;
  41. } else {
  42. AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderCZyhf " id="${value.v_id}">已解决</p>`;
  43. }
  44. AppleListHTML += `</div>
  45. </div>`;
  46. });
  47. $("#AppleList").html(AppleListHTML);
  48. },
  49. complete: function (res, status) {
  50. console.log(res);
  51. $("#page").paging({
  52. pageNo: tabId,
  53. totalPage: Math.ceil(res.responseJSON.all_count / 50),
  54. callback: function (num) {
  55. window.location.href =
  56. "https://api.9169kkxstzsjkdd222.app/tabBtn11?TabId=" + num;
  57. },
  58. });
  59. $(".HoutaiContainerBottomAppleListHeaderNR").on("click", function () {
  60. let content = $(this).attr("content");
  61. // 分享固定链接
  62. let input = $(
  63. "<input value = " + content + ">"
  64. );
  65. $("body").prepend(input);
  66. $("body").find("input").eq(0).select();
  67. document.execCommand("copy");
  68. $("body").find("input").eq(0).remove();
  69. alert("复制成功~");
  70. })
  71. $(".HoutaiContainerBottomAppleListHeaderCZhf").on("click", function () {
  72. id = $(this).attr("id");
  73. $.ajax({
  74. type: "post",
  75. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/save_error_video_type",
  76. dataType: "json",
  77. data: {
  78. v_id: id
  79. },
  80. success: function (res) {
  81. // alert("添加成功");
  82. console.log(res);
  83. window.location.reload();
  84. },
  85. });
  86. });
  87. },
  88. });
  89. }
  90. getData();
  91. });