Authored by 梁志锋

update

... ... @@ -12,7 +12,7 @@ var filter = require('../../plugin/filter');
var $goodsContainer = $('#goods-container'),
$ngc = $($goodsContainer.children().get(0)),
$pgc = $($goodsContainer.children().get(1)),
$dgc = $($goodsContainer.children().get(2));
$dgc = $($goodsContainer.children().get(2)),
$all = $($goodsContainer.children().get(3));
var winH = $(window).height();
... ... @@ -27,7 +27,6 @@ var defaultOpt = {
price: $('#price').val(),
discount: $('#discount').val(),
limit: $('#limit').val(),
dayLimit: $('#dayLimit').val(),
channel: $('#channel').val(),
p_d: $('#p_d').val()
};
... ... @@ -74,7 +73,6 @@ function search(opt) {
ext,
att,
nav, navType,
dayLimit,
page;
if (opt) {
... ... @@ -153,16 +151,12 @@ function search(opt) {
//导航类别
if ($pre === undefined || $pre.hasClass('today')) {
navType = 'today';
dayLimit = 1;
} else if ($pre.hasClass('week')) {
navType = 'week';
dayLimit = 2;
} else if ($pre.hasClass('sale')) {
navType = 'sale';
dayLimit = 3;
}else if ($pre.hasClass('all')) {
} else if ($pre.hasClass('all')) {
navType = 'all';
dayLimit = 4;
}
nav = navInfo[navType];
... ... @@ -177,7 +171,6 @@ function search(opt) {
}
$.extend(setting, defaultOpt, {
dayLimit: dayLimit,
page: page
});
... ...
... ... @@ -263,9 +263,7 @@ $listNav.delegate('li', 'touchstart', function() {
nav = navInfo[navType];
if ($this.hasClass('active')) {
} else {
if ($this.hasClass('hide')) {
$active = $this.siblings('.active');
$pre = $this; //$pre为除筛选导航的其他导航项,若当前active的为筛选,则把$pre置为当前点击项
... ... @@ -309,8 +307,6 @@ $(window).scroll(function() {
//当scroll到1/4$goodsContainer高度后继续请求下一页数据
if ($(window).scrollTop() + winH >
$(document).height() - 0.25 * $goodsContainer.height()) {
if($pre){
search();
}
+search();
}
});
\ No newline at end of file
... ...
... ... @@ -42,9 +42,84 @@
color: #000;
}
}
.list-nav {
> li {
float: left;
width: 20%;
height: 33px;
line-height: 33px;
text-align: center;
font-size: 14px;
}
a {
display: block;
box-sizing: border-box;
width: 100%;
height: 100%;
color: #999;
}
.active > a {
border-bottom: 2px solid #000;
color: #000;
.goods-list.hide {
display: none;
.iconfont {
color: #999;
&.cur {
color: #000;
}
}
}
.new .iconfont {
@include scale(0.8);
font-weight: bold;
}
.filter .iconfont {
font-size: 12px;
@include transition(transform 0.1 ease-in);
}
.filter.active .iconfont {
@include rotate(-180deg);
}
.icon {
position: relative;
i {
position: absolute;
@include scale(0.8);
font-weight: bold;
}
.up {
top: -11px;
}
.down {
top: -4px;
}
}
}
.no-result {
text-align: center;
vertical-align: middle;
color: #ccc;
font-size: 1.2em;
margin-top: 220px;
}
.goods-container {
position: relative;
min-height: 440px;
}
}
... ...
... ... @@ -50,13 +50,5 @@
color: #000;
}
}
.newarrival-nav-item:nth-child(4n) {
border-right: none;
}
.goods-list.hide {
display: none;
}
}
... ...