列表
This commit is contained in:
@@ -36,7 +36,7 @@ const ListPage = () => {
|
||||
initialFilterSearch,
|
||||
loadMoreMatches,
|
||||
fetchGetGamesCount,
|
||||
updateDistanceQuickFilter
|
||||
updateDistanceQuickFilter,
|
||||
} = store;
|
||||
|
||||
const {
|
||||
@@ -47,6 +47,7 @@ const ListPage = () => {
|
||||
filterOptions,
|
||||
distanceQuickFilter,
|
||||
isShowInputCustomerNavBar,
|
||||
pageOption
|
||||
} = listPageState || {};
|
||||
|
||||
// 防抖的滚动处理函数
|
||||
@@ -90,6 +91,16 @@ const ListPage = () => {
|
||||
getLocation()
|
||||
}, []);
|
||||
|
||||
// 监听数据变化,如果是第一页就滚动到顶部
|
||||
useEffect(() => {
|
||||
if (pageOption?.page === 1 && matches?.length > 0) {
|
||||
Taro.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
}
|
||||
}, [matches, pageOption?.page]);
|
||||
|
||||
// 清理定时器
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user