header.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!-- 头部导航 -->
  2. <header class="navbar" xmlns:th="https://www.thymeleaf.org">
  3. <input type="hidden" th:value="${coreServer}" id="coreServer">
  4. <input type="hidden" th:value="${agent}" id="userAgent">
  5. <div class="container">
  6. <div class="logo">
  7. <div class="menu-btn" id="menuBtn" data-target="#menuNav" data-colse="#menuColseBtn">
  8. <i class="icon menu"></i>
  9. </div>
  10. <a href="/">
  11. <h1>采美百科丰富的百科文库</h1>
  12. <img src="/img/encyclopedia/logo.png" alt="采美百科"/>
  13. </a>
  14. </div>
  15. <ul class="nav" id="menuNav">
  16. <li class="active"><a href="product.html">产品百科</a></li>
  17. <li><a href="instrument.html">仪器百科</a></li>
  18. <li><a href="about.html">关于采美百科</a></li>
  19. <li><a href="contact.html">联系我们</a></li>
  20. <li><span class="nav-close" id="#menuColseBtn"></span></li>
  21. </ul>
  22. <div class="search">
  23. <div class="search-control">
  24. <form action="search.html">
  25. <input type="text" id="searchKeyword" class="search-input" name="keyword" placeholder="请输入产品/仪器名称"/>
  26. <button class="search-btn">搜索</button>
  27. </form>
  28. <button class="hot-keyword" id="hotKeyword" data-target="#hotKeywords">热搜词</button>
  29. </div>
  30. <div class="keywords" id="hotKeywords">
  31. <span class="close-btn icon close"></span>
  32. <span>热门搜索:</span>
  33. <!--跳转方式:1仅搜索,2产品,3仪器,4链接-->
  34. <th:block th:each="item,stat: ${searchHotWord}" th:object="${item}">
  35. <a th:href="*{'search.html?keyword=' + keyWord}" th:if="*{jumpType eq 1}" th:text="*{keyWord}" th:title="*{keyWord}"></a>
  36. <a th:href="*{'product-' + productId + '.html'}" th:if="*{jumpType eq 2}" th:text="*{keyWord}" th:title="*{keyWord}"></a>
  37. <a th:href="*{'instrument-' + productId + '.html'}" th:if="*{jumpType eq 3}" th:text="*{keyWord}" th:title="*{keyWord}"></a>
  38. <a th:href="*{jumpLink}" th:if="*{jumpType eq 4}" th:text="*{keyWord}" th:title="*{keyWord}"></a>
  39. <em th:if="${stat.size gt 1 and stat.size ne stat.index + 1}">/</em>
  40. </th:block>
  41. </div>
  42. </div>
  43. </div>
  44. </header>