修复bug

This commit is contained in:
李瑞
2025-10-12 23:49:02 +08:00
parent 35dfc7ffc8
commit 12600ebdfb
12 changed files with 45 additions and 33 deletions

View File

@@ -29,9 +29,12 @@ const ListContainer = (props) => {
useReachBottom(() => {
// 加载更多方法
timerRef.current = setTimeout(() => {
if (loading) {
return;
}
// timerRef.current = setTimeout(() => {
loadMoreMatches();
}, 500);
// }, 500);
});
useEffect(() => {
@@ -102,15 +105,6 @@ const ListContainer = (props) => {
return (
<View className="listContentWrapper">
{/* <ScrollView
scrollY
scrollWithAnimation
enableBackToTop
enablePassive
style={{ height: '100vh' }}
onScrollToLower={handleScrollToLower}
upperThreshold={60}
> */}
{renderList(data)}
{/* 显示骨架屏 */}
{loading && renderSkeleton()}
@@ -120,7 +114,6 @@ const ListContainer = (props) => {
{renderList(recommendList)} */}
{/* 到底了 */}
{data?.length > 0 && <View className="bottomTextWrapper"></View>}
{/* </ScrollView> */}
</View>
);
};

View File

@@ -7,6 +7,7 @@ import CustomNavbar from "@/components/CustomNavbar";
import { Input } from "@nutui/nutui-react-taro";
import Taro from "@tarojs/taro";
import "./index.scss";
import { getCurrentFullPath } from "@/utils";
interface IProps {
config?: {
@@ -40,10 +41,8 @@ const ListHeader = (props: IProps) => {
const currentAddress = city + district
const handleInputClick = () => {
const pages = Taro.getCurrentPages();
const currentPage = pages[pages.length - 1];
const currentPagePath = currentPage.route;
if (currentPagePath === "game_pages/searchResult/index") {
const currentPagePath = getCurrentFullPath()
if (currentPagePath === "/game_pages/searchResult/index") {
Taro.navigateBack();
} else {
Taro.navigateTo({
@@ -54,6 +53,13 @@ const ListHeader = (props: IProps) => {
// 点击logo
const handleLogoClick = () => {
// 如果当前在列表页,点击后页面回到顶部
if (getCurrentFullPath() === "/game_pages/list/index") {
Taro.pageScrollTo({
scrollTop: 0,
duration: 300,
});
}
Taro.redirectTo({
url: "game_pages/list/index", // 列表页
});