search.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <div class='ConstructSearch'>
  3. <!-- 输入框 -->
  4. <!-- <div class="inputBox" @keydown.enter="searchFu()">
  5. <div class="searInco" @click="searchFu()">
  6. <van-icon name="search" />
  7. </div>
  8. <van-field maxlength="10" v-model="txt" placeholder="请输入要搜索的内容" />
  9. </div> -->
  10. <!-- 文字介绍 -->
  11. <div class="searTxt">
  12. <h3>芜湖市古建一张图</h3>
  13. <p>&emsp;&emsp;芜湖是全国文明域市、全国创新型试点域市、全国电子商务示范城市、全国信息消费示范域市、全国双拥模范城、国家园林域市等。</p>
  14. <p>&emsp;&emsp;辖区内有方特旅游度假区、天门山、镜湖公园、鸠兹古镇、丫山风景区、马仁奇峰、松鼠小镇、广济寺、王稼祥纪念园、繁昌窑遗址等景区。</p>
  15. </div>
  16. <!-- 底部下拉 -->
  17. <div class="searDown">
  18. <h3>区域划分</h3>
  19. <div class="searDownBox">
  20. <div class="searDownBox_row" v-for="item in data" :key="item.id">
  21. <div class="one" @click="item.done = !item.done">
  22. <div class="ll">{{ item.name }}</div>
  23. <div class="rr">
  24. <div class="bs">{{ item.children.length }}</div>
  25. <div class="arrows">
  26. <van-icon name="arrow-up" v-show="item.done" />
  27. <van-icon name="arrow-down" v-show="!item.done" />
  28. </div>
  29. </div>
  30. </div>
  31. <div class="downInfo" :class="{ downInfoAc: item.done }">
  32. <div @click="$router.push('/layout/goods')" v-for="val in item.children" :key="val.id">{{ val.name }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. </template>
  39. <script>
  40. export default {
  41. name: 'ConstructSearch',
  42. components: {},
  43. data() {
  44. return {
  45. txt: '',
  46. data: [
  47. { id: 1, name: '全部', done: false, children: [{ id: 1001, name: '芜湖老海关' }] },
  48. { id: 2, name: '镜湖', done: false, children: [] },
  49. { id: 3, name: '鸠江', done: false, children: [] },
  50. { id: 4, name: '弋江', done: false, children: [] },
  51. { id: 5, name: '湾沚', done: false, children: [] },
  52. { id: 6, name: '繁昌', done: false, children: [] },
  53. ]
  54. };
  55. },
  56. computed: {},
  57. watch: {},
  58. methods: {
  59. searchFu() {
  60. console.log('---------');
  61. }
  62. },
  63. created() {
  64. },
  65. mounted() {
  66. },
  67. beforeCreate() { }, //生命周期 - 创建之前
  68. beforeMount() { }, //生命周期 - 挂载之前
  69. beforeUpdate() { }, //生命周期 - 更新之前
  70. updated() { }, //生命周期 - 更新之后
  71. beforeDestroy() { }, //生命周期 - 销毁之前
  72. destroyed() { }, //生命周期 - 销毁完成
  73. activated() { }, //如果页面有keep-alive缓存功能,这个函数会触发
  74. }
  75. </script>
  76. <style lang='less' scoped>
  77. .ConstructSearch {
  78. width: 75%;
  79. height: 100%;
  80. background-image: url('../../../assets/img/construct/searchBac.png');
  81. background-size: 100% 100%;
  82. padding-top: 10px;
  83. .inputBox {
  84. margin: 0px auto;
  85. width: 90%;
  86. height: 30px;
  87. position: relative;
  88. .searInco {
  89. color: #A0A0A0;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. font-size: 20px;
  94. position: absolute;
  95. top: 0;
  96. left: 10px;
  97. z-index: 3;
  98. width: 20px;
  99. height: 30px;
  100. }
  101. /deep/.van-cell {
  102. width: 100%;
  103. height: 30px;
  104. line-height: 30px;
  105. padding: 0px 0 0px 36px;
  106. background-color: #fff;
  107. border-radius: 15px;
  108. }
  109. }
  110. .searTxt {
  111. width: 100%;
  112. height: 35%;
  113. overflow-y: auto;
  114. font-size: 14px;
  115. padding: 5px 8px;
  116. h3 {
  117. text-align: center;
  118. margin: 10px 0;
  119. }
  120. p {
  121. margin-bottom: 5px;
  122. line-height: 18px;
  123. }
  124. }
  125. .searDown {
  126. padding-top: 30px;
  127. width: 100%;
  128. height: 64%;
  129. color: black;
  130. h3 {
  131. text-align: center;
  132. font-size: 18px;
  133. }
  134. .searDownBox {
  135. padding: 15px 20px 0;
  136. margin-top: 10px;
  137. width: 100%;
  138. height: calc(100% - 34px);
  139. overflow-y: auto;
  140. .searDownBox_row {
  141. width: 100%;
  142. font-size: 16px;
  143. color: #666666;
  144. margin-bottom: 20px;
  145. .one {
  146. height: 24px;
  147. align-items: center;
  148. display: flex;
  149. justify-content: space-between;
  150. .rr {
  151. display: flex;
  152. align-items: center;
  153. }
  154. .bs {
  155. width: 30px;
  156. height: 24px;
  157. border-radius: 5px;
  158. background-color: #ECB1B8;
  159. text-align: center;
  160. line-height: 24px;
  161. color: #fff;
  162. }
  163. .arrows {
  164. margin-left: 15px;
  165. }
  166. }
  167. .downInfo {
  168. &>div {
  169. transition: height .3s;
  170. padding-left: 40px;
  171. height: 0;
  172. line-height: 0;
  173. overflow: hidden;
  174. opacity: 0;
  175. }
  176. }
  177. .downInfoAc {
  178. &>div {
  179. opacity: 1;
  180. height: 30px;
  181. line-height: 30px;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>