zs.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $(function () {
  2. setTimeout(function () { initWrapperTop(true)}, 150);
  3. $(".zoushi-category-item").click(function () {
  4. let type = $(this).find('span').data('code');
  5. if (type == 'DFC' || type == 'QGC') {
  6. $('#gpc').hide();
  7. initWrapperTop(false);
  8. } else {
  9. $('#gpc').show();
  10. initWrapperTop(true);
  11. }
  12. $(this).addClass("zoushi-active").siblings(".zoushi-category-item").removeClass("zoushi-active");
  13. var load = layer.load(2, {
  14. shade: [0.1, '#000']
  15. });
  16. //$("#zsList").load('@(Url.Action("ZSList", "ZS", null, Request.Url.Scheme))', { t: type }, function () {
  17. // layer.close(load);
  18. //});
  19. $.ajax({
  20. url: "/ZS/ZSList",
  21. type: "post",
  22. async: false,
  23. data: { t: type },
  24. success: function (res) {
  25. layer.close(load);
  26. if (res != "") {
  27. thisPageIndex = 1;
  28. $("#zsList").html(res);
  29. }
  30. else {
  31. layer.msg("没有更多数据了!")
  32. }
  33. },
  34. error: function (err) {
  35. console.log(err)
  36. layer.close(load);
  37. }
  38. })
  39. })
  40. })
  41. function initWrapperTop(gpc) {
  42. $("#ads-wrapper").show();
  43. var h1 = $("#ads-wrapper").height();
  44. var h = h1 + 43;
  45. if (gpc) {
  46. h = h + 40;
  47. }
  48. $("#wrapper1").css({top:h+"px"})
  49. }