diff --git a/src/components/FilterPopup/index.tsx b/src/components/FilterPopup/index.tsx index 74fc113..2124c70 100644 --- a/src/components/FilterPopup/index.tsx +++ b/src/components/FilterPopup/index.tsx @@ -13,7 +13,7 @@ import CourtType from "@/components/CourtType"; // 玩法 import GamePlayType from "@/components/GamePlayType"; import { useDictionaryActions } from "@/store/dictionaryStore"; -import { View } from "@tarojs/components"; +import { View, ScrollView } from "@tarojs/components"; const FilterPopup = (props: FilterPopupProps) => { const { @@ -91,76 +91,92 @@ const FilterPopup = (props: FilterPopupProps) => { round visible={visible} onClose={onClose} - style={{ marginTop: statusNavbarHeigh + "px", maxHeight: '75vh' }} + style={{ marginTop: statusNavbarHeigh + "px", maxHeight: '70vh' }} overlayStyle={{ marginTop: statusNavbarHeigh + "px" }} zIndex={1001} > -
- {/* 日历 */} - - - - {/* 时间气泡选项 */} - - - - {/* 范围选择 */} - { - handleFilterChange("ntrp", value) + + {/* 可滚动的内容区域 */} + - - {/* 场次气泡选项 */} - {/*
- } - /> + onTouchMove={(e) => { + // 阻止滚动穿透 + e.stopPropagation(); + }} + > + {/* 日历 */} + + + + {/* 时间气泡选项 */} + -
*/} - {/* CourtType */} - - {/* 玩法 */} - - {/* 按钮 */} -
+ + {/* 范围选择 */} + { + handleFilterChange("ntrp", value) + }} + value={filterOptions?.ntrp} + /> + + {/* 场次气泡选项 */} + {/*
+ } + /> + +
*/} + {/* CourtType */} + + {/* 玩法 */} + + + + {/* 固定在底部的按钮区域 */} + -
-
+ + ); diff --git a/src/game_pages/list/index.tsx b/src/game_pages/list/index.tsx index 52c10bc..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 () => { @@ -226,7 +237,9 @@ const ListPage = () => { /> {/* */} - {/* 综合筛选 */} + {/* 列表内容 */} + + {/* 综合筛选 */} {isShowFilterPopup && ( { /> )} - {/* 列表内容 */} -