banner.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  1. $(document).ready(function () {
  2. let url = window.location.search;
  3. var theRequest = new Object();
  4. if (url.indexOf("?") != -1) {
  5. var str = url.substr(1);
  6. strs = str.split("&");
  7. for (var i = 0; i < strs.length; i++) {
  8. theRequest[strs[i].split("=")[0]] = unescape(
  9. decodeURI(strs[i].split("=")[1])
  10. );
  11. }
  12. }
  13. let tabId = theRequest.TabId || 1;
  14. if (theRequest.labelcurrenttype == "视频列表广告") {
  15. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  16. $(".SLHeaderChild").eq(0).addClass("SLHeaderChildActive");
  17. $('#my-img').css('width', '271px');
  18. $('#my-img').css('height', '200px');
  19. $('#my-img img').attr('src', '/Public/Admin/img/tttp.png');
  20. $('#my-img1').css('width', '271px');
  21. $('#my-img1').css('height', '200px');
  22. } else if (theRequest.labelcurrenttype == "片头广告") {
  23. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  24. $(".SLHeaderChild").eq(1).addClass("SLHeaderChildActive");
  25. $('#my-img').css('width', '375px');
  26. $('#my-img').css('height', '200px');
  27. $('#my-img img').attr('src', '/Public/Admin/img/tttps.png');
  28. $('#my-img1').css('width', '375px');
  29. $('#my-img1').css('height', '200px');
  30. } else if (theRequest.labelcurrenttype == "游戏广告") {
  31. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  32. $(".SLHeaderChild").eq(2).addClass("SLHeaderChildActive");
  33. $('#my-img').css('width', '271px');
  34. $('#my-img').css('height', '200px');
  35. $('#my-img img').attr('src', '/Public/Admin/img/tttp.png');
  36. $('#my-img2').css('width', '271px');
  37. $('#my-img2').css('height', '200px');
  38. }
  39. // 切换视频列表广告与片头广告
  40. $(".SLHeaderChild").on("click", function () {
  41. // window.scrollTo(0, 0);
  42. var _this = $(this);
  43. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  44. $(this).addClass("SLHeaderChildActive");
  45. if (_this.attr("tabText") != theRequest.labelcurrenttype) {
  46. // window.location.href = "sl_adv?labelcurrenttype=" + _this.attr("tabText");
  47. window.location.href = "./banner.html?labelcurrenttype=" + _this.attr("tabText");
  48. }
  49. console.log($(this).index());
  50. });
  51. // 上传图片功能-取消上传图片并关闭弹弹窗
  52. $(".HoutaiContainerDialogAdvert5Left").on("click", function () {
  53. $(".HoutaiContainerDialog").hide();
  54. });
  55. // 上传图片功能-显示创建广告弹窗
  56. $(".SLHeaderCreate").on("click", function () {
  57. $(".HoutaiContainerDialog").show();
  58. });
  59. // 上传图片功能-打开上传图片窗口
  60. $(".HoutaiContainerDialogAdvert4Right").on("click", function () {
  61. $("#img-upload").click();
  62. });
  63. // 上传图片功能-打开上传图片窗口
  64. $(".HoutaiContainerDialogBJAdvertRight2").on("click", function () {
  65. $("#img-upload1").click();
  66. });
  67. // 上传图片功能-打开上传图片窗口
  68. // $(".HoutaiContainerDialogBJAdvertRight2").on("click", function () {
  69. // $("#img-upload1").click();
  70. // });
  71. var input = document.getElementById("img-upload");
  72. var theFile;
  73. var aa;
  74. input.onchange = function () {
  75. //获取用户上传的文件对象
  76. theFile = input.files[0];
  77. //实例化一个文件读取器
  78. var fileReader = new FileReader();
  79. //将用户上传的文件对象作为参数,传入文件读取器的方法readAsDataURL
  80. fileReader.readAsDataURL(theFile);
  81. //文件读取器方法执行完毕后调用函数
  82. fileReader.onload = function () {
  83. //文件读取器的result属性即fileReader.result,就是上传文件的dataURL
  84. //document.getElementsByTagName("img")[0].src = fileReader.result;
  85. // $("#HoutaiContainerDialogDeputyXImg").attr("src", fileReader.result);
  86. console.log(fileReader.result);
  87. aa = fileReader.result;
  88. $("#my-img img").attr("src", fileReader.result);
  89. };
  90. };
  91. var input1 = document.getElementById("img-upload1");
  92. var theFile1;
  93. var aa;
  94. input1.onchange = function () {
  95. //获取用户上传的文件对象
  96. theFile1 = input1.files[0];
  97. //实例化一个文件读取器
  98. var fileReader = new FileReader();
  99. //将用户上传的文件对象作为参数,传入文件读取器的方法readAsDataURL
  100. fileReader.readAsDataURL(theFile1);
  101. //文件读取器方法执行完毕后调用函数
  102. fileReader.onload = function () {
  103. //文件读取器的result属性即fileReader.result,就是上传文件的dataURL
  104. //document.getElementsByTagName("img")[0].src = fileReader.result;
  105. // $("#HoutaiContainerDialogDeputyXImg").attr("src", fileReader.result);
  106. console.log(fileReader.result);
  107. aa = fileReader.result;
  108. $("#my-img1 img").attr("src", fileReader.result);
  109. };
  110. };
  111. $.ajax({
  112. type: "post",
  113. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/adv_count_show",
  114. dataType: "json",
  115. data: {
  116. //async: false,
  117. token: "b8e3bb6ef8747d7"
  118. },
  119. success: function (res) {
  120. console.log(res);
  121. $("#listBanner").text(`视频列表广告 ( ${res.data.videolist_adv} ) `);
  122. $("#videoBanner").text(`片头广告 ( ${res.data.start_adv} ) `);
  123. $("#gameBanner").text(`游戏广告 ( ${res.data.gamelist_adv} ) `);
  124. }
  125. })
  126. if (
  127. theRequest.labelcurrenttype == "视频列表广告" ||
  128. theRequest.labelcurrenttype == undefined
  129. ) {
  130. $.ajax({
  131. type: "post",
  132. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowList",
  133. dataType: "json",
  134. data: {
  135. //async: false,
  136. token: "b8e3bb6ef8747d7",
  137. page: tabId,
  138. size: 50,
  139. },
  140. success: function (res) {
  141. console.log(res);
  142. var AppleList = "";
  143. $.each(res.data, function (index, value) {
  144. AppleList +=
  145. ' <div class="HoutaiContainerBottomAppleListHeaders">';
  146. AppleList +=
  147. '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
  148. value.number +
  149. "</p>";
  150. AppleList +=
  151. ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
  152. value.img +
  153. '" alt=""></p>';
  154. AppleList +=
  155. ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
  156. value.jump_link +
  157. "</p>";
  158. AppleList +=
  159. ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
  160. AppleList +=
  161. ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
  162. value.id +
  163. '">' +
  164. "修改" +
  165. "</p>";
  166. AppleList +=
  167. ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
  168. value.id +
  169. '">' +
  170. "删除" +
  171. "</p>";
  172. AppleList += " </div>";
  173. AppleList += " </div>";
  174. });
  175. $("#AppleList").html(AppleList);
  176. },
  177. complete: function (res, status) {
  178. console.log(res.responseJSON.total);
  179. $("#page").paging({
  180. pageNo: tabId,
  181. totalPage: Math.ceil(res.responseJSON.total / 50),
  182. callback: function (num) {
  183. window.location.href =
  184. "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=视频列表广告";
  185. },
  186. });
  187. var id;
  188. $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
  189. $(".bannerImgBJ").show();
  190. let imgurl = $(this).attr("imgurl");
  191. $(".bannerImg").attr("src", imgurl);
  192. });
  193. $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
  194. "click",
  195. function () {
  196. $(".HoutaiContainerDialogBJ").show();
  197. id = $(this).attr("id");
  198. $.ajax({
  199. type: "post",
  200. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
  201. dataType: "json",
  202. data: {
  203. token: "b8e3bb6ef8747d7",
  204. advert_id: $(this).attr("id"),
  205. },
  206. success: function (res) {
  207. console.log(res);
  208. $(".HoutaiContainerDialogBJAdvertRight").val(
  209. res.data.jump_link
  210. );
  211. $(".HoutaiContainerDialogBJAdvertRight1").val(
  212. res.data.content
  213. );
  214. $("#my-img1 img").attr("src", res.data.img);
  215. },
  216. });
  217. }
  218. );
  219. $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
  220. "click",
  221. function () {
  222. $(".HoutaiContainerDialogSC").show();
  223. id = $(this).attr("id");
  224. }
  225. );
  226. $(".HoutaiContainerDialogABJdvertLeft3").on(
  227. "click",
  228. function () {
  229. $(".HoutaiContainerDialogBJ").hide();
  230. }
  231. );
  232. $(".HoutaiContainerDialogBJAdvertRight3").on(
  233. "click",
  234. function () {
  235. var formFile = new FormData();
  236. formFile.append("token", "b8e3bb6ef8747d7");
  237. formFile.append("advert_id", id);
  238. formFile.append(
  239. "jump_link",
  240. $(".HoutaiContainerDialogBJAdvertRight").val()
  241. );
  242. formFile.append(
  243. "content",
  244. ''
  245. );
  246. formFile.append("img", theFile1);
  247. $.ajax({
  248. type: "post",
  249. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
  250. dataType: "json",
  251. data: formFile,
  252. async: true,
  253. cache: false,
  254. contentType: false,
  255. processData: false,
  256. success: function (res) {
  257. // alert("修改成功")
  258. console.log(res);
  259. if (res.code == "200") {
  260. alert("修改成功");
  261. window.location.reload();
  262. } else {
  263. alert("请求失败,请修改后重试!");
  264. }
  265. },
  266. });
  267. }
  268. );
  269. $(".HoutaiContainerDialogASCdvertLeft").on(
  270. "click",
  271. function () {
  272. $(".HoutaiContainerDialogSC").hide();
  273. }
  274. );
  275. $(".HoutaiContainerDialogSCAdvertRight").on(
  276. "click",
  277. function () {
  278. $.ajax({
  279. type: "post",
  280. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
  281. dataType: "json",
  282. data: {
  283. token: "b8e3bb6ef8747d7",
  284. advert_id: id,
  285. },
  286. success: function (res) {
  287. console.log(res);
  288. window.location.reload();
  289. },
  290. });
  291. }
  292. );
  293. },
  294. });
  295. $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
  296. var formFile = new FormData();
  297. formFile.append("token", "b8e3bb6ef8747d7");
  298. formFile.append("type", theRequest.labelcurrenttype);
  299. formFile.append(
  300. "jump_link",
  301. $(".HoutaiContainerDialogAdvert2Right").val()
  302. );
  303. formFile.append("img", theFile);
  304. $.ajax({
  305. type: "post",
  306. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
  307. dataType: "json",
  308. data: formFile,
  309. async: true,
  310. cache: false,
  311. contentType: false,
  312. processData: false,
  313. success: function (res) {
  314. // alert("修改成功")
  315. console.log(res);
  316. window.location.reload();
  317. },
  318. });
  319. });
  320. } else if (
  321. theRequest.labelcurrenttype == "片头广告"
  322. ) {
  323. $.ajax({
  324. type: "post",
  325. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowStart",
  326. dataType: "json",
  327. data: {
  328. //async: false,
  329. token: "b8e3bb6ef8747d7",
  330. page: tabId,
  331. size: 50,
  332. },
  333. success: function (res) {
  334. console.log(res);
  335. var AppleList = "";
  336. $.each(res.data, function (index, value) {
  337. AppleList +=
  338. ' <div class="HoutaiContainerBottomAppleListHeaders">';
  339. AppleList +=
  340. '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
  341. value.number +
  342. "</p>";
  343. AppleList +=
  344. ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
  345. value.img +
  346. '" alt=""></p>';
  347. AppleList +=
  348. ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
  349. value.jump_link +
  350. "</p>";
  351. AppleList +=
  352. ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
  353. AppleList +=
  354. ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
  355. value.id +
  356. '">' +
  357. "修改" +
  358. "</p>";
  359. AppleList +=
  360. ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
  361. value.id +
  362. '">' +
  363. "删除" +
  364. "</p>";
  365. AppleList += " </div>";
  366. AppleList += " </div>";
  367. });
  368. $("#AppleList").html(AppleList);
  369. },
  370. complete: function (res, status) {
  371. console.log(res.responseJSON.total);
  372. $("#page").paging({
  373. pageNo: tabId,
  374. totalPage: Math.ceil(res.responseJSON.total / 50),
  375. callback: function (num) {
  376. window.location.href =
  377. "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=片头广告";
  378. },
  379. });
  380. var id;
  381. $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
  382. $(".bannerImgBJ").show();
  383. let imgurl = $(this).attr("imgurl");
  384. $(".bannerImg").attr("src", imgurl);
  385. });
  386. $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
  387. "click",
  388. function () {
  389. $(".HoutaiContainerDialogBJ").show();
  390. id = $(this).attr("id");
  391. $.ajax({
  392. type: "post",
  393. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
  394. dataType: "json",
  395. data: {
  396. token: "b8e3bb6ef8747d7",
  397. advert_id: $(this).attr("id"),
  398. },
  399. success: function (res) {
  400. console.log(res);
  401. $(".HoutaiContainerDialogBJAdvertRight").val(
  402. res.data.jump_link
  403. );
  404. $(".HoutaiContainerDialogBJAdvertRight1").val(
  405. res.data.content
  406. );
  407. $("#my-img1 img").attr("src", res.data.img);
  408. },
  409. });
  410. }
  411. );
  412. $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
  413. "click",
  414. function () {
  415. $(".HoutaiContainerDialogSC").show();
  416. id = $(this).attr("id");
  417. }
  418. );
  419. $(".HoutaiContainerDialogABJdvertLeft3").on(
  420. "click",
  421. function () {
  422. $(".HoutaiContainerDialogBJ").hide();
  423. }
  424. );
  425. $(".HoutaiContainerDialogBJAdvertRight3").on(
  426. "click",
  427. function () {
  428. var formFile = new FormData();
  429. formFile.append("token", "b8e3bb6ef8747d7");
  430. formFile.append("advert_id", id);
  431. formFile.append(
  432. "jump_link",
  433. $(".HoutaiContainerDialogBJAdvertRight").val()
  434. );
  435. formFile.append(
  436. "content",
  437. ''
  438. );
  439. formFile.append("img", theFile1);
  440. $.ajax({
  441. type: "post",
  442. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
  443. dataType: "json",
  444. data: formFile,
  445. async: true,
  446. cache: false,
  447. contentType: false,
  448. processData: false,
  449. success: function (res) {
  450. // alert("修改成功")
  451. console.log(res);
  452. if (res.code == "200") {
  453. alert("修改成功");
  454. window.location.reload();
  455. } else {
  456. alert("请求失败,请修改后重试!");
  457. }
  458. },
  459. });
  460. }
  461. );
  462. $(".HoutaiContainerDialogASCdvertLeft").on(
  463. "click",
  464. function () {
  465. $(".HoutaiContainerDialogSC").hide();
  466. }
  467. );
  468. $(".HoutaiContainerDialogSCAdvertRight").on(
  469. "click",
  470. function () {
  471. $.ajax({
  472. type: "post",
  473. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
  474. dataType: "json",
  475. data: {
  476. token: "b8e3bb6ef8747d7",
  477. advert_id: id,
  478. },
  479. success: function (res) {
  480. console.log(res);
  481. window.location.reload();
  482. },
  483. });
  484. }
  485. );
  486. },
  487. });
  488. $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
  489. console.log(11);
  490. var formFile = new FormData();
  491. formFile.append("token", "b8e3bb6ef8747d7");
  492. formFile.append("type", theRequest.labelcurrenttype);
  493. formFile.append(
  494. "jump_link",
  495. $(".HoutaiContainerDialogAdvert2Right").val()
  496. );
  497. formFile.append("img", theFile);
  498. $.ajax({
  499. type: "post",
  500. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
  501. dataType: "json",
  502. data: formFile,
  503. async: true,
  504. cache: false,
  505. contentType: false,
  506. processData: false,
  507. success: function (res) {
  508. // alert("修改成功")
  509. console.log(res);
  510. window.location.reload();
  511. },
  512. });
  513. });
  514. } else if (theRequest.labelcurrenttype == "游戏广告") {
  515. $.ajax({
  516. type: "post",
  517. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/gameOnlineShowList",
  518. dataType: "json",
  519. data: {
  520. //async: false,
  521. token: "b8e3bb6ef8747d7",
  522. page: tabId,
  523. size: 50,
  524. },
  525. success: function (res) {
  526. console.log(res);
  527. var AppleList = "";
  528. $.each(res.data, function (index, value) {
  529. AppleList +=
  530. ' <div class="HoutaiContainerBottomAppleListHeaders">';
  531. AppleList +=
  532. '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
  533. value.number +
  534. "</p>";
  535. AppleList +=
  536. ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
  537. value.img +
  538. '" alt=""></p>';
  539. AppleList +=
  540. ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
  541. value.jump_link +
  542. "</p>";
  543. AppleList +=
  544. ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
  545. AppleList +=
  546. ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
  547. value.id +
  548. '">' +
  549. "修改" +
  550. "</p>";
  551. AppleList +=
  552. ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
  553. value.id +
  554. '">' +
  555. "删除" +
  556. "</p>";
  557. AppleList += " </div>";
  558. AppleList += " </div>";
  559. });
  560. $("#AppleList").html(AppleList);
  561. },
  562. complete: function (res, status) {
  563. $("#page").paging({
  564. pageNo: tabId,
  565. totalPage: Math.ceil(res.responseJSON.total / 50),
  566. callback: function (num) {
  567. window.location.href =
  568. "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=片头广告";
  569. },
  570. });
  571. var id;
  572. $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
  573. $(".bannerImgBJ").show();
  574. let imgurl = $(this).attr("imgurl");
  575. $(".bannerImg").attr("src", imgurl);
  576. console.log("names");
  577. });
  578. $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
  579. "click",
  580. function () {
  581. $(".HoutaiContainerDialogBJ").show();
  582. id = $(this).attr("id");
  583. $.ajax({
  584. type: "post",
  585. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
  586. dataType: "json",
  587. data: {
  588. token: "b8e3bb6ef8747d7",
  589. advert_id: $(this).attr("id"),
  590. },
  591. success: function (res) {
  592. console.log(res);
  593. $(".HoutaiContainerDialogBJAdvertRight").val(
  594. res.data.jump_link
  595. );
  596. $(".HoutaiContainerDialogBJAdvertRight1").val(
  597. res.data.content
  598. );
  599. $("#my-img1 img").attr("src", res.data.img);
  600. },
  601. });
  602. }
  603. );
  604. $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
  605. "click",
  606. function () {
  607. $(".HoutaiContainerDialogSC").show();
  608. id = $(this).attr("id");
  609. }
  610. );
  611. $(".HoutaiContainerDialogABJdvertLeft3").on(
  612. "click",
  613. function () {
  614. $(".HoutaiContainerDialogBJ").hide();
  615. }
  616. );
  617. $(".HoutaiContainerDialogBJAdvertRight3").on("click", function () {
  618. var formFile = new FormData();
  619. formFile.append("token", "b8e3bb6ef8747d7");
  620. formFile.append("advert_id", id);
  621. formFile.append(
  622. "jump_link",
  623. $(".HoutaiContainerDialogBJAdvertRight").val()
  624. );
  625. formFile.append(
  626. "content",
  627. ''
  628. );
  629. formFile.append("img", theFile1);
  630. $.ajax({
  631. type: "post",
  632. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
  633. dataType: "json",
  634. data: formFile,
  635. async: true,
  636. cache: false,
  637. contentType: false,
  638. processData: false,
  639. success: function (res) {
  640. // alert("修改成功")
  641. // console.log(res);
  642. if (res.code == "200") {
  643. alert("修改成功");
  644. window.location.reload();
  645. } else {
  646. alert("请求失败,请修改后重试!");
  647. }
  648. },
  649. });
  650. }
  651. );
  652. $(".HoutaiContainerDialogASCdvertLeft").on(
  653. "click",
  654. function () {
  655. $(".HoutaiContainerDialogSC").hide();
  656. }
  657. );
  658. $(".HoutaiContainerDialogSCAdvertRight").on(
  659. "click",
  660. function () {
  661. $.ajax({
  662. type: "post",
  663. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
  664. dataType: "json",
  665. data: {
  666. token: "b8e3bb6ef8747d7",
  667. advert_id: id,
  668. },
  669. success: function (res) {
  670. console.log(res);
  671. window.location.reload();
  672. },
  673. });
  674. }
  675. );
  676. }
  677. })
  678. $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
  679. var formFile = new FormData();
  680. formFile.append("token", "b8e3bb6ef8747d7");
  681. formFile.append("type", theRequest.labelcurrenttype);
  682. formFile.append(
  683. "jump_link",
  684. $(".HoutaiContainerDialogAdvert2Right").val()
  685. );
  686. formFile.append("img", theFile);
  687. $.ajax({
  688. type: "post",
  689. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
  690. dataType: "json",
  691. data: formFile,
  692. async: true,
  693. cache: false,
  694. contentType: false,
  695. processData: false,
  696. success: function (res) {
  697. // alert("修改成功")
  698. console.log(res);
  699. window.location.reload();
  700. },
  701. });
  702. });
  703. } else {
  704. $.ajax({
  705. type: "post",
  706. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowList",
  707. dataType: "json",
  708. data: {
  709. //async: false,
  710. token: "b8e3bb6ef8747d7",
  711. page: tabId,
  712. size: 50,
  713. },
  714. success: function (res) {
  715. console.log(res);
  716. var AppleList = "";
  717. $.each(res.data, function (index, value) {
  718. AppleList +=
  719. ' <div class="HoutaiContainerBottomAppleListHeaders">';
  720. AppleList +=
  721. '<p class="HoutaiContainerBottomAppleListHeaderBH">' +
  722. value.number +
  723. "</p>";
  724. AppleList +=
  725. ' <p imgurl="' + value.img + '" class="HoutaiContainerBottomAppleListHeaderTP"><img src="' +
  726. value.img +
  727. '" alt=""></p>';
  728. AppleList +=
  729. ' <p class="HoutaiContainerBottomAppleListHeaderLJ">' +
  730. value.jump_link +
  731. "</p>";
  732. AppleList +=
  733. ' <div class="HoutaiContainerBottomAppleListHeaderCZ">';
  734. AppleList +=
  735. ' <p class="HoutaiContainerBottomAppleListHeaderCZxg" id="' +
  736. value.id +
  737. '">' +
  738. "修改" +
  739. "</p>";
  740. AppleList +=
  741. ' <p class="HoutaiContainerBottomAppleListHeaderCZsc" id="' +
  742. value.id +
  743. '">' +
  744. "删除" +
  745. "</p>";
  746. AppleList += " </div>";
  747. AppleList += " </div>";
  748. });
  749. $("#AppleList").html(AppleList);
  750. },
  751. complete: function (res, status) {
  752. console.log(res.responseJSON.total);
  753. $("#page").paging({
  754. pageNo: tabId,
  755. totalPage: Math.ceil(res.responseJSON.total / 50),
  756. callback: function (num) {
  757. window.location.href =
  758. "https://api.9169kkxstzsjkdd222.app/sl_adv?TabId=" + num + "&labelcurrenttype=视频列表广告";
  759. },
  760. });
  761. var id;
  762. $(".HoutaiContainerBottomAppleListHeaderTP").on("click", function () {
  763. $(".bannerImgBJ").show();
  764. let imgurl = $(this).attr("imgurl");
  765. $(".bannerImg").attr("src", imgurl);
  766. });
  767. $(".HoutaiContainerBottomAppleListHeaderCZxg").on(
  768. "click",
  769. function () {
  770. $(".HoutaiContainerDialogBJ").show();
  771. id = $(this).attr("id");
  772. $.ajax({
  773. type: "post",
  774. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/advertShowDetailOne",
  775. dataType: "json",
  776. data: {
  777. token: "b8e3bb6ef8747d7",
  778. advert_id: $(this).attr("id"),
  779. },
  780. success: function (res) {
  781. console.log(res);
  782. $(".HoutaiContainerDialogBJAdvertRight").val(
  783. res.data.jump_link
  784. );
  785. $(".HoutaiContainerDialogBJAdvertRight1").val(
  786. res.data.content
  787. );
  788. $("#my-img1 img").attr("src", res.data.img);
  789. },
  790. });
  791. }
  792. );
  793. $(".HoutaiContainerBottomAppleListHeaderCZsc").on(
  794. "click",
  795. function () {
  796. $(".HoutaiContainerDialogSC").show();
  797. id = $(this).attr("id");
  798. }
  799. );
  800. $(".HoutaiContainerDialogABJdvertLeft3").on(
  801. "click",
  802. function () {
  803. $(".HoutaiContainerDialogBJ").hide();
  804. }
  805. );
  806. $(".HoutaiContainerDialogBJAdvertRight3").on(
  807. "click",
  808. function () {
  809. var formFile = new FormData();
  810. formFile.append("token", "b8e3bb6ef8747d7");
  811. formFile.append("advert_id", id);
  812. formFile.append(
  813. "jump_link",
  814. $(".HoutaiContainerDialogBJAdvertRight").val()
  815. );
  816. formFile.append(
  817. "content",
  818. ''
  819. );
  820. formFile.append("img", theFile1);
  821. $.ajax({
  822. type: "post",
  823. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDetail",
  824. dataType: "json",
  825. data: formFile,
  826. async: true,
  827. cache: false,
  828. contentType: false,
  829. processData: false,
  830. success: function (res) {
  831. // alert("修改成功")
  832. console.log(res);
  833. if (res.code == "200") {
  834. alert("修改成功");
  835. window.location.reload();
  836. } else {
  837. alert("请求失败,请修改后重试!");
  838. }
  839. },
  840. });
  841. }
  842. );
  843. $(".HoutaiContainerDialogASCdvertLeft").on(
  844. "click",
  845. function () {
  846. $(".HoutaiContainerDialogSC").hide();
  847. }
  848. );
  849. $(".HoutaiContainerDialogSCAdvertRight").on(
  850. "click",
  851. function () {
  852. $.ajax({
  853. type: "post",
  854. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertDelete",
  855. dataType: "json",
  856. data: {
  857. token: "b8e3bb6ef8747d7",
  858. advert_id: id,
  859. },
  860. success: function (res) {
  861. console.log(res);
  862. window.location.reload();
  863. },
  864. });
  865. }
  866. );
  867. },
  868. });
  869. $(".HoutaiContainerDialogAdvert5Right").on("click", function () {
  870. var formFile = new FormData();
  871. formFile.append("token", "b8e3bb6ef8747d7");
  872. formFile.append("type", theRequest.labelcurrenttype);
  873. formFile.append(
  874. "jump_link",
  875. $(".HoutaiContainerDialogAdvert2Right").val()
  876. );
  877. formFile.append("img", theFile);
  878. $.ajax({
  879. type: "post",
  880. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackonenine/videoAdvertAdd",
  881. dataType: "json",
  882. data: formFile,
  883. async: true,
  884. cache: false,
  885. contentType: false,
  886. processData: false,
  887. success: function (res) {
  888. // alert("修改成功")
  889. console.log(res);
  890. window.location.reload();
  891. },
  892. });
  893. });
  894. }
  895. $(".HoutaiContainerTitleLogout").on("click", function () {
  896. $.ajax({
  897. type: "post",
  898. url: "https://api.9169kkxstzsjkdd222.app/Admin/Login/loginOut",
  899. dataType: "json",
  900. success: function (res) {
  901. // alert("修改成功")
  902. console.log(res);
  903. window.location.href = "dlogin";
  904. },
  905. });
  906. });
  907. $(".bannerImgBJ").on("click", function () {
  908. $(this).fadeOut(300);
  909. })
  910. });