source.js 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. let labelcurrenttype = theRequest.labelcurrenttype || "coins";
  15. if (theRequest.labelcurrenttype == "coins") {
  16. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  17. $(".SLHeaderChild").eq(0).addClass("SLHeaderChildActive");
  18. } else if (theRequest.labelcurrenttype == "vip") {
  19. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  20. $(".SLHeaderChild").eq(1).addClass("SLHeaderChildActive");
  21. } else if (theRequest.labelcurrenttype == "free") {
  22. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  23. $(".SLHeaderChild").eq(2).addClass("SLHeaderChildActive");
  24. } else if (theRequest.labelcurrenttype == "all") {
  25. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  26. $(".SLHeaderChild").eq(3).addClass("SLHeaderChildActive");
  27. }
  28. // 切换视频列表广告与片头广告
  29. $(".SLHeaderChild").on("click", function () {
  30. // window.scrollTo(0, 0);
  31. var _this = $(this);
  32. $(".SLHeaderChild").removeClass("SLHeaderChildActive");
  33. $(this).addClass("SLHeaderChildActive");
  34. if (_this.attr("tabText") != theRequest.labelcurrenttype) {
  35. window.location.href =
  36. "source?labelcurrenttype=" + _this.attr("tabText");
  37. }
  38. });
  39. // 接口调用-获取数据-新增活跃
  40. function getData() {
  41. $.ajax({
  42. type: "post",
  43. url: "https://api.9169kkxstzsjkdd222.app/Admin/Adminbackoneeight/video_add_tongJi",
  44. dataType: "json",
  45. data: {
  46. //async: false,
  47. token: "b8e3bb6ef8747d7",
  48. type: labelcurrenttype
  49. },
  50. success: function (res) {
  51. console.log(res);
  52. data = res.data;
  53. let AppleListHTML = "";
  54. $.each(data, function (index, value) {
  55. AppleListHTML += `
  56. <div class="HoutaiContainerBottomAppleListHeaders">
  57. <p class="HoutaiContainerBottomAppleListHeader1">${value.uploader}</p>
  58. <p class="HoutaiContainerBottomAppleListHeader2">${value.seven}</p>
  59. <p class="HoutaiContainerBottomAppleListHeader3">${value.count_video}</p>
  60. </div> `;
  61. });
  62. $("#AppleList").html(AppleListHTML);
  63. },
  64. complete: function (res, status) {
  65. console.log(res);
  66. $("#page").paging({
  67. pageNo: tabId,
  68. totalPage: 0,
  69. callback: function (num) {
  70. window.location.href =
  71. "https://api.9169kkxstzsjkdd222.app/source?TabId=" + num + "&labelcurrenttype" + labelcurrenttype;
  72. },
  73. });
  74. $(".HoutaiContainerBottomAppleListHeaderCZhf").on("click", function () {
  75. id = $(this).attr("id");
  76. let content = $(this).attr("content");
  77. $(".HoutaiContainerDialogAdd").show();
  78. $("#feedbackContent").val(content);
  79. });
  80. },
  81. });
  82. }
  83. getData();
  84. });