sh-order.vue
3.3 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<template>
<!-- 订单卡片 -->
<view class="order-wrapper"> <!-- 为了加样式-->
<view class="sh-order-box x-f">
<view class="order-box x-f">
<view class="order-item y-f" @tap="jump('/pages/order/list', { type: order.type })" v-for="order in orderNav" :key="order.id">
<view class="y-f item-box">
<image class="order-img" :src="order.img" mode=""></image>
<text class="item-title">{{ order.title }}</text>
<view class="cu-tag badge" v-if=" orderNum && orderNum[order.type]">{{ orderNum[order.type] }}</view>
</view>
</view>
<!-- <view class="order-item y-f" @tap="jump('/pages/order/after-sale/list')">
<view class="y-f item-box">
<image class="order-img" src="http://shopro.7wpp.com/imgs/user/tab55.png" mode=""></image>
<text class="item-title">退换货</text>
<view class="cu-tag badge"></view>
</view>
</view> -->
</view>
<view class="order-item y-f all-order" @tap="jump('/pages/order/list', { type: 'all' })">
<!-- <image class="cut-off--line" src="/static/imgs/user/cut_off_line.png" mode=""></image> -->
<view class="y-f item-box">
<image class="order-img" src="/static/imgs/user/all_order.png" mode="aspectFill"></image>
<text class="item-title">全部</text>
<!-- <view class="cu-tag badge" v-if="orderNum[order.type]">{{ orderNum[order.type] }}</view> -->
</view>
</view>
</view>
</view>
</template>
<script>
import { mapMutations, mapActions, mapState } from 'vuex';
export default {
components: {},
data() {
return {
orderNav: [
{
id: 1,
title: '待付款',
img: 'http://shopro.7wpp.com/imgs/user/tab11.png',
type: 'nopay'
},
{
id: 2,
title: '待发货',
img: 'http://shopro.7wpp.com/imgs/user/tab22.png',
type: 'nosend'
},
{
id: 3,
title: '待收货',
img: 'http://shopro.7wpp.com/imgs/user/tab33.png',
type: 'noget'
},
{
id: 4,
title: '已完成',
img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
type: 'nocomment'
},
// {
// id: 4,
// title: '待评价',
// img: 'http://shopro.7wpp.com/imgs/user/tab44.png',
// type: 'nocomment'
// },
// {
// id: 5,
// title: '退换货',
// img: 'http://shopro.7wpp.com/imgs/user/tab55.png',
// type: 'aftersale'
// }
]
};
},
computed: {
...mapState({
orderNum: state => state.user.orderNum
})
},
onLoad() {},
methods: {
jump(path, query) {
this.$Router.push({
path: path,
query: query
});
}
}
};
</script>
<style lang="scss">
// 订单卡片
.order-wrapper{
padding-bottom: 32rpx !important;
}
.sh-order-box {
padding-top: 28rpx;
padding-bottom: 28rpx;
background: #fff;
width: 686rpx;
border-radius: 16px;
margin: 0 auto;
.order-box {
flex: 4;
}
.all-order {
position: relative;
// .cut-off--line {
// position: absolute;
// top: 50%;
// transform: translateY(-50%);
// right: (750rpx/5) - 15rpx;
// width: 30rpx;
// height: 136rpx;
// }
}
.order-item {
flex: 1;
.item-box {
position: relative;
}
.order-img {
width: 46rpx;
height: 46rpx;
// background: #ccc;
}
.item-title {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: rgba(153, 153, 153, 1);
line-height: 24rpx;
padding-top: 10rpx;
}
}
}
</style>