Authored by whb

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

... ... @@ -118,6 +118,26 @@ function updateConformButtonClassAndText() {
}
}
//显示剩余件数
function displayGoodNum(curGoodNum) {
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
init();
$yohoPage.on('touchstart', '.chose-panel', function(e) {
... ... @@ -187,22 +207,10 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$curSizeBlock.addClass('chosed');
}
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
// 显示剩余数量
displayGoodNum(curGoodNum);
// 尺码行当前行隐藏
$sizeRowList.eq(curSizeIndex).removeClass('show').addClass('hide');
... ... @@ -271,29 +279,15 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
// 之前选中的颜色去掉勾选样式,新颜色块勾选
if ($curColorBlock && $curColorBlock.length > 0) {
$curColorBlock.removeClass('chosed');
//curColorBlock = $colorRowList.eq(curColorIndex + 1).children().get(curSizeIndex - 1);
curColorBlock = $colorRowList.eq(index + 1).children().get(curSizeIndex - 1);
$curColorBlock = $(curColorBlock);
curGoodNum = $curColorBlock.data('num');
$curColorBlock.addClass('chosed');
}
//数量大于0
if (curGoodNum > 0) {
if ($soonSoldOut.length > 0) {
$allChoseItems.find('.num .left-num').html('即将售罄');
} else {
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
}
$leftNum.val(curGoodNum);
//数量小于0
} else {
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
// 显示剩余数量
displayGoodNum(curGoodNum);
// 颜色当前行隐藏
$colorRowList.eq(curColorIndex).removeClass('show').addClass('hide');
... ...
... ... @@ -215,6 +215,7 @@
background-size:100% 100%;
position: relative;
top: .36rem;
margin-right: pxToRem(12px);
}
&.highlight {
background: #eee;
... ...
... ... @@ -6,9 +6,9 @@
<div class="sale-group-big clearfix">
{{#brandSale}}
{{#big}}
<a class="item pull-left {{#if @first}}first{{/if}} {{#if @last}}last{{/if}}" href="{{link}}">
<a class="item pull-left" href="{{link}}">
<div class="pic">
<img class="" src="{{img}}">
<img src="{{img}}">
<div class="time">{{time}}</div>
</div>
<div class="detail">
... ... @@ -24,6 +24,17 @@
</div>
</a>
{{/big}}
</div>
<div class="sale-group clearfix">
{{#normal}}
<a class="item pull-left" href="{{link}}">
<img class="pic" src="{{img}}">
<div class="detail">
<div class="title">{{title}}</div>
<div class="time">{{time}}</div>
</div>
</a>
{{/normal}}
{{/brandSale}}
</div>
... ...
... ... @@ -55,20 +55,13 @@
}
.brand-sale {
.sale-group-big {
.item {
width: 377px;
margin-right: 10px;
&.first,
&.last {
width: 376px;
}
width: 1150px + 8px;
&.last {
margin-right: 0;
}
.item {
width: 378px;
margin-right: 8px;
margin-bottom: 10px;
}
.pic {
... ... @@ -95,7 +88,7 @@
}
.brand {
margin: 24px 10px;
margin: 24px 10px 0;
}
.text {
... ... @@ -112,7 +105,36 @@
font-size: 40px;
}
}
}
.sale-group {
width: 1150px + 8px;
.item {
width: 185px;
margin-right: 8px;
margin-bottom: 10px;
}
.pic {
width: 100%;
display: block;
}
.detail {
padding: 14px 10px;
background: #f5f5f5;
text-align: center;
line-height: 20px;
}
.title {
font-size: 12px;
}
.time {
font-size: 14px;
}
}
}
}
... ...
... ... @@ -54,7 +54,7 @@ class Sale1Controller extends WebAction
'brandSale' => array(
'big' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -62,7 +62,7 @@ class Sale1Controller extends WebAction
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -70,7 +70,7 @@ class Sale1Controller extends WebAction
'discount' => '70%',
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/376/h/400',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/378/h/400',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'brand' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/22/09/0168ae2421d5283414ff5b873fa4a1c16a.jpg?imageView/1/w/185/h/62',
... ... @@ -78,7 +78,80 @@ class Sale1Controller extends WebAction
'discount' => '70%',
)
),
'normal' => array()
'normal' => array(
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
),
array(
'img' => 'http://img13.static.yhbimg.com/goodsimg/2015/03/31/07/02c9f302b6a633d7fac1a08655633a45d3.jpg?imageView/1/w/185/h/180',
'link' => 'http://www.yohobuy.com',
'time' => '低于1小时',
'title' => '2015春夏海量大促!'
)
)
)
);
$this->setWebNavHeader();
... ...