Authored by 毕凯

Merge branch 'gray' into 'master'

Gray



See merge request !611
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 var isWechat = /micromessenger/i.test(navigator.userAgent || ''); 26 var isWechat = /micromessenger/i.test(navigator.userAgent || '');
27 if (isWechat) { 27 if (isWechat) {
28 document.title =document.title.replace(' | Yoho!Buy有货 | 潮流购物逛不停', ''); 28 document.title =document.title.replace(' | Yoho!Buy有货 | 潮流购物逛不停', '');
29 - (function () { if (typeof (WeixinJSBridge) == "undefined") { document.addEventListener("WeixinJSBridgeReady", function (a) { setTimeout(function () { WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 }, function (b) { }) }, 0) }) } else { setTimeout(function () { WeixinJSBridge.invoke("setFontSizeCallback", { fontSize: 0 }, function (a) { }) }, 0) } })(); 29 + (function(){function setWechatSize(){if(typeof WeixinJSBridge!=="undefined"&&WeixinJSBridge.invoke){WeixinJSBridge.invoke("setFontSizeCallback",{fontSize:0},function(){})}}if(typeof WeixinJSBridge!=="undefined"){setTimeout(setWechatSize,0)}else{document.addEventListener("WeixinJSBridgeReady",function(){setTimeout(setWechatSize,0)})};}());
30 } 30 }
31 </script> 31 </script>
32 32
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.7.2", 3 + "version": "5.7.3",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
103 "yoho-fastclick": "^1.0.6", 103 "yoho-fastclick": "^1.0.6",
104 "yoho-hammer": "^2.0.7", 104 "yoho-hammer": "^2.0.7",
105 "yoho-iscroll": "^5.2.0", 105 "yoho-iscroll": "^5.2.0",
106 - "yoho-jquery": "^2.2.4", 106 + "yoho-jquery": "^1.12.4",
107 "yoho-jquery-lazyload": "^1.9.12", 107 "yoho-jquery-lazyload": "^1.9.12",
108 "yoho-jquery-qrcode": "^0.14.0", 108 "yoho-jquery-qrcode": "^0.14.0",
109 "yoho-mlellipsis": "0.0.3", 109 "yoho-mlellipsis": "0.0.3",
@@ -15,13 +15,13 @@ let fCbFn, hCbFn; // 筛选和关闭的回调 @@ -15,13 +15,13 @@ let fCbFn, hCbFn; // 筛选和关闭的回调
15 // 隐藏筛选界面 15 // 隐藏筛选界面
16 function hideFilter() { 16 function hideFilter() {
17 setTimeout(function() { 17 setTimeout(function() {
18 - $filter.addClass('hide'); 18 + $filter && $filter.addClass('hide');
19 }, 301); 19 }, 301);
20 } 20 }
21 21
22 // 显示筛选界面 22 // 显示筛选界面
23 function showFilter() { 23 function showFilter() {
24 - $filter.removeClass('hide'); 24 + $filter && $filter.removeClass('hide');
25 } 25 }
26 26
27 // 一级菜单点击时背景高亮 27 // 一级菜单点击时背景高亮
@@ -313,8 +313,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW @@ -313,8 +313,7 @@ const processArticleDetail = (articleContent, isApp, gender, isWeixin, isqq, isW
313 finalDetail.push({ 313 finalDetail.push({
314 relatedReco: { 314 relatedReco: {
315 isApp: isApp, 315 isApp: isApp,
316 - goods: goodsData,  
317 - moreNum: goodsData.length - 2 > 0 ? goodsData.length - 2 : 0 316 + goods: goodsData
318 } 317 }
319 }); 318 });
320 } 319 }
@@ -380,14 +379,26 @@ const pushGoodsInfo = (finalDetail, goodsList, isApp) => { @@ -380,14 +379,26 @@ const pushGoodsInfo = (finalDetail, goodsList, isApp) => {
380 379
381 _.forEach(finalDetail, (value, key) => { 380 _.forEach(finalDetail, (value, key) => {
382 if (value.relatedReco) { 381 if (value.relatedReco) {
383 - _.forEach(value.relatedReco.goods, (item, subKey) => {  
384 - if (goodsObj[item.id]) {  
385 - finalDetail[key].relatedReco.goods[subKey] = goodsObj[item.id]; 382 + let goodsIds = [];
  383 +
  384 + _.forEach(value.relatedReco.goods, relatedGoods => {
  385 + goodsIds.push(relatedGoods.id);
  386 + });
  387 +
  388 + goodsIds = _.uniq(goodsIds);
  389 + finalDetail[key].relatedReco.goods = [];
  390 +
  391 + _.forEach(goodsIds, (item, subKey) => {
  392 + if (goodsObj[item]) {
  393 + finalDetail[key].relatedReco.goods[subKey] = goodsObj[item];
386 } else { 394 } else {
387 delete finalDetail[key].relatedReco.goods[subKey]; 395 delete finalDetail[key].relatedReco.goods[subKey];
388 - finalDetail[key].relatedReco.moreNum--;  
389 } 396 }
390 }); 397 });
  398 +
  399 + let moreNum = _.get(finalDetail[key], 'relatedReco.goods.length', 0);
  400 +
  401 + finalDetail[key].relatedReco.moreNum = moreNum - 2 > 0 ? moreNum - 2 : 0;
391 } 402 }
392 403
393 if (value.collocation) { 404 if (value.collocation) {