12345678910111213141516171819202122232425262728293031323334 |
- (() => {
- $.ajax({
- url: api + "/open/listNews",
- data: {},
- type: "GET",
- dataType: "json",
- success: function (e) {
- if (e.error && e.error.length) alert("数据加载失败,请刷新页面");
- else {
- var t = "";
- if (e.data.list.length) {
- for (var j = 0; j < e.data.list.length; j++) {
- var i = e.data.list[j],
- num = j + 1;
- t += "<a target='_blank' href=" + newUrl + i.id + "><div class='htit'><span class='hnum'>" + num + "</span>" + i.title + "</div></a>"
- }
- } else t = "<h4 style='text-align:center;margin:50px 0;color:#666' >暂无新闻动态</h4>", $(".page_ctrl").css({
- display: "none"
- });
- $(".hlist").html(t)
- }
- }
- })
- })();
- (() => {
- $(".kw").click(function () {
- var keywords = $(this).html()
- window.sessionStorage.setItem("keyword", keywords)
- window.location.href =
- window.location.protocol + '//'
- + window.location.host + "/news"
- })
- })();
|