123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959 |
- $(document).ready(function () {
- let url = window.location.search;
- 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;
- if (theRequest.labelcurrenttype == "视频列表广告") {
- $(".SLHeaderChild").removeClass("SLHeaderChildActive");
- $(".SLHeaderChild").eq(0).addClass("SLHeaderChildActive");
- $('#my-img').css('width', '271px');
- $('#my-img').css('height', '200px');
- $('#my-img img').attr('src', '/Public/Admin/img/tttp.png');
- $('#my-img1').css('width', '271px');
- $('#my-img1').css('height', '200px');
- } else if (theRequest.labelcurrenttype == "片头广告") {
- $(".SLHeaderChild").removeClass("SLHeaderChildActive");
- $(".SLHeaderChild").eq(1).addClass("SLHeaderChildActive");
- $('#my-img').css('width', '375px');
- $('#my-img').css('height', '200px');
- $('#my-img img').attr('src', '/Public/Admin/img/tttps.png');
- $('#my-img1').css('width', '375px');
- $('#my-img1').css('height', '200px');
- } else if (theRequest.labelcurrenttype == "游戏广告") {
- $(".SLHeaderChild").removeClass("SLHeaderChildActive");
- $(".SLHeaderChild").eq(2).addClass("SLHeaderChildActive");
- $('#my-img').css('width', '271px');
- $('#my-img').css('height', '200px');
- $('#my-img img').attr('src', '/Public/Admin/img/tttp.png');
- $('#my-img2').css('width', '271px');
- $('#my-img2').css('height', '200px');
- }
- // 切换视频列表广告与片头广告
- $(".SLHeaderChild").on("click", function () {
- // window.scrollTo(0, 0);
- var _this = $(this);
- $(".SLHeaderChild").removeClass("SLHeaderChildActive");
- $(this).addClass("SLHeaderChildActive");
- if (_this.attr("tabText") != theRequest.labelcurrenttype) {
- // window.location.href = "sl_adv?labelcurrenttype=" + _this.attr("tabText");
- window.location.href = "./banner.html?labelcurrenttype=" + _this.attr("tabText");
- }
- console.log($(this).index());
- });
- // 上传图片功能-取消上传图片并关闭弹弹窗
- $(".HoutaiContainerDialogAdvert5Left").on("click", function () {
- $(".HoutaiContainerDialog").hide();
- });
- // 上传图片功能-显示创建广告弹窗
- $(".SLHeaderCreate").on("click", function () {
- $(".HoutaiContainerDialog").show();
- });
- // 上传图片功能-打开上传图片窗口
- $(".HoutaiContainerDialogAdvert4Right").on("click", function () {
- $("#img-upload").click();
- });
- // 上传图片功能-打开上传图片窗口
- $(".HoutaiContainerDialogBJAdvertRight2").on("click", function () {
- $("#img-upload1").click();
- });
- // 上传图片功能-打开上传图片窗口
- // $(".HoutaiContainerDialogBJAdvertRight2").on("click", function () {
- // $("#img-upload1").click();
- // });
- var input = document.getElementById("img-upload");
- var theFile;
- var aa;
- input.onchange = function () {
- //获取用户上传的文件对象
- theFile = input.files[0];
- //实例化一个文件读取器
- var fileReader = new FileReader();
- //将用户上传的文件对象作为参数,传入文件读取器的方法readAsDataURL
- fileReader.readAsDataURL(theFile);
- //文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- //文件读取器的result属性即fileReader.result,就是上传文件的dataURL
- //document.getElementsByTagName("img")[0].src = fileReader.result;
- // $("#HoutaiContainerDialogDeputyXImg").attr("src", fileReader.result);
- console.log(fileReader.result);
- aa = fileReader.result;
- $("#my-img img").attr("src", fileReader.result);
- };
- };
- var input1 = document.getElementById("img-upload1");
- var theFile1;
- var aa;
- input1.onchange = function () {
- //获取用户上传的文件对象
- theFile1 = input1.files[0];
- //实例化一个文件读取器
- var fileReader = new FileReader();
- //将用户上传的文件对象作为参数,传入文件读取器的方法readAsDataURL
- fileReader.readAsDataURL(theFile1);
- //文件读取器方法执行完毕后调用函数
- fileReader.onload = function () {
- //文件读取器的result属性即fileReader.result,就是上传文件的dataURL
- //document.getElementsByTagName("img")[0].src = fileReader.result;
- // $("#HoutaiContainerDialogDeputyXImg").attr("src", fileReader.result);
- console.log(fileReader.result);
- aa = fileReader.result;
- $("#my-img1 img").attr("src", fileReader.result);
- };
- };
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/adv_count_show",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7"
- },
- success: function (res) {
- console.log(res);
- $("#listBanner").text(`视频列表广告 ( ${res.data.videolist_adv} ) `);
- $("#videoBanner").text(`片头广告 ( ${res.data.start_adv} ) `);
- $("#gameBanner").text(`游戏广告 ( ${res.data.gamelist_adv} ) `);
- }
- })
- if (
- theRequest.labelcurrenttype == "视频列表广告" ||
- theRequest.labelcurrenttype == undefined
- ) {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowList",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- var AppleList = "";
- $.each(res.data, function (index, value) {
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaders">';
- AppleList +=
- '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
- value.number +
- "</p>";
- AppleList +=
- ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
- value.img +
- '" alt=""></p>';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
- value.jump_link +
- "</p>";
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
- value.id +
- '">' +
- "修改" +
- "</p>";
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
- value.id +
- '">' +
- "删除" +
- "</p>";
- AppleList += " </div>";
- AppleList += " </div>";
- });
- $("#AppleList").html(AppleList);
- },
- complete: function (res, status) {
- console.log(res.responseJSON.total);
- $("#page").paging({
- pageNo: tabId,
- totalPage: Math.ceil(res.responseJSON.total / 50),
- callback: function (num) {
- window.location.href =
- "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=视频列表广告";
- },
- });
- var id;
- $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
- $(".bannerImgBJ").show();
- let imgurl = $(this).attr("imgurl");
- $(".bannerImg").attr("src", imgurl);
- });
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").show();
- id = $(this).attr("id");
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: $(this).attr("id"),
- },
- success: function (res) {
- console.log(res);
- $(".HoutaiContainerDialogBJAdvertRight").val(
- res.data.jump_link
- );
- $(".HoutaiContainerDialogBJAdvertRight1").val(
- res.data.content
- );
- $("#my-img1 img").attr("src", res.data.img);
- },
- });
- }
- );
- $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").show();
- id = $(this).attr("id");
- }
- );
- $(".HoutaiContainerDialogABJdvertLeft3").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").hide();
- }
- );
- $(".HoutaiContainerDialogBJAdvertRight3").on(
- "click",
- function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("advert_id", id);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogBJAdvertRight").val()
- );
- formFile.append(
- "content",
- ''
- );
- formFile.append("img", theFile1);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- if (res.code == "200") {
- alert("修改成功");
- window.location.reload();
- } else {
- alert("请求失败,请修改后重试!");
- }
- },
- });
- }
- );
- $(".HoutaiContainerDialogASCdvertLeft").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").hide();
- }
- );
- $(".HoutaiContainerDialogSCAdvertRight").on(
- "click",
- function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- },
- });
- $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("type", theRequest.labelcurrenttype);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogAdvert2Right").val()
- );
- formFile.append("img", theFile);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- window.location.reload();
- },
- });
- });
- } else if (
- theRequest.labelcurrenttype == "片头广告"
- ) {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowStart",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- var AppleList = "";
- $.each(res.data, function (index, value) {
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaders">';
- AppleList +=
- '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
- value.number +
- "</p>";
- AppleList +=
- ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
- value.img +
- '" alt=""></p>';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
- value.jump_link +
- "</p>";
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
- value.id +
- '">' +
- "修改" +
- "</p>";
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
- value.id +
- '">' +
- "删除" +
- "</p>";
- AppleList += " </div>";
- AppleList += " </div>";
- });
- $("#AppleList").html(AppleList);
- },
- complete: function (res, status) {
- console.log(res.responseJSON.total);
- $("#page").paging({
- pageNo: tabId,
- totalPage: Math.ceil(res.responseJSON.total / 50),
- callback: function (num) {
- window.location.href =
- "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=片头广告";
- },
- });
- var id;
- $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
- $(".bannerImgBJ").show();
- let imgurl = $(this).attr("imgurl");
- $(".bannerImg").attr("src", imgurl);
- });
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").show();
- id = $(this).attr("id");
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: $(this).attr("id"),
- },
- success: function (res) {
- console.log(res);
- $(".HoutaiContainerDialogBJAdvertRight").val(
- res.data.jump_link
- );
- $(".HoutaiContainerDialogBJAdvertRight1").val(
- res.data.content
- );
- $("#my-img1 img").attr("src", res.data.img);
- },
- });
- }
- );
- $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").show();
- id = $(this).attr("id");
- }
- );
- $(".HoutaiContainerDialogABJdvertLeft3").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").hide();
- }
- );
- $(".HoutaiContainerDialogBJAdvertRight3").on(
- "click",
- function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("advert_id", id);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogBJAdvertRight").val()
- );
- formFile.append(
- "content",
- ''
- );
- formFile.append("img", theFile1);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- if (res.code == "200") {
- alert("修改成功");
- window.location.reload();
- } else {
- alert("请求失败,请修改后重试!");
- }
- },
- });
- }
- );
- $(".HoutaiContainerDialogASCdvertLeft").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").hide();
- }
- );
- $(".HoutaiContainerDialogSCAdvertRight").on(
- "click",
- function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- },
- });
- $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
- console.log(11);
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("type", theRequest.labelcurrenttype);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogAdvert2Right").val()
- );
- formFile.append("img", theFile);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- window.location.reload();
- },
- });
- });
- } else if (theRequest.labelcurrenttype == "游戏广告") {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/gameOnlineShowList",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- var AppleList = "";
- $.each(res.data, function (index, value) {
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaders">';
- AppleList +=
- '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
- value.number +
- "</p>";
- AppleList +=
- ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
- value.img +
- '" alt=""></p>';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
- value.jump_link +
- "</p>";
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
- value.id +
- '">' +
- "修改" +
- "</p>";
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
- value.id +
- '">' +
- "删除" +
- "</p>";
- AppleList += " </div>";
- AppleList += " </div>";
- });
- $("#AppleList").html(AppleList);
- },
- complete: function (res, status) {
- $("#page").paging({
- pageNo: tabId,
- totalPage: Math.ceil(res.responseJSON.total / 50),
- callback: function (num) {
- window.location.href =
- "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=片头广告";
- },
- });
- var id;
- $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
- $(".bannerImgBJ").show();
- let imgurl = $(this).attr("imgurl");
- $(".bannerImg").attr("src", imgurl);
- console.log("names");
- });
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").show();
- id = $(this).attr("id");
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: $(this).attr("id"),
- },
- success: function (res) {
- console.log(res);
- $(".HoutaiContainerDialogBJAdvertRight").val(
- res.data.jump_link
- );
- $(".HoutaiContainerDialogBJAdvertRight1").val(
- res.data.content
- );
- $("#my-img1 img").attr("src", res.data.img);
- },
- });
- }
- );
- $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").show();
- id = $(this).attr("id");
- }
- );
- $(".HoutaiContainerDialogABJdvertLeft3").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").hide();
- }
- );
- $(".HoutaiContainerDialogBJAdvertRight3").on("click", function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("advert_id", id);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogBJAdvertRight").val()
- );
- formFile.append(
- "content",
- ''
- );
- formFile.append("img", theFile1);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- // console.log(res);
- if (res.code == "200") {
- alert("修改成功");
- window.location.reload();
- } else {
- alert("请求失败,请修改后重试!");
- }
- },
- });
- }
- );
- $(".HoutaiContainerDialogASCdvertLeft").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").hide();
- }
- );
- $(".HoutaiContainerDialogSCAdvertRight").on(
- "click",
- function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- }
- })
- $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("type", theRequest.labelcurrenttype);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogAdvert2Right").val()
- );
- formFile.append("img", theFile);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- window.location.reload();
- },
- });
- });
- } else {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowList",
- dataType: "json",
- data: {
- //async: false,
- token: "b8e3bb6ef8747d7",
- page: tabId,
- size: 50,
- },
- success: function (res) {
- console.log(res);
- var AppleList = "";
- $.each(res.data, function (index, value) {
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaders">';
- AppleList +=
- '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
- value.number +
- "</p>";
- AppleList +=
- ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
- value.img +
- '" alt=""></p>';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
- value.jump_link +
- "</p>";
- AppleList +=
- ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
- value.id +
- '">' +
- "修改" +
- "</p>";
- AppleList +=
- ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
- value.id +
- '">' +
- "删除" +
- "</p>";
- AppleList += " </div>";
- AppleList += " </div>";
- });
- $("#AppleList").html(AppleList);
- },
- complete: function (res, status) {
- console.log(res.responseJSON.total);
- $("#page").paging({
- pageNo: tabId,
- totalPage: Math.ceil(res.responseJSON.total / 50),
- callback: function (num) {
- window.location.href =
- "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=视频列表广告";
- },
- });
- var id;
- $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
- $(".bannerImgBJ").show();
- let imgurl = $(this).attr("imgurl");
- $(".bannerImg").attr("src", imgurl);
- });
- $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").show();
- id = $(this).attr("id");
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: $(this).attr("id"),
- },
- success: function (res) {
- console.log(res);
- $(".HoutaiContainerDialogBJAdvertRight").val(
- res.data.jump_link
- );
- $(".HoutaiContainerDialogBJAdvertRight1").val(
- res.data.content
- );
- $("#my-img1 img").attr("src", res.data.img);
- },
- });
- }
- );
- $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").show();
- id = $(this).attr("id");
- }
- );
- $(".HoutaiContainerDialogABJdvertLeft3").on(
- "click",
- function () {
- $(".HoutaiContainerDialogBJ").hide();
- }
- );
- $(".HoutaiContainerDialogBJAdvertRight3").on(
- "click",
- function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("advert_id", id);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogBJAdvertRight").val()
- );
- formFile.append(
- "content",
- ''
- );
- formFile.append("img", theFile1);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- if (res.code == "200") {
- alert("修改成功");
- window.location.reload();
- } else {
- alert("请求失败,请修改后重试!");
- }
- },
- });
- }
- );
- $(".HoutaiContainerDialogASCdvertLeft").on(
- "click",
- function () {
- $(".HoutaiContainerDialogSC").hide();
- }
- );
- $(".HoutaiContainerDialogSCAdvertRight").on(
- "click",
- function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
- dataType: "json",
- data: {
- token: "b8e3bb6ef8747d7",
- advert_id: id,
- },
- success: function (res) {
- console.log(res);
- window.location.reload();
- },
- });
- }
- );
- },
- });
- $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
- var formFile = new FormData();
- formFile.append("token", "b8e3bb6ef8747d7");
- formFile.append("type", theRequest.labelcurrenttype);
- formFile.append(
- "jump_link",
- $(".HoutaiContainerDialogAdvert2Right").val()
- );
- formFile.append("img", theFile);
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
- dataType: "json",
- data: formFile,
- async: true,
- cache: false,
- contentType: false,
- processData: false,
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- window.location.reload();
- },
- });
- });
- }
- $(".HoutaiContainerTitleLogout").on("click", function () {
- $.ajax({
- type: "post",
- url: "https://api.9169kkxstzsjkdd222.app/Admin/Login/loginOut",
- dataType: "json",
- success: function (res) {
- // alert("修改成功")
- console.log(res);
- window.location.href = "dlogin";
- },
- });
- });
- $(".bannerImgBJ").on("click", function () {
- $(this).fadeOut(300);
- })
- });
|