完善个人页(测试NTRP水平未做)

This commit is contained in:
2025-09-14 11:46:29 +08:00
parent 01aad920ad
commit 6f0c0c30fa
8 changed files with 317 additions and 59 deletions

View File

@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import { View, Text, Image, ScrollView } from "@tarojs/components";
import Taro from "@tarojs/taro";
import Taro, { useDidShow } from "@tarojs/taro";
import "./index.scss";
import GuideBar from "@/components/GuideBar";
import { UserInfoCard, UserInfo } from "@/components/UserInfo/index";
@@ -33,6 +33,7 @@ const MyselfPage: React.FC = () => {
location: "加载中...",
occupation: "加载中...",
ntrp_level: "NTRP 3.0",
personal_profile: "加载中...",
});
// 球局记录状态
@@ -77,9 +78,13 @@ const MyselfPage: React.FC = () => {
};
// 页面加载时获取数据
useEffect(() => {
load_user_data();
}, [user_id]);
// useEffect(() => {
// load_user_data();
// }, [user_id]);
useDidShow(() => {
load_user_data(); // 确保从编辑页面返回时刷新数据
});
// 切换标签页时重新加载球局数据
useEffect(() => {
@@ -157,6 +162,7 @@ const MyselfPage: React.FC = () => {
is_current_user={is_current_user}
is_following={is_following}
on_follow={handle_follow}
set_user_info={set_user_info}
/>
)}
{/* 球局订单和收藏功能 */}
@@ -208,6 +214,7 @@ const MyselfPage: React.FC = () => {
loading={loading}
error={null}
reload={load_game_data}
loadMoreMatches={() => { }}
/>
</ScrollView>
</View>