...
|
...
|
@@ -11,8 +11,6 @@ const mRoot = '../models'; |
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const saleModel = require(`${mRoot}/sale`);
|
|
|
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
|
|
// const queryParam = {
|
|
|
// brand: '0',
|
|
|
// gender: '1,2,3',
|
...
|
...
|
@@ -47,17 +45,6 @@ const _processPublicData = (req, title, page) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 频道转换
|
|
|
* 产品要求,SALE的导航显示 Boy,Girl 单数形式
|
|
|
*/
|
|
|
const channelHash = {
|
|
|
boys: 'Boy',
|
|
|
girls: 'Girl',
|
|
|
kids: 'Kid',
|
|
|
lifestyle: 'Lifestyle'
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* sale 首页 资源位获取
|
|
|
* @param {[object]} req
|
|
|
* @param {[object]} res
|
...
|
...
|
@@ -71,25 +58,10 @@ let index = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
saleModel.getSaleData(params.channel).then((result) => {
|
|
|
|
|
|
// 扩展头部频道选择数据
|
|
|
Object.assign(params.renderData.pageHeader, {
|
|
|
saleNav: {
|
|
|
channel: channelHash[req.yoho.channel],
|
|
|
list: [
|
|
|
{
|
|
|
title: 'Boy',
|
|
|
url: helpers.urlFormat('/product/sale', {channel: 'boys'})
|
|
|
}, {
|
|
|
title: 'Girl',
|
|
|
url: helpers.urlFormat('/product/sale', {channel: 'girls'})
|
|
|
}, {
|
|
|
title: 'Kid',
|
|
|
url: helpers.urlFormat('/product/sale', {channel: 'kids'})
|
|
|
}, {
|
|
|
title: 'Lifestyle',
|
|
|
url: helpers.urlFormat('/product/sale', {channel: 'lifestyle'})
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
saleNav: saleModel.saleNav(req.yoho.channel)
|
|
|
});
|
|
|
res.render('sale/index', Object.assign(params.renderData, {
|
|
|
content: result,
|
...
|
...
|
@@ -97,7 +69,8 @@ let index = (req, res, next) => { |
|
|
title: {
|
|
|
title: '最新降价'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
pageChannel: false // 需求中,头部不需要跟随频道变颜色
|
|
|
}));
|
|
|
}).catch(next);
|
|
|
};
|
...
|
...
|
|