...
|
...
|
@@ -10,25 +10,43 @@ const utils = '../../../utils'; |
|
|
const headerModel = require('../../../doraemon/models/header');
|
|
|
const searchProcess = require(`${utils}/search-process`);
|
|
|
const newModel = require(`${mRoot}/new`);
|
|
|
const searchModel = require(`${mRoot}/search`);
|
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
|
|
|
// 新品到着(blk)
|
|
|
const blkNewGoods = (req, res) => {
|
|
|
const blkNewGoods = (req, res, next) => {
|
|
|
let params = Object.assign({
|
|
|
isblknew: true
|
|
|
}, req.query);
|
|
|
|
|
|
res.render('search/goods-list', {
|
|
|
module: 'product',
|
|
|
page: 'search-list',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: req.query.title || req.query.sort_name || '新品抢先看'
|
|
|
}),
|
|
|
goodList: params,
|
|
|
showDownloadApp: true,
|
|
|
pageFooter: true
|
|
|
});
|
|
|
// 获取第一页数据做服务端渲染
|
|
|
let uid = req.user.uid || 0;
|
|
|
let initialData = _.assign({
|
|
|
gender: req.query.gender || '1,3',
|
|
|
type: 'default',
|
|
|
order: '0',
|
|
|
page: 1,
|
|
|
limit: 12
|
|
|
}, params);
|
|
|
|
|
|
if (uid) {
|
|
|
initialData.uid = uid;
|
|
|
}
|
|
|
|
|
|
searchModel.getSearchData(initialData).then(firstScreenGoodsList => {
|
|
|
res.render('search/goods-list', {
|
|
|
module: 'product',
|
|
|
page: 'search-list',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: req.query.title || req.query.sort_name || '新品抢先看'
|
|
|
}),
|
|
|
goodList: params,
|
|
|
firstPageGoodsList: firstScreenGoodsList.list,
|
|
|
showDownloadApp: true,
|
|
|
pageFooter: true
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
// 新品到着
|
...
|
...
|
|