question.zml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <#def title = "扬彩帮助中心"/>
  2. <#def keywords = "帮助中心"/>
  3. <#def desc = "扬彩帮助中心"/>
  4. <#--头部起始-->
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>扬彩知识库</title>
  9. <meta charset="UTF-8">
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  12. <meta name="viewport" content="width=device-width,initial-scale=1"/>
  13. <meta name="Keywords" content="知识库" />
  14. <meta name="Description" content="扬彩知识库" />
  15. <link rel="shortcut icon" type="image/ico" href="/favicon.ico">
  16. ${Styles.src(zhiqim.css)}
  17. ${Scripts.src(zhiqim.js)}
  18. ${Styles.src(context.getRootPath("/zinc/css/yangcai_question_main_v1.4.0R2018031701.css"))}
  19. ${Scripts.src(context.getRootPath("/zinc/css/zhiqim_search_auto_list_v1.4.0R2018031701.js"))}
  20. </head>
  21. </div>
  22. <!--固定的111margin-->
  23. <div style="margin-top:10px"></div>
  24. <script>
  25. Z.onload(function()
  26. {
  27. //左侧分类列表点击事件
  28. Z(".sidebar p").click(function()
  29. {
  30. var $thisUl = Z(this).next("ul");
  31. var hasChild = ($thisUl.find("li").length > 0)?(1):(0);
  32. if (hasChild)
  33. {
  34. var $ulDisplay = $thisUl.css("display");
  35. var $thisIcon = Z(this).find(".z-font");
  36. $thisUl.slideToggle().siblings("ul").slideUp();
  37. if ($ulDisplay == "block")
  38. return Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
  39. Z(".sidebar p>.z-font").removeClass("z-arrowhead-up").addClass("z-arrowhead-down");
  40. $thisIcon.removeClass("z-arrowhead-down").addClass("z-arrowhead-up");
  41. }
  42. else
  43. selectCategory(Z(this).attr("data-id"));
  44. });
  45. //定义搜索框
  46. var search = new Z.SearchAutoList();
  47. search.elem = "searchinput";
  48. search.className = "SearchPresenter";
  49. search.methodName = "search";
  50. search.callback = function(){doSearchAjax(this.value);};
  51. search.execute();
  52. })
  53. //分类选择
  54. function selectCategory(id){
  55. window.location.href = "/question.htm?categoryId=" + id;
  56. }
  57. //文章显示
  58. function getArticle(categoryId,articleId)
  59. {
  60. window.location.href = "/question.htm?categoryId=" + categoryId + "&articleId=" + articleId;
  61. }
  62. //执行搜索
  63. function doSearchAjax(str)
  64. {
  65. window.location.href = "/search.htm?keyword=" + str;
  66. }
  67. </script>
  68. <#--容器开始-->
  69. <!-- 左边导航 -->
  70. <div class="sidebar" style="position: fixed;left: 0;top:0;bottom: 0;width:15%;margin-top:10px">
  71. <p data-id="0" class="<#if categoryId == 0>z-selected</#if>">热门问题</p>
  72. <#for category : categoryList>
  73. <#if category.getCategoryLevel() == 2>
  74. <p data-id="${category.getCategoryId()}" class="<#if category.getCategoryId()==categoryId>z-selected</#if>">
  75. <#if parentList.get(categoryList.indexOf(category))><i class="z-font <#if selectedList.get(categoryList.indexOf(category))>z-arrowhead-up<#else>z-arrowhead-down</#if> z-float-left z-mg-r10"></i></#if>${category.getCategoryName()}
  76. </p>
  77. <ul style="display:<#if selectedList.get(categoryList.indexOf(category))>block<#else>none</#if>;">
  78. <#for child : childrenList>
  79. <#if child.getParentId() == category.getCategoryId()>
  80. <li <#if categoryId == child.getCategoryId()>class="z-selected"</#if> onclick="selectCategory(${child.getCategoryId()})">${child.getCategoryName()}</li>
  81. </#if>
  82. </#for>
  83. </ul>
  84. </#if>
  85. </#for>
  86. </div>
  87. <!-- 右边主体 -->
  88. <div class="mainbody" style="width:84%;" >
  89. <!-- 搜索框 -->
  90. <div class="mainsearch">
  91. <span class="z-show-ib" id="search_wrap">
  92. <input id="searchinput" placeholder="输入问题关键词" type="text" class="z-input z-xlarge"><button onclick="doSearchAjax(searchinput.value)" class="z-button">&#xf004;</button>
  93. </span>
  94. </div>
  95. <div class="questionbody" id="questionbody">
  96. <!-- 显示文章 -->
  97. <#if articleStr != null>
  98. <div class="article">
  99. ${articleStr}</br>
  100. </div>
  101. <div class="article" >
  102. ${content}
  103. </div>
  104. <!-- 显示列表 -->
  105. <#elseif !articleList.isEmpty()>
  106. <dl class="article-list">
  107. <#for article : articleList>
  108. <dd><a href="javascript:{getArticle(${article.getCategoryId()},${article.getArticleId()})}">${article.getArticleTitle()}</a><span style="float:right">${article.getArticleTime().toString().substring(0, article.getArticleTime().toString().length() - 2)}</span></dd>
  109. </#for>
  110. </dl>
  111. <#else>
  112. <h2 style="font-weight:normal;">没有找到相关项目</h2>
  113. </#if>
  114. </div>
  115. </div>
  116. </body>
  117. </html>