Browse Source

技术交易banner

albertshaw 8 years ago
parent
commit
6bc39c984e

+ 4 - 0
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -427,6 +427,10 @@ public class WebpageController extends BaseController {
 	@RequestMapping(value = "/portal/technologyTrading/index", method = RequestMethod.GET)
 	public ModelAndView portalTechnologyTradingIndex(HttpServletRequest request, ModelAndView modelview) {
 		modelview.setViewName("/portal/technologyTrading/index");
+		List<Banners> banners = bannersService.findPortalBanners(BannersType.JI_SHU_JIAO_YI.getKey());
+		if (!banners.isEmpty()) {
+			modelview.addObject("banners", banners);
+		}
 		return modelview;
 	}
 

+ 21 - 2
src/main/webapp/WEB-INF/views/portal/technologyTrading/index.html

@@ -32,10 +32,29 @@
 		</div>
 		<div class="secondary_navigation"></div>
 	</div>
-
-	<div class="item active">
+	<div id="myCarousel" class="carousel slide" th:if="${banners!=null && banners.size() > 1}">
+		<ol class="carousel-indicators">
+			<th:block th:each="banner,bannerStat:${banners}">
+				<li data-target="#myCarousel" data-slide-to="0" th:class="${bannerStat.first?'active':''}"></li>
+			</th:block>
+		</ol>
+		<div class="carousel-inner">
+			<th:block  th:each="banner,bannerStat:${banners}">
+			<div class="item" th:classappend="${bannerStat.first?'active':''}">
+				<img th:src="${portalHost + banner.imgurl}" th:alt="${banner.text}">
+			</div>
+			</th:block>
+		</div>
+		<a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="glyphicon glyphicon-chevron-left"></span></a>
+		<a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="glyphicon glyphicon-chevron-right"></span></a>
+	</div>
+	<div class="banner-item" th:if="${banners!=null && banners.size()==1}">
+		<img th:src="${portalHost + banners[0].imgurl}" th:alt="${banners[0].text}">
+	</div>
+	<div class="banner-item" th:if="${banners==null}">
 		<img th:src="${portalHost + '/img/technologyTrading_index_banner.jpg'}" alt="First slide">
 	</div>
+	
 	<div class="container trading_btn">
         <div class="nav_btn">
             <a class="active">技术评估</a>