Authored by Rock Zhang

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

@@ -16,7 +16,9 @@ var consultFooterEle = document.getElementById('consult-content-footer'), @@ -16,7 +16,9 @@ var consultFooterEle = document.getElementById('consult-content-footer'),
16 navtabHammer = navtabEle && new Hammer(navtabEle), 16 navtabHammer = navtabEle && new Hammer(navtabEle),
17 17
18 gotoConsultEle = document.getElementById('goto-consult'), 18 gotoConsultEle = document.getElementById('goto-consult'),
19 - gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle); 19 + gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
  20 +
  21 + $gotoConsult = $('#goto-consult');
20 22
21 23
22 24
@@ -77,4 +79,22 @@ if (gotoConsultHammer) { @@ -77,4 +79,22 @@ if (gotoConsultHammer) {
77 gotoConsultHammer.on('tap', function() { 79 gotoConsultHammer.on('tap', function() {
78 location.href = $(gotoConsultEle).find('a').attr('href'); 80 location.href = $(gotoConsultEle).find('a').attr('href');
79 }); 81 });
80 -}  
  82 +}
  83 +
  84 +function fixConsultBar() {
  85 + if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {
  86 + $gotoConsult.css('position', 'fixed');
  87 + $gotoConsult.css('top', '0');
  88 + } else {
  89 + $gotoConsult.css('position', 'static');
  90 + }
  91 +}
  92 +
  93 +//滚动时顶部固定 我要咨询
  94 +function scrollHandler() {
  95 + fixConsultBar();
  96 +}
  97 +
  98 +$(window).scroll(function() {
  99 + window.requestAnimationFrame(scrollHandler);
  100 +});
@@ -15,7 +15,10 @@ var goodsSwiper, @@ -15,7 +15,10 @@ var goodsSwiper,
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 17
18 -var $cart = $('.cart-bar'); 18 +var $cart = $('.cart-bar'),
  19 + $goodsSubtitle = $('.goodsSubtitle'),
  20 + divH,
  21 + $goodsSubtitleSpan;
19 22
20 require('./desc'); 23 require('./desc');
21 require('./comments-consults'); 24 require('./comments-consults');
@@ -82,4 +85,12 @@ $.ajax({ @@ -82,4 +85,12 @@ $.ajax({
82 } 85 }
83 }); 86 });
84 87
  88 +//限制goodsSubtitle为两行
  89 +if ($goodsSubtitle[0]) {
  90 + divH = $goodsSubtitle.height();
  91 + $goodsSubtitleSpan = $goodsSubtitle.find('span');
  92 + while ($goodsSubtitleSpan.outerHeight() > divH) {
  93 + $goodsSubtitleSpan.text($goodsSubtitleSpan.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, '...'));
  94 + }
  95 +}
