diff --git a/src/pages/user/components/UserCard.tsx b/src/pages/user/components/UserCard.tsx index 8b3456b..a2e4de5 100644 --- a/src/pages/user/components/UserCard.tsx +++ b/src/pages/user/components/UserCard.tsx @@ -1,6 +1,6 @@ import {Button} from '@nutui/nutui-react-taro' import {Avatar, Tag} from '@nutui/nutui-react-taro' -import {View, Text} from '@tarojs/components' +import {View, Text, Image} from '@tarojs/components' import {Scan} from '@nutui/icons-react-taro'; import {getUserInfo, getWxOpenId} from '@/api/layout'; import Taro from '@tarojs/taro'; @@ -16,7 +16,7 @@ const UserCard = forwardRef((_, ref) => { const { isAdmin } = useUser(); - const { data, refresh } = useUserData() + const {data, refresh} = useUserData() const {getDisplayName, getRoleName} = useUser(); const [IsLogin, setIsLogin] = useState(false) const [userInfo, setUserInfo] = useState() @@ -119,7 +119,7 @@ const UserCard = forwardRef((_, ref) => { }; /* 获取用户手机号 */ - const handleGetPhoneNumber = ({detail}: {detail: {code?: string, encryptedData?: string, iv?: string}}) => { + const handleGetPhoneNumber = ({detail}: { detail: { code?: string, encryptedData?: string, iv?: string } }) => { const {code, encryptedData, iv} = detail // 获取存储的邀请参数 @@ -171,71 +171,85 @@ const UserCard = forwardRef((_, ref) => { return ( - - - - { - IsLogin ? ( - - ) : ( - - ) - } - - {getDisplayName()} - {IsLogin ? ( - - - - {getRoleName()} - - - - ) : ''} + ) : ( + + ) + } + + {getDisplayName()} + {IsLogin ? ( + + + + {getRoleName()} + + + + ) : ''} + + {isAdmin() && + navTo('/user/store/verification', true)}/>} - {isAdmin() && navTo('/user/store/verification', true)} />} - navTo('/user/profile/profile', true)}> - {'个人资料'} + + navTo('/user/wallet/wallet', true)}> + 余额 + {data?.balance || '0.00'} + + + 积分 + {data?.points || 0} + + navTo('/user/coupon/index', true)}> + 优惠券 + {data?.coupons || 0} + + navTo('/user/gift/index', true)}> + 礼品卡 + {data?.giftCards || 0} + - - navTo('/user/wallet/wallet', true)}> - 余额 - {data?.balance || '0.00'} - - - 积分 - {data?.points || 0} - - navTo('/user/coupon/index', true)}> - 优惠券 - {data?.coupons || 0} - - navTo('/user/gift/index', true)}> - 礼品卡 - {data?.giftCards || 0} - + + {/* 个人资料图片,定位在右上角 */} + navTo('/user/profile/profile', true)} + > + 个人资料 - ) }) diff --git a/src/pages/user/user.scss b/src/pages/user/user.scss index 794599d..a01d79c 100644 --- a/src/pages/user/user.scss +++ b/src/pages/user/user.scss @@ -3,3 +3,7 @@ background: linear-gradient(to bottom, #03605c, #18ae4f); background-size: 100%; } + +.my-bg{ + background: url('https://oss.wsdns.cn/20250913/5ae575a50dbb4ccaab086c3679c5e2c3.png') no-repeat top center; +}