Authored by Rock Zhang

修复新品标签的显示,如果既有new又有sale标签,只显示new标签

@@ -2,10 +2,9 @@ @@ -2,10 +2,9 @@
2 <div class="good-detail-page yoho-page"> 2 <div class="good-detail-page yoho-page">
3 <div class="banner-container"> 3 <div class="banner-container">
4 <div class="tag-container"> 4 <div class="tag-container">
5 - <p class="good-tag new-tag">NEW</p>  
6 {{# tags}} 5 {{# tags}}
7 {{# is_new}} 6 {{# is_new}}
8 - <!-- <p class="good-tag new-tag">NEW</p> --> 7 + <p class="good-tag new-tag">NEW</p>
9 {{/ is_new}} 8 {{/ is_new}}
10 {{# is_advance}} 9 {{# is_advance}}
11 <p class="good-tag renew-tag">再到着</p> 10 <p class="good-tag renew-tag">再到着</p>
@@ -50,10 +50,10 @@ class DetailModel @@ -50,10 +50,10 @@ class DetailModel
50 case 'is_soon_sold_out': // 即将售磬 50 case 'is_soon_sold_out': // 即将售磬
51 $result['tags']['is_soon_sold_out'] = true; 51 $result['tags']['is_soon_sold_out'] = true;
52 break; 52 break;
53 - case 'is_new': // 新品 53 + case 'is_new': // 新品NEW
54 $result['tags']['is_new'] = true; 54 $result['tags']['is_new'] = true;
55 break; 55 break;
56 - case 'is_discount': // 在售 56 + case 'is_discount': // SALE
57 $result['tags']['is_discount'] = true; 57 $result['tags']['is_discount'] = true;
58 break; 58 break;
59 case 'is_limited': // 限量 59 case 'is_limited': // 限量
@@ -68,7 +68,17 @@ class DetailModel @@ -68,7 +68,17 @@ class DetailModel
68 } 68 }
69 } 69 }
70 } 70 }
71 - 71 +
  72 + // 新品标签
  73 + if (isset($baseInfo['isNew']) && $baseInfo['isNew'] === 'Y') {
  74 + $result['tags']['is_new'] = true;
  75 + }
  76 +
  77 + // NEW和SALE只显示一个
  78 + if (isset($result['tags']['is_new']) && isset($result['tags']['is_discount'])) {
  79 + unset($result['tags']['is_discount']);
  80 + }
  81 +
72 // 商品价格 82 // 商品价格
73 if (isset($baseInfo['productPriceBo'])) { 83 if (isset($baseInfo['productPriceBo'])) {
74 $result['goodsPrice'] = array(); 84 $result['goodsPrice'] = array();