Authored by 梁志锋

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

... ... @@ -144,6 +144,7 @@ class SearchData
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
$param['sales'] = 'Y'; // 只搜索销售的产品
$param['stocknumber'] = 1; // 过滤掉已售罄的商品
// $param['needFilter'] = 1; // 是否需要返回筛选条件
if (!isset($condition['order'])) {
$param['order'] = $orderMaps['s_t_desc'];
... ...
... ... @@ -129,10 +129,10 @@ function searchResult() {
brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
if (brand.isNew) {
brandHtml.push('<i class="icon-hot">HOT</i>');
brandHtml.push('<i class="icon-new">NEW</i>');
}
if (brand.isHot) {
brandHtml.push('<i class="icon-new">NEW</i>');
brandHtml.push('<i class="icon-hot">HOT</i>');
}
brandHtml.push('</a></p>');
});
... ...
... ... @@ -95,11 +95,15 @@ function getShoppingKey() {
//根据页面内容重新设置通用底部的显示
function rePosFooter() {
var winH;
if ($footer.length === 0) {
return;
}
if ($('body').height() <= $(window).height() - parseInt($footer.css('height'), 0)) {
winH = Math.min($(window).height(), window.screen.availHeight);
if ($('body').height() <= winH - parseInt($footer.css('height'), 0)) {
$footer.addClass('bottom');
} else {
$footer.removeClass('bottom');
... ...
... ... @@ -31,6 +31,8 @@ chHammer.on('tap', function() {
localStorage.removeItem('historys');
$history.html('');
window.rePosFooter();
});
$input.on('input', function() {
... ... @@ -78,6 +80,8 @@ $('#search').on('touchend', function() {
$history.html(html);
$clearHistory.removeClass('hide');
window.rePosFooter();
}
}
}());
... ...
... ... @@ -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');
... ...
... ... @@ -84,7 +84,7 @@
display: block;
color: #b0b0b0;
font-size: 24rem / $pxConvertRem;
margin: 30rem / $pxConvertRem 0 110rem / $pxConvertRem;
margin: 30rem / $pxConvertRem 0 80rem / $pxConvertRem;
}
.walk-way {
... ...
... ... @@ -20,10 +20,10 @@
display: block;
}
span{
float: left;
overflow: hidden;
}
.user-name {
float: left;
max-width: 240rem / $pxConvertRem;
text-overflow:ellipsis;
white-space:nowrap;
... ... @@ -32,6 +32,7 @@
}
.vip-icon {
float: left;
width: pxToRem(72px);
height: pxToRem(32px);
line-height: 36rem / $pxConvertRem;
... ...
... ... @@ -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 {
... ...
... ... @@ -43,6 +43,7 @@ class ClassModel
break;
}
$genderArr = array('boy' => '1,3', 'girl' => '2,3', 'kids' => '1,2,3', 'lifestyle' => '1,2,3');
$oneClass = array();
$item = array();
foreach ($data['data'] as $k => $v) {
... ... @@ -59,7 +60,8 @@ class ClassModel
'id' => $item['id'],
'url' => Helpers::url('/', array(
'sort' => $item['id'],
'sort_name' => $item['name']), 'list')
'sort_name' => $item['name'],
'gender' => $genderArr[$k]), 'list')
);
$subitem = array();
... ... @@ -69,7 +71,8 @@ class ClassModel
$subitem['id'] = $value['relation_parameter']['sort'];
$subitem['url'] = Helpers::url('/', array(
'sort' => $value['relation_parameter']['sort'],
'sort_name' => $value['category_name']
'sort_name' => $value['category_name'],
'gender' => $genderArr[$k]
), 'list');
$item['sub'][] = $subitem;
}
... ...
... ... @@ -179,6 +179,9 @@ class IndexModel
}
}
// 分页需要参数
$data['guang']['gender'] = $gender;
// 显示底部
$data['pageFooter'] = true;
... ...
... ... @@ -102,7 +102,7 @@ class DetailModel
if (isset($baseInfo['promotionBoList'])) {
$build = array();
foreach ($baseInfo['promotionBoList'] as $value) {
$build['text'] = $value['promotionTitle'];
$build['text'] = '【' . $value['promotionType'] . '】' . $value['promotionTitle'];
$result['goodsDiscount']['list'][] = $build;
}
}
... ... @@ -165,26 +165,31 @@ class DetailModel
foreach ($baseInfo['goodsList'] as $value) {
$colorId = intval($value['colorId']);
// 商品按颜色进行分类分组
foreach ($value['goodsImagesList'] as $goods) {
$goodsList[$goods['goodsId']] = $colorId;
$goodsGroup[$colorId][] = array(
'goodsId' => $goods['goodsId'],
'img' => $goods['imageUrl'],
);
$colorGroup[$colorId] = array(
'colorId' => $colorId,
'colorName' => $value['colorName'],
'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
);
}
if (isset($value['goodsImagesList'])) {
foreach ($value['goodsImagesList'] as $goods) {
$goodsList[$goods['goodsId']] = $colorId;
$goodsGroup[$colorId][] = array(
'goodsId' => $goods['goodsId'],
'img' => $goods['imageUrl'],
);
$colorGroup[$colorId] = array(
'colorId' => $colorId,
'colorName' => $value['colorName'],
'colorImage' => Helpers::getImageUrl($value['colorImage'], 60, 60),
);
}
}
// 商品的尺码列表
foreach ($value['goodsSizeBoList'] as $size) {
$sizeGroup[$colorId] = array(
'sizeName' => $size['sizeName'],
'sizeSku' => $size['goodsSizeSkuId'],
'sizeStorage' => $size['goodsSizeStorageNum'],
);
}
if (isset($value['goodsSizeBoList'])) {
foreach ($value['goodsSizeBoList'] as $size) {
$sizeGroup[$colorId] = array(
'sizeName' => $size['sizeName'],
'sizeSku' => $size['goodsSizeSkuId'],
'sizeStorage' => $size['goodsSizeStorageNum'],
);
}
}
}
// 商品图
... ...