...
|
...
|
@@ -12,7 +12,7 @@ const orderModel = require('../models/order'); |
|
|
/**
|
|
|
* 我的订单
|
|
|
*/
|
|
|
const index = (req, res) => {
|
|
|
const index = (req, res, next) => {
|
|
|
const type = req.query.type;
|
|
|
const page = req.query.page;
|
|
|
const uid = global.yoho.uid || '7394907';
|
...
|
...
|
@@ -27,10 +27,10 @@ const index = (req, res) => { |
|
|
banner: 'http://placehold.it/{width}x{height}'
|
|
|
}, result)
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const detail = (req, res) => {
|
|
|
const detail = (req, res, next) => {
|
|
|
const code = req.query.code;
|
|
|
const uid = global.yoho.uid || '7394907';
|
|
|
|
...
|
...
|
@@ -44,10 +44,10 @@ const detail = (req, res) => { |
|
|
banner: 'http://placehold.it/{width}x{height}'
|
|
|
}, result)
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const getOrderList = (req, res) => {
|
|
|
const getOrderList = (req, res, next) => {
|
|
|
const type = req.query.type;
|
|
|
const page = req.query.page;
|
|
|
const uid = global.yoho.uid || '7394907';
|
...
|
...
|
@@ -60,10 +60,10 @@ const getOrderList = (req, res) => { |
|
|
orderList: result.order.orderList,
|
|
|
paginationOpts: result.order.paginationOpts
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const getOrderTotal = (req, res) => {
|
|
|
const getOrderTotal = (req, res, next) => {
|
|
|
const type = req.query.type;
|
|
|
const uid = global.yoho.uid || '7394907';
|
|
|
|
...
|
...
|
@@ -74,40 +74,40 @@ const getOrderTotal = (req, res) => { |
|
|
total: result.order.total,
|
|
|
type: result.order.type
|
|
|
});
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const cancelOrder = (req, res) => {
|
|
|
const cancelOrder = (req, res, next) => {
|
|
|
const uid = global.yoho.uid || '7394907';
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.cancelOrder(uid, code).then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const deleteOrder = (req, res) => {
|
|
|
const deleteOrder = (req, res, next) => {
|
|
|
const uid = global.yoho.uid || '7394907';
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.deleteOrder(uid, code).then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const getExpressInfo = (req, res) => {
|
|
|
const getExpressInfo = (req, res, next) => {
|
|
|
const uid = global.yoho.uid || '7394907';
|
|
|
const code = req.query.orderCode;
|
|
|
|
|
|
orderModel.getExpressInfo(uid, code).then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const getCancelOrderReason = (req, res) => {
|
|
|
const getCancelOrderReason = (req, res, next) => {
|
|
|
orderModel.getCancelOrderReason().then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
const editOrder = (req, res) => {
|
...
|
...
|
|