From 92bd00ea4476cf88d0f977dbb17240cf117ba27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 22 Sep 2025 10:58:42 +0800 Subject: [PATCH] =?UTF-8?q?```=20feat(components):=20=E8=B0=83=E6=95=B4=20?= =?UTF-8?q?QRLoginButton=20=E9=BB=98=E8=AE=A4=E5=B1=9E=E6=80=A7=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E5=8D=A1=E7=89=87=E5=B8=83?= =?UTF-8?q?=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改 QRLoginButton 组件的默认 type 为 'default',size为 'small' - 在 UserCard 组件中注释掉 QRLoginButton 的引入和使用- 使用 Space 组件优化用户卡片中的按钮布局 - 替换原有条件渲染逻辑,统一使用按钮展示“扫码核销”功能 - 样式微调与代码格式化``` --- src/components/QRLoginButton.tsx | 4 +-- src/pages/index/Header.tsx | 1 + src/pages/user/components/UserCard.tsx | 42 ++++++++++++++++++-------- src/pages/user/components/UserGrid.tsx | 5 +-- 4 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/components/QRLoginButton.tsx b/src/components/QRLoginButton.tsx index 6a155e3..5775db3 100644 --- a/src/components/QRLoginButton.tsx +++ b/src/components/QRLoginButton.tsx @@ -28,8 +28,8 @@ export interface QRLoginButtonProps { * 扫码登录按钮组件 */ const QRLoginButton: React.FC = ({ - type = 'primary', - size = 'normal', + type = 'default', + size = 'small', text = '扫码登录', showIcon = true, onSuccess, diff --git a/src/pages/index/Header.tsx b/src/pages/index/Header.tsx index 0427d86..42d467b 100644 --- a/src/pages/index/Header.tsx +++ b/src/pages/index/Header.tsx @@ -207,6 +207,7 @@ const Header = (props: any) => { )}> + {/**/} ) diff --git a/src/pages/user/components/UserCard.tsx b/src/pages/user/components/UserCard.tsx index a021741..aed2fd2 100644 --- a/src/pages/user/components/UserCard.tsx +++ b/src/pages/user/components/UserCard.tsx @@ -1,8 +1,8 @@ import {Button} from '@nutui/nutui-react-taro' -import {Avatar, Tag} from '@nutui/nutui-react-taro' +import {Avatar, Tag, Space} from '@nutui/nutui-react-taro' import {View, Text, Image} from '@tarojs/components' -import {Scan} from '@nutui/icons-react-taro'; import {getUserInfo, getWxOpenId} from '@/api/layout'; +import {Scan} from '@nutui/icons-react-taro'; import Taro from '@tarojs/taro'; import {useEffect, useState, forwardRef, useImperativeHandle} from "react"; import {User} from "@/api/system/user/model"; @@ -11,7 +11,7 @@ import {TenantId} from "@/config/app"; import {useUser} from "@/hooks/useUser"; import {useUserData} from "@/hooks/useUserData"; import {getStoredInviteParams} from "@/utils/invite"; -import QRLoginButton from "@/components/QRLoginButton"; +// import QRLoginButton from "@/components/QRLoginButton"; const UserCard = forwardRef((_, ref) => { const { @@ -185,10 +185,14 @@ const UserCard = forwardRef((_, ref) => { { IsLogin ? ( - + ) : ( ) } @@ -205,11 +209,25 @@ const UserCard = forwardRef((_, ref) => { ) : ''} - {userInfo?.userId === 33738 && - - } - {isAdmin() && - navTo('/user/store/verification', true)}/>} + + {/*{userInfo?.userId === 33738 &&*/} + {/* */} + {/*}*/} + {!isAdmin() && + + } + ((_, ref) => { navTo('/user/profile/profile', true)} > diff --git a/src/pages/user/components/UserGrid.tsx b/src/pages/user/components/UserGrid.tsx index 417491c..95663c5 100644 --- a/src/pages/user/components/UserGrid.tsx +++ b/src/pages/user/components/UserGrid.tsx @@ -11,7 +11,8 @@ import { People, AfterSaleService, Logout, - ShoppingAdd, ShoppingRemove, Service + ShoppingAdd, + Service } from '@nutui/icons-react-taro' import {useUser} from "@/hooks/useUser"; @@ -102,7 +103,7 @@ const UserCell = () => { - navTo('/admin/index', true)}> + navTo('/admin/index', true)}>