exchange.js
1.3 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
/**
* 换货 Model
* DOC: http://git.yoho.cn/yoho-documents/api-interfaces/blob/master/订单/exchange.md
*/
const api = global.yoho.API;
const crypto = global.yoho.crypto;
const exchange = {
// 获取 换货列表
getOrderData(uid, orderId) {
return api.get('', {
method: 'app.change.goodsList',
uid: uid,
order_code: orderId
}, {
cache: true,
code: 200
});
},
// 加载用户可选择的退货方式列表
getDelivery(uid, areaCode) {
return api.get('', {
method: 'app.change.getDelivery',
area_code: areaCode,
uid: uid
}, {
cache: true,
code: 200
});
},
submitExchange(uid, params) {
const data = Object.assign(params, {
uid,
method: 'app.change.submit'
});
if (data.address_id) {
data.address_id = crypto.decrypt(null, data.address_id);
}
return api.post('', data);
},
/**
* 取消换货申请
* @param uid
* @param id
*/
cancelApply(uid, id) {
return api.post('', {
uid: uid,
id: id,
method: 'app.change.cancel'
});
}
};
module.exports = exchange;