Merge branch 'feature/juguohong/20250816'

This commit is contained in:
李瑞
2025-09-14 16:37:31 +08:00
2 changed files with 94 additions and 67 deletions

View File

@@ -13,7 +13,7 @@ import CourtType from "@/components/CourtType";
// 玩法 // 玩法
import GamePlayType from "@/components/GamePlayType"; import GamePlayType from "@/components/GamePlayType";
import { useDictionaryActions } from "@/store/dictionaryStore"; import { useDictionaryActions } from "@/store/dictionaryStore";
import { View } from "@tarojs/components"; import { View, ScrollView } from "@tarojs/components";
const FilterPopup = (props: FilterPopupProps) => { const FilterPopup = (props: FilterPopupProps) => {
const { const {
@@ -91,11 +91,25 @@ const FilterPopup = (props: FilterPopupProps) => {
round round
visible={visible} visible={visible}
onClose={onClose} onClose={onClose}
style={{ marginTop: statusNavbarHeigh + "px", maxHeight: '75vh' }} style={{ marginTop: statusNavbarHeigh + "px", maxHeight: '70vh' }}
overlayStyle={{ marginTop: statusNavbarHeigh + "px" }} overlayStyle={{ marginTop: statusNavbarHeigh + "px" }}
zIndex={1001} zIndex={1001}
> >
<div className={styles.filterPopupWrapper}> <View className={styles.filterPopupWrapper}>
{/* 可滚动的内容区域 */}
<ScrollView
scrollY
enhanced
showScrollbar={false}
className={styles.filterPopupContent}
style={{
maxHeight: '60vh'
}}
onTouchMove={(e) => {
// 阻止滚动穿透
e.stopPropagation();
}}
>
{/* 日历 */} {/* 日历 */}
<View> <View>
<CalendarUI <CalendarUI
@@ -159,8 +173,10 @@ const FilterPopup = (props: FilterPopupProps) => {
options={gamePlayOptions} options={gamePlayOptions}
value={filterOptions?.playType} value={filterOptions?.playType}
/> />
{/* 按钮 */} </ScrollView>
<div className={styles.filterPopupBtnWrapper}>
{/* 固定在底部的按钮区域 */}
<View className={styles.filterPopupBtnWrapper}>
<Button <Button
className={styles.btn} className={styles.btn}
type="default" type="default"
@@ -176,8 +192,8 @@ const FilterPopup = (props: FilterPopupProps) => {
> >
{gamesNum} {gamesNum}
</Button> </Button>
</div> </View>
</div> </View>
</Popup> </Popup>
</> </>
); );

View File

@@ -36,7 +36,7 @@ const ListPage = () => {
initialFilterSearch, initialFilterSearch,
loadMoreMatches, loadMoreMatches,
fetchGetGamesCount, fetchGetGamesCount,
updateDistanceQuickFilter updateDistanceQuickFilter,
} = store; } = store;
const { const {
@@ -47,6 +47,7 @@ const ListPage = () => {
filterOptions, filterOptions,
distanceQuickFilter, distanceQuickFilter,
isShowInputCustomerNavBar, isShowInputCustomerNavBar,
pageOption
} = listPageState || {}; } = listPageState || {};
// 防抖的滚动处理函数 // 防抖的滚动处理函数
@@ -90,6 +91,16 @@ const ListPage = () => {
getLocation() getLocation()
}, []); }, []);
// 监听数据变化,如果是第一页就滚动到顶部
useEffect(() => {
if (pageOption?.page === 1 && matches?.length > 0) {
Taro.pageScrollTo({
scrollTop: 0,
duration: 300
});
}
}, [matches, pageOption?.page]);
// 清理定时器 // 清理定时器
useEffect(() => { useEffect(() => {
return () => { return () => {
@@ -226,6 +237,8 @@ const ListPage = () => {
/> />
<View ref={scrollContextRef}> <View ref={scrollContextRef}>
{/* <ShareCardCanvas /> */} {/* <ShareCardCanvas /> */}
{/* 列表内容 */}
<View className={styles.listPage} style={{ paddingTop: totalHeight }}>
{/* 综合筛选 */} {/* 综合筛选 */}
{isShowFilterPopup && ( {isShowFilterPopup && (
<View> <View>
@@ -242,8 +255,6 @@ const ListPage = () => {
/> />
</View> </View>
)} )}
{/* 列表内容 */}
<View className={styles.listPage} style={{ paddingTop: totalHeight }}>
<View <View
className={`${styles.listTopSearchWrapper}`} className={`${styles.listTopSearchWrapper}`}
> >