diff --git a/src/dealer/apply/add.tsx b/src/dealer/apply/add.tsx index cbabb50..9042c90 100644 --- a/src/dealer/apply/add.tsx +++ b/src/dealer/apply/add.tsx @@ -86,7 +86,7 @@ const AddUserAddress = () => { } Taro.showToast({ - title: `${isEditMode ? '更新' : '保存'}成功`, + title: `${isEditMode ? '更新' : '提交'}成功`, icon: 'success' }); @@ -95,9 +95,9 @@ const AddUserAddress = () => { }, 1000); } catch (error) { - console.error('保存失败:', error); + console.error('提交失败:', error); Taro.showToast({ - title: `${isEditMode ? '更新' : '保存'}失败`, + title: `${isEditMode ? '更新' : '提交'}失败`, icon: 'error' }); } diff --git a/src/dealer/index.tsx b/src/dealer/index.tsx index a2cd75a..14750cd 100644 --- a/src/dealer/index.tsx +++ b/src/dealer/index.tsx @@ -1,35 +1,156 @@ import React from 'react' import { View, Text } from '@tarojs/components' -import { Cell, Button } from '@nutui/nutui-react-taro' +import { Button, Cell, CellGroup, Tag } from '@nutui/nutui-react-taro' +import { useDealerUser } from '@/hooks/useDealerUser' import Taro from '@tarojs/taro' const DealerIndex: React.FC = () => { + const { + dealerUser, + loading, + error, + refresh, + } = useDealerUser() + + // 跳转到申请页面 + const navigateToApply = () => { + Taro.navigateTo({ + url: '/pages/dealer/apply/add' + }) + } + + if (error) { + return ( + + + {error} + + + + ) + } + return ( - - 分销中心 - - - Taro.navigateTo({url: '/dealer/team/index'})}>查看} - /> - Taro.navigateTo({url: '/dealer/orders/index'})}>查看} - /> - Taro.navigateTo({url: '/dealer/withdraw/index'})}>提现} - /> - Taro.navigateTo({url: '/dealer/qrcode/index'})}>生成} - /> - + + {/* 页面标题 */} + + + {dealerUser?.realName} + + 推荐人ID:{dealerUser?.refereeId} + + + {!dealerUser ? ( + // 非经销商状态 + + + 您还不是经销商 + + 成为经销商后可享受专属价格和佣金收益 + + + + + ) : ( + // 经销商信息展示 + + {/* 状态卡片 */} + + + 经销商状态 + + {dealerUser.realName} + + + + {/* 基本信息 */} + + + + + + + + {/* 操作按钮 */} + + + + + + {/* 经销商权益 */} + + 经销商权益 + + + • 享受经销商专属价格 + + + • 获得推广佣金收益 + + + • 优先获得新品信息 + + + • 专属客服支持 + + + + + {/* 佣金统计 */} + + 佣金统计 + + + 0 + 今日佣金 + + + 0 + 本月佣金 + + + 0 + 累计佣金 + + + + + )} + + {/* 刷新按钮 */} + + + 点击刷新数据 + + ) }