- 在用户注册时支持从邀请参数中获取推荐人ID并绑定 - 修改管理员面板UI,添加统一扫码功能入口- 更新用户管理相关API地址,统一使用SERVER_API_URL - 调整优惠券卡片样式,移除小程序不支持的CSS属性 - 添加聊天会话和消息管理相关API模块 - 新增分销商银行卡管理API接口 - 修改系统用户模型,增加推荐人ID字段 - 更新广告位查询接口,支持根据code获取广告位 - 调整邀请绑定接口参数,将refereeId改为dealerId - 修改环境配置中的应用名称为"时里院子市集" - 移除分享到朋友圈的相关代码 - 添加管理员面板组件,提供统一扫码等管理功能 -修复用户管理API请求参数传递问题 - 添加聊天消息和会话管理的完整CRUD接口 - 更新系统用户相关接口URL,确保正确调用后端服务 - 添加分销商银行卡管理的完整API接口实现 - 修改邀请绑定接口,使用dealerId替代refereeId参数 - 修复扫码登录相关API的URL拼接问题 - 添加二维码内容解析功能,支持多种格式的token提取 - 更新用户信息模型,增加推荐人ID字段 -优化管理员面板样式和交互逻辑- 调整优惠券组件样式,兼容小程序环境限制- 修复用户管理模块的API调用问题 - 添加聊天相关数据模型和接口定义 - 更新环境配置中的应用名称 -修复邀请绑定相关的参数传递问题- 添加扫码登录状态枚举和相关数据结构定义- 优化管理员功能面板的UI展示和交互体验- 修复系统用户管理接口的请求参数问题 - 添加分销商银行卡管理相关接口实现- 调整聊天消息和会话管理接口的数据结构定义 -修复用户管理模块中的API调用路径问题 - 添加扫码登录相关工具函数,如设备信息获取等 - 更新邀请绑定接口的数据模型定义 -优化管理员面板组件的样式和功能实现 -修复系统用户管理接口中的参数传递问题 - 添加聊天相关模块的完整API接口实现 - 调整分销商银行卡管理模块的数据结构定义- 修复扫码登录相关接口的URL拼接问题- 更新用户管理模块中的API调用方式 - 添加聊天消息批量发送等相关接口实现- 修复邀请绑定接口中的参数名称问题- 优化管理员面板组件的功能和交互逻辑 - 调整系统用户管理接口的请求参数传递方式 - 添加分销商银行卡管理模块的完整接口实现 -修复聊天相关接口中的数据结构问题 - 更新扫码登录相关接口的数据模型定义 - 优化管理员功能面板的展示效果和用户体验
158 lines
4.7 KiB
TypeScript
158 lines
4.7 KiB
TypeScript
import React from 'react'
|
|
import { View, Text } from '@tarojs/components'
|
|
import { Button, Cell, CellGroup, Tag } from '@nutui/nutui-react-taro'
|
|
import { useDealerUser } from '@/hooks/useDealerUser'
|
|
import Taro from '@tarojs/taro'
|
|
|
|
const DealerInfo: React.FC = () => {
|
|
const {
|
|
dealerUser,
|
|
loading,
|
|
error,
|
|
refresh,
|
|
} = useDealerUser()
|
|
|
|
// 跳转到申请页面
|
|
const navigateToApply = () => {
|
|
Taro.navigateTo({
|
|
url: '/pages/dealer/apply/add'
|
|
})
|
|
}
|
|
|
|
if (error) {
|
|
return (
|
|
<View className="p-4">
|
|
<View className="bg-red-50 border border-red-200 rounded-lg p-4 mb-4">
|
|
<Text className="text-red-600">{error}</Text>
|
|
</View>
|
|
<Button type="primary" onClick={refresh}>
|
|
重试
|
|
</Button>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<View className="bg-gray-50 min-h-screen">
|
|
{/* 页面标题 */}
|
|
<View className="bg-white px-4 py-3 border-b border-gray-100">
|
|
<Text className="text-lg font-bold text-center">
|
|
经销商信息
|
|
</Text>
|
|
</View>
|
|
|
|
{!dealerUser ? (
|
|
// 非经销商状态
|
|
<View className="bg-white mx-4 mt-4 rounded-lg p-6">
|
|
<View className="text-center py-8">
|
|
<Text className="text-gray-500 mb-4">您还不是经销商</Text>
|
|
<Text className="text-sm text-gray-400 mb-6">
|
|
成为经销商后可享受专属价格和佣金收益
|
|
</Text>
|
|
<Button
|
|
type="primary"
|
|
size="large"
|
|
onClick={navigateToApply}
|
|
>
|
|
申请成为经销商
|
|
</Button>
|
|
</View>
|
|
</View>
|
|
) : (
|
|
// 经销商信息展示
|
|
<View>
|
|
{/* 状态卡片 */}
|
|
<View className="bg-white mx-4 mt-4 rounded-lg p-4">
|
|
<View className="flex items-center justify-between mb-4">
|
|
<Text className="text-lg font-semibold">经销商状态</Text>
|
|
<Tag>
|
|
{dealerUser.realName}
|
|
</Tag>
|
|
</View>
|
|
|
|
{/* 基本信息 */}
|
|
<CellGroup>
|
|
<Cell
|
|
title="经销商ID"
|
|
extra={dealerUser.userId || '-'}
|
|
/>
|
|
<Cell
|
|
title="refereeId"
|
|
extra={dealerUser.refereeId || '-'}
|
|
/>
|
|
<Cell
|
|
title="成为经销商时间"
|
|
extra={
|
|
dealerUser.money
|
|
}
|
|
/>
|
|
|
|
</CellGroup>
|
|
|
|
{/* 操作按钮 */}
|
|
<View className="mt-6 gap-2">
|
|
<Button
|
|
type="primary"
|
|
size="large"
|
|
loading={loading}
|
|
>
|
|
检查状态
|
|
</Button>
|
|
</View>
|
|
</View>
|
|
|
|
{/* 经销商权益 */}
|
|
<View className="bg-white mx-4 mt-4 rounded-lg p-4">
|
|
<Text className="font-semibold mb-3">经销商权益</Text>
|
|
<View className="gap-2">
|
|
<Text className="text-sm text-gray-600">
|
|
• 享受经销商专属价格
|
|
</Text>
|
|
<Text className="text-sm text-gray-600">
|
|
• 获得推广佣金收益
|
|
</Text>
|
|
<Text className="text-sm text-gray-600">
|
|
• 优先获得新品信息
|
|
</Text>
|
|
<Text className="text-sm text-gray-600">
|
|
• 专属客服支持
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
|
|
{/* 佣金统计 */}
|
|
<View className="bg-white mx-4 mt-4 rounded-lg p-4">
|
|
<Text className="font-semibold mb-3">佣金统计</Text>
|
|
<View className="grid grid-cols-3 gap-4">
|
|
<View className="text-center">
|
|
<Text className="text-lg font-bold text-blue-600">0</Text>
|
|
<Text className="text-sm text-gray-500">今日佣金</Text>
|
|
</View>
|
|
<View className="text-center">
|
|
<Text className="text-lg font-bold text-green-600">0</Text>
|
|
<Text className="text-sm text-gray-500">本月佣金</Text>
|
|
</View>
|
|
<View className="text-center">
|
|
<Text className="text-lg font-bold text-orange-600">0</Text>
|
|
<Text className="text-sm text-gray-500">累计佣金</Text>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
)}
|
|
|
|
{/* 刷新按钮 */}
|
|
<View className="text-center py-4">
|
|
<Text
|
|
className="text-blue-500 text-sm"
|
|
onClick={refresh}
|
|
>
|
|
点击刷新数据
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
export default DealerInfo
|