Authored by 毕凯

Merge branch 'hotfix/undefined' into 'gray'

Hotfix/undefined



See merge request !1208
... ... @@ -294,20 +294,6 @@ const category = (req, res, next) => {
*/
const listNew = (req, res, next) => {
let params = _.assign({}, req.query);
/* 勿修改,唤起 APP 使用 */
let appParams = _.assign({}, req.query, {
title: req.query.title || req.query.sort_name || '',
productPool: req.query.filter_poolId,
actiontype: req.query.actiontype || '1'
});
delete appParams.filter_poolId;
let appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' +
JSON.stringify(appParams) +
'}';
let uid = req.user.uid;
// 获取第一页数据做服务端渲染
... ... @@ -357,6 +343,20 @@ const listNew = (req, res, next) => {
title: categoryIntroRedis[0],
desc: categoryIntroRedis[1]
} : null;
let appPath = 'yohobuy://yohobuy.com/goapp';
if (params.gender && params.category_id) {
let appParams = {
gender: params.gender,
title: params.seoTitle,
category_id: params.category_id,
actiontype: params.actiontype || '1'
};
appPath = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.list","params":' +
JSON.stringify(appParams) +
'}';
}
res.render('search/list-new', Object.assign({
_noLazy: true, // 首屏不使用lazyload
... ...
... ... @@ -583,13 +583,15 @@ const shop = {
params.limit = 24;
req.ctx(searchModel).getShopGoods(params).then((result) => {
if (result.data.product_list && result.data.product_list.length > 0) {
let product_list = productProcess.processProductList(result.data.product_list || [], {
isApp: params.isApp || (params.appVersion && params.appVersion !== 'false'),
gender: _coverChannel[params.coverChannel],
showSimilar: params.shop_id || params.material === 'true' ? false : true
});
let productList = _.get(result, 'data.product_list', []);
if (productList.length > 0) {
let product_list =
productProcess.processProductList(productList, {
isApp: params.isApp || (params.appVersion && params.appVersion !== 'false'),
gender: _coverChannel[params.coverChannel],
showSimilar: params.shop_id || params.material === 'true' ? false : true
});
res.render('search/page', {
layout: false,
... ...