From c3da6864830f9938afdb1ea9847e21bb3d204fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=91=9E?= Date: Sun, 14 Sep 2025 16:37:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/game_pages/list/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/game_pages/list/index.tsx b/src/game_pages/list/index.tsx index 79d5bfa..bf7d73e 100644 --- a/src/game_pages/list/index.tsx +++ b/src/game_pages/list/index.tsx @@ -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 () => {