refactor(admin): 简化经销商首页界面和功能模块
- 移除购物、京东、箭头、钱包、人员等图标导入 - 删除佣金统计卡片组件及其相关样式配置 - 移除团队统计数据展示区域 - 将功能导航标题从"分销工具"改为"管理工具" - 将网格项目中的"分销订单"改为"成员管理" - 移除提现申请、我的邀请、我的邀请码等功能入口 - 清理相关的渐变色样式导入和金额格式化函数
This commit is contained in:
@@ -3,15 +3,11 @@ import {View, Text} from '@tarojs/components'
|
|||||||
import {ConfigProvider, Button, Grid, Avatar} from '@nutui/nutui-react-taro'
|
import {ConfigProvider, Button, Grid, Avatar} from '@nutui/nutui-react-taro'
|
||||||
import {
|
import {
|
||||||
User,
|
User,
|
||||||
Shopping,
|
Shopping
|
||||||
Dongdong,
|
|
||||||
ArrowRight,
|
|
||||||
Purse,
|
|
||||||
People
|
|
||||||
} from '@nutui/icons-react-taro'
|
} from '@nutui/icons-react-taro'
|
||||||
import {useDealerUser} from '@/hooks/useDealerUser'
|
import {useDealerUser} from '@/hooks/useDealerUser'
|
||||||
import { useThemeStyles } from '@/hooks/useTheme'
|
import { useThemeStyles } from '@/hooks/useTheme'
|
||||||
import {businessGradients, cardGradients, gradientUtils} from '@/styles/gradients'
|
import {gradientUtils} from '@/styles/gradients'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
const DealerIndex: React.FC = () => {
|
const DealerIndex: React.FC = () => {
|
||||||
@@ -30,10 +26,10 @@ const DealerIndex: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 格式化金额
|
// 格式化金额
|
||||||
const formatMoney = (money?: string) => {
|
// const formatMoney = (money?: string) => {
|
||||||
if (!money) return '0.00'
|
// if (!money) return '0.00'
|
||||||
return parseFloat(money).toFixed(2)
|
// return parseFloat(money).toFixed(2)
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 格式化时间
|
// 格式化时间
|
||||||
const formatTime = (time?: string) => {
|
const formatTime = (time?: string) => {
|
||||||
@@ -108,7 +104,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
<View className="text-sm" style={{
|
<View className="text-sm" style={{
|
||||||
color: 'rgba(255, 255, 255, 0.8)'
|
color: 'rgba(255, 255, 255, 0.8)'
|
||||||
}}>
|
}}>
|
||||||
ID: {dealerUser.userId} | 推荐人: {dealerUser.refereeId || '无'}
|
{dealerUser.mobile}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
<View className="text-right hidden">
|
<View className="text-right hidden">
|
||||||
@@ -125,80 +121,9 @@ const DealerIndex: React.FC = () => {
|
|||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 佣金统计卡片 */}
|
|
||||||
{dealerUser && (
|
|
||||||
<View className="mx-4 -mt-6 rounded-xl p-4 relative z-10" style={cardGradients.elevated}>
|
|
||||||
<View className="mb-4">
|
|
||||||
<Text className="font-semibold text-gray-800">佣金统计</Text>
|
|
||||||
</View>
|
|
||||||
<View className="grid grid-cols-3 gap-3">
|
|
||||||
<View className="text-center p-3 rounded-lg flex flex-col" style={{
|
|
||||||
background: businessGradients.money.available
|
|
||||||
}}>
|
|
||||||
<Text className="text-lg font-bold mb-1 text-white">
|
|
||||||
{formatMoney(dealerUser.money)}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs" style={{ color: 'rgba(255, 255, 255, 0.9)' }}>可提现</Text>
|
|
||||||
</View>
|
|
||||||
<View className="text-center p-3 rounded-lg flex flex-col" style={{
|
|
||||||
background: businessGradients.money.frozen
|
|
||||||
}}>
|
|
||||||
<Text className="text-lg font-bold mb-1 text-white">
|
|
||||||
{formatMoney(dealerUser.freezeMoney)}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs" style={{ color: 'rgba(255, 255, 255, 0.9)' }}>冻结中</Text>
|
|
||||||
</View>
|
|
||||||
<View className="text-center p-3 rounded-lg flex flex-col" style={{
|
|
||||||
background: businessGradients.money.total
|
|
||||||
}}>
|
|
||||||
<Text className="text-lg font-bold mb-1 text-white">
|
|
||||||
{formatMoney(dealerUser.totalMoney)}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs" style={{ color: 'rgba(255, 255, 255, 0.9)' }}>累计收益</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 团队统计 */}
|
|
||||||
{dealerUser && (
|
|
||||||
<View className="bg-white mx-4 mt-4 rounded-xl p-4 hidden">
|
|
||||||
<View className="flex items-center justify-between mb-4">
|
|
||||||
<Text className="font-semibold text-gray-800">我的邀请</Text>
|
|
||||||
<View
|
|
||||||
className="text-gray-400 text-sm flex items-center"
|
|
||||||
onClick={() => navigateToPage('/dealer/team/index')}
|
|
||||||
>
|
|
||||||
<Text>查看详情</Text>
|
|
||||||
<ArrowRight size="12"/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
<View className="grid grid-cols-3 gap-4">
|
|
||||||
<View className="text-center grid">
|
|
||||||
<Text className="text-xl font-bold text-purple-500 mb-1">
|
|
||||||
{dealerUser.firstNum || 0}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs text-gray-500">一级成员</Text>
|
|
||||||
</View>
|
|
||||||
<View className="text-center grid">
|
|
||||||
<Text className="text-xl font-bold text-indigo-500 mb-1">
|
|
||||||
{dealerUser.secondNum || 0}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs text-gray-500">二级成员</Text>
|
|
||||||
</View>
|
|
||||||
<View className="text-center grid">
|
|
||||||
<Text className="text-xl font-bold text-pink-500 mb-1">
|
|
||||||
{dealerUser.thirdNum || 0}
|
|
||||||
</Text>
|
|
||||||
<Text className="text-xs text-gray-500">三级成员</Text>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* 功能导航 */}
|
{/* 功能导航 */}
|
||||||
<View className="bg-white mx-4 mt-4 rounded-xl p-4">
|
<View className="bg-white mx-4 mt-4 rounded-xl p-4">
|
||||||
<View className="font-semibold mb-4 text-gray-800">分销工具</View>
|
<View className="font-semibold mb-4 text-gray-800">管理工具</View>
|
||||||
<ConfigProvider>
|
<ConfigProvider>
|
||||||
<Grid
|
<Grid
|
||||||
columns={4}
|
columns={4}
|
||||||
@@ -209,7 +134,7 @@ const DealerIndex: React.FC = () => {
|
|||||||
border: 'none'
|
border: 'none'
|
||||||
} as React.CSSProperties}
|
} as React.CSSProperties}
|
||||||
>
|
>
|
||||||
<Grid.Item text="分销订单" onClick={() => navigateToPage('/dealer/orders/index')}>
|
<Grid.Item text="成员管理" onClick={() => navigateToPage('/dealer/orders/index')}>
|
||||||
<View className="text-center">
|
<View className="text-center">
|
||||||
<View className="w-12 h-12 bg-blue-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
<View className="w-12 h-12 bg-blue-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
||||||
<Shopping color="#3b82f6" size="20"/>
|
<Shopping color="#3b82f6" size="20"/>
|
||||||
@@ -217,71 +142,8 @@ const DealerIndex: React.FC = () => {
|
|||||||
</View>
|
</View>
|
||||||
</Grid.Item>
|
</Grid.Item>
|
||||||
|
|
||||||
<Grid.Item text={'提现申请'} onClick={() => navigateToPage('/dealer/withdraw/index')}>
|
|
||||||
<View className="text-center">
|
|
||||||
<View className="w-12 h-12 bg-green-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
|
||||||
<Purse color="#10b981" size="20"/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</Grid.Item>
|
|
||||||
|
|
||||||
<Grid.Item text={'我的邀请'} onClick={() => navigateToPage('/dealer/team/index')}>
|
|
||||||
<View className="text-center">
|
|
||||||
<View className="w-12 h-12 bg-purple-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
|
||||||
<People color="#8b5cf6" size="20"/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</Grid.Item>
|
|
||||||
|
|
||||||
<Grid.Item text={'我的邀请码'} onClick={() => navigateToPage('/dealer/qrcode/index')}>
|
|
||||||
<View className="text-center">
|
|
||||||
<View className="w-12 h-12 bg-orange-50 rounded-xl flex items-center justify-center mx-auto mb-2">
|
|
||||||
<Dongdong color="#f59e0b" size="20"/>
|
|
||||||
</View>
|
|
||||||
</View>
|
|
||||||
</Grid.Item>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* 第二行功能 */}
|
|
||||||
{/*<Grid*/}
|
|
||||||
{/* columns={4}*/}
|
|
||||||
{/* className="no-border-grid mt-4"*/}
|
|
||||||
{/* style={{*/}
|
|
||||||
{/* '--nutui-grid-border-color': 'transparent',*/}
|
|
||||||
{/* '--nutui-grid-item-border-width': '0px',*/}
|
|
||||||
{/* border: 'none'*/}
|
|
||||||
{/* } as React.CSSProperties}*/}
|
|
||||||
{/*>*/}
|
|
||||||
{/* <Grid.Item text={'邀请统计'} onClick={() => navigateToPage('/dealer/invite-stats/index')}>*/}
|
|
||||||
{/* <View className="text-center">*/}
|
|
||||||
{/* <View className="w-12 h-12 bg-indigo-50 rounded-xl flex items-center justify-center mx-auto mb-2">*/}
|
|
||||||
{/* <Presentation color="#6366f1" size="20"/>*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </Grid.Item>*/}
|
|
||||||
|
|
||||||
{/* /!* 预留其他功能位置 *!/*/}
|
|
||||||
{/* <Grid.Item text={''}>*/}
|
|
||||||
{/* <View className="text-center">*/}
|
|
||||||
{/* <View className="w-12 h-12 bg-gray-50 rounded-xl flex items-center justify-center mx-auto mb-2">*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </Grid.Item>*/}
|
|
||||||
|
|
||||||
{/* <Grid.Item text={''}>*/}
|
|
||||||
{/* <View className="text-center">*/}
|
|
||||||
{/* <View className="w-12 h-12 bg-gray-50 rounded-xl flex items-center justify-center mx-auto mb-2">*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </Grid.Item>*/}
|
|
||||||
|
|
||||||
{/* <Grid.Item text={''}>*/}
|
|
||||||
{/* <View className="text-center">*/}
|
|
||||||
{/* <View className="w-12 h-12 bg-gray-50 rounded-xl flex items-center justify-center mx-auto mb-2">*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </View>*/}
|
|
||||||
{/* </Grid.Item>*/}
|
|
||||||
{/*</Grid>*/}
|
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
0
src/admin/users/index.tsx
Normal file
0
src/admin/users/index.tsx
Normal file
Reference in New Issue
Block a user