search.vue 865 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="search-container">
  3. <d-search-log :search_list_hot="search_list_hot" :store_key="store_key" @onClickDelAllApi="onClickDelAll"
  4. @onSearchNameApi="onSearchName"></d-search-log>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. getTagByCode
  10. } from '@/request/api/house.js'
  11. export default {
  12. data() {
  13. return {
  14. search_list_hot: []
  15. }
  16. },
  17. onShow() {
  18. getTagByCode(this.$store.getters.activeCity.cityCode).then(res => {
  19. if (res.code == 200) {
  20. this.search_list_hot = res.data.map(node => node.name);
  21. }
  22. })
  23. },
  24. methods: {
  25. onClickDelAll() {
  26. console.log('[父级接收事件]:删除全部搜索记录')
  27. },
  28. onSearchName(e) {
  29. this.$navigateTo('/pages/searchlist/searchlist?searchValue=' + e);
  30. }
  31. }
  32. }
  33. </script>
  34. <style lang="scss">
  35. .search-container {}
  36. </style>