d081895d by 任超

style:新闻

1 parent 09694f59
......@@ -70,6 +70,11 @@ function NewsData() {
//数据,这里使用的是Json格式进行传输
success: function (result) {//返回数据根据结果进行相应的处理
if (result.code == 200 && result.data != null) {
if(result.data[0].preViewUrl) {
$('.news-img img').attr('src',result.data[0].preViewUrl);
}else {
$('.news-img img').attr('src','./staticImages/news_demo.jpg');
}
for (var i = 0; i < result.data.length; i++) {
if (i == 6) return;
publishTime = CutDate(result.data[i].publishTime);
......@@ -86,11 +91,6 @@ function NewsData() {
li += '<span>' + publishTime + '</span></a></li>';
ulNews.append(li);
}
if(result.data[0].preViewUrl) {
$('.news-img img').attr('src',result.data[0].preViewUrl);
}else {
$('.news-img img').attr('src','./staticImages/news_demo.jpg');
}
}
}
});
......