123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- $(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/Adminbackoneeight/show_gonggao_list",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- data = res.data;
- let AppleListHTML = "";
- $.each(data, function (index, value) {
- AppleListHTML += `
- <div id="${value.id
- }" class="HoutaiContainerBottomAppleListHeaders">
-
- <p class="HoutaiContainerBottomAppleListHeaderNR">${value.content
- }</p>
- <div class="HoutaiContainerBottomAppleListHeaderCZ">
- <p class="HoutaiContainerBottomAppleListHeaderCZxg" id = "${value.id}">修改</p>
- <p class="HoutaiContainerBottomAppleListHeaderCZsc">删除</p>
- </div>
- </div>`;
- });
- $("#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/announcement?TabId=" + num;
- },
- });
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- id = $(this).attr("id");
- let index = $(this).parent().parent().index();
- console.log(index);
- $(".HoutaiContainerDialoggai").show();
- $("#feedbackContent2").val(data[index].content);
- }
- );
- $(".HoutaiContainerBottomAppleListHeaderCZhf").on(
- "click",
- function () {
- id = $(this).attr("id");
- var formFile = new FormData();
- formFile.append("id", id);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/open_gonggao",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("添加成功");
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- // 功能-删除-反差内容-弹窗展示
- $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
- "click",
- function () {
- console.log(123123);
- id = $(this).parent().parent().attr("id");
- $(".HoutaiContainerDialogSC").show();
- }
- );
- },
- });
- }
- getData();
- // 功能-新增-反差内容-弹窗展示
- $(".SLHeaderCreate").on("click", function () {
- $(".HoutaiContainerDialogAdd").show();
- });
- // 功能-新增-反差内容-弹窗隐藏
- $(".HoutaiContainerDialogLine5LeftAdd").on("click", function () {
- $(".HoutaiContainerDialogAdd").hide();
- $(".HoutaiContainerDialoggai").hide();
- });
- // 功能-新增-反差内容-确认新增
- $(".HoutaiContainerDialogLine5RightAdd").on("click", function () {
- var formFile = new FormData();
- formFile.append("content", $("#feedbackContent").val());
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/add_gonggao",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("添加成功");
- console.log(res);
- window.location.reload();
- },
- });
- });
- // 功能-新增-反差内容-修改
- $(".HoutaiContainerDialogLine5Rightgai").on("click", function () {
- var formFile = new FormData();
- formFile.append("id", id);
- formFile.append("content", $("#feedbackContent2").val());
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/save_gonggao_content",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("添加成功");
- console.log(res);
- window.location.reload();
- },
- });
- });
- // 功能-删除-反差内容-取消删除
- $(".HoutaiContainerDialogASCdvertLeft").on("click", function () {
- $(".HoutaiContainerDialogSC").hide();
- });
- // 功能-删除-反差内容-确定删除
- $(".HoutaiContainerDialogSCAdvertRight").on("click", function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/delete_gonggao",
- dataType: "json",
- data: {
- id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- });
- });
|