|
@@ -39,26 +39,26 @@ const index = (req, res, next) => { |
|
@@ -39,26 +39,26 @@ const index = (req, res, next) => { |
39
|
|
39
|
|
40
|
return req.ctx(search).getSearchDataPre(Object.assign(params,
|
40
|
return req.ctx(search).getSearchDataPre(Object.assign(params,
|
41
|
{uid: req.user.uid, prid: req.user.prid, query: queryKey}),
|
41
|
{uid: req.user.uid, prid: req.user.prid, query: queryKey}),
|
42
|
- req.yoho.channel).then(result => {
|
42
|
+ req.yoho.channel).then(result => {
|
43
|
|
43
|
|
44
|
- Object.assign(resData, result);
|
44
|
+ Object.assign(resData, result);
|
45
|
|
45
|
|
46
|
- if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
|
|
|
47
|
- _.set(resData, 'search.keyWord', queryKey);
|
|
|
48
|
- return res.render('search/no-result', resData);
|
|
|
49
|
- }
|
46
|
+ if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
|
|
|
47
|
+ _.set(resData, 'search.keyWord', queryKey);
|
|
|
48
|
+ return res.render('search/no-result', resData);
|
|
|
49
|
+ }
|
50
|
|
50
|
|
51
|
- if (queryKey) {
|
|
|
52
|
- Object.assign(resData, {
|
|
|
53
|
- title: `${queryKey}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
54
|
- keywords: `${queryKey},${queryKey}价格,${queryKey}图片,${queryKey}怎么样,${queryKey}品牌,YOHO!BUY有货`,
|
51
|
+ if (queryKey) {
|
|
|
52
|
+ Object.assign(resData, {
|
|
|
53
|
+ title: `${queryKey}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
54
|
+ keywords: `${queryKey},${queryKey}价格,${queryKey}图片,${queryKey}怎么样,${queryKey}品牌,YOHO!BUY有货`,
|
55
|
description: `YOHO!BUY有货网yohobuy.com是国内专业的${queryKey}网上潮流购物商城,为您找到${_.get(resData, 'search.totalCount', 0)}条${queryKey}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${queryKey},就上YOHO!BUY有货` // eslint-disable-line
|
55
|
description: `YOHO!BUY有货网yohobuy.com是国内专业的${queryKey}网上潮流购物商城,为您找到${_.get(resData, 'search.totalCount', 0)}条${queryKey}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${queryKey},就上YOHO!BUY有货` // eslint-disable-line
|
56
|
- });
|
|
|
57
|
- }
|
56
|
+ });
|
|
|
57
|
+ }
|
58
|
|
58
|
|
59
|
- res.render('search/index', resData);
|
59
|
+ res.render('search/index', resData);
|
60
|
|
60
|
|
61
|
- });
|
61
|
+ });
|
62
|
}).catch(next);
|
62
|
}).catch(next);
|
63
|
};
|
63
|
};
|
64
|
|
64
|
|
|
@@ -210,21 +210,21 @@ const keyword = (req, res, next) => { |
|
@@ -210,21 +210,21 @@ const keyword = (req, res, next) => { |
210
|
|
210
|
|
211
|
return req.ctx(search).getSearchKeywordData(Object.assign(params, {query: query}),
|
211
|
return req.ctx(search).getSearchKeywordData(Object.assign(params, {query: query}),
|
212
|
req.yoho.channel).then(result => {
|
212
|
req.yoho.channel).then(result => {
|
213
|
- Object.assign(resData, result, {
|
|
|
214
|
- pageNoFollow: true,
|
|
|
215
|
- title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
216
|
- keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
|
|
|
217
|
- description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
|
213
|
+ Object.assign(resData, result, {
|
|
|
214
|
+ pageNoFollow: true,
|
|
|
215
|
+ title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
216
|
+ keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
|
|
|
217
|
+ description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
|
218
|
'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`
|
218
|
'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`
|
219
|
- });
|
219
|
+ });
|
220
|
|
220
|
|
221
|
- if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
|
|
|
222
|
- _.set(resData, 'search.keyWord', query);
|
|
|
223
|
- return res.render('search/no-result', resData);
|
|
|
224
|
- }
|
|
|
225
|
- res.render('search/index', resData);
|
221
|
+ if (!_.get(resData, 'search.goods') || !_.get(resData, 'search.goods').length) {
|
|
|
222
|
+ _.set(resData, 'search.keyWord', query);
|
|
|
223
|
+ return res.render('search/no-result', resData);
|
|
|
224
|
+ }
|
|
|
225
|
+ res.render('search/index', resData);
|
226
|
|
226
|
|
227
|
- }).catch(next);
|
227
|
+ }).catch(next);
|
228
|
};
|
228
|
};
|
229
|
|
229
|
|
230
|
/**
|
230
|
/**
|
|
@@ -240,29 +240,29 @@ const keyId = (req, res, next) => { |
|
@@ -240,29 +240,29 @@ const keyId = (req, res, next) => { |
240
|
return req.ctx(search).getSearchKeywordDataById(id, Object.assign({stocknumber: -1}, params),
|
240
|
return req.ctx(search).getSearchKeywordDataById(id, Object.assign({stocknumber: -1}, params),
|
241
|
req.yoho.channel).then(result => {
|
241
|
req.yoho.channel).then(result => {
|
242
|
|
242
|
|
243
|
- if (!result) {
|
|
|
244
|
- return next();
|
|
|
245
|
- }
|
243
|
+ if (!result) {
|
|
|
244
|
+ return next();
|
|
|
245
|
+ }
|
246
|
|
246
|
|
247
|
- let query = result.queryKey;
|
247
|
+ let query = result.queryKey;
|
248
|
|
248
|
|
249
|
- Object.assign(result, {
|
|
|
250
|
- pageNoFollow: true,
|
|
|
251
|
- title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
252
|
- keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
|
|
|
253
|
- description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
|
249
|
+ Object.assign(result, {
|
|
|
250
|
+ pageNoFollow: true,
|
|
|
251
|
+ title: `${query}价格_图片_品牌_怎么样-YOHO!BUY有货`,
|
|
|
252
|
+ keywords: `${query},${query}价格,${query}图片,${query}怎么样,${query}品牌,YOHO!BUY有货`,
|
|
|
253
|
+ description: `YOHO!BUY有货网yohobuy.com是国内专业的${query}网上潮流购物商城,为您找到${_.get(result,
|
254
|
'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`,
|
254
|
'search.totalCount', 0)}条${query}、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买${query},就上YOHO!BUY有货`,
|
255
|
- pageFooterSeo: {
|
|
|
256
|
- description: `YOHO!BUY有货网yohobuy.com是国内专业的<b>${query}</b>网上潮流购物商城,为您找到<b>${_.get(result,
|
255
|
+ pageFooterSeo: {
|
|
|
256
|
+ description: `YOHO!BUY有货网yohobuy.com是国内专业的<b>${query}</b>网上潮流购物商城,为您找到<b>${_.get(result,
|
257
|
'search.totalCount', 0)}</b>条<b>${query}</b>、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买<b>` +
|
257
|
'search.totalCount', 0)}</b>条<b>${query}</b>、产品的详细参数,实时报价,价格行情,图片、评价、品牌等信息。买<b>` +
|
258
|
`${query}</b>,就上YOHO!BUY有货!`,
|
258
|
`${query}</b>,就上YOHO!BUY有货!`,
|
259
|
- queryKey: query,
|
|
|
260
|
- wapUrl: helpers.urlFormat(`/chanpin/${id}.html`, null, 'm')
|
|
|
261
|
- }
|
|
|
262
|
- });
|
259
|
+ queryKey: query,
|
|
|
260
|
+ wapUrl: helpers.urlFormat(`/chanpin/${id}.html`, null, 'm')
|
|
|
261
|
+ }
|
|
|
262
|
+ });
|
263
|
|
263
|
|
264
|
- res.render('search/index', result);
|
|
|
265
|
- }).catch(next);
|
264
|
+ res.render('search/index', result);
|
|
|
265
|
+ }).catch(next);
|
266
|
};
|
266
|
};
|
267
|
|
267
|
|
268
|
module.exports = {
|
268
|
module.exports = {
|