order-logistics.js
990 Bytes
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
/* eslint-disable operator-linebreak */
export default function() {
return {
namespaced: true,
state: {
logisticInfo: {},
},
mutations: {
initData: (state, data) => {
state.logisticInfo = data;
},
},
actions: {
/**
* 获取物流信息
* @param {*} param0
* @param {*}
* @returns ts ILogisticsInfo
*/
async fetchLogisticInfo({ commit }, { owner, code } = {}) {
const res = await this.$api.post('/api/order/express', {
tabType: owner,
orderCode: +code,
});
if (res.code === 200) {
commit('initData', res.data);
}
},
async flawReject(_, { orderCode } = {}) {
return this.$api.get('/api/order/flawreject', {
orderCode,
});
},
async flawAccept(_, { orderCode } = {}) {
return this.$api.get('/api/order/flawaccept', {
orderCode,
});
},
},
};
}