...
|
...
|
@@ -15,7 +15,7 @@ const sale = require(`${mRoot}/sale`); // sale 页 model |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.index = (req, res) => {
|
|
|
exports.index = (req, res, next) => {
|
|
|
let channel = req.query.channel || req.cookies._Channel || 'boys';
|
|
|
|
|
|
let responseData = {
|
...
|
...
|
@@ -29,10 +29,7 @@ exports.index = (req, res) => { |
|
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
|
|
responseData.headerData = result.headerData;
|
|
|
res.render('sale/index', responseData);
|
|
|
}).catch(() => {
|
|
|
responseData.pageErr = true;
|
|
|
res.render('error', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
|
|
|
};
|
|
|
|
...
|
...
|
@@ -42,7 +39,7 @@ exports.index = (req, res) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.discount = (req, res) => {
|
|
|
exports.discount = (req, res, next) => {
|
|
|
let params = Object.assign({
|
|
|
saleType: '3'
|
|
|
}, req.query);
|
...
|
...
|
@@ -59,12 +56,8 @@ exports.discount = (req, res) => { |
|
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
|
|
responseData.headerData = result.headerData;
|
|
|
|
|
|
// log.info(result);
|
|
|
res.render('sale/discount', responseData);
|
|
|
}).catch(() => {
|
|
|
responseData.pageErr = true;
|
|
|
res.render('error', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -73,7 +66,7 @@ exports.discount = (req, res) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.vip = (req, res) => {
|
|
|
exports.vip = (req, res, next) => {
|
|
|
let params = Object.assign({
|
|
|
saleType: '2'
|
|
|
}, req.query);
|
...
|
...
|
@@ -92,10 +85,7 @@ exports.vip = (req, res) => { |
|
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
|
|
responseData.headerData = result.headerData;
|
|
|
res.render('sale/other', responseData);
|
|
|
}).catch(() => {
|
|
|
responseData.pageErr = true;
|
|
|
res.render('error', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
|
|
|
};
|
|
|
|
...
|
...
|
@@ -105,7 +95,7 @@ exports.vip = (req, res) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.newSale = (req, res) => {
|
|
|
exports.newSale = (req, res, next) => {
|
|
|
let params = Object.assign({
|
|
|
order: 's_t_desc'
|
|
|
}, req.query);
|
...
|
...
|
@@ -122,10 +112,7 @@ exports.newSale = (req, res) => { |
|
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
|
|
responseData.headerData = result.headerData;
|
|
|
res.render('sale/other', responseData);
|
|
|
}).catch(() => {
|
|
|
responseData.pageErr = true;
|
|
|
res.render('error', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -134,7 +121,7 @@ exports.newSale = (req, res) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.breakingYards = (req, res) => {
|
|
|
exports.breakingYards = (req, res, next) => {
|
|
|
let params = Object.assign({
|
|
|
saleType: '5'
|
|
|
}, req.query);
|
...
|
...
|
@@ -151,10 +138,7 @@ exports.breakingYards = (req, res) => { |
|
|
responseData.resultShow = JSON.stringify(result, null, 4);
|
|
|
responseData.headerData = result.headerData;
|
|
|
res.render('sale/other', responseData);
|
|
|
}).catch(() => {
|
|
|
responseData.pageErr = true;
|
|
|
res.render('error', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -163,7 +147,7 @@ exports.breakingYards = (req, res) => { |
|
|
* @param {[type]} res [description]
|
|
|
* @return {[type]} [description]
|
|
|
*/
|
|
|
exports.getGoodsList = (req, res) => {
|
|
|
exports.getGoodsList = (req, res, next) => {
|
|
|
let params = req.query;
|
|
|
|
|
|
params.uid = req.user.uid || 0;
|
...
|
...
|
@@ -176,5 +160,5 @@ exports.getGoodsList = (req, res) => { |
|
|
responseData.result = result;
|
|
|
|
|
|
res.render('goods', responseData);
|
|
|
});
|
|
|
}).catch(next);
|
|
|
}; |
...
|
...
|
|