exchange.js
691 Bytes
/*
* 换货 controller
*/
'use strict';
const exchangeModel = require('../models/exchange');
const exchange = {
exchange(req, res) {
const view = {
module: 'home',
page: 'exchange'
};
res.render('exchange', view);
},
// 订单 可换货商品列表
order(req, res, next) {
const uid = req.user.uid || 8050882;
const orderId = req.query.orderId;
if (!orderId) {
return next();
}
exchangeModel.getOrderData(uid, orderId).then(result => {
res.json(result);
}).catch(next);
},
// 提交 换货
submit() { }
};
module.exports = exchange;