Showing
1 changed file
with
15 additions
and
10 deletions
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-03-24 13:43:55 | 3 | * @Date: 2017-03-24 13:43:55 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-03-24 16:44:21 | 5 | + * @Last Modified time: 2017-03-24 16:52:14 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /** ***************************** | 8 | /** ***************************** |
@@ -62,6 +62,7 @@ let defaultOpt = Object.assign({}, navInfo.default, {shop_id: shopId}); // 默 | @@ -62,6 +62,7 @@ let defaultOpt = Object.assign({}, navInfo.default, {shop_id: shopId}); // 默 | ||
62 | let onSearching = false; // 是否正在搜索 | 62 | let onSearching = false; // 是否正在搜索 |
63 | let isScrollLoad = false; // 是否是滚动加载 | 63 | let isScrollLoad = false; // 是否是滚动加载 |
64 | let page = 1; // 页码 | 64 | let page = 1; // 页码 |
65 | +let nav; | ||
65 | 66 | ||
66 | /** | 67 | /** |
67 | * 处理筛选参数 | 68 | * 处理筛选参数 |
@@ -87,6 +88,10 @@ const getGoodsList = function() { | @@ -87,6 +88,10 @@ const getGoodsList = function() { | ||
87 | }); | 88 | }); |
88 | } | 89 | } |
89 | 90 | ||
91 | + if (nav && nav.end) { | ||
92 | + return false; | ||
93 | + } | ||
94 | + | ||
90 | if (!onSearching) { | 95 | if (!onSearching) { |
91 | onSearching = true; | 96 | onSearching = true; |
92 | 97 | ||
@@ -109,20 +114,21 @@ const getGoodsList = function() { | @@ -109,20 +114,21 @@ const getGoodsList = function() { | ||
109 | 114 | ||
110 | let noResult = !result || result.length < 1 || (result.list && result.list.length < 1); | 115 | let noResult = !result || result.length < 1 || (result.list && result.list.length < 1); |
111 | 116 | ||
117 | + | ||
112 | // 没有结果输出没有结果页面 | 118 | // 没有结果输出没有结果页面 |
113 | - if (!isScrollLoad && noResult) { | ||
114 | - $container.html(noResultHbs()); | 119 | + if (noResult) { |
120 | + if (isScrollLoad) { | ||
121 | + $container.append('<div class="search-divide">没有更多内容了...</div>'); | ||
122 | + } else { | ||
123 | + $container.html(noResultHbs()); | ||
124 | + } | ||
125 | + | ||
126 | + nav.end = true; | ||
115 | onSearching = false; | 127 | onSearching = false; |
116 | return false; | 128 | return false; |
117 | } | 129 | } |
118 | 130 | ||
119 | if (isScrollLoad) { | 131 | if (isScrollLoad) { |
120 | - if (noResult) { | ||
121 | - $container.append('<div class="search-divide">没有更多内容了...</div>'); | ||
122 | - onSearching = false; | ||
123 | - return false; | ||
124 | - } | ||
125 | - | ||
126 | $container.append(result); | 132 | $container.append(result); |
127 | } else { | 133 | } else { |
128 | $container.html(result); | 134 | $container.html(result); |
@@ -192,7 +198,6 @@ $listNav.on('touchend touchcancel', function(e) { | @@ -192,7 +198,6 @@ $listNav.on('touchend touchcancel', function(e) { | ||
192 | 198 | ||
193 | let $this = $(e.target).closest('li'); // 被点击的 Tab | 199 | let $this = $(e.target).closest('li'); // 被点击的 Tab |
194 | let $active; | 200 | let $active; |
195 | - let nav; | ||
196 | 201 | ||
197 | if ($this.hasClass('filter')) { // 筛选面板 | 202 | if ($this.hasClass('filter')) { // 筛选面板 |
198 | 203 |
-
Please register or login to post a comment