<template>
  <!-- 组件模板只能包含一个根元素，除非使用v-if 和 v-if-else -->
  <div>
    <!-- 轮播及店铺推荐 -->
    <recommend-store/>

    <recommendStore-show/>
  </div>
</template>
<script>
import { RecommendStore, RecommendStoreShow } from '~components/provider'

export default {
  layout: 'main',
  fetch ({ store }) {
    return Promise.all([
      store.commit('provider/stores/SET_STORETYPE', 'factory'),
      store.dispatch('loadBanners', {type: 'factory_banner_carousel'}),
      store.dispatch('provider/loadSalesStore', { isOriginal: true }),
      store.dispatch('provider/loadNewStores', { types: 'ORIGINAL_FACTORY', size: 5 }),
      store.dispatch('provider/loadRecommendOriginal', { types: 'ORIGINAL_FACTORY', num: 5 }),
      store.dispatch('provider/findSimilarStoreList', { page: 1, count: 10, type: 'ORIGINAL_FACTORY' }),
      store.dispatch('provider/loadHotComponents'),
      store.dispatch('provider/loadFactoriesCount'),
      store.dispatch('provider/loadAgencyCount'),
      store.dispatch('loadStoreStatus', { op: 'check' })
    ])
  },
  components: {
    RecommendStore,
    RecommendStoreShow
  },
  data () {
    return {
      msg: 'hello vue'
    }
  }
}
</script>
<style scoped lang="scss">
  div{
    background: #f2f1f1;
  }
</style>