85 require('./like'); 96 require('./like');
@@ -41,6 +41,8 @@ @@ -41,6 +41,8 @@
41 .goods-consults-page { 41 .goods-consults-page {
42 background-color: #f0f0f0; 42 background-color: #f0f0f0;
43 .goto-consult { 43 .goto-consult {
  44 + width: 100%;
  45 + box-sizing:border-box;
44 padding: 0 pxToRem(28px); 46 padding: 0 pxToRem(28px);
45 height: pxToRem(120px); 47 height: pxToRem(120px);
46 background-color: #ffffff; 48 background-color: #ffffff;
@@ -211,14 +211,19 @@ $basicBtnC:#eb0313; @@ -211,14 +211,19 @@ $basicBtnC:#eb0313;
211 background-color: #515150; 211 background-color: #515150;
212 } 212 }
213 .goodsSubtitle { 213 .goodsSubtitle {
214 - min-height: pxToRem(87px); 214 + height: pxToRem(88px);
215 font-size: pxToRem(24px); 215 font-size: pxToRem(24px);
216 - line-height: pxToRem(36px);  
217 color: $subFontC; 216 color: $subFontC;
218 padding-left: pxToRem(28px); 217 padding-left: pxToRem(28px);
219 padding-right: pxToRem(28px); 218 padding-right: pxToRem(28px);
  219 + padding-top: pxToRem(14px);
220 border-bottom: 1px solid $borderC; 220 border-bottom: 1px solid $borderC;
221 background-color: #f4f4f4; 221 background-color: #f4f4f4;
  222 + span{
  223 + display: block;
  224 + line-height: pxToRem(36px);
  225 + margin: 0;
  226 + }
222 } 227 }
223 .price-date { 228 .price-date {
224 // width: 100%; 229 // width: 100%;
@@ -253,8 +258,7 @@ $basicBtnC:#eb0313; @@ -253,8 +258,7 @@ $basicBtnC:#eb0313;
253 line-height: pxToRem(88px); 258 line-height: pxToRem(88px);
254 } 259 }
255 } 260 }
256 - .goodsName,  
257 - .goodsSubtitle { 261 + .goodsName {
258 // width: 100%; 262 // width: 100%;
259 display: table; 263 display: table;
260 span { 264 span {
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="brand-page yoho-page"> 2 <div class="brand-page yoho-page">
  3 + {{# channel}}
  4 +
3 <div class="newbrand-search"> 5 <div class="newbrand-search">
4 - <div class="search-box clearfix"> 6 + <div class="search-box clearfix">
5 <a href="{{searchUrl}}" > 7 <a href="{{searchUrl}}" >
6 <input type="text" class="search-input" placeholder="查找品牌" readonly="true"> 8 <input type="text" class="search-input" placeholder="查找品牌" readonly="true">
7 <i class="search-icon iconfont">&#xe60f;</i> 9 <i class="search-icon iconfont">&#xe60f;</i>
@@ -40,4 +42,6 @@ @@ -40,4 +42,6 @@
40 {{/ list}} 42 {{/ list}}
41 </div> 43 </div>
42 {{/ brandList}} 44 {{/ brandList}}
  45 +
  46 + {{/channel}}
43 {{> layout/footer}} 47 {{> layout/footer}}
1 <div class="hot-brands"> 1 <div class="hot-brands">
2 - {{> home/floor_header}} 2 + {{^ brandPage}}
  3 + {{> home/floor_header}}
  4 + {{/ brandPage}}
3 <div class="brands-swiper"> 5 <div class="brands-swiper">
4 <ul class="brands-list swiper-wrapper clearfix"> 6 <ul class="brands-list swiper-wrapper clearfix">
5 {{# list}} 7 {{# list}}
@@ -12,4 +14,4 @@ @@ -12,4 +14,4 @@
12 {{/ list}} 14 {{/ list}}
13 </ul> 15 </ul>
14 </div> 16 </div>
15 -</div>  
  17 +</div>
@@ -11,7 +11,7 @@ class BrandController extends AbstractAction @@ -11,7 +11,7 @@ class BrandController extends AbstractAction
11 11
12 /** 12 /**
13 * 品牌一览 13 * 品牌一览
14 - * 14 + *
15 * @param string gender 老版本中使用的参数, 做兼容判断 15 * @param string gender 老版本中使用的参数, 做兼容判断
16 * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 16 * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
17 */ 17 */
@@ -41,12 +41,15 @@ class BrandController extends AbstractAction @@ -41,12 +41,15 @@ class BrandController extends AbstractAction
41 } 41 }
42 42
43 // 渲染模板 43 // 渲染模板
44 - $this->_view->display('index', Category\BrandModel::getBrandByChannel($channel)); 44 + $this->_view->display('index', array(
  45 + 'brandPage' => true,
  46 + 'channel' => Category\BrandModel::getBrandByChannel($channel)
  47 + ));
45 } 48 }
46 49
47 /** 50 /**
48 * 品牌一览搜索页 51 * 品牌一览搜索页
49 - * 52 + *
50 * @param string gender 老版本中使用的参数, 做兼容判断 53 * @param string gender 老版本中使用的参数, 做兼容判断
51 * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道 54 * @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
52 */ 55 */