feedback.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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/fankui_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.all_count} )`);
  32. let AppleListHTML = "";
  33. $.each(data, function (index, value) {
  34. AppleListHTML += `
  35. <div id="${value.id}" class="HoutaiContainerBottomAppleListHeaders">
  36. <p class="HoutaiContainerBottomAppleListHeaderID">${value.user_name}</p>
  37. <p class="HoutaiContainerBottomAppleListHeaderZCSJ">${value.zhuce_time}</p>
  38. <p class="HoutaiContainerBottomAppleListHeaderJE">${value.all_pay}</p>
  39. <p class="HoutaiContainerBottomAppleListHeaderNR">${value.user_content}</p>
  40. <p imgurl="${value.fk_img}" class="HoutaiContainerBottomAppleListHeaderTP"><img src="${value.fk_img}" alt=""></p>
  41. <p class="HoutaiContainerBottomAppleListHeaderSJ">${value.user_date}</p>
  42. <div class="HoutaiContainerBottomAppleListHeaderCZ">`;
  43. if (value.type == "1") {
  44. AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderCZhf " id="${value.id}" content = "${value.user_content}">回复</p>`;
  45. } else {
  46. AppleListHTML += `<p class="HoutaiContainerBottomAppleListHeaderCZyhf " id="${value.id}" content = "${value.user_content}" contentb = "${value.admin_content}">查看回复</p>`;
  47. }
  48. AppleListHTML += `</div>
  49. </div>`;
  50. });
  51. $("#AppleList").html(AppleListHTML);
  52. },
  53. complete: function (res, status) {
  54. console.log(res);
  55. $("#page").paging({
  56. pageNo: tabId,
  57. totalPage: Math.ceil(res.responseJSON.all_count / 50),
  58. callback: function (num) {
  59. window.location.href =
  60. "https://api.9169kkxstzsjkdd222.app/feedback?TabId=" + num;
  61. },
  62. });
  63. $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
  64. $(".bannerImgBJ").show();
  65. let imgurl = $(this).attr("imgurl");
  66. $(".bannerImg").attr("src", imgurl);
  67. });
  68. $(".bannerImgBJ").on("click", function () {
  69. $(this).fadeOut(300);
  70. })
  71. $(".HoutaiContainerBottomAppleListHeaderCZhf").on("click", function () {
  72. id = $(this).attr("id");
  73. let content = $(this).attr("content");
  74. $(".HoutaiContainerDialogAdd").show();
  75. $("#feedbackContent").val(content);
  76. });
  77. $(".HoutaiContainerBottomAppleListHeaderCZyhf").on("click", function () {
  78. id = $(this).attr("id");
  79. let content = $(this).attr("content");
  80. let contentb = $(this).attr("contentb");
  81. $(".HoutaiContainerDialogLook").show();
  82. $("#feedbackContent2").val(content);
  83. $("#feedbackMessage2").val(contentb);
  84. });
  85. },
  86. });
  87. }
  88. getData();
  89. // 功能-新增-反差内容-弹窗隐藏
  90. $(".HoutaiContainerDialogLine5LeftAdd").on("click", function () {
  91. $(".HoutaiContainerDialogAdd").hide();
  92. });
  93. // 功能-新增-反差内容-确认新增
  94. $(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
  95. var formFile = new FormData();
  96. formFile.append("id", id);
  97. formFile.append(
  98. "admin_content",
  99. $("#feedbackMessage").val()
  100. );
  101. formFile.append("token", "b8e3bb6ef8747d7");
  102. $.ajax({
  103. type: "post",
  104. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/huifu_user_fankui",
  105. dataType: "json",
  106. data: formFile,
  107. async: true,
  108. cache: false,
  109. contentType: false,
  110. processData: false,
  111. success: function (res) {
  112. // alert("添加成功");
  113. console.log(res);
  114. window.location.reload();
  115. },
  116. });
  117. });
  118. $(".HoutaiContainerDialogLook").on("click", function () {
  119. $(".HoutaiContainerDialogLook").hide();
  120. });
  121. });