index.vue 781 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <div class="index">
  3. <banner/>
  4. <news/>
  5. <garden/>
  6. </div>
  7. </template>
  8. <script>
  9. import { Banner, News, Garden } from '@/components/home'
  10. export default {
  11. name: 'Index',
  12. layout: 'town',
  13. fetch ({ store }) {
  14. return Promise.all([
  15. store.dispatch('loadCarouselInfo', { client_type: 'cc', cityId: store.state.option.user.data.currentCity ? store.state.option.user.data.currentCity.id : null }),
  16. store.dispatch('loadNewsList', { limit: 4, page: 1 }),
  17. store.dispatch('loadGardenList', { limit: 4, page: 1 })
  18. ])
  19. },
  20. components: {
  21. News,
  22. Banner,
  23. Garden
  24. },
  25. computed: {
  26. bannerData () {
  27. return this.$store.state.carouselInfo.infoData.data.index
  28. }
  29. }
  30. }
  31. </script>