Authored by 毕凯

code review by liangzhifeng

@@ -13,7 +13,8 @@ var goodsSwiper, @@ -13,7 +13,8 @@ var goodsSwiper,
13 $discountArrow = $('.goodsDiscount .first-item span'); 13 $discountArrow = $('.goodsDiscount .first-item span');
14 14
15 var goodsDiscountEl = document.getElementById('goodsDiscount'), 15 var goodsDiscountEl = document.getElementById('goodsDiscount'),
16 - goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl); 16 + goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl),
  17 + $discountFirstItem = $(goodsDiscountEl).find('.first-item');
17 18
18 var $cart = $('.cart-bar'); 19 var $cart = $('.cart-bar');
19 20
@@ -62,9 +63,11 @@ if (0 === $discountFolder.children().length) { @@ -62,9 +63,11 @@ if (0 === $discountFolder.children().length) {
62 if (goodsDiscountHammer && $discountFolder.children().length > 0) { 63 if (goodsDiscountHammer && $discountFolder.children().length > 0) {
63 goodsDiscountHammer.on('tap', function(e) { 64 goodsDiscountHammer.on('tap', function(e) {
64 if ($discountFolder.is(':hidden')) { 65 if ($discountFolder.is(':hidden')) {
  66 + $discountFirstItem.removeClass('short-text');
65 $discountArrow.removeClass('icon-down').addClass('icon-up').html(''); 67 $discountArrow.removeClass('icon-down').addClass('icon-up').html('');
66 $discountFolder.slideDown(); 68 $discountFolder.slideDown();
67 } else { 69 } else {
  70 + $discountFirstItem.addClass('short-text');
68 $discountArrow.removeClass('icon-up').addClass('icon-down').html(''); 71 $discountArrow.removeClass('icon-up').addClass('icon-down').html('');
69 $discountFolder.slideUp(); 72 $discountFolder.slideUp();
70 } 73 }
@@ -353,11 +353,15 @@ $basicBtnC:#eb0313; @@ -353,11 +353,15 @@ $basicBtnC:#eb0313;
353 position: relative; 353 position: relative;
354 padding: pxToRem(30px) pxToRem(60px) pxToRem(30px) pxToRem(28px); 354 padding: pxToRem(30px) pxToRem(60px) pxToRem(30px) pxToRem(28px);
355 line-height: pxToRem(36px); 355 line-height: pxToRem(36px);
  356 + // line-height: pxToRem(88px);
  357 + }
  358 +
  359 + .short-text {
356 white-space: nowrap; 360 white-space: nowrap;
357 overflow: hidden; 361 overflow: hidden;
358 text-overflow: ellipsis; 362 text-overflow: ellipsis;
359 - // line-height: pxToRem(88px);  
360 } 363 }
  364 +
361 .iconfont { 365 .iconfont {
362 position: absolute; 366 position: absolute;
363 top: pxToRem(30px); 367 top: pxToRem(30px);
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 {{# goodsName}} 30 {{# goodsName}}
31 <h2 class="goodsName"><span>{{.}}</span></h2> 31 <h2 class="goodsName"><span>{{.}}</span></h2>
32 {{/ goodsName}} 32 {{/ goodsName}}
33 - 33 +
34 {{# goodsSubtitle}} 34 {{# goodsSubtitle}}
35 <h1 class="goodsSubtitle"><span>{{.}}</span></h1> 35 <h1 class="goodsSubtitle"><span>{{.}}</span></h1>
36 {{/ goodsSubtitle}} 36 {{/ goodsSubtitle}}
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 </span> 59 </span>
60 <span class="vip-price ">{{text}}</span> 60 <span class="vip-price ">{{text}}</span>
61 </li> 61 </li>
62 - {{/ list}} 62 + {{/ list}}
63 </ul> 63 </ul>
64 {{/vipLevel}} 64 {{/vipLevel}}
65 65
@@ -68,10 +68,10 @@ @@ -68,10 +68,10 @@
68 {{# list}} 68 {{# list}}
69 {{#if @first}} 69 {{#if @first}}
70 {{#if text}} 70 {{#if text}}
71 - <h1 class="first-item">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>  
72 - {{/if}} 71 + <h1 class="first-item short-text">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
  72 + {{/if}}
73 {{/if}} 73 {{/if}}
74 - {{/ list}} 74 + {{/ list}}
75 <div class="discount-folder"> 75 <div class="discount-folder">
76 {{# list}} 76 {{# list}}
77 {{#if @first}} 77 {{#if @first}}
@@ -81,12 +81,12 @@ @@ -81,12 +81,12 @@
81 {{/if}} 81 {{/if}}
82 {{/if}} 82 {{/if}}
83 {{/list}} 83 {{/list}}
84 - </div> 84 + </div>
85 </div> 85 </div>
86 {{/ goodsDiscount}} 86 {{/ goodsDiscount}}
87 87
88 {{# feedbacks}} 88 {{# feedbacks}}
89 - <div class="feedback-list "> 89 + <div class="feedback-list ">
90 {{#if commentsNum}} 90 {{#if commentsNum}}
91 {{> product/feedback-tab}} 91 {{> product/feedback-tab}}
92 {{else}} 92 {{else}}
@@ -101,15 +101,15 @@ @@ -101,15 +101,15 @@
101 {{/if}} 101 {{/if}}
102 </div> 102 </div>
103 {{/ feedbacks}} 103 {{/ feedbacks}}
104 -  
105 - {{# enterStore}} 104 +
  105 + {{# enterStore}}
106 <div id="enter-store" class="enter-store page-block"> 106 <div id="enter-store" class="enter-store page-block">
107 <a class="store-logo" href="{{url}}" style=""> 107 <a class="store-logo" href="{{url}}" style="">
108 <img class="lazy" data-original="{{img}}" alt="{{storeName}}"> 108 <img class="lazy" data-original="{{img}}" alt="{{storeName}}">
109 </a> 109 </a>
110 <a class="store-name" href="{{url}}">{{storeName}}</a> 110 <a class="store-name" href="{{url}}">{{storeName}}</a>
111 <a class="store-link" href="{{url}}">进入店铺<span class="iconfont">&#xe604;</span></a> 111 <a class="store-link" href="{{url}}">进入店铺<span class="iconfont">&#xe604;</span></a>
112 - </div> 112 + </div>
113 {{/ enterStore}} 113 {{/ enterStore}}
114 114
115 <div id="productDesc"> </div> 115 <div id="productDesc"> </div>
@@ -117,10 +117,10 @@ @@ -117,10 +117,10 @@
117 {{> product/recommend-for-you}} 117 {{> product/recommend-for-you}}
118 118
119 {{#cartInfo}} 119 {{#cartInfo}}
120 - <div class="cart-bar"> 120 + <div class="cart-bar">
121 <span class="num-tag hide"></span> 121 <span class="num-tag hide"></span>
122 <a href="{{cartUrl}}" class="num-incart iconfont">&#xe62c;</a> 122 <a href="{{cartUrl}}" class="num-incart iconfont">&#xe62c;</a>
123 - 123 +
124 {{#if addToCartUrl}} 124 {{#if addToCartUrl}}
125 <a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a> 125 <a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a>
126 {{/if}} 126 {{/if}}
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
133 <a href="javascript:;" class="sold-out">非卖品</a> 133 <a href="javascript:;" class="sold-out">非卖品</a>
134 {{/if}} 134 {{/if}}
135 135
136 - <a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a> 136 + <a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a>
137 </div> 137 </div>
138 {{/cartInfo}} 138 {{/cartInfo}}
139 {{#if introUrl}} 139 {{#if introUrl}}
@@ -147,4 +147,4 @@ @@ -147,4 +147,4 @@
147 {{/if}} 147 {{/if}}
148 148
149 </div> 149 </div>
150 -{{> layout/footer}}  
  150 +{{> layout/footer}}