Browse Source

新闻政策详情修改

liliang4869 7 years ago
parent
commit
6903668269

+ 11 - 2
src/main/java/com/goafanti/portal/controller/PortalNewsController.java

@@ -152,9 +152,15 @@ public class PortalNewsController extends BaseController {
 			String createTimeFormattedDate = n.getCreateTimeFormattedDate();
 			n.setDataS(createTimeFormattedDate);
 		}
+		if(newsDetail.getTitleImg()!=null) {
+			String[] imgs=newsDetail.getTitleImg().split(",");
+			modelview.addObject("imgs",imgs);
+		}
 		modelview.addObject("newsDetail", newsDetail);
 		modelview.addObject("newsList", newsList.getList());
-		modelview.addObject("news", news);}
+		modelview.addObject("news", news);
+		
+		}
 		else {
 			List<PolicyEntity> newsList = achievementService.getIntellectualProperty(6);
 			PolicyEntity newsDetail = newsService.getPolicyDetail(id+"");
@@ -172,7 +178,10 @@ public class PortalNewsController extends BaseController {
 			}
 			@SuppressWarnings("unchecked")
 			List<PolicyEntity> la = (List<PolicyEntity>) newsList;
-			
+			if(newsDetail.getTitleImg()!=null) {
+				String[] imgs=newsDetail.getTitleImg().split(",");
+				modelview.addObject("imgs",imgs);
+			}
 			modelview.addObject("newsDetail", newsDetail);
 			modelview.addObject("newsList", newsList);
 			if(newsList!=null && newsList.size()>0)

+ 2 - 2
src/main/webapp/WEB-INF/views/portal/news/newsDetail.html

@@ -19,8 +19,8 @@
 					<span>时间:<span th:text="${newsDetail.createTime}?${#dates.format(newsDetail.createTime,'yyyy-MM-dd')}:''"></span></span>
 					<span>来源:<span th:text="${newsDetail.source}?${newsDetail.source}:行业新闻"></span></span>
 				</div>
-				<div th:if="${newsDetail.titleImg != null and newsDetail.titleImg !=''}" class="content_img">					
-					<img th:src="${avatarUploadHost+newsDetail.titleImg}" alt="" />
+				<div th:each="img:${imgs}" class="content_img">					
+					<img th:src="${avatarUploadHost+img}" alt="" />
 				</div>
 				<p th:utext="${newsDetail.content}?${newsDetail.content}:'暂无内容'">
 				</p>