personCenter.vue
3.82 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
<template>
<div class="personCenter-page">
<div class="person-header">
<div class="person-info">
<img v-if="personData.buyerAvatar" :src="face" alt="头像" class="person-face">
<img v-else src="../../static/images/defaultface.png" alt="头像" class="person-face">
<div>
<div class="person-name">{{personData.buyerNickName}}</div>
<div class="person-coins">联盟币:{{personData.buyerPoint}}</div>
</div>
</div>
</div>
<div class="cell-padding part-one">
<div class="total-order">
<mt-cell title="全部订单" is-link>
<img slot="icon" src="../../static/images/order.svg" width="20" height="20">
</mt-cell>
</div>
<ul class="order-box">
<li class="order-item">
<div><p>{{orderNum.stayPayNum}}</p>
<p>待付款</p></div>
</li>
<li class="order-item">
<div><p>{{orderNum.stayDeliverNum}}</p>
<p>待发货</p></div>
</li>
<li class="order-item">
<div><p>{{orderNum.stayTakeNum}}</p>
<p>待收货</p></div>
</li>
<li class="order-item">
<div><p>{{orderNum.stayReplyNum}}</p>
<p>待评价</p></div>
</li>
<li class="order-item">
<div><p>{{orderNum.salesReturnNum}}</p>
<p>退货</p></div>
</li>
</ul>
</div>
<div class="cell-padding part-two">
<mt-cell title="浏览记录" to="/browseRecordList" is-link>
<img slot="icon" src="../../static/images/record.svg" width="20" height="20">
</mt-cell>
<mt-cell title="我的收藏" to="/collectionList" is-link>
<img slot="icon" src="../../static/images/collection.svg" width="20" height="20">
</mt-cell>
<mt-cell title="我的地址" to="/myAddress" is-link>
<img slot="icon" src="../../static/images/address.svg" width="20" height="20">
</mt-cell>
</div>
<div class="cell-padding part-three">
<mt-cell title="我的优惠券" to="/myCoupon" is-link>
<img slot="icon" src="../../static/images/coupon.svg" width="20" height="20">
</mt-cell>
</div>
<bottom-nav></bottom-nav>
</div>
</template>
<script type="text/ecmascript-6">
import bottomNav from '../common/bottomNav.vue';
import {getpersonData} from '../../vuex/actions';
import {getorderNum} from '../../vuex/actions';
import {formatImg} from '../../utils/commonUtil';
export default {
data() {
return {}
},
components: {
bottomNav
},
computed: {
face(){
return formatImg.formatSRC(this.personData.buyerAvatar, 100, 100);
}
},
methods: {},
vuex: {
getters: {
personData: ({personCenterData}) => {
return personCenterData.personData;
},
orderNum: ({personCenterData}) => {
return personCenterData.orderNum;
}
},
actions: {
getpersonData,
getorderNum,
},
},
beforeRouteEnter(to, from, next) {
next(vm => {
vm.getpersonData(),
vm.getorderNum();
});
},
beforeRouteLeave(to, from, next) {
next();
}
}
</script>