...
|
...
|
@@ -48,19 +48,22 @@ exports.init = function() { |
|
|
direction: 1, //排序方向;NOTE:最新保持升序排序
|
|
|
reload: false, //是否需要重新加载
|
|
|
start: 1,
|
|
|
end: false
|
|
|
end: false,
|
|
|
empty: false
|
|
|
},
|
|
|
sale: {
|
|
|
direction: 0, //销量降序排列
|
|
|
reload: true,
|
|
|
start: 0,
|
|
|
end: false
|
|
|
end: false,
|
|
|
empty: true
|
|
|
},
|
|
|
price: {
|
|
|
direction: 1,
|
|
|
reload: true,
|
|
|
start: 0,
|
|
|
end: false
|
|
|
end: false,
|
|
|
empty: true
|
|
|
}
|
|
|
},
|
|
|
classifyItemTpl = '<li class="{{^ id}}chosed{{/ id}}" data-id="{{id}}">' +
|
...
|
...
|
@@ -169,6 +172,11 @@ exports.init = function() { |
|
|
$loading.removeClass('hide');
|
|
|
$noMore.addClass('hide');
|
|
|
}
|
|
|
|
|
|
if (nav.end && nav.empty) {
|
|
|
$noMore.addClass('hide');
|
|
|
}
|
|
|
|
|
|
if (nav.reload) {
|
|
|
setting.start = 1;
|
|
|
} else if (nav.end) {
|
...
|
...
|
@@ -206,9 +214,11 @@ exports.init = function() { |
|
|
break;
|
|
|
}
|
|
|
if (len === 0) {
|
|
|
nav.empty = true;
|
|
|
//无返回数据
|
|
|
html = '<p class="search-tip">未找到相关搜索结果</p>';
|
|
|
} else {
|
|
|
nav.empty = false;
|
|
|
for (i = 0; i < len; i++) {
|
|
|
html += Mustache.render(tpl, goods[i]);
|
|
|
}
|
...
|
...
|
@@ -226,7 +236,12 @@ exports.init = function() { |
|
|
nav.end = true;
|
|
|
//设置加载更多显示
|
|
|
$loading.addClass('hide');
|
|
|
$noMore.removeClass('hide');
|
|
|
//若无数据项返回则不显示noMore
|
|
|
if (len === 0) {
|
|
|
$noMore.addClass('hide');
|
|
|
} else {
|
|
|
$noMore.removeClass('hide');
|
|
|
}
|
|
|
}
|
|
|
nav.reload = false;
|
|
|
nav.start++;
|
...
|
...
|
|