_keyword.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div class="container" id="searchResult">
  3. <search-title :keyword="key" @showAction="showAction" @typeAction="onTypeChanged"></search-title>
  4. <store-content v-show="show" @pageAction="onPageChanged"></store-content>
  5. </div>
  6. </template>
  7. <script>
  8. import { SearchTitle, StoreContent } from '~components/searchStore'
  9. export default {
  10. layout: 'main',
  11. components: {
  12. SearchTitle,
  13. StoreContent
  14. },
  15. data () {
  16. return {
  17. key: this.$route.query.w,
  18. show: true,
  19. type: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY'
  20. }
  21. },
  22. fetch ({store, route}) {
  23. return Promise.all([
  24. store.dispatch('searchStore/searchStoreDetail', {page: 1, count: 8, keyword: route.query.w, types: 'AGENCY-DISTRIBUTION-ORIGINAL_FACTORY', op: 'pageByType'})
  25. ])
  26. },
  27. methods: {
  28. showAction: function (show) {
  29. this.show = show
  30. },
  31. onPageChanged: function (page) {
  32. this.$store.dispatch('searchStore/searchStoreDetail', {page: page, count: 8, keyword: this.$route.query.w, types: this.type, op: 'pageByType'})
  33. },
  34. onTypeChanged: function (type) {
  35. this.type = type
  36. }
  37. }
  38. }
  39. </script>
  40. <style>
  41. #search-store-content .el-dialog--tiny{
  42. width: 320px !important;
  43. }
  44. #search-store-content .el-dialog__body{
  45. padding: 12px !important;
  46. }
  47. </style>