From 3088777b86dae29a92df3c6cc6e009ec5015d2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=91=9E?= Date: Tue, 30 Sep 2025 20:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=A7=A6=E5=BA=95=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ListCardSkeleton/index.scss | 2 +- src/container/listContainer/index.tsx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/ListCardSkeleton/index.scss b/src/components/ListCardSkeleton/index.scss index e642055..58b8842 100644 --- a/src/components/ListCardSkeleton/index.scss +++ b/src/components/ListCardSkeleton/index.scss @@ -47,7 +47,7 @@ } .location-position { - max-width: 66%; + max-width: 58%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/src/container/listContainer/index.tsx b/src/container/listContainer/index.tsx index 21dbe7b..ffd3833 100644 --- a/src/container/listContainer/index.tsx +++ b/src/container/listContainer/index.tsx @@ -4,6 +4,7 @@ import ListLoadError from "@/components/ListLoadError"; import ListCardSkeleton from "@/components/ListCardSkeleton"; import { useReachBottom } from "@tarojs/taro"; import "./index.scss"; +import { useRef, useEffect } from "react"; const ListContainer = (props) => { const { @@ -14,12 +15,23 @@ const ListContainer = (props) => { // recommendList, loadMoreMatches, } = props; + const timerRef = useRef(null); useReachBottom(() => { // 加载更多方法 - loadMoreMatches(); + timerRef.current = setTimeout(() => { + loadMoreMatches(); + }, 500); }); + useEffect(() => { + return () => { + if (timerRef.current) { + clearTimeout(timerRef.current); + } + }; + }, []); + if (error) { return ; }