Authored by 郭成尧

goods-scroll-load

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2017-03-24 13:43:55
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-24 16:44:21
* @Last Modified time: 2017-03-24 16:52:14
*/
/** *****************************
... ... @@ -62,6 +62,7 @@ let defaultOpt = Object.assign({}, navInfo.default, {shop_id: shopId}); // 默
let onSearching = false; // 是否正在搜索
let isScrollLoad = false; // 是否是滚动加载
let page = 1; // 页码
let nav;
/**
* 处理筛选参数
... ... @@ -87,6 +88,10 @@ const getGoodsList = function() {
});
}
if (nav && nav.end) {
return false;
}
if (!onSearching) {
onSearching = true;
... ... @@ -109,20 +114,21 @@ const getGoodsList = function() {
let noResult = !result || result.length < 1 || (result.list && result.list.length < 1);
// 没有结果输出没有结果页面
if (!isScrollLoad && noResult) {
$container.html(noResultHbs());
if (noResult) {
if (isScrollLoad) {
$container.append('<div class="search-divide">没有更多内容了...</div>');
} else {
$container.html(noResultHbs());
}
nav.end = true;
onSearching = false;
return false;
}
if (isScrollLoad) {
if (noResult) {
$container.append('<div class="search-divide">没有更多内容了...</div>');
onSearching = false;
return false;
}
$container.append(result);
} else {
$container.html(result);
... ... @@ -192,7 +198,6 @@ $listNav.on('touchend touchcancel', function(e) {
let $this = $(e.target).closest('li'); // 被点击的 Tab
let $active;
let nav;
if ($this.hasClass('filter')) { // 筛选面板
... ...