添加选择过度
This commit is contained in:
@@ -19,6 +19,7 @@ interface IProps {
|
||||
leftIconClick?: () => void;
|
||||
};
|
||||
onCityPickerVisibleChange?: (visible: boolean) => void; // 城市选择器显示/隐藏回调
|
||||
onScrollToTop?: () => void; // 滚动到顶部回调
|
||||
}
|
||||
|
||||
function CityPicker(props) {
|
||||
@@ -50,7 +51,7 @@ function CityPicker(props) {
|
||||
}
|
||||
|
||||
const ListHeader = (props: IProps) => {
|
||||
const { config, onCityPickerVisibleChange } = props;
|
||||
const { config, onCityPickerVisibleChange, onScrollToTop } = props;
|
||||
const { showInput = false, inputLeftIcon, leftIconClick } = config || {};
|
||||
const { getLocationLoading, statusNavbarHeightInfo } = useGlobalState();
|
||||
const { gamesNum, searchValue, cities, area, updateArea, getMatchesData, fetchGetGamesCount, refreshBothLists } = useListState();
|
||||
@@ -89,10 +90,16 @@ const ListHeader = (props: IProps) => {
|
||||
const handleLogoClick = () => {
|
||||
// 如果当前在列表页,点击后页面回到顶部
|
||||
if (getCurrentFullPath() === "/game_pages/list/index") {
|
||||
Taro.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300,
|
||||
});
|
||||
// 使用父组件传递的滚动方法(适配 ScrollView)
|
||||
if (onScrollToTop) {
|
||||
onScrollToTop();
|
||||
} else {
|
||||
// 降级方案:使用页面滚动(兼容旧版本)
|
||||
Taro.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300,
|
||||
});
|
||||
}
|
||||
}
|
||||
Taro.redirectTo({
|
||||
url: "game_pages/list/index", // 列表页
|
||||
|
||||
Reference in New Issue
Block a user