Showing
1 changed file
with
7 additions
and
2 deletions
@@ -62,7 +62,7 @@ let navType = 'default'; // 目前激活的导航页面 | @@ -62,7 +62,7 @@ let navType = 'default'; // 目前激活的导航页面 | ||
62 | let defaultOpt = navInfo.default; // 默认参数 | 62 | let defaultOpt = navInfo.default; // 默认参数 |
63 | let onSearching = false; // 是否正在搜索 | 63 | let onSearching = false; // 是否正在搜索 |
64 | let isScrollLoad = false; // 是否是滚动加载 | 64 | let isScrollLoad = false; // 是否是滚动加载 |
65 | -let page = 0; // 页码 | 65 | +let page = 1; // 页码 |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * 处理筛选参数 | 68 | * 处理筛选参数 |
@@ -82,6 +82,12 @@ function handleChoseFilter() { | @@ -82,6 +82,12 @@ function handleChoseFilter() { | ||
82 | function getGoodsList() { | 82 | function getGoodsList() { |
83 | handleChoseFilter(); | 83 | handleChoseFilter(); |
84 | 84 | ||
85 | + if (isScrollLoad && !onSearching) { | ||
86 | + Object.assign(defaultOpt, { | ||
87 | + page: page++ | ||
88 | + }); | ||
89 | + } | ||
90 | + | ||
85 | if (!onSearching) { | 91 | if (!onSearching) { |
86 | onSearching = true; | 92 | onSearching = true; |
87 | 93 | ||
@@ -146,7 +152,6 @@ function getGoodsList() { | @@ -146,7 +152,6 @@ function getGoodsList() { | ||
146 | function scrollHandler() { | 152 | function scrollHandler() { |
147 | if ($filterBox.is(':visible') && $(window).scrollTop() > $goodsContainer.height() * 0.5) { | 153 | if ($filterBox.is(':visible') && $(window).scrollTop() > $goodsContainer.height() * 0.5) { |
148 | isScrollLoad = true; | 154 | isScrollLoad = true; |
149 | - Object.assign(defaultOpt, {page: page++}); | ||
150 | getGoodsList(); | 155 | getGoodsList(); |
151 | } | 156 | } |
152 | } | 157 | } |
-
Please register or login to post a comment