refund.js
1.28 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
/**
* 退换货
* @type {Object}
*/
'use strict';
const refundModel = require('../models/refund');
const refund = {
refund(req, res) {
res.render('refund');
},
order(req, res, next) {
const uid = req.user.uid || 8050882;
const orderId = req.query.orderId;
if (!orderId) {
return next();
}
refundModel.getOrderData(uid, orderId).then(result => {
res.json(result);
}).catch(next);
},
submit(req, res, next) {
const uid = req.user.uid || 8050882;
refundModel.submitRefundData(uid, req.body).then(result => {
res.json(result);
}).catch(next);
},
logistics(req, res, next) {
refundModel.getExpressCompany().then(result => {
res.render('logistics', {
module: 'home',
page: 'logistics',
company_list: result ? JSON.stringify(result.data) : ''
});
}).catch(next);
},
saveLogistics(req, res) {
// todo 调用保存物流信息接口
// const companyId = req.body.company_id;
// const companyName = req.body.company_name;
// const num = req.body.num;
res.json({
code: 200
});
}
};
module.exports = refund;