RelicSearch.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="relic-search">
  3. <BtnClose
  4. @click="router.go(-1)"
  5. />
  6. <div class="search-bar">
  7. <input
  8. v-model="keyword"
  9. type="text"
  10. placeholder="请输入要搜索的内容..."
  11. >
  12. <img
  13. class="search"
  14. src="@/assets/images/icon_search_white.png"
  15. alt=""
  16. draggable="false"
  17. >
  18. </div>
  19. <menu class="tab-bar">
  20. <button
  21. v-for="(item, idx) in areaList"
  22. :key="idx"
  23. :class="{
  24. active: activeAreaIdx === idx
  25. }"
  26. @click="activeAreaIdx = idx"
  27. >
  28. {{ item }}
  29. </button>
  30. </menu>
  31. <ul class="relic-list">
  32. <li
  33. v-for="item in relicList"
  34. :key="item.id"
  35. class="relic-item"
  36. >
  37. <img
  38. :src="item.thumb"
  39. alt=""
  40. class="photo"
  41. >
  42. <div class="center">
  43. <div class="name">
  44. {{ item.name }}
  45. </div>
  46. <div class="desc">
  47. {{ item.description }}
  48. </div>
  49. </div>
  50. <button class="go">
  51. <img
  52. class=""
  53. src="@/assets/images/icon_arrow.png"
  54. alt=""
  55. draggable="false"
  56. >
  57. </button>
  58. </li>
  59. </ul>
  60. </div>
  61. </template>
  62. <script setup>
  63. import { ref, computed, watch, onMounted, watchEffect } from "vue"
  64. import { useRoute, useRouter } from "vue-router"
  65. import { useStore } from "vuex"
  66. import BtnClose from '@/components/BtnClose.vue'
  67. const route = useRoute()
  68. const router = useRouter()
  69. const store = useStore()
  70. const keyword = ref('')
  71. const areaList = ref([
  72. '全部',
  73. '锡山区',
  74. '惠山区',
  75. '滨湖区',
  76. '梁溪区',
  77. '宜兴市',
  78. '江阴市',
  79. '新吴区',
  80. ])
  81. const activeAreaIdx = ref(0)
  82. // {
  83. // id: 1,
  84. // photo: 'icon_user-active.png',
  85. // name: '点位名称',
  86. // desc: '上看到附近可舒服都市妇科技术都是了解对方 时刻的风景 士大夫精神地方可是对方 ',
  87. // },
  88. const relicList = ref([])
  89. watchEffect(() => {
  90. api.getRelicList(keyword.value, activeAreaIdx.value > 0 ? areaList.value[activeAreaIdx.value] : null).then((res) => {
  91. console.log('sdfsdf', res)
  92. relicList.value = res
  93. })
  94. })
  95. </script>
  96. <style lang="less" scoped>
  97. .relic-search{
  98. position: fixed;
  99. left: 0;
  100. top: 0;
  101. width: 100%;
  102. height: 100%;
  103. background: rgba(0,0,0,0.6);
  104. backdrop-filter: blur(10px);
  105. z-index: 10;
  106. display: flex;
  107. flex-direction: column;
  108. align-items: center;
  109. >.search-bar{
  110. margin-top: 77px;
  111. flex: 0 0 auto;
  112. width: 874px;
  113. height: 74px;
  114. padding-left: 65px;
  115. padding-right: 32px;
  116. background: linear-gradient( 180deg, rgba(255,255,255,0.5) 100%, rgba(255,255,255,0.2) 0%);
  117. box-shadow: 0px 1px 4px 0px rgba(255,255,255,0.25);
  118. border-radius: 36px 36px 36px 36px;
  119. border: 1px solid rgba(255, 255, 255, 0.5);
  120. display: flex;
  121. align-items: center;
  122. margin-bottom: 58px;
  123. >input{
  124. flex: 1 0 1px;
  125. font-family: Source Han Sans CN, Source Han Sans CN;
  126. font-weight: 400;
  127. font-size: 24px;
  128. color: #FFFFFF;
  129. line-height: 28px;
  130. &::placeholder {
  131. font-size: 24px;
  132. color: rgba(200, 200, 200, 1);
  133. line-height: 28px;
  134. }
  135. }
  136. >img{
  137. flex: 0 0 auto;
  138. width: 32px;
  139. height: 32px;
  140. }
  141. }
  142. >menu.tab-bar{
  143. width: 100%;
  144. flex: 0 0 auto;
  145. display: flex;
  146. justify-content: space-evenly;
  147. align-items: center;
  148. margin-bottom: 89px;
  149. >button{
  150. font-family: Source Han Sans CN, Source Han Sans CN;
  151. font-weight: 400;
  152. font-size: 24px;
  153. color: rgba(255, 255, 255, 0.5);
  154. line-height: 28px;
  155. &.active{
  156. font-weight: bold;
  157. color: #fff;
  158. border-bottom: 1px solid #fff;
  159. }
  160. }
  161. }
  162. >ul.relic-list{
  163. flex: 1 0 1px;
  164. max-width: 1650px;
  165. overflow: auto;
  166. margin-bottom: 50px;
  167. >li.relic-item{
  168. height: 65px;
  169. display: inline-flex;
  170. align-items: center;
  171. margin-right: 97px;
  172. margin-bottom: 40px;
  173. cursor: pointer;
  174. >img{
  175. width: 65px;
  176. height: 65PX;
  177. margin-right: 26px;
  178. border-radius: 50%;
  179. border: 3px solid #FFFFFF;
  180. }
  181. >.center{
  182. width: 256px;
  183. margin-right: 77px;
  184. >.name{
  185. font-family: Source Han Sans CN, Source Han Sans CN;
  186. font-weight: bold;
  187. font-size: 24px;
  188. color: #FFFFFF;
  189. line-height: 28px;
  190. overflow: hidden;
  191. white-space: pre;
  192. text-overflow: ellipsis;
  193. margin-bottom: 4px;
  194. }
  195. >.desc{
  196. font-family: Source Han Sans CN, Source Han Sans CN;
  197. font-weight: 400;
  198. font-size: 16px;
  199. color: #FFFFFF;
  200. line-height: 19px;
  201. overflow: hidden;
  202. white-space: nowrap;
  203. text-overflow: ellipsis;
  204. }
  205. }
  206. >button.go{
  207. width: 26px;
  208. height: 22px;
  209. margin-right: 1px;
  210. }
  211. }
  212. }
  213. }
  214. </style>