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'),
navtabHammer = navtabEle && new Hammer(navtabEle),
gotoConsultEle = document.getElementById('goto-consult'),
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle);
gotoConsultHammer = gotoConsultEle && new Hammer(gotoConsultEle),
$gotoConsult = $('#goto-consult');
... ... @@ -77,4 +79,22 @@ if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
location.href = $(gotoConsultEle).find('a').attr('href');
});
}
\ No newline at end of file
}
function fixConsultBar() {
if ($(window).scrollTop() > $('#yoho-header').outerHeight()) {
$gotoConsult.css('position', 'fixed');
$gotoConsult.css('top', '0');
} else {
$gotoConsult.css('position', 'static');
}
}
//滚动时顶部固定 我要咨询
function scrollHandler() {
fixConsultBar();
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...
... ... @@ -15,7 +15,10 @@ var goodsSwiper,
var goodsDiscountEl = document.getElementById('goodsDiscount'),
goodsDiscountHammer = goodsDiscountEl && new Hammer(goodsDiscountEl);
var $cart = $('.cart-bar');
var $cart = $('.cart-bar'),
$goodsSubtitle = $('.goodsSubtitle'),
divH,
$goodsSubtitleSpan;
require('./desc');
require('./comments-consults');
... ... @@ -82,4 +85,12 @@ $.ajax({
}
});
//限制goodsSubtitle为两行
if ($goodsSubtitle[0]) {
divH = $goodsSubtitle.height();
$goodsSubtitleSpan = $goodsSubtitle.find('span');
while ($goodsSubtitleSpan.outerHeight() > divH) {
$goodsSubtitleSpan.text($goodsSubtitleSpan.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, '...'));
}
}
require('./like');
... ...
... ... @@ -41,6 +41,8 @@
.goods-consults-page {
background-color: #f0f0f0;
.goto-consult {
width: 100%;
box-sizing:border-box;
padding: 0 pxToRem(28px);
height: pxToRem(120px);
background-color: #ffffff;
... ...
... ... @@ -211,14 +211,19 @@ $basicBtnC:#eb0313;
background-color: #515150;
}
.goodsSubtitle {
min-height: pxToRem(87px);
height: pxToRem(88px);
font-size: pxToRem(24px);
line-height: pxToRem(36px);
color: $subFontC;
padding-left: pxToRem(28px);
padding-right: pxToRem(28px);
padding-top: pxToRem(14px);
border-bottom: 1px solid $borderC;
background-color: #f4f4f4;
span{
display: block;
line-height: pxToRem(36px);
margin: 0;
}
}
.price-date {
// width: 100%;
... ... @@ -253,8 +258,7 @@ $basicBtnC:#eb0313;
line-height: pxToRem(88px);
}
}
.goodsName,
.goodsSubtitle {
.goodsName {
// width: 100%;
display: table;
span {
... ...
{{> layout/header}}
<div class="brand-page yoho-page">
{{# channel}}
<div class="newbrand-search">
<div class="search-box clearfix">
<div class="search-box clearfix">
<a href="{{searchUrl}}" >
<input type="text" class="search-input" placeholder="查找品牌" readonly="true">
<i class="search-icon iconfont">&#xe60f;</i>
... ... @@ -40,4 +42,6 @@
{{/ list}}
</div>
{{/ brandList}}
{{/channel}}
{{> layout/footer}}
... ...
<div class="hot-brands">
{{> home/floor_header}}
{{^ brandPage}}
{{> home/floor_header}}
{{/ brandPage}}
<div class="brands-swiper">
<ul class="brands-list swiper-wrapper clearfix">
{{# list}}
... ... @@ -12,4 +14,4 @@
{{/ list}}
</ul>
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -11,7 +11,7 @@ class BrandController extends AbstractAction
/**
* 品牌一览
*
*
* @param string gender 老版本中使用的参数, 做兼容判断
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
*/
... ... @@ -41,12 +41,15 @@ class BrandController extends AbstractAction
}
// 渲染模板
$this->_view->display('index', Category\BrandModel::getBrandByChannel($channel));
$this->_view->display('index', array(
'brandPage' => true,
'channel' => Category\BrandModel::getBrandByChannel($channel)
));
}
/**
* 品牌一览搜索页
*
*
* @param string gender 老版本中使用的参数, 做兼容判断
* @param int channel 1表示男生频道, 2表示女生频道, 3表示潮童频道, 4表示创意生活频道
*/
... ...