step1.vue
2.18 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
<template>
<div>
<Row>
<order-goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</order-goods-info>
</Row>
<i-button type="primary" @click="nextStep(orderCode)">下一步</i-button>
</div>
</template>
<script>
import { orderGoodsInfo } from '../../components';
import OrderService from 'services/order/order-service';
import { OrderConfig } from '../../configs';
import _ from 'lodash';
export default {
components: { orderGoodsInfo },
props: ['current', 'orderCode', 'orderInfo'],
data() {
return {
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
feeSharingType: OrderConfig.feeSharingType,
};
},
created() {
this.$emit('nextStep', 0);
this.orderService = new OrderService();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
nextStep(code) {
this.$router.push({
name: 'order.deliver.step2',
params: {},
query: {
orderCode: code,
},
});
},
//获取订单商品
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>