detail.vue
3.73 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
<template>
<div class="ivu-row">
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title" style="height: 35px">
当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
<template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600">
<i-button
size="large"
type="success"
style="margin-left: 50px;"
@click="deliver(orderCode, orderInfo.orderStatus)"
>
发货
</i-button>
</template>
</p>
</div>
<div v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600" class="ivu-card-body">
若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br />
若买家存在恶意购买行为,您可以联系平台处理
</div>
</div>
<order-base-info :order-info="orderInfo" :order-status="orderStatus"></order-base-info>
<order-user-info :order-info="orderInfo" :is-show-express="true"></order-user-info>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">商品信息</p>
</div>
<div class="ivu-card-body">
<order-goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</order-goods-info>
</div>
</div>
</div>
</template>
<script>
import { orderGoodsInfo, orderUserInfo, orderBaseInfo } from '../components';
import { OrderConfig } from '../configs';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { orderGoodsInfo, orderUserInfo, orderBaseInfo },
data() {
return {
orderCode: this.$route.query.orderCode,
orderStatus: OrderConfig.orderStatus,
feeSharingType: OrderConfig.feeSharingType,
orderInfo: [],
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
};
},
created() {
this.orderService = new OrderService();
this.getOrderInfo();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
deliver(code, status) {
const routerName = status === 100 ? 'order.deliver.step1' : 'order.deliver.step3';
this.$router.push({
name: routerName,
params: {},
query: {
orderCode: code,
},
});
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
//获取订单商品
getOrderGoods() {
this.orderService.queryOrderGoods({ orderCode: +this.orderCode }).then(ret => {
this.tableData = _.get(ret, 'data', []);
});
},
//获取订单商品促销信息
getGoodsPromos() {
this.orderService.queryOrderGoodsPromos({ orderCode: +this.orderCode }).then(ret => {
this.goodsPromos = _.get(ret, 'data', []);
});
},
//获取订单优惠券
getOrderCoupons() {
this.orderService.queryOrderCoupons({ orderCode: +this.orderCode }).then(ret => {
this.couponsData = _.get(ret, 'data', {});
_.each(this.couponsData, coupons => {
coupons['feeSharingTypeStr'] = this.feeSharingType[coupons.feeSharingType] || '无';
});
});
},
//获取订单促销信息
getOrderPromos() {
this.orderService.queryOrderPromos({ orderCode: +this.orderCode }).then(ret => {
this.orderPromos = _.get(ret, 'data', {});
});
},
},
};
</script>
<style lang="scss"></style>