Authored by yyq

fix lint

... ... @@ -39,26 +39,26 @@ const index = (req, res, next) => {
return req.ctx(search).getSearchDataPre(Object.assign(params,
{uid: req.user.uid, prid: req.user.prid, query: queryKey}),
req.yoho.channel).then(result => {
req.yoho.channel).then(result => {
Object.assign(resData, result);
Object.assign(resData, result);
if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
_.set(resData, 'search.keyWord', queryKey);
return res.render('search/no-result', resData);
}
if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
_.set(resData, 'search.keyWord', queryKey);
return res.render('search/no-result', resData);
}
if (queryKey) {
Object.assign(resData, {
title: `${queryKey}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${queryKey},${queryKey}价格,${queryKey}图片,${queryKey}怎么样,${queryKey}品牌,YOHO!BUY有货`,
if (queryKey) {
Object.assign(resData, {
title: `${queryKey}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${queryKey},${queryKey}价格,${queryKey}图片,${queryKey}怎么样,${queryKey}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${queryKey}网上潮流购物商城,为您找到${_.get(resData, 'search.totalCount', 0)}${queryKey}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${queryKey},就上YOHO!BUY有货` // eslint-disable-line
});
}
});
}
res.render('search/index', resData);
res.render('search/index', resData);
});
});
}).catch(next);
};
... ... @@ -209,21 +209,21 @@ const keyword = (req, res, next) => {
return req.ctx(search).getSearchKeywordData(Object.assign(params, {query: query}),
req.yoho.channel).then(result => {
Object.assign(resData, result, {
pageNoFollow: true,
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
Object.assign(resData, result, {
pageNoFollow: true,
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
'search.totalCount', 0)}${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`
});
});
if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
_.set(resData, 'search.keyWord', query);
return res.render('search/no-result', resData);
}
res.render('search/index', resData);
if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
_.set(resData, 'search.keyWord', query);
return res.render('search/no-result', resData);
}
res.render('search/index', resData);
}).catch(next);
}).catch(next);
};
/**
... ... @@ -239,29 +239,29 @@ const keyId = (req, res, next) => {
return req.ctx(search).getSearchKeywordDataById(id, Object.assign({stocknumber: -1}, params),
req.yoho.channel).then(result => {
if (!result) {
return next();
}
if (!result) {
return next();
}
let query = result.queryKey;
let query = result.queryKey;
Object.assign(result, {
pageNoFollow: true,
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
Object.assign(result, {
pageNoFollow: true,
title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
'search.totalCount', 0)}${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`,
pageFooterSeo: {
description: `YOHO!BUY有货网yohobuy.com是国内专业的<b>${query}</b>网上潮流购物商城,为您找到<b>${_.get(result,
pageFooterSeo: {
description: `YOHO!BUY有货网yohobuy.com是国内专业的<b>${query}</b>网上潮流购物商城,为您找到<b>${_.get(result,
'search.totalCount', 0)}</b>条<b>${query}</b>、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买<b>` +
`${query}</b>,就上YOHO!BUY有货!`,
queryKey: query,
wapUrl: helpers.urlFormat(`/chanpin/${id}.html`, null, 'm')
}
});
queryKey: query,
wapUrl: helpers.urlFormat(`/chanpin/${id}.html`, null, 'm')
}
});
res.render('search/index', result);
}).catch(next);
res.render('search/index', result);
}).catch(next);
};
module.exports = {
... ...