order-goods-info.vue
4.76 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<template>
<table cellspacing="0" cellpadding="0" class="order-detail">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width: ' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(goods, index) in tableData">
<tr :key="index">
<td>{{ goods.productSku }}</td>
<td>
<img
:src="
'http://shopmanage.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=' +
goods.productSku +
'&size=40x60'
"
/>
</td>
<td style="text-align: left">
<p>{{ goods.productName }}</p>
<p>{{ goods.prodcutCode }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>{{ goods.buyNumber }}</td>
<td>{{ goods.retailPrice }}</td>
<td>{{ goods.salePrice }}</td>
<td>{{ goods.lastPrice }}</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].couponsDiscountAmount
? goodsPromos[goods.id].couponsDiscountAmount
: 0
}}
</td>
<td>{{ goodsPromos[goods.id] && goodsPromos[goods.id].yohoCoin ? goodsPromos[goods.id].yohoCoin : 0 }}</td>
<td>
{{ goodsPromos[goods.id] && goodsPromos[goods.id].redPackage ? goodsPromos[goods.id].redPackage : 0 }}
</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].giftCardAmount ? goodsPromos[goods.id].giftCardAmount : 0
}}
</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].activityAmount ? goodsPromos[goods.id].activityAmount : 0
}}
</td>
<td>{{ goods.subtotal }}</td>
</tr>
</template>
</tbody>
<tfoot>
<tr>
<td colspan="13" style="text-align: left">
<span>实付金额:¥{{ orderInfo.lastOrderAmount }}</span>
<span>快递费:¥{{ orderInfo.shippingCost }}</span>
</td>
</tr>
<tr>
<td td colspan="13">
<div class="ivu-card">
<div class="ivu-card-head" style="text-align: left">
<p slot="title">使用优惠券</p>
</div>
<i-table border :columns="couponsTableCols" :data="couponsData"></i-table>
</div>
</td>
</tr>
<tr>
<td colspan="13">
<template v-if="orderPromos">
<template v-for="(item, index) in orderPromos">
<Row :key="index">{{ item.promotionTitle }} {{ item.beginTime }} — {{ item.endTime }}</Row>
</template>
</template>
<template v-else>
<span>没有参加活动.</span>
</template>
</td>
</tr>
</tfoot>
</table>
</template>
<script>
export default {
name: 'OrderGoodsInfo',
props: ['orderInfo', 'tableData', 'couponsData', 'goodsPromos', 'orderPromos'],
data() {
return {
tableCols: [
{ title: 'sku', width: '8%' },
{ title: '商品图片', width: '8%' },
{ title: '商品信息', width: '10%' },
{ title: '数量', width: '6%' },
{ title: '吊牌价', width: '6%' },
{ title: '销售价', width: '6%' },
{ title: '成交价', width: '6%' },
{ title: '优惠券', width: '6%' },
{ title: 'YOHO币', width: '6%' },
{ title: '红包', width: '6%' },
{ title: '礼品卡', width: '6%' },
{ title: '活动优惠', width: '6%' },
{ title: '小计', width: '6%' },
],
couponsTableCols: [
{
title: '优惠券名称',
key: 'couponTitle',
},
{
title: '优惠券面值',
key: 'couponAmount',
},
{
title: '优惠券金额调整',
key: 'couponAdjustAmount',
},
{
title: '费用承担类型',
key: 'feeSharingTypeStr',
},
{
title: '费用承担比例',
key: 'feeSharingRatio',
},
],
};
},
};
</script>
<style lang="scss">
table.order-detail {
width: 100%;
height: auto;
thead {
th {
padding: 8px 0;
border: 1px solid #cccccc;
text-align: center;
}
}
tbody,
tfoot {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>