...
|
...
|
@@ -13,6 +13,15 @@ const headerModel = require('../../../doraemon/models/header'); |
|
|
const log = require(`${library}/logger`);
|
|
|
const saleModel = require(`${mRoot}/sale`);
|
|
|
|
|
|
const queryParam = {
|
|
|
brand: '0',
|
|
|
gender: '1,2,3',
|
|
|
sort: '0',
|
|
|
size: '0',
|
|
|
price: '0',
|
|
|
discount: '0.1,0.9'
|
|
|
};
|
|
|
|
|
|
const saleLogger = (err, res) => {
|
|
|
log.error('sale页面渲染错误:' + JSON.stringify(err));
|
|
|
res.send('error');
|
...
|
...
|
@@ -32,7 +41,7 @@ exports.index = (req, res) => { |
|
|
};
|
|
|
|
|
|
saleModel.getSaleData().then((result) => {
|
|
|
res.render('sale', Object.assign(renderData, {
|
|
|
res.render('sale', Object.assign(renderData, queryParam, {
|
|
|
content: result,
|
|
|
floorHeader: {
|
|
|
title: {
|
...
|
...
|
@@ -58,7 +67,7 @@ exports.breakCode = (req, res) => { |
|
|
};
|
|
|
|
|
|
saleModel.getBreakCodeData().then((result) => {
|
|
|
res.render('break-code', Object.assign(renderData, result));
|
|
|
res.render('break-code', Object.assign(renderData, queryParam, result));
|
|
|
}).catch((err) => {
|
|
|
saleLogger(err, res);
|
|
|
});
|
...
|
...
|
@@ -99,7 +108,7 @@ exports.specialDetail = (req, res) => { |
|
|
saleModel.getSpecialDetailData(id).then((result) => {
|
|
|
headerData.navTitle = result.title;
|
|
|
renderData.pageHeader = headerData;
|
|
|
res.render('special-detail', Object.assign(renderData, result));
|
|
|
res.render('special-detail', Object.assign(renderData, queryParam, result));
|
|
|
}).catch((err) => {
|
|
|
saleLogger(err, res);
|
|
|
});
|
...
|
...
|
@@ -118,7 +127,7 @@ exports.vip = (req, res) => { |
|
|
};
|
|
|
|
|
|
saleModel.getVipData().then((result) => {
|
|
|
res.render('vip', Object.assign(renderData, {
|
|
|
res.render('vip', Object.assign(renderData, queryParam, {
|
|
|
content: result
|
|
|
}));
|
|
|
}).catch((err) => {
|
...
|
...
|
|