...
|
...
|
@@ -13,6 +13,7 @@ const _ = require('lodash'); |
|
|
const crypto = global.yoho.crypto;
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const productProcess = require(`${utils}/product-process`);
|
|
|
const searchModel = require(`${mRoot}/search`);
|
|
|
|
|
|
/**
|
|
|
* 从 useragent 获取 uid
|
...
|
...
|
@@ -211,19 +212,24 @@ const shopFav = (req, res) => { |
|
|
};
|
|
|
|
|
|
// 品类落地页
|
|
|
const category = (req, res) => {
|
|
|
const category = (req, res, next) => {
|
|
|
let params = Object.assign({}, 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
|
|
|
});
|
|
|
// 获取第一页数据
|
|
|
searchModel.getSearchData(Object.assign({page: 1, limit: 6}, params)).then((firstPageGoodsList) => {
|
|
|
res.render('search/goods-list', {
|
|
|
_noLazy: true, // 首屏不使用lazyload
|
|
|
module: 'product',
|
|
|
page: 'search-list',
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: req.query.title || req.query.sort_name
|
|
|
}),
|
|
|
goodList: params,
|
|
|
firstPageGoodsList: firstPageGoodsList,
|
|
|
showDownloadApp: true,
|
|
|
pageFooter: true
|
|
|
});
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
|