From 431a095e87e47cab2cb487b67adb7e88ddfd2b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Thu, 8 Jan 2026 13:28:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor(dealer):=20=E7=A7=BB=E9=99=A4=E6=9C=AA?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E5=AF=BC=E5=85=A5=E5=92=8C=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了未使用的 Button 组件导入 - 移除了未使用的 gradientUtils 导入 - 移除了未使用的 error 和 refresh 变量 - 注释掉了 --- src/dealer/index.tsx | 52 +++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/dealer/index.tsx b/src/dealer/index.tsx index 9a1a37b..97f7a95 100644 --- a/src/dealer/index.tsx +++ b/src/dealer/index.tsx @@ -1,6 +1,6 @@ import React, {useState, useEffect} from 'react' import {View, Text} from '@tarojs/components' -import {ConfigProvider, Button, Grid, Avatar} from '@nutui/nutui-react-taro' +import {ConfigProvider, Grid, Avatar} from '@nutui/nutui-react-taro' import { User, Shopping, @@ -11,16 +11,14 @@ import { } from '@nutui/icons-react-taro' import {useDealerUser} from '@/hooks/useDealerUser' import {useThemeStyles} from '@/hooks/useTheme' -import {businessGradients, cardGradients, gradientUtils} from '@/styles/gradients' +import {businessGradients, cardGradients} from '@/styles/gradients' import Taro from '@tarojs/taro' import {getShopDealerRefereeByUserId} from "@/api/shop/shopDealerReferee"; import {ShopDealerUser} from "@/api/shop/shopDealerUser/model"; const DealerIndex: React.FC = () => { const { - dealerUser, - error, - refresh, + dealerUser } = useDealerUser() const [dealer, setDealer] = useState() @@ -45,16 +43,16 @@ const DealerIndex: React.FC = () => { } // 获取用户主题 - const userTheme = gradientUtils.getThemeByUserId(dealerUser?.userId) + // const userTheme = gradientUtils.getThemeByUserId(dealerUser?.userId) // 获取渐变背景 - const getGradientBackground = (themeColor?: string) => { - if (themeColor) { - const darkerColor = gradientUtils.adjustColorBrightness(themeColor, -30) - return gradientUtils.createGradient(themeColor, darkerColor) - } - return userTheme.background - } + // const getGradientBackground = (themeColor?: string) => { + // if (themeColor) { + // const darkerColor = gradientUtils.adjustColorBrightness(themeColor, -30) + // return gradientUtils.createGradient(themeColor, darkerColor) + // } + // return userTheme.background + // } // 初始化当前用户名称 @@ -65,20 +63,20 @@ const DealerIndex: React.FC = () => { }, [dealerUser]) - console.log(getGradientBackground(), 'getGradientBackground()') - - if (error) { - return ( - - - {error} - - - - ) - } + // console.log(getGradientBackground(), 'getGradientBackground()') + // + // if (error) { + // return ( + // + // + // {error} + // + // + // + // ) + // } return (