Authored by 郭成尧

屏蔽最新降价下的 new 标签

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-19 10:20:08 3 * @Date: 2016-05-19 10:20:08
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-06-08 15:36:50 5 + * @Last Modified time: 2016-06-08 15:53:18
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
@@ -64,28 +64,35 @@ exports.getSaleGoodsData = (params) => { @@ -64,28 +64,35 @@ exports.getSaleGoodsData = (params) => {
64 } 64 }
65 65
66 // 处理 VIP 商品数据 66 // 处理 VIP 商品数据
67 - if (result[1].code === 200 && parseInt(params.saleType, 10) === 2) {  
68 - _.forEach(finalResult.goods, (value, key) => { 67 + if (result[1].code === 200) {
  68 + if (params.saleType === '2') {
  69 + _.forEach(finalResult.goods, (value, key) => {
69 70
70 - switch (result[1].curLevel) {  
71 - case '1':  
72 - finalResult.goods[key].vipPrice = value.vip1Price;  
73 - finalResult.goods[key].vip1 = true;  
74 - break;  
75 - case '2':  
76 - finalResult.goods[key].vipPrice = value.vip2Price;  
77 - finalResult.goods[key].vip2 = true;  
78 - break;  
79 - case '3':  
80 - finalResult.goods[key].vipPrice = value.vip3Price;  
81 - finalResult.goods[key].vip3 = true;  
82 - break;  
83 - default:  
84 - finalResult.goods[key].vip = true;  
85 - break;  
86 - } 71 + switch (result[1].curLevel) {
  72 + case '1':
  73 + finalResult.goods[key].vipPrice = value.vip1Price;
  74 + finalResult.goods[key].vip1 = true;
  75 + break;
  76 + case '2':
  77 + finalResult.goods[key].vipPrice = value.vip2Price;
  78 + finalResult.goods[key].vip2 = true;
  79 + break;
  80 + case '3':
  81 + finalResult.goods[key].vipPrice = value.vip3Price;
  82 + finalResult.goods[key].vip3 = true;
  83 + break;
  84 + default:
  85 + finalResult.goods[key].vip = true;
  86 + break;
  87 + }
87 88
88 - }); 89 + });
  90 + }
  91 + if (params.saleType === '3') {
  92 + _.forEach(finalResult.goods, (value, key) => {
  93 + finalResult.goods[key].tags.isNew = false; // 屏蔽 new 标签
  94 + });
  95 + }
89 } 96 }
90 97
91 // 需要判断是否为今日推荐,今日推荐需要添加最后的全部商品图片 98 // 需要判断是否为今日推荐,今日推荐需要添加最后的全部商品图片