style:首页新闻
Showing
1 changed file
with
6 additions
and
2 deletions
| ... | @@ -73,7 +73,11 @@ function NewsData() { | ... | @@ -73,7 +73,11 @@ function NewsData() { |
| 73 | for (var i = 0; i < result.data.length; i++) { | 73 | for (var i = 0; i < result.data.length; i++) { |
| 74 | if (i == 6) return; | 74 | if (i == 6) return; |
| 75 | publishTime = CutDate(result.data[i].publishTime); | 75 | publishTime = CutDate(result.data[i].publishTime); |
| 76 | if (result.data[i].cover) { | ||
| 76 | li = '<li url="'+result.data[i].cover+'"><a href="./staticViews/xwxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'; | 77 | li = '<li url="'+result.data[i].cover+'"><a href="./staticViews/xwxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'; |
| 78 | }else { | ||
| 79 | li = '<li><a href="./staticViews/xwxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'; | ||
| 80 | } | ||
| 77 | li += '<div class="news_item">'; | 81 | li += '<div class="news_item">'; |
| 78 | if (recentlyDay.indexOf(publishTime) > -1) { | 82 | if (recentlyDay.indexOf(publishTime) > -1) { |
| 79 | li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>'; | 83 | li += '<svg class="icon svg-icon" aria-hidden="true"> <use xlink:href="#iconzuixin"></use> </svg>'; |
| ... | @@ -85,7 +89,7 @@ function NewsData() { | ... | @@ -85,7 +89,7 @@ function NewsData() { |
| 85 | if(result.data[0].cover) { | 89 | if(result.data[0].cover) { |
| 86 | $('.news-img img').attr('src',result.data[0].cover); | 90 | $('.news-img img').attr('src',result.data[0].cover); |
| 87 | }else { | 91 | }else { |
| 88 | $('.news-img img').attr('src','staticImages/news_demo.jpg'); | 92 | $('.news-img img').attr('src','./staticImages/news_demo.jpg'); |
| 89 | } | 93 | } |
| 90 | } | 94 | } |
| 91 | } | 95 | } |
| ... | @@ -95,7 +99,7 @@ function NewsData() { | ... | @@ -95,7 +99,7 @@ function NewsData() { |
| 95 | if($(this).attr('url')) { | 99 | if($(this).attr('url')) { |
| 96 | $('.news-img img').attr('src',$(this).attr('url')); | 100 | $('.news-img img').attr('src',$(this).attr('url')); |
| 97 | }else { | 101 | }else { |
| 98 | $('.news-img img').attr('src','staticImages/news_demo.jpg'); | 102 | $('.news-img img').attr('src','./staticImages/news_demo.jpg'); |
| 99 | } | 103 | } |
| 100 | }) | 104 | }) |
| 101 | } | 105 | } | ... | ... |
-
Please register or sign in to post a comment