feat: 定位到组件异常渲染的问题

This commit is contained in:
2025-11-15 20:23:15 +08:00
parent d427b9323c
commit 2a8c337b72
6 changed files with 251 additions and 160 deletions

View File

@@ -16,7 +16,7 @@ const MyselfPageContent: React.FC = () => {
const pickerOption = usePickerOption();
const { statusNavbarHeightInfo } = useGlobalState() || {};
const { totalHeight = 98 } = statusNavbarHeightInfo || {};
const instance = (Taro as any).getCurrentInstance();
const user_id = instance.router?.params?.userid || "";
const is_current_user = !user_id;
@@ -26,7 +26,9 @@ const MyselfPageContent: React.FC = () => {
const [ended_game_records, setEndedGameRecords] = useState<TennisMatch[]>([]);
const [loading] = useState(false);
const [is_following, setIsFollowing] = useState(false);
const [active_tab, setActiveTab] = useState<"hosted" | "participated">("hosted");
const [active_tab, setActiveTab] = useState<"hosted" | "participated">(
"hosted"
);
useEffect(() => {
pickerOption.getCities();
@@ -66,7 +68,7 @@ const MyselfPageContent: React.FC = () => {
const load_game_data = async () => {
try {
if (!user_info || !('id' in user_info)) {
if (!user_info || !("id" in user_info)) {
return;
}
let games_data;
@@ -136,7 +138,10 @@ const MyselfPageContent: React.FC = () => {
return (
<View className="myself_page">
<View className="myself_page_content_main" style={{ paddingTop: `${totalHeight}px` }}>
<View
className="myself_page_content_main"
style={{ paddingTop: `${totalHeight}px` }}
>
<View className="user_info_section">
<UserInfoCard
editable={is_current_user}
@@ -234,4 +239,3 @@ const MyselfPageContent: React.FC = () => {
};
export default MyselfPageContent;