mine.vue
2.83 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<template>
<LayoutApp :show-back="true" title="我的" :hideHeader="hideHeader">
<div class="body" ref="body">
<Scroll>
<div v-for="(value, key) in getMineList" :key="key">
<tab-item v-if="key === 'board'" :data="value" noLine icon="cubeic-notification" small grey>
<niticelScroll></niticelScroll>
</tab-item>
<template v-else-if="key === 'resource1' || key === 'resource2'">
<div v-if="value.data.template_name ==='single_image'" class="marg">
<singleImage :data="value.data.data[0]"></singleImage>
</div>
</template>
<div v-else-if="key === 'order'" class="bg-bottom marg">
<order></order>
</div>
<div v-else-if="key === 'sale'" class="bg-top marg">
<tab-item :data="value" noLine titleBold titleSmall></tab-item>
</div>
<bind class="marg" v-else-if="key === 'bindAccount'" :data="value"></bind>
<tab-item class="marg" v-else :data="value"></tab-item>
</div>
</Scroll>
</div>
</LayoutApp>
</template>
<script>
import tabItem from './components/tabItem';
import order from './components/order';
import scroll from './components/scroll';
import singleImage from './components/singleImage';
import bind from './components/bind';
import {Style, Scroll} from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
const { mapGetters, mapActions } = createNamespacedHelpers('home/mine');
export default {
props: ['hideHeader'],
data() {
return {};
},
computed: {
...mapGetters(['getMineList'])
},
created() {
},
activated() {
this.fetchResource();
this.fetchFavoriteNum();
this.fetchOrderSummary();
this.fetchSellerOrder();
this.fetchAssets(true)
// this.fetchUserWalletInfo();
this.fetchCoupon();
},
beforeRouteEnter (to, from, next) {
// 从我的绑定支付宝后进入交易明细
next(vm => {
let isbind = vm.$store.state.home.bindAccount.validStatus === 1
if(isbind && from.name === 'bindAccount') {
vm.$router.push({name: 'tradeIncome'})
}
})
},
methods: {
...mapActions(['fetchFavoriteNum', 'fetchResource', 'fetchSellerOrder', 'fetchOrderSummary', 'fetchAssets', 'fetchUserWalletInfo', 'fetchCoupon']),
},
components: {
tabItem,
order,
niticelScroll: scroll,
singleImage,
bind,
Style,
Scroll
}
};
</script>
<style lang="scss" scoped>
.body {
height: 100%;
// overflow-y: auto;
background-color: white;
// padding: 0 40px;
}
.marg {
margin: 0 40px;
}
.bg-top,
.bg-bottom {
background-color: #F2F2F2;
}
.bg-top {
border-top-left-radius: 32px;
border-top-right-radius: 32px;
margin-top: 30px;
padding: 0 30px;
}
.bg-bottom {
border-bottom-left-radius: 32px;
border-bottom-right-radius: 32px;
margin-bottom: 20px;
}
</style>