| 12345678910111213141516171819202122232425262728293031323334353637 |
- <template>
- <div class="container">
- <recommend-product/>
- <commodity-list :kinds="kinds"/>
- </div>
- </template>
- <script>
- import axios from '~plugins/axios'
- import { CommodityList, RecommendProduct } from '~components/store'
- export default {
- layout: 'shop',
- data () {
- return {
- uuid: this.$route.params.uuid
- }
- },
- fetch ({ store, params }) {
- return Promise.all([
- store.dispatch('shop/findStoreInfoFromUuid', params),
- store.dispatch('shop/findRecommendProducts', params),
- store.dispatch('shop/pageCommoditiesOfStore', params.uuid, { page: 1, count: 6 })
- ])
- },
- async asyncData ({ params }) {
- let { data } = await axios.get('/api/commodity/components/kinds', { params: { StoreUuid: params.uuid } })
- return { kinds: data }
- },
- components: {
- RecommendProduct,
- CommodityList
- }
- }
- </script>
- <style>
- </style>
|