...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
const returns = require('../models/returns');
|
|
|
|
|
|
const detail = (req, res, next) => {
|
...
|
...
|
@@ -28,6 +29,28 @@ const refund = (req, res, next) => { |
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const refundApply = (req, res, next) => {
|
|
|
let orderCode = req.body.orderCode,
|
|
|
uid = req.user.uid,
|
|
|
goods = req.body.goods,
|
|
|
payment = req.body.payment;
|
|
|
|
|
|
uid = '8050560';
|
|
|
orderCode = '160192757';
|
|
|
|
|
|
if (!orderCode || _.isEmpty(goods) || _.isEmpty(payment)) {
|
|
|
return res.json({
|
|
|
code: 203,
|
|
|
message: '非法提交'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
returns.saveRefund(orderCode, uid, goods, payment).then(result => {
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
|
|
|
};
|
|
|
|
|
|
const exchange = (req, res, next) => {
|
|
|
next();
|
|
|
};
|
...
|
...
|
@@ -35,5 +58,6 @@ const exchange = (req, res, next) => { |
|
|
module.exports = {
|
|
|
detail,
|
|
|
refund,
|
|
|
refundApply,
|
|
|
exchange
|
|
|
}; |
...
|
...
|
|