...
|
...
|
@@ -219,8 +219,6 @@ const shopFav = (req, res) => { |
|
|
|
|
|
// 品类落地页
|
|
|
const category = (req, res, next) => {
|
|
|
let seoTitle = '商品列表';
|
|
|
|
|
|
if (req.query) {
|
|
|
_.forEach(req.query, (perParam, index) => {
|
|
|
req.query[index] = stringProcess.paramsFilter(perParam);
|
...
|
...
|
@@ -228,11 +226,10 @@ const category = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
let params = Object.assign({}, req.query);
|
|
|
let seoTitle;
|
|
|
|
|
|
try {
|
|
|
seoTitle = decodeURIComponent(req.query.title || req.query.sort_name);
|
|
|
} catch (e) {
|
|
|
logger.error(`decodeURIComponent seoTitle:${e},url:${req.url}`);
|
|
|
if (req.query.title || req.query.sort_name) {
|
|
|
seoTitle = stringProcess.decodeURIComponent(req.query.title || req.query.sort_name);
|
|
|
}
|
|
|
|
|
|
/* 勿修改,唤起 APP 使用 */
|
...
|
...
|
@@ -275,7 +272,7 @@ const category = (req, res, next) => { |
|
|
// currentHref: 'https://www.yohobuy.com/list?' // TODO
|
|
|
// },
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: seoTitle
|
|
|
navTitle: seoTitle || '商品列表'
|
|
|
}),
|
|
|
goodList: params,
|
|
|
firstPageGoods: firstPageGoods || [],
|
...
|
...
|
@@ -358,16 +355,8 @@ const listNew = (req, res, next) => { |
|
|
let seoTitle = _.get(seoParams, 'sort');
|
|
|
let paramsTitle = params.title || params.sort_name; // 可能会配置的标题,优先级最高
|
|
|
|
|
|
if (!seoTitle) {
|
|
|
seoTitle = '商品列表';
|
|
|
}
|
|
|
|
|
|
if (paramsTitle) {
|
|
|
try {
|
|
|
seoTitle = decodeURIComponent(paramsTitle);
|
|
|
} catch (e) {
|
|
|
logger.error(`decodeURIComponent seoTitle:${e},url:${req.url}`);
|
|
|
}
|
|
|
seoTitle = stringProcess.decodeURIComponent(paramsTitle);
|
|
|
}
|
|
|
|
|
|
try {
|
...
|
...
|
@@ -390,7 +379,7 @@ const listNew = (req, res, next) => { |
|
|
currentHref: `https://www.yohobuy.com${req.url}`
|
|
|
},
|
|
|
pageHeader: headerModel.setNav({
|
|
|
navTitle: seoTitle
|
|
|
navTitle: seoTitle || '商品列表'
|
|
|
}),
|
|
|
goodList: params,
|
|
|
firstPageGoods: responseResult || [],
|
...
|
...
|
|