From 997c5a6e285ec1b2e47213883d0e98dd5a14ffe7 Mon Sep 17 00:00:00 2001 From: Ultrame <1019265060@qq.com> Date: Sun, 14 Sep 2025 23:29:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E4=BB=96=E4=BA=BA=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.config.ts | 3 ++- src/components/UserInfo/index.tsx | 13 ++++++++----- src/game_pages/detail/index.tsx | 8 +++++++- src/user_pages/other/index.config.ts | 1 - src/user_pages/other/index.scss | 1 + src/user_pages/other/index.tsx | 11 ++++++++--- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/app.config.ts b/src/app.config.ts index 17fe620..1a1b247 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -21,7 +21,8 @@ export default defineAppConfig({ root: "user_pages", pages: [ "myself/index", // 个人中心 - "edit/index", // 个人中心 + "edit/index", // 编辑个人中心 + "other/index", // 他人个人主页 ], }, // { diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 3515970..0201dc4 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -24,10 +24,13 @@ export interface UserInfo { ntrp_level: string; phone?: string; gender?: string; - bio?: string, - latitude?: string, - longitude?: string, - birthday?: string, + bio?: string; + latitude?: string; + longitude?: string; + birthday?: string; + is_following?: boolean; + tags?: string[]; + ongoing_games?: string[]; } @@ -59,7 +62,7 @@ export const UserInfoCard: React.FC = ({ on_share, set_user_info, }) => { - console.log("用户信息xx:", user_info); + console.log("用户信息:", user_info); // 编辑个人简介弹窗状态 const [edit_modal_visible, setEditModalVisible] = useState(false); const [editing_field, setEditingField] = useState(''); diff --git a/src/game_pages/detail/index.tsx b/src/game_pages/detail/index.tsx index e3c929f..23e4f3e 100644 --- a/src/game_pages/detail/index.tsx +++ b/src/game_pages/detail/index.tsx @@ -855,6 +855,12 @@ function OrganizerInfo(props) { } }; + const viewOtherPage = () => { + Taro.navigateTo({ + url: `/user_pages/other/index?userid=${id}`, + }); + }; + return ( {/* orgnizer title */} @@ -863,7 +869,7 @@ function OrganizerInfo(props) { {/* organizer avatar and name */} - + {nickname} diff --git a/src/user_pages/other/index.config.ts b/src/user_pages/other/index.config.ts index 62cb01c..5dcd237 100644 --- a/src/user_pages/other/index.config.ts +++ b/src/user_pages/other/index.config.ts @@ -1,4 +1,3 @@ export default definePageConfig({ navigationBarTitleText: '用户主页', - navigationStyle: 'custom' }) \ No newline at end of file diff --git a/src/user_pages/other/index.scss b/src/user_pages/other/index.scss index 7283e94..a1c7fcb 100644 --- a/src/user_pages/other/index.scss +++ b/src/user_pages/other/index.scss @@ -23,6 +23,7 @@ flex-direction: column; gap: 16px; margin-bottom: 16px; + margin-top: 98px; // 基本信息 .basic_info { diff --git a/src/user_pages/other/index.tsx b/src/user_pages/other/index.tsx index 63222a5..62fbf7e 100644 --- a/src/user_pages/other/index.tsx +++ b/src/user_pages/other/index.tsx @@ -11,6 +11,7 @@ import { GameRecord, } from "@/components/UserInfo"; import { UserService } from "@/services/userService"; +import * as LoginService from "@/services/loginService"; const OtherUserPage: React.FC = () => { // 获取页面参数 @@ -34,6 +35,9 @@ const OtherUserPage: React.FC = () => { location: "北京朝阳", occupation: "金融从业者", ntrp_level: "NTRP 3.5", + is_following: false, + ongoing_games: [], + personal_profile: '', }); // 模拟球局数据 @@ -52,8 +56,9 @@ const OtherUserPage: React.FC = () => { const load_user_data = async () => { if (user_id) { try { - const user_data = await UserService.get_user_info(user_id); - setUserInfo(user_data); + // const user_data = await UserService.get_user_info(user_id); + const res = await LoginService.getUserInfoById(user_id); + setUserInfo(res.data as UserInfo); const games_data = await UserService.get_user_games( user_id, @@ -151,7 +156,7 @@ const OtherUserPage: React.FC = () => { - + {/* */} ); };