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 { 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}
>
<div className={styles.filterPopupWrapper}>
{/* 日历 */}
<View>
<CalendarUI
type="multiple"
isBorder={true}
value={filterOptions?.dateRange}
onChange={handleDateChange}
/>
</View>
{/* 时间气泡选项 */}
<Bubble
options={timeBubbleData}
value={filterOptions?.timeSlot}
onChange={handleFilterChange}
layout="grid"
size="small"
columns={3}
name="timeSlot"
/>
{/* 范围选择 */}
<Range
min={1.0}
max={5.0}
step={0.5}
className={styles.filterPopupRange}
onChange={(value) => {
handleFilterChange("ntrp", value)
<View className={styles.filterPopupWrapper}>
{/* 可滚动的内容区域 */}
<ScrollView
scrollY
enhanced
showScrollbar={false}
className={styles.filterPopupContent}
style={{
maxHeight: '60vh'
}}
value={filterOptions?.ntrp}
/>
{/* 场次气泡选项 */}
{/* <div>
<TitleComponent
title="场地类型"
icon={<Image src={img.ICON_SITE} />}
/>
onTouchMove={(e) => {
// 阻止滚动穿透
e.stopPropagation();
}}
>
{/* 日历 */}
<View>
<CalendarUI
type="multiple"
isBorder={true}
value={filterOptions?.dateRange}
onChange={handleDateChange}
/>
</View>
{/* 时间气泡选项 */}
<Bubble
options={locationOptions}
value={filterOptions?.site}
options={timeBubbleData}
value={filterOptions?.timeSlot}
onChange={handleFilterChange}
layout="grid"
size="small"
columns={3}
name="site"
name="timeSlot"
/>
</div> */}
{/* CourtType */}
<CourtType
onChange={handleFilterChange}
name="venueType"
options={locationOptions}
value={filterOptions?.venueType}
/>
{/* 玩法 */}
<GamePlayType
onChange={handleFilterChange}
name="playType"
options={gamePlayOptions}
value={filterOptions?.playType}
/>
{/* 按钮 */}
<div className={styles.filterPopupBtnWrapper}>
{/* 范围选择 */}
<Range
min={1.0}
max={5.0}
step={0.5}
className={styles.filterPopupRange}
onChange={(value) => {
handleFilterChange("ntrp", value)
}}
value={filterOptions?.ntrp}
/>
{/* 场次气泡选项 */}
{/* <div>
<TitleComponent
title="场地类型"
icon={<Image src={img.ICON_SITE} />}
/>
<Bubble
options={locationOptions}
value={filterOptions?.site}
onChange={handleFilterChange}
layout="grid"
size="small"
columns={3}
name="site"
/>
</div> */}
{/* CourtType */}
<CourtType
onChange={handleFilterChange}
name="venueType"
options={locationOptions}
value={filterOptions?.venueType}
/>
{/* 玩法 */}
<GamePlayType
onChange={handleFilterChange}
name="playType"
options={gamePlayOptions}
value={filterOptions?.playType}
/>
</ScrollView>
{/* 固定在底部的按钮区域 */}
<View className={styles.filterPopupBtnWrapper}>
<Button
className={styles.btn}
type="default"
@@ -176,8 +192,8 @@ const FilterPopup = (props: FilterPopupProps) => {
>
{gamesNum}
</Button>
</div>
</div>
</View>
</View>
</Popup>
</>
);

View File

@@ -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 = () => {
/>
<View ref={scrollContextRef}>
{/* <ShareCardCanvas /> */}
{/* 综合筛选 */}
{/* 列表内容 */}
<View className={styles.listPage} style={{ paddingTop: totalHeight }}>
{/* 综合筛选 */}
{isShowFilterPopup && (
<View>
<FilterPopup
@@ -242,8 +255,6 @@ const ListPage = () => {
/>
</View>
)}
{/* 列表内容 */}
<View className={styles.listPage} style={{ paddingTop: totalHeight }}>
<View
className={`${styles.listTopSearchWrapper}`}
>