mine.vue
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<template>
<LayoutApp :show-back="true">
<div class="body" ref="body">
<div v-for="item in tabList" :key="item.name">
<tab-item v-if="item.name === 'board'" :data="item" noLine titleBold titleSmall small grey>
<scroll></scroll>
</tab-item>
<order v-else-if="item.name === 'order'"></order>
<tab-item v-else-if="item.name === 'sale'" :data="item" noLine titleBold></tab-item>
<tab-item v-else :data="item"></tab-item>
</div>
</div>
</LayoutApp>
</template>
<script>
import tabItem from './components/tabItem';
import order from './components/order';
import scroll from './components/scroll';
import { createNamespacedHelpers } from 'vuex';
const {mapState, mapActions} = createNamespacedHelpers('home/mine');
export default {
data() {
return {
tabList: [
{name: 'board', title: '公告栏'},
{name:'sale', title: '出售中', num: 1},
{name: 'order'},
{name: 'income', title: '交易收入', num: 1},
{name: 'buyOrder', title: '我购买的订单', num: 1},
{name: 'buy', title: '我的求购', num: 1},
{name: 'collect', title: '我的收藏', num: 1}
]
}
},
computed:{
...mapState([
'favoriteNum',
'buyNum'
])
},
created() {
this.fetchResource()
this.fetchFavoriteNum()
this.fetchOrderSummary().then(data => {
console.log(data)
})
this.fetchSellerOrder()
this.fetchAssets().then(data => {
console.log(data)
})
},
methods: {
...mapActions(['fetchFavoriteNum','fetchResource','fetchSellerOrder','fetchOrderSummary', 'fetchAssets'])
},
components: {
tabItem,
order,
scroll
}
};
</script>
<style lang="scss" scoped>
.body {
height: 100%;
overflow-y: auto;
background-color: white;
padding: 0 40px;
}
</style>