From 1403a1888ed8be2152ea9bb0a3582cf13aa2121b 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, 18 Aug 2025 20:51:29 +0800
Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E6=9B=B4=E6=96=B0=20API?=
=?UTF-8?q?=E8=B0=83=E7=94=A8=E4=BB=A5=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84?=
=?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=B7=A5=E5=85=B7-=20=E5=B0=86=E6=89=80?=
=?UTF-8?q?=E6=9C=89=20API=20=E8=B0=83=E7=94=A8=E4=B8=AD=E7=9A=84=20reques?=
=?UTF-8?q?t-legacy=20=E6=9B=BF=E6=8D=A2=E4=B8=BA=20request=20-=20?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86=20API=20=E8=B0=83=E7=94=A8?=
=?UTF-8?q?=E7=9A=84=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92=E6=96=B9=E5=BC=8F?=
=?UTF-8?q?=20-=20=E7=BB=9F=E4=B8=80=E5=AF=BC=E5=85=A5=20ApiResult=20?=
=?UTF-8?q?=E5=92=8C=20PageResult=20=E7=B1=BB=E5=9E=8B=E7=9A=84=E8=B7=AF?=
=?UTF-8?q?=E5=BE=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/dealer/apply/add.tsx | 6 +-
src/dealer/index.tsx | 173 +++++++++++++++++++++++++++++++++------
2 files changed, 150 insertions(+), 29 deletions(-)
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
+ 累计佣金
+
+
+
+
+ )}
+
+ {/* 刷新按钮 */}
+
+
+ 点击刷新数据
+
+
)
}