search.html 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <!DOCTYPE html>
  2. <html lang="zh-CN" xmlns:th="https://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="https://www.thymeleaf.org ">
  4. <head>
  5. <meta charset="UTF-8"/>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  8. <title>采美百科搜索页面</title>
  9. <link rel="stylesheet" th:href="@{/css/encyclopedia/normalize.css(v=${version})}"/>
  10. <link rel="stylesheet" th:href="@{/css/encyclopedia/base.css(v=${version})}"/>
  11. <link rel="stylesheet" th:href="@{/css/encyclopedia/common.css(v=${version})}"/>
  12. <link rel="stylesheet" th:href="@{/css/encyclopedia/pagination.css(v=${version})}"/>
  13. <link rel="stylesheet" th:href="@{/css/encyclopedia/index.css(v=${version})}"/>
  14. </head>
  15. <body>
  16. <!-- 引用公共头部 -->
  17. <template th:replace="encyclopedia/components/header"></template>
  18. <!-- 分类楼层 -->
  19. <div class="floor container search-floor" id="search">
  20. <p class="search-title">为您找到相关结果<span v-text="totalRecord"></span>条</p>
  21. <div class="emtyp" v-if="totalRecord <= 0">
  22. <img src="/img/encyclopedia/pc-icon-empty.png" alt="搜索结果为空"/>
  23. <p>未找到相关结果!</p>
  24. </div>
  25. <article class="article" v-else>
  26. <section class="section" v-for="(item, index) in searchList" :key="index">
  27. <a :href="item | formatUrl">
  28. <div class="cover">
  29. <img :src="item.image" :alt="item.name"/>
  30. </div>
  31. <div class="content">
  32. <h3 v-html="formatFromKeyword(item.name)"></h3>
  33. <div class="title" v-text="item.discription"></div>
  34. <div class="question">
  35. <p v-for="question in item.questionList" v-html="formatFromKeyword(question)"></p>
  36. </div>
  37. <div class="tag-list">
  38. <span class="tag">常见问题</span>
  39. <span class="tag">效果展示</span>
  40. <span class="tag">技术原理</span>
  41. <span class="tag">术前术后</span>
  42. </div>
  43. <div class="dashed-line"></div>
  44. <footer class="footer">
  45. <time>日期:<span v-text="item.publishTime"></span></time>
  46. <span>浏览量:<span v-text="item.pv"></span></span>
  47. </footer>
  48. </div>
  49. </a>
  50. </section>
  51. </article>
  52. <!--页码-->
  53. <div class="pagination-container" v-if="totalPage > 1">
  54. <ul class="pagination">
  55. <!--左侧固定-->
  56. <li v-if="listQuery.pageNum > 1"><a href="#" @click.prevent="pageChange(listQuery.pageNum - 1)">«</a></li>
  57. <li v-if="pagination[0] > 1"><a href="#" @click.prevent="pageChange(1)">1</a></li>
  58. <li class="ellipsis" v-if="pagination[0] > 2"><span>···</span></li>
  59. <!--可变动-->
  60. <template v-for="num in pagination">
  61. <li :class="{ active: listQuery.pageNum === num }" v-if="num >= 1 && num <= totalPage">
  62. <a href="#" @click.prevent="pageChange(num)" v-text="num"></a>
  63. </li>
  64. </template>
  65. <!--右侧固定-->
  66. <li class="ellipsis" v-if="pagination[pagination.length - 1] < totalPage - 1"><span>···</span></li>
  67. <li v-if="pagination[pagination.length - 1] < totalPage">
  68. <a href="#" @click.prevent="pageChange(totalPage)" v-text="totalPage"></a>
  69. </li>
  70. <li v-if="listQuery.pageNum < totalPage" :class="{ active: listQuery.pageNum === totalPage }">
  71. <a href="#" @click.prevent="pageChange(listQuery.pageNum + 1)">»</a>
  72. </li>
  73. </ul>
  74. <div class="tool">
  75. <div class="total">共<span v-text="totalPage"></span>页</div>
  76. <div class="jump">
  77. <div class="pagenum-input">跳至<input type="text" v-model="jumpInput"/>页</div>
  78. <a href="#" class="jump-btn" @click.prevent="pageChange(jumpInput)">点击跳转</a>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <!-- 引用公共底部 -->
  84. <template th:replace="encyclopedia/components/footer"></template>
  85. <script src="/lib/vue2.6.12.min.js"></script>
  86. <script th:src="@{/js/common/ajax.service.js(v=${version})}"></script>
  87. <script th:src="@{/js/common/serviceapi/encyclopedia.service.js(v=${version})}"></script>
  88. <script th:src="@{/js/encyclopedia/search.js(v=${version})}"></script>
  89. </body>
  90. </html>