Authored by yyq

Merge branch 'hotfix/friendLinkQQ' into feature/modifyApi

@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 3、百度权重值大于等于5。<br><br> 38 3、百度权重值大于等于5。<br><br>
39 39
40 欢迎交换友情链接,请通过以下方式联系。<br> 40 欢迎交换友情链接,请通过以下方式联系。<br>
41 - QQ :156030336(标注交换链接,带上网址) 41 + QQ :2413949472(标注交换链接,带上网址)
42 </p> 42 </p>
43 </div> 43 </div>
44 </div> 44 </div>
@@ -200,6 +200,10 @@ module.exports = class extends global.yoho.BaseModel { @@ -200,6 +200,10 @@ module.exports = class extends global.yoho.BaseModel {
200 // } 200 // }
201 let shopInfo, shopId; 201 let shopInfo, shopId;
202 202
  203 + if (!ssubValue) {
  204 + return;
  205 + }
  206 +
203 switch (ssubValue.type * 1) { 207 switch (ssubValue.type * 1) {
204 case 1: 208 case 1:
205 extQs = { 209 extQs = {
@@ -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 = {
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 "css-loader": "^0.28.11", 74 "css-loader": "^0.28.11",
75 "cssnano": "^3.10.0", 75 "cssnano": "^3.10.0",
76 "eslint": "^4.19.1", 76 "eslint": "^4.19.1",
77 - "eslint-config-yoho": "^1.0.9", 77 + "eslint-config-yoho": "1.0.9",
78 "eslint-loader": "^1.6.3", 78 "eslint-loader": "^1.6.3",
79 "extract-text-webpack-plugin": "^4.0.0-beta.0", 79 "extract-text-webpack-plugin": "^4.0.0-beta.0",
80 "handlebars": "4.0.5", 80 "handlebars": "4.0.5",
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 "shelljs": "^0.8.1", 101 "shelljs": "^0.8.1",
102 "style-loader": "^0.21.0", 102 "style-loader": "^0.21.0",
103 "stylelint": "^9.2.0", 103 "stylelint": "^9.2.0",
104 - "stylelint-config-yoho": "^1.3.0", 104 + "stylelint-config-yoho": "1.3.0",
105 "stylelint-formatter-table": "^1.0.3", 105 "stylelint-formatter-table": "^1.0.3",
106 "webpack": "^4.6.0", 106 "webpack": "^4.6.0",
107 "webpack-cli": "^2.0.15", 107 "webpack-cli": "^2.0.15",