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);
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
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> 71 + <h1 class="first-item short-text">{{text}}<span class="icon-down iconfont dropdown">&#xe609;</span></h1>
72 {{/if}} 72 {{/if}}
73 {{/if}} 73 {{/if}}
74 {{/ list}} 74 {{/ list}}