Search.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="search">
  3. <div class="top">
  4. <!-- 返回按钮 -->
  5. <div class="back" @click="$emit('close')"></div>
  6. <!-- 搜索按钮 -->
  7. <div class="searBtn"></div>
  8. <input type="text" v-model="txt" placeholder="请输入关键词..." />
  9. </div>
  10. <!-- 下面内容 -->
  11. <div class="main">
  12. <div class="mainTop">
  13. <div>村落名称</div>
  14. <div>访问量</div>
  15. </div>
  16. <div class="mainCon">
  17. <div class="row" v-for="i in 12" :key="i" @click="$router.push('/stair/1')">
  18. <div><span>·</span>卢边村</div>
  19. <div>99999</div>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. name: "search",
  28. components: {},
  29. data() {
  30. //这里存放数据
  31. return {
  32. txt: "",
  33. };
  34. },
  35. //监听属性 类似于data概念
  36. computed: {},
  37. //监控data中的数据变化
  38. watch: {},
  39. //方法集合
  40. methods: {},
  41. //生命周期 - 创建完成(可以访问当前this实例)
  42. created() {},
  43. //生命周期 - 挂载完成(可以访问DOM元素)
  44. mounted() {},
  45. beforeCreate() {}, //生命周期 - 创建之前
  46. beforeMount() {}, //生命周期 - 挂载之前
  47. beforeUpdate() {}, //生命周期 - 更新之前
  48. updated() {}, //生命周期 - 更新之后
  49. beforeDestroy() {}, //生命周期 - 销毁之前
  50. destroyed() {}, //生命周期 - 销毁完成
  51. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  52. };
  53. </script>
  54. <style lang='less' scoped>
  55. .search {
  56. padding: 18px 12px 0;
  57. z-index: 3;
  58. position: absolute;
  59. top: 0;
  60. left: 0;
  61. width: 100%;
  62. height: 100%;
  63. &::before {
  64. content: "";
  65. position: absolute;
  66. left: 0;
  67. top: 0;
  68. width: 100%;
  69. height: 100%;
  70. background: rgba(202, 185, 153, 0.9);
  71. backdrop-filter: blur(4px);
  72. z-index: -2;
  73. }
  74. .top {
  75. position: relative;
  76. width: 100%;
  77. height: 40px;
  78. input {
  79. color: #e0bb74;
  80. padding: 0 40px;
  81. width: 100%;
  82. height: 100%;
  83. border-radius: 20px;
  84. border: none;
  85. }
  86. /*修改提示文字的颜色*/
  87. /deep/input::-webkit-input-placeholder {
  88. /* WebKit browsers */
  89. color: #bfb094;
  90. }
  91. /deep/input:-moz-placeholder {
  92. /* Mozilla Firefox 4 to 18 */
  93. color: #bfb094;
  94. }
  95. /deep/input::-moz-placeholder {
  96. /* Mozilla Firefox 19+ */
  97. color: #bfb094;
  98. }
  99. /deep/input:-ms-input-placeholder {
  100. /* Internet Explorer 10+ */
  101. color: #bfb094;
  102. }
  103. .back {
  104. position: absolute;
  105. top: 6px;
  106. left: 10px;
  107. width: 29px;
  108. height: 29px;
  109. background: url("../assets/img/back.png");
  110. background-size: 100% 100%;
  111. }
  112. .searBtn {
  113. position: absolute;
  114. top: 5px;
  115. right: 10px;
  116. width: 29px;
  117. height: 29px;
  118. background: url("../assets/img/search2.png");
  119. background-size: 100% 100%;
  120. }
  121. }
  122. .main {
  123. padding: 0 10px;
  124. border-radius: 10px;
  125. margin-top: 10px;
  126. background-image: linear-gradient(
  127. rgba(255, 255, 255, 1),
  128. rgba(255, 255, 255, 0)
  129. );
  130. width: 100%;
  131. height: calc(100% - 60px);
  132. .mainTop {
  133. display: flex;
  134. width: 100%;
  135. height: 41px;
  136. border-bottom: 1px solid #bfb094;
  137. margin-bottom: 20px;
  138. & > div {
  139. width: 50%;
  140. text-align: center;
  141. line-height: 40px;
  142. font-family: "SYST";
  143. color: #5b5b5b;
  144. font-size: 14px;
  145. }
  146. }
  147. .mainCon {
  148. width: 100%;
  149. height: calc(100% - 62px);
  150. overflow-y: auto;
  151. }
  152. .row {
  153. display: flex;
  154. height: 40px;
  155. & > div {
  156. width: 50%;
  157. text-align: center;
  158. color: #5b5b5b;
  159. font-size: 14px;
  160. line-height: 40px;
  161. & > span {
  162. font-size: 24px;
  163. margin-right: 5px;
  164. }
  165. &:nth-of-type(1){
  166. display: flex;
  167. align-items: center;
  168. justify-content: center;
  169. }
  170. }
  171. }
  172. }
  173. }
  174. </style>