加载新闻列表数据
Showing
2 changed files
with
11 additions
and
4 deletions
... | @@ -37,13 +37,17 @@ $(function () { | ... | @@ -37,13 +37,17 @@ $(function () { |
37 | function LoadNewsData() { | 37 | function LoadNewsData() { |
38 | $.ajax({ | 38 | $.ajax({ |
39 | type: "get", //提交方式 | 39 | type: "get", //提交方式 |
40 | url: portal.api_url + "/hlwj/Mh/getNewsHotArticleList",//路径 | 40 | url: portal.api_url + "/hlwj/Mh/getNewsArticleList",//路径 |
41 | data:{ | ||
42 | "currentPage":1, | ||
43 | "pageSize":10 | ||
44 | }, | ||
41 | dataType: "json", | 45 | dataType: "json", |
42 | async: false, | 46 | async: false, |
43 | //数据,这里使用的是Json格式进行传输 | 47 | //数据,这里使用的是Json格式进行传输 |
44 | success: function (result) {//返回数据根据结果进行相应的处理 | 48 | success: function (result) {//返回数据根据结果进行相应的处理 |
45 | if (result.code == 200 && result.data != null) { | 49 | if (result.code == 200 && result.data != null) { |
46 | data.list = result.data; | 50 | data.list = result.data.records; |
47 | } | 51 | } |
48 | } | 52 | } |
49 | }); | 53 | }); | ... | ... |
... | @@ -104,7 +104,9 @@ | ... | @@ -104,7 +104,9 @@ |
104 | </div> | 104 | </div> |
105 | <div class="xw-right"> | 105 | <div class="xw-right"> |
106 | <div class="left-body"> | 106 | <div class="left-body"> |
107 | {{ item.headline }} | 107 | {{# if(item.summary !== null){ }} |
108 | {{ item.summary }} | ||
109 | {{# } }} | ||
108 | </div> | 110 | </div> |
109 | <div class="left-buttom"> | 111 | <div class="left-buttom"> |
110 | <div> | 112 | <div> |
... | @@ -120,7 +122,7 @@ | ... | @@ -120,7 +122,7 @@ |
120 | <span>{{ item.commentnum }}</span> | 122 | <span>{{ item.commentnum }}</span> |
121 | </div> | 123 | </div> |
122 | <div class="left-buttom-date"> | 124 | <div class="left-buttom-date"> |
123 | {{ item.publishTime }} | 125 | {{ CutDate(item.publishTime) }} |
124 | </div> | 126 | </div> |
125 | </div> | 127 | </div> |
126 | </div> | 128 | </div> |
... | @@ -128,4 +130,5 @@ | ... | @@ -128,4 +130,5 @@ |
128 | </li> | 130 | </li> |
129 | {{# }); }} | 131 | {{# }); }} |
130 | </script> | 132 | </script> |
133 | |||
131 | </html> | 134 | </html> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment