优化活动加载更多

This commit is contained in:
2025-11-27 15:56:32 +08:00
parent 4f32312209
commit a20490f28d

View File

@@ -43,7 +43,8 @@ const MyselfPageContent: React.FC = () => {
});
// 分类球局数据(使用 useCallback 包装,避免每次渲染都创建新函数)
const classifyGameRecords = useCallback((
const classifyGameRecords = useCallback(
(
game_records: TennisMatch[]
): { notEndGames: TennisMatch[]; finishedGames: TennisMatch[] } => {
const now = new Date().getTime();
@@ -61,7 +62,9 @@ const MyselfPageContent: React.FC = () => {
finishedGames: [] as TennisMatch[],
}
);
}, []);
},
[]
);
// 使用 useCallback 包装 load_game_data避免每次渲染都创建新函数
const load_game_data = useCallback(async () => {
@@ -144,7 +147,7 @@ const MyselfPageContent: React.FC = () => {
const handleScroll = (event: any) => {
const scrollData = event.detail;
setCollapseProfile(scrollData.scrollTop > 10);
}
};
return (
<ScrollView scrollY className={styles.myselfPage} onScroll={handleScroll}>
@@ -162,11 +165,13 @@ const MyselfPageContent: React.FC = () => {
on_follow={handle_follow}
onTab={handleOnTab}
/>
{
!collapseProfile ?
{!collapseProfile ? (
<View className={styles.quickActionsSection}>
<View className={styles.actionCard}>
<View className={styles.actionContent} onClick={handle_game_orders}>
<View
className={styles.actionContent}
onClick={handle_game_orders}
>
<Image
className={styles.actionIcon}
src={require("@/static/userInfo/order_btn.svg")}
@@ -182,25 +187,29 @@ const MyselfPageContent: React.FC = () => {
<Text className={styles.actionText}></Text>
</View>
</View>
</View> :
null
}
</View>
) : null}
</View>
{!collapseProfile ? (
<View className={styles.testEntryCardBox}>
<NTRPTestEntryCard type={EvaluateScene.user} />
</View>
) : null}
<View className={styles.gameTabsSection}>
<View className={styles.tabContainer}>
<View
className={`${styles.tabItem} ${active_tab === "hosted" ? styles.active : ""}`}
className={`${styles.tabItem} ${
active_tab === "hosted" ? styles.active : ""
}`}
onClick={() => setActiveTab("hosted")}
>
<Text className={styles.tabText}></Text>
</View>
<View
className={`${styles.tabItem} ${active_tab === "participated" ? styles.active : ""
className={`${styles.tabItem} ${
active_tab === "participated" ? styles.active : ""
}`}
onClick={() => setActiveTab("participated")}
>