newdetails.js 1022 B

12345678910111213141516171819202122232425262728293031323334
  1. (() => {
  2. $.ajax({
  3. url: api + "/open/listNews",
  4. data: {},
  5. type: "GET",
  6. dataType: "json",
  7. success: function (e) {
  8. if (e.error && e.error.length) alert("数据加载失败,请刷新页面");
  9. else {
  10. var t = "";
  11. if (e.data.list.length) {
  12. for (var j = 0; j < e.data.list.length; j++) {
  13. var i = e.data.list[j],
  14. num = j + 1;
  15. t += "<a target='_blank' href=" + newUrl + i.id + "><div class='htit'><span class='hnum'>" + num + "</span>" + i.title + "</div></a>"
  16. }
  17. } else t = "<h4 style='text-align:center;margin:50px 0;color:#666' >暂无新闻动态</h4>", $(".page_ctrl").css({
  18. display: "none"
  19. });
  20. $(".hlist").html(t)
  21. }
  22. }
  23. })
  24. })();
  25. (() => {
  26. $(".kw").click(function () {
  27. var keywords = $(this).html()
  28. window.sessionStorage.setItem("keyword", keywords)
  29. window.location.href =
  30. window.location.protocol + '//'
  31. + window.location.host + "/news"
  32. })
  33. })();