diff --git a/src/app.config.ts b/src/app.config.ts index be35419..ae2fec1 100644 --- a/src/app.config.ts +++ b/src/app.config.ts @@ -1,5 +1,6 @@ export default defineAppConfig({ pages: [ + 'pages/userInfo/myself/index', // 个人中心 'pages/login/index/index', 'pages/login/verification/index', 'pages/login/terms/index', @@ -11,8 +12,10 @@ export default defineAppConfig({ 'pages/detail/index', 'pages/message/index', 'pages/orderCheck/index', - 'pages/userInfo/myself/index', // 个人中心 - + + 'pages/userInfo/edit/index', // 个人中心 + 'pages/userInfo/favorites/index', // 个人中心 + 'pages/userInfo/orders/index', // 个人中心 // 'pages/mapDisplay/index', ], diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index e86135a..e742fe4 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import Taro from '@tarojs/taro'; import { View, Text, Image, Button } from '@tarojs/components'; import './index.scss'; @@ -19,6 +20,8 @@ export interface UserInfo { location: string; occupation: string; ntrp_level: string; + phone?: string; + gender?: string; } // 用户信息卡片组件属性 @@ -28,10 +31,16 @@ interface UserInfoCardProps { is_following?: boolean; on_follow?: () => void; on_message?: () => void; - on_edit?: () => void; on_share?: () => void; } + + // 处理编辑用户信息 + const on_edit = () => { + Taro.navigateTo({ + url: '/pages/userInfo/edit/index' + }); + }; // 用户信息卡片组件 export const UserInfoCard: React.FC = ({ user_info, @@ -39,7 +48,6 @@ export const UserInfoCard: React.FC = ({ is_following = false, on_follow, on_message, - on_edit, on_share }) => { return ( @@ -53,7 +61,7 @@ export const UserInfoCard: React.FC = ({ {user_info.nickname} {user_info.join_date} - + = ({ /> )} - {/* 只有当前用户才显示编辑按钮 */} - {is_current_user && on_edit && ( - - )} + {/* 只有当前用户才显示分享按钮 */} {is_current_user && on_share && (