Commit e1dfa7b1 by 侯昆

添加视频

1 parent aeb21d9d
...@@ -29,7 +29,7 @@ public class HtmlHelper { ...@@ -29,7 +29,7 @@ public class HtmlHelper {
} }
public static List<List<String>> paraphBriefToHtml(List<String> brief) { public static List<List<String>> paraphBriefToHtml(List<String> brief) {
List<List<String>> partition = Lists.partition(brief, 3); List<List<String>> partition = Lists.partition(brief, brief.size() % 2 == 0 ? brief.size() /2 : brief.size()/2 + 1 );
List<List<String>> collect = partition.stream().map( List<List<String>> collect = partition.stream().map(
g -> g.stream() g -> g.stream()
.map(b -> { .map(b -> {
......
...@@ -15,14 +15,14 @@ ...@@ -15,14 +15,14 @@
<div class="header-main-left"> <div class="header-main-left">
<h1>${vo.word}</h1> <h1>${vo.word}</h1>
<div class="header-main-desc clear"> <div class="header-main-desc clear">
<div class="word-read pt-0"> <%--<div class="word-read pt-0">--%>
<c:forEach var="item" items="${vo.spell}"> <%--<c:forEach var="item" items="${vo.spell}">--%>
<span>【${item}】</span> <%--<span>【${item}】</span>--%>
<a class="link js-play-voice" href="javascript:;"> <%--<a class="link js-play-voice" href="javascript:;">--%>
<i class="icon icon-shengyin"></i> <%--<i class="icon icon-shengyin"></i>--%>
</a> <%--</a>--%>
</c:forEach> <%--</c:forEach>--%>
</div> <%--</div>--%>
<h4>${vo.description}</h4> <h4>${vo.description}</h4>
</div> </div>
</div> </div>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
<c:if test="${vo.brief.size() > 0}"> <c:if test="${vo.brief.size() > 0}">
<div class="row encyclopedias"> <div class="row encyclopedias">
<c:forEach var="group" items="<%=Lists.partition(HtmlHelper.baikeBreifToHtml(vo.getBrief()), 7)%>"> <c:forEach var="group" items="<%=Lists.partition(HtmlHelper.baikeBreifToHtml(vo.getBrief()), vo.getBrief().size() % 2 == 0 ? vo.getBrief().size() / 2 : vo.getBrief().size()/2 + 1)%>">
<div class="col-sm-6"> <div class="col-sm-6">
<table> <table>
<tbody> <tbody>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<div class="row list-img"> <div class="row list-img">
<c:forEach items="${group}" var="item"> <c:forEach items="${group}" var="item">
<div class="col-sm-3"> <div class="col-sm-3">
<a> <a href="/video?file=${item.file}">
<img class="img-fluid" src="${item.file}"> <img class="img-fluid" src="${item.file}">
</a> </a>
</div> </div>
......
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.dookay.cihai.app.helper.HtmlHelper" %> <%@ page import="com.dookay.cihai.app.helper.HtmlHelper" %>
<%@ page import="com.google.common.collect.Lists" %> <%@ page import="com.google.common.collect.Lists" %>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp" %> <%@ include file="/WEB-INF/jsp/include/taglib.jsp" %>
...@@ -24,13 +23,21 @@ ...@@ -24,13 +23,21 @@
</div> </div>
<div class="header-main-right"> <div class="header-main-right">
<div class="word-read"> <div class="word-read">
<c:forEach var="item" items="${vo.spell}"> <c:if test="${vo.word eq '象'}">
<span>【${item}】</span> <span>【xiàng】</span>
<a class="link js-play-voice" href="javascript:;"> <a class="link js-play-voice" href="javascript:;">
<i class="icon icon-shengyin"></i> <i class="icon icon-shengyin"></i>
</a> </a>
</c:forEach> </c:if>
</div> </div>
<%--<div class="word-read">--%>
<%--<c:forEach var="item" items="${vo.spell}">--%>
<%--<span>【${item}】</span>--%>
<%--<a class="link js-play-voice" href="javascript:;">--%>
<%--<i class="icon icon-shengyin"></i>--%>
<%--</a>--%>
<%--</c:forEach>--%>
<%--</div>--%>
<c:if test="${vo.brief.size()>0}"> <c:if test="${vo.brief.size()>0}">
<table> <table>
<tbody> <tbody>
...@@ -48,10 +55,10 @@ ...@@ -48,10 +55,10 @@
<div class="clear collapse-wrapper"> <div class="clear collapse-wrapper">
<div class="collapse" id="header-main-collapse-1"> <div class="collapse" id="header-main-collapse-1">
<img class="img-fluid" src="/static/images/xiang-ziyuan-1.png"> <img class="img-fluid" src="/static/images/xiang-ziyuan-1.png">
<img class="img-fluid" src="images/xiang-ziyuan-2.png"> <img class="img-fluid" src="/static/images/xiang-ziyuan-2.png">
</div> </div>
<div class="collapse" id="header-main-collapse-2"> <div class="collapse" id="header-main-collapse-2">
<img class="img-fluid" src="/staticimages/xiang-shufa-1.png"> <img class="img-fluid" src="/static/images/xiang-shufa-1.png">
</div> </div>
</div> </div>
</div> </div>
......
...@@ -16,12 +16,20 @@ ...@@ -16,12 +16,20 @@
<h1>${vo.word}</h1> <h1>${vo.word}</h1>
<div class="header-main-desc clear"> <div class="header-main-desc clear">
<div class="word-read pt-0"> <div class="word-read pt-0">
<c:if test="${vo.spell.length() > 0}"> <c:choose>
<span>【 <c:forEach var="item" items="${vo.spell}"> ${item} </c:forEach> 】</span> <c:when test="${vo.word eq '中华人民共和国'}">
<a class="link js-play-voice" href="javascript:;"> <span>【Zhōnghuá Rénmín Gònghéguó】</span>
<i class="icon icon-shengyin"></i> <a class="link js-play-voice" href="javascript:;">
</a> <i class="icon icon-shengyin"></i>
</c:if> </a>
</c:when>
</c:choose>
<%--<c:if test="${vo.spell.length() > 0}">--%>
<%--<span>【 <c:forEach var="item" items="${vo.spell}"> ${item} </c:forEach> 】</span>--%>
<%--<a class="link js-play-voice" href="javascript:;">--%>
<%--<i class="icon icon-shengyin"></i>--%>
<%--</a>--%>
<%--</c:if>--%>
</div> </div>
<h4>${vo.description}</h4> <h4>${vo.description}</h4>
</div> </div>
...@@ -39,7 +47,7 @@ ...@@ -39,7 +47,7 @@
</div> </div>
<c:if test="${vo.brief.size() > 0}"> <c:if test="${vo.brief.size() > 0}">
<div class="row encyclopedias"> <div class="row encyclopedias">
<c:forEach var="group" items="<%=Lists.partition(HtmlHelper.baikeBreifToHtml(vo.getBrief()), 7)%>"> <c:forEach var="group" items="<%=Lists.partition(HtmlHelper.baikeBreifToHtml(vo.getBrief()), vo.getBrief().size() % 2 == 0 ? vo.getBrief().size() / 2 : vo.getBrief().size()/2 + 1)%>">
<div class="col-sm-6"> <div class="col-sm-6">
<table> <table>
<tbody> <tbody>
...@@ -610,14 +618,13 @@ ...@@ -610,14 +618,13 @@
</c:if> </c:if>
</div> </div>
</c:if> </c:if>
<c:if test="${vo.videos.size() > 0}"> <c:if test="${vo.videos.size() > 0}">
<div class="tab-pane" id="content-detail-tab-1" role="tabpanel"> <div class="tab-pane" id="content-detail-tab-1" role="tabpanel">
<c:forEach items="<%=Lists.partition(vo.getVideos(), 4)%>" var="group"> <c:forEach items="<%=Lists.partition(vo.getVideos(), 4)%>" var="group">
<div class="row list-img"> <div class="row list-img">
<c:forEach items="${group}" var="item"> <c:forEach items="${group}" var="item">
<div class="col-sm-3"> <div class="col-sm-3">
<a> <a href="/video/file=${item.file}">
<img class="img-fluid" src="${item.file}"> <img class="img-fluid" src="${item.file}">
</a> </a>
</div> </div>
......
...@@ -16,14 +16,14 @@ ...@@ -16,14 +16,14 @@
<div class="header-main-left"> <div class="header-main-left">
<h1>${vo.word}</h1> <h1>${vo.word}</h1>
<div class="header-main-desc"> <div class="header-main-desc">
<div class="word-read"> <%--<div class="word-read">--%>
<c:if test="${vo.spell.length() > 0}"> <%--<c:if test="${vo.spell.length() > 0}">--%>
<span>【 <c:forEach var="item" items="${vo.spell}"> ${item} </c:forEach> 】</span> <%--<span>【 <c:forEach var="item" items="${vo.spell}"> ${item} </c:forEach> 】</span>--%>
<a class="link js-play-voice" href="javascript:;"> <%--<a class="link js-play-voice" href="javascript:;">--%>
<i class="icon icon-shengyin"></i> <%--<i class="icon icon-shengyin"></i>--%>
</a> <%--</a>--%>
</c:if> <%--</c:if>--%>
</div> <%--</div>--%>
<%--<h4>长鼻目象科哺乳动物</h4>--%> <%--<h4>长鼻目象科哺乳动物</h4>--%>
</div> </div>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!