";
+ // 页面渲染
+ $('.news_wrap').empty();
+ $('.pageNum_wrap').empty();
+
+ $.each(item,function(index){
+ var title = item[index].title;
+ var subtitle = item[index].subtitle;
+ var time = item[index].publish_time_text.substr(0,11);
+ var thumb = item[index].thumb;
+ var id = item[index].id;
+ var flags = item[index].flags;
+
+ if (flags) {
+ html += "
";
html += "
";
html += "
";
+ html += "
置顶
";
html += "
";
-
- }
- })
- $('.news_wrap').append(html);
-
- newsNum = res.data.total;
- pageNum = Math.ceil(newsNum/4);
-
- page += "
<";
-
- for (var index = 1; index <= pageNum; index++) {
- if (index == pageCurrent) {
- page += "
" + index + "";
- }else{
- page += "
" + index + "";
+ } else {
+ html += "
";
+ html += "
";
+ html += "
";
+ html += "
";
+
+ }
+ })
+ $('.news_wrap').append(html);
+
+ // 页码渲染
+ page += "
<";
+ for (var index = 1; index <= pageNum; index++) {
+ if (index == pageCurrent) {
+ page += "
" + index + "";
+ }else{
+ page += "
" + index + "";
+ }
+ }
+ page += "
>";
+ $('.pageNum_wrap').append(page);
}
-
- }
-
- page += "
>";
- $('.pageNum_wrap').append(page);
-
- }
- },
- error: function (err) {
- console.log(err);
- }
-
- });
+
+ }
+ },
+ error: function (err) {
+ console.log(err);
+ }
+
+ });
+
+ }
}