returns-api.js
2.78 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
/**
* 商品基本信息
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/7/19
*/
'use strict';
const api = global.yoho.API;
const getExpressCompanyAsync = () => {
return api.get('', {
method: 'app.express.getExpressCompany'
}, {code: 200});
};
const getOrderInfoAsync = (orderCode, uid, sessionKey) => {
return api.get('', {
method: 'app.SpaceOrders.info',
order_code: orderCode,
uid: uid,
session_key: sessionKey
}, {code: 200});
};
const getRefundGoodsAsync = (orderCode, uid) => {
return api.get('', {
method: 'app.refund.goodsList',
order_code: orderCode,
uid: uid
}, {code: 200});
};
const getRefundDetailAsync = (applyId, uid) => {
return api.get('', {
method: 'app.refund.detail',
id: applyId,
uid: uid
}, {code: 200});
};
const refundSubmitAsync = (orderCode, uid, goods, payment) => {
return api.get('', {
method: 'app.refund.submit',
order_code: orderCode,
uid: uid,
goods: JSON.stringify(goods),
payment: JSON.stringify(payment)
}, {code: 200});
};
const getChangeGoodsListAsync = (orderCode, uid) => {
return api.get('', {
method: 'app.change.goodsList',
order_code: orderCode,
uid: uid
});
};
const getProductInfoAsync = (productId, productSkn) => {
return api.get('', {
method: 'app.product.data',
product_id: productId,
product_skn: productSkn
});
};
const getExchangeDetail = (id, uid) => {
return api.get('', {
method: 'app.change.detail',
id: id,
uid: uid
});
};
const changeSubmitAsync = (data, uid) => {
const requestData = Object.assign(data, {
method: 'app.change.submit',
uid: uid,
goods: JSON.stringify(data.goods)
});
return api.get('', requestData);
};
const setExpressNumberAsync = (uid, param, isChange) => {
return api.post('', {
method: isChange ? 'app.change.setexpress' : 'app.refund.setexpress',
uid: uid,
id: param.id,
express_id: param.companyId,
express_number: param.number,
express_company: param.companyName
});
};
const cancelReturnAsync = (id, uid, isChange) => {
return api.post('', {
method: isChange ? 'app.change.cancel' : 'app.refund.cancel',
id: id,
uid: uid
});
};
const getRefundBank = () => {
return api.get('', {
method: 'app.refund.refundBank'
});
};
module.exports = {
getExpressCompanyAsync,
getOrderInfoAsync,
getRefundGoodsAsync,
getChangeGoodsListAsync,
getProductInfoAsync,
getRefundDetailAsync,
refundSubmitAsync,
getExchangeDetail,
changeSubmitAsync,
setExpressNumberAsync,
cancelReturnAsync,
getRefundBank
};