From 078b422db00c53e361f13b18cd81d4ca8fa0ed3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Fri, 21 Nov 2025 13:38:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8D=A1=E7=89=87=E7=BB=84=E4=BB=B6=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=BE=AE=E4=BF=A1=E6=89=8B=E6=9C=BA=E5=8F=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入 Button 组件用于触发微信获取手机号功能 - 根据登录状态显示不同的用户头像和信息区域 - 为未登录用户提供点击登录入口并绑定手机号 - 登录后展示用户头像、昵称及角色标签 - 优化用户卡片界面布局与交互逻辑 --- src/pages/user/components/UserCard.tsx | 43 +++++++++++++++++--------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/src/pages/user/components/UserCard.tsx b/src/pages/user/components/UserCard.tsx index ccda8ed..b2e2dc8 100644 --- a/src/pages/user/components/UserCard.tsx +++ b/src/pages/user/components/UserCard.tsx @@ -1,4 +1,4 @@ -import {Avatar, Tag, Space} from '@nutui/nutui-react-taro' +import {Avatar, Tag, Space, Button} from '@nutui/nutui-react-taro' import {View, Text} from '@tarojs/components' import {getUserInfo, getWxOpenId} from '@/api/layout'; import Taro from '@tarojs/taro'; @@ -179,22 +179,35 @@ const UserCard = forwardRef((_, ref) => { className={'user-card w-full flex flex-col justify-around rounded-xl'} > - - + {IsLogin && ( + navTo(`/user/profile/profile`)}> + + - - {getDisplayName()} - {IsLogin ? ( - - - - {getRoleName()} - - + /> + + {getDisplayName() || '点击登录'} + {getRoleName()} + - ) : ''} - + + )} + {!IsLogin && ( + + )}