120 lines
4.6 KiB
Plaintext
120 lines
4.6 KiB
Plaintext
<#def title = "扬彩知识库"/>
|
|
<#def keywords = "知识库"/>
|
|
<#def desc = "扬彩知识库"/>
|
|
<#--头部起始-->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>扬彩知识库</title>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
|
<meta name="Keywords" content="知识库" />
|
|
<meta name="Description" content="扬彩知识库" />
|
|
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
|
|
${Styles.src(zhiqim.css)}
|
|
${Scripts.src(zhiqim.js)}
|
|
${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))}
|
|
${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))}
|
|
</head>
|
|
|
|
<script>
|
|
Z.onload(function()
|
|
{
|
|
//左侧分类列表点击事件
|
|
Z(".sidebar p").click(function()
|
|
{
|
|
var $thisUl = Z(this).next("ul");
|
|
var hasChild = ($thisUl.find("li").length > 0)?(1):(0);
|
|
if (hasChild)
|
|
{
|
|
var $ulDisplay = $thisUl.css("display");
|
|
var $thisIcon = Z(this).find(".z-font");
|
|
$thisUl.slideToggle().siblings("ul").slideUp();
|
|
if ($ulDisplay == "block")
|
|
return Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
|
|
Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
|
|
$thisIcon.removeClass("z-arrowhead-down").addClass("z-arrowhead-up");
|
|
}
|
|
else
|
|
selectCategory(Z(this).attr("data-id"));
|
|
});
|
|
|
|
//定义搜索框
|
|
var search = new Z.SearchAutoList();
|
|
search.elem = "searchinput";
|
|
search.className = "SearchPresenter";
|
|
search.methodName = "search";
|
|
search.callback = function(){doSearchAjax(this.value);};
|
|
search.execute();
|
|
})
|
|
|
|
//分类选择
|
|
function selectCategory(id)
|
|
{
|
|
window.location.href = "/question.htm?categoryId=" + id;
|
|
}
|
|
|
|
//文章显示
|
|
function getArticle(categoryId,articleId)
|
|
{
|
|
window.location.href = "/question.htm?categoryId=" + categoryId + "&articleId=" + articleId;
|
|
}
|
|
|
|
//执行搜索
|
|
function doSearchAjax(str)
|
|
{
|
|
window.location.href = "/search.htm?keyword=" + str;
|
|
}
|
|
|
|
</script>
|
|
<#--容器开始-->
|
|
<div id="container" class="container">
|
|
<!-- 左边导航 -->
|
|
<div class="sidebar">
|
|
<main<#if menu=="index"> class="selected"</#if> onclick="location.href='${context.getRootPath("/question.htm")}'"><img width="150" height="40" src="${context.getRootPath("/inc/images/logo.png")}" alt="扬彩印刷" title="扬彩印刷"></a></main>
|
|
<p data-id="0">热门问题</p>
|
|
<#for category : categoryList>
|
|
<#if category.getCategoryLevel() == 2>
|
|
<p data-id="${category.getCategoryId()}" class="<#if category.getCategoryId()==categoryId>z-selected</#if>">
|
|
<#if isParent.get(categoryList.indexOf(category))><i class="z-font z-arrowhead-down z-float-left z-mg-r10"></i></#if>${category.getCategoryName()}
|
|
</p>
|
|
<ul style="display:none;">
|
|
<#for child : childrenList>
|
|
<#if child.getParentId() == category.getCategoryId()>
|
|
<li <#if categoryId == child.getCategoryId()>class="z-selected"</#if> onclick="selectCategory(${child.getCategoryId()})">${child.getCategoryName()}</li>
|
|
</#if>
|
|
</#for>
|
|
</ul>
|
|
</#if>
|
|
</#for>
|
|
</div>
|
|
|
|
<!-- 右边主体 -->
|
|
<div class="mainbody">
|
|
<!-- 搜索框 -->
|
|
<div class="mainsearch">
|
|
<span class="z-show-ib" id="search_wrap">
|
|
<input id="searchinput" placeholder="输入问题关键词" value="${keyword}" type="text" class="z-input z-xlarge"><button onclick="doSearchAjax(searchinput.value)" class="z-button"></button>
|
|
</span>
|
|
</div>
|
|
<div class="questionbody" id="questionbody">
|
|
<div class="search-resultBar z-lh30">搜索结果:
|
|
<span>${keyword}</span> 共找到
|
|
<span>${articleList.size()}</span> 个结果
|
|
</div>
|
|
<dl class="search-resultList">
|
|
<#for article : articleList>
|
|
<dt><a href="javascript:{getArticle(${article.getCategoryId()},${article.getArticleId()})}">${article.getArticleTitle()}</a></dt>
|
|
<dd>${contentList.get(articleList.indexOf(article))}</dd>
|
|
</#for>
|
|
<#if articleList.size()==0>
|
|
<h2 style="font-weight:normal;">没有找到相关项目</h2>
|
|
</#if>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |