Compare commits

..

20 Commits

Author SHA1 Message Date
fc778e9de6 feat(user): 优化用户信息加载及表单体验
- 新增页面加载状态,加载中显示提示
- 等待 useUser 初始化完成后再加载用户数据
- 添加获取数据字典和用户信息的异常处理及错误提示
- 同步更新备注信息表单控件,修正校验提示文案
- 修正备注信息输入框的name属性,确保表单数据绑定正确
2026-04-29 17:07:14 +08:00
0ae33997ee feat(user): 优化用户信息加载及表单体验
- 新增页面加载状态,加载中显示提示
- 等待 useUser 初始化完成后再加载用户数据
- 添加获取数据字典和用户信息的异常处理及错误提示
- 同步更新备注信息表单控件,修正校验提示文案
- 修正备注信息输入框的name属性,确保表单数据绑定正确
2026-04-29 16:48:05 +08:00
1c7f35b40f fix(dealer): 移除楼层字段优化房号相关逻辑及表单
- 删除楼层相关代码及状态管理
- 更新房号唯一键及展示逻辑,去除楼层字段
- 表单中楼层输入改为普通输入框,禁用编辑状态
- 修正提交及校验逻辑,统一房号字段处理
- 简化编辑模式房号数据回填过程
- 移除小区、楼栋、单元、楼层、房号弹出选择组件及相关逻辑
- 更改提示文案,从“请选择”改为“请填写”房号相关项
2026-04-24 20:26:52 +08:00
a2009c8cea feat(customer): 优化客户列表访问权限及新增备注字段
- 修改客户添加页面,新增“备注”输入框,支持录入客户备注信息
- 调整环境配置,统一开发、生产、测试环境的API_BASE_URL为正式地址
- 在shopDealerApply模型中新增receptionistId字段,用于查询分配的客户
- 优化客户列表权限逻辑,改为登录即可查看,不再限制角色
- 更新接口调用参数,支持查询当前登录用户提交及分配的客户
- 移除对管理员角色的特殊判断,使权限逻辑更简洁
- UI调整,未登录时显示“请先登录”提示而非“没有查看权限”
2026-04-18 10:56:47 +08:00
2ff740fb07 fix(customer): 修正表单必填属性及组件属性拼写错误
- 将小区和房号字段的 required 属性明确设置为 true
- 修复签约时间和合同时间输入框的 readOnly 属性拼写错误
- 调整姓名和手机号表单项位置,避免隐藏字段内嵌套组件
- 在姓名与手机号表单项间添加间距提升布局美观性
2026-04-16 17:31:42 +08:00
b5f66017cf feat(referral): 新增楼栋单元楼层房号精细选择功能
- 将房号唯一键增加楼层字段,修改相关函数支持楼层处理
- 新增楼栋、单元、楼层、房号的选择状态和搜索过滤功能
- 实现楼栋、单元、楼层、房号的选择弹窗和清除按钮
- 表单改用选择控件替代输入框,隐藏字段同步表单数据
- 修改表单校验,验证楼栋、楼层、房号
2026-04-16 17:11:39 +08:00
099855e121 feat(referral): 新增楼栋单元楼层房号精细选择功能
- 将房号唯一键增加楼层字段,修改相关函数支持楼层处理
- 新增楼栋、单元、楼层、房号的选择状态和搜索过滤功能
- 实现楼栋、单元、楼层、房号的选择弹窗和清除按钮
- 表单改用选择控件替代输入框,隐藏字段同步表单数据
- 修改表单校验,验证楼栋、楼层、房号字段必填
- 编辑模式支持从dealerCode解析回填楼栋、单元、楼层、房号
- 优化房号规范化逻辑,去除楼层相关后缀
- 代码中统一使用规范化后的楼栋单元楼层房号构造唯一
2026-04-16 17:09:58 +08:00
8128e2ffb2 fix(dealer): 更新角色ID及重新登录逻辑
- 将用户角色ID从1848更新为1935
- 注册后延时1.5秒等待权限同步,无额外空行

feat(customer): 新增小区选择功能

- 添加小区选择状态管理及弹出层组件
- 实现小区列表加载与搜索过滤
- 支持小区的选择与清除操作,更新表单地址字段
- 表单回填时设置小区选中状态
- 用自定义Cell替代地址输入框,增加交互体验

fix(index): 修改邀请好友页面路径

- 将邀请好友页面路径由/dealer/qrcode/index更改为/dealer/team/index

fix(qrcode): 更新伙伴计划名称

- 将“南南佐顿门窗伙伴计划”修改为“桂乐淘伙伴计划”

fix(team): 隐藏手机号显示并简化成员信息

- 将手机号显示组件隐藏
- 移除显示UID的文本,仅保留加入时间显示
2026-04-16 15:14:36 +08:00
815678a1de feat(dealer): 优化分享码页面加载和保存功能
- 修改配置文件环境接口地址为本地调试
- 更新分享二维码页面标题为“账户管理中心”,启用分享按钮
- 新增分享小程序功能,支持转发给朋友和分享到朋友圈
- 改进生成小程序码的加载状态及错误处理
- 增加保存小程序码到相册的权限申请和下载容错机制
- 处理保存失败时授权提示和异常提醒
- 显示加载失败及重试按钮,避免未授权用户界面死循环
- 未成为分销商时增加跳转申请页面引导
- 更新邀请文案和页面UI细节优化
- 在useDealerUser钩子中新增无经销商数据自动跳转申请页逻辑
2026-04-16 14:37:25 +08:00
238a652afc feat(dealer): 优化分享码页面加载和保存功能
- 修改配置文件环境接口地址为本地调试
- 更新分享二维码页面标题为“账户管理中心”,启用分享按钮
- 新增分享小程序功能,支持转发给朋友和分享到朋友圈
- 改进生成小程序码的加载状态及错误处理
- 增加保存小程序码到相册的权限申请和下载容错机制
- 处理保存失败时授权提示和异常提醒
- 显示加载失败及重试按钮,避免未授权用户界面死循环
- 未成为分销商时增加跳转申请页面引导
- 更新邀请文案和页面UI细节优化
- 在useDealerUser钩子中新增无经销商数据自动跳转申请页逻辑
2026-04-16 14:22:23 +08:00
d2cdd42846 feat(referral): 添加推荐客户功能及相关接口
- 新增小程序端推荐客户页面,实现客户信息报备功能
- 添加推荐客户统计与推荐记录展示,支持分页加载更多
- 实现手机号格式校验及报备表单提交逻辑
- 新增拨打客户电话功能
- 在分销商首页添加“推荐客户”入口菜单项
- 新增推荐客户相关API接口,包括报备、查询列表、统计及状态更新
- 完善推荐客户页面样式,提升用户体验
2026-04-14 11:54:07 +08:00
0a72306d6a feat(referral): 添加推荐客户功能及相关接口
- 新增小程序端推荐客户页面,实现客户信息报备功能
- 添加推荐客户统计与推荐记录展示,支持分页加载更多
- 实现手机号格式校验及报备表单提交逻辑
- 新增拨打客户电话功能
- 在分销商首页添加“推荐客户”入口菜单项
- 新增推荐客户相关API接口,包括报备、查询列表、统计及状态更新
- 完善推荐客户页面样式,提升用户体验
2026-04-14 10:06:17 +08:00
128563bfeb feat(home): 将首页菜单改为硬编码
- 首页4个功能按钮改为硬编码,删除后端接口请求
- 菜单项包括:我要推荐、客户列表、邀请好友、个人中心
- 菜单图标使用OSS直链,减少接口延迟
- Grid组件中map数据源由接口返回改为本地硬编码数据
- ContactSection中在线咨询功能改用button标签并简化逻辑
- 增加ContactSection按钮样式覆盖,去除默认边框和样式
2026-04-09 14:04:08 +08:00
1cd535d517 feat(home): 将首页菜单改为硬编码
- 首页4个功能按钮改为硬编码,删除后端接口请求
- 菜单项包括:我要推荐、客户列表、邀请好友、个人中心
- 菜单图标使用OSS直链,减少接口延迟
- Grid组件中map数据源由接口返回改为本地硬编码数据
- ContactSection中在线咨询功能改用button标签并简化逻辑
- 增加ContactSection按钮样式覆盖,去除默认边框和样式
2026-04-09 13:57:22 +08:00
5f4ea47300 feat(home): 将首页菜单改为硬编码
- 首页4个功能按钮改为硬编码,删除后端接口请求
- 菜单项包括:我要推荐、客户列表、邀请好友、个人中心
- 菜单图标使用OSS直链,减少接口延迟
- Grid组件中map数据源由接口返回改为本地硬编码数据
- ContactSection中在线咨询功能改用button标签并简化逻辑
- 增加ContactSection按钮样式覆盖,去除默认边框和样式
2026-04-09 13:52:30 +08:00
f14e190a79 feat(home): 将首页菜单改为硬编码
- 首页4个功能按钮改为硬编码,删除后端接口请求
- 菜单项包括:我要推荐、客户列表、邀请好友、个人中心
- 菜单图标使用OSS直链,减少接口延迟
- Grid组件中map数据源由接口返回改为本地硬编码数据
- ContactSection中在线咨询功能改用button标签并简化逻辑
- 增加ContactSection按钮样式覆盖,去除默认边框和样式
2026-04-09 13:52:06 +08:00
61025522aa refactor(style): 优化首页主要组件样式及布局实现
- 移除 BestSellers 组件中多余的 SCSS 样式,改用 TailwindCSS 工具类规范字体大小和颜色
- 替换 BestSellers.tsx 中对应元素的样式类为 TailwindCSS 实现,提升样式一致性和维护性
- 调整 CatalogShowcase 组件样式,删除不必要的 SCSS 样式,增加内边距并修改书本尺寸,整体优化布局
- CatalogShowcase.tsx 中相关文本和图形元素改为 TailwindCSS 实现,规范字体大小、颜色和间距
- ContactSection 组件部分样式移除过
2026-04-09 13:35:50 +08:00
25abd81d9f style(index): 优化首页样式与布局
- 重新设计首页背景色与容器安全区适配
- 优化Hero Banner区域增加圆角遮罩效果
- 调整Hero Grid菜单区样式,去除背景色实现透明效果
- 新增公告条样式,自定义样式替代NutUI NoticeBar
- 优化底部购买按钮样式,调整高度及阴影
- 统一首页通用section的左右边距,融合TrustSection和ContactSection样式
2026-04-09 13:09:45 +08:00
0be67bdb91 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	src/pages/index/index.tsx
2026-04-09 12:24:30 +08:00
969bc00b53 feat(customer): 新增接待人员选择功能
- 为 ShopDealerApply 模型增加接待人员 ID 和姓名字段
- dealer/customer/add 页面引入 Popup、SearchBar 及图标组件
- 实现接待人员选择弹层及搜索功能
- 表单中新增接待人员展示及清除操作
- 编辑模式下回填接待人员信息
- 提交表单时携带接待人员相关字段

feat(index): 新增首页品牌画册展示组件

- 创建 CatalogShowcase 组件及样式文件
- 展示品牌画册封面及标题说明
- “点击查看”按钮复制链接并提示用户打开浏览器查看
- 在首页主视图添加 CatalogShowcase 组件显示

fix(webview): 优化 webview 页面 URL 获取逻辑

- 使用 useRouter Hook 获取参数替代直接调用 Taro.getCurrentPages
-
2026-04-09 12:24:07 +08:00
40 changed files with 4373 additions and 664 deletions

View File

@@ -0,0 +1,39 @@
{
"version": 2,
"sessions": {
"8469bdd5894b41e1ba171a40f33d6a83": [
{
"expertId": "UiDesigner",
"name": "Sam",
"profession": "UI设计师",
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/01-Design/UiDesigner/UiDesigner.png",
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/01-Design/UiDesigner/UiDesigner_zh.md",
"usedAt": 1775709039214,
"industryId": "all"
}
],
"2d8018ea3c7f4b92a608c23c2ee6211a": [
{
"expertId": "SeniorDeveloper",
"name": "Will",
"profession": "高级开发工程师",
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
"usedAt": 1776102350082,
"industryId": "all"
}
],
"06a306d869f24d2eb36c381b2a67c63e": [
{
"expertId": "SeniorDeveloper",
"name": "吴八哥",
"profession": "高级开发工程师",
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
"usedAt": 1776328275045,
"industryId": "all"
}
]
},
"lastUpdated": 1776332994640
}

View File

@@ -0,0 +1,33 @@
# 2026-04-08 工作日志
## dealer/customer/add 新增接待人员选择功能
-`src/api/shop/shopDealerApply/model/index.ts` 中为 `ShopDealerApply` 接口新增了 `receptionistId`接待人员用户ID`receptionistName`(接待人员姓名)字段
-`src/dealer/customer/add.tsx` 中实现了接待人员选择功能:
- 引入 `Popup``SearchBar``ArrowRight``Del` 组件
- 引入 `pageShopDealerUser` API
- 添加接待人员相关状态(`showReceptionistPicker``receptionistList``selectedReceptionist` 等)
- 在表单手机号字段后新增 `Cell` 显示已选接待人员,支持清除
- 底部 `Popup` 弹出层,含搜索框 + 分销商用户列表选择
- 编辑模式下自动回填已保存的接待人员信息
- 提交时携带 `receptionistId``receptionistName` 字段
## 首页新增品牌画册区域
- 创建 `src/pages/index/CatalogShowcase.tsx` 组件:
- 展示品牌画册封面预览
- "点击查看"按钮,点击后复制链接并提示用户到浏览器打开
- 链接地址https://book.yunzhan365.com/mdfy/tjcs/mobile/index.html
- 创建 `src/pages/index/CatalogShowcase.scss` 样式文件
-`src/pages/index/index.tsx` 中引入并添加 `CatalogShowcase` 组件,位于 `CaseShowcase``ContactSection` 之间
## pages/webview/index.tsx 修复
- 原代码 `getUrl()` 在渲染阶段直接调用 `Taro.getCurrentPages()`,数据可能未就绪导致 URL 取不到
- 改为 `useRouter()` Hook + `useState` 获取 `params.url`,确保参数可靠后再渲染 web-view
- URL 无效时直接 return null 并 toast 提示后返回
## pages/index/CatalogShowcase.tsx 图标名修复
- `@nutui/icons-react-taro` 中不存在 `FileText` 图标,正确名称为 `File`
- `React error #130`Element type is undefined即因此导致已修复

View File

@@ -0,0 +1,34 @@
# 2026-04-09 工作日志
## 首页UI重构 — 去除"豆腐块"布局
用户反馈首页过于规整的"豆腐块"布局,要求重新设计。完成以下改动:
### 设计思路
- 打破均匀间距,各模块使用差异化 padding/margin
- 去掉公式化的"模块标题+白色卡片"结构
- 引入沉浸式视觉区域和横向交互
### 具体改动
1. **index.tsx** — 重构布局结构,引入 Hero 区域概念Banner+Grid 融为一体
2. **index.scss** — 全局样式重写,浅灰背景(#f5f5f7),自定义公告条样式
3. **TrustSection** — 从均匀三列改为横向滑动渐变卡片,突出数据亮点(10年/15年/98%)
4. **ContactSection** — 从2x2网格改为全宽深色底部(#1e293b#0f172a),沉浸式设计
5. **BestSellers** — 从纵向列表改为横向图文卡片(左图右信息),更紧凑
6. **CatalogShowcase** — 从小卡片改为大面积渐变视觉卡片,带装饰性书本图形
7. **NoticeBar** — 替换NutUI NoticeBar为自定义轻量公告条
### 注意事项
- `Fire` 图标在 @nutui/icons-react-taro 中不存在,改用 `StarFill`
- Banner 组件保留动态数据加载能力,圆角样式通过外层 CSS 控制
- Menu 组件已在原代码中 hidden本次未改动
## Grid.tsx 硬编码改造 (13:48)
- 将首页4个功能按钮从后端接口请求改为硬编码
- 菜单项:推荐客户、客户列表、邀请好友、个人中心
- 图片使用OSS直链避免接口延迟
- 对应页面路径保持不变
## 客户列表显示接待人员 (13:57)
- 在客户卡片中增加接待人员信息显示
- 字段来源receptionistName来自 ShopDealerApply model
- 仅当接待人员存在时显示

View File

@@ -0,0 +1,84 @@
# 2026-04-14 日志
## 项目客资管理系统Customer Lead Management System
### 需求背景
用户委托开发一个客资管理系统,具备以下功能:
1. **客资派单** - 管理员直接派单给业务员
2. **全民推荐** - 任何人可推荐客户赚取推荐费
3. **推荐人报备** - 注册用户可报备客户
4. **实时跟进** - 实时查看跟进情况和成交状态
5. **多管理员** - 支持多管理员设置
6. **数据统计导出** - 统计报表功能
### 涉及项目
- Java后端: `/Users/gxwebsoft/JAVA/mp-java`
- Vue后台管理: `/Users/gxwebsoft/VUE/mp-vue`
- 小程序端: `/Users/gxwebsoft/VUE/template-10582`
### 状态
- [x] 探索代码结构
- [x] 设计数据库schema
- [x] 设计API接口
- [x] 实施开发
### 实施成果
#### Java后端 (`/Users/gxwebsoft/JAVA/mp-java`)
- SQL脚本: `docs/sql/customer_lead_system.sql`
- Entity: CustomerLeadEntity, LeadDispatch, LeadFollowLog, LeadReferral, LeadStatistics, UserRoleExtend
- Mapper: CustomerLeadMapper, LeadDispatchMapper, LeadFollowLogMapper, LeadReferralMapper
- Service: CustomerLeadService, LeadReferralService
- Controller: CustomerLeadController, LeadReferralController
- 总结文档: `docs/ai/customer-lead-system-summary.md`
#### Vue后台 (`/Users/gxwebsoft/VUE/mp-vue`)
- API: `api/cms/customerLead/index.ts`, `model.ts`
- 页面: `views/cms/customerLead/index.vue`
#### 小程序端 (`/Users/gxwebsoft/VUE/template-10582`)
- API: `api/shop/referral.ts`
- 页面: `dealer/referral/index.tsx`
- 首页入口: 在分销商首页添加「推荐客户」功能
### 编译错误修复10:14
1. **Controller层** - `R.ok()``ApiResult` + `success()`两个Controller均继承 `BaseController`
- `CustomerLeadController`: 去掉 `import R`,改用 `ApiResult` + `extends BaseController`
- `LeadReferralController`: 同上
2. **Service层** - `userService.getLoginUser()` 方法不存在
- `CustomerLeadServiceImpl`: 去掉 `UserService` 注入,改用私有 `getLoginUser()` 方法(通过 `SecurityContextHolder` 实现,与 `BaseController` 逻辑一致)
- `LeadReferralServiceImpl`: 同上;另外修正 `userService.getUserById()``userService.getByIdRel()``UserService` 仍保留用于按ID查询用户
**项目规范记录**
- 返回值用 `ApiResult<T>` + `success()`Controller继承 `BaseController`
- Service层获取登录用户`SecurityContextHolder.getContext().getAuthentication().getPrincipal()` 强转 `User`
- 按ID查询用户`userService.getByIdRel(userId)`(非 `getUserById`
### 推荐客户模块重构2026-04-16
- **包名变更**`cms.LeadReferralController``app.recommendation.LeadReferralController`
- **API路径**`/lead/referral``/app/lead/referral`
- **数据库表前缀**`cms_contact_lead``app_lead_referral`
#### 新建文件清单
| 项目 | 文件 |
|------|------|
| Java后端 | `app/recommendation/entity/LeadReferral.java` |
| | `app/recommendation/entity/ReferrerInfo.java` |
| | `app/recommendation/entity/ReferralSettlement.java` |
| | `app/recommendation/mapper/LeadReferralMapper.java` |
| | `app/recommendation/mapper/ReferrerInfoMapper.java` |
| | `app/recommendation/mapper/ReferralSettlementMapper.java` |
| | `app/recommendation/service/LeadReferralService.java` |
| | `app/recommendation/service/impl/LeadReferralServiceImpl.java` |
| | `app/recommendation/controller/LeadReferralController.java`(小程序端) |
| | `app/recommendation/controller/LeadReferralAdminController.java`(后台管理) |
| | `app/recommendation/param/LeadReferralParam.java` |
| | `resources/db/sql/app_lead_referral.sql` |
| 小程序 | `src/api/app/referral.ts`新API |
| | `src/recommendation/index.tsx`(独立推荐页面) |
| | `src/recommendation/index.scss` |
| | `src/dealer/referral/index.tsx`改用新API |
| | `src/app.config.ts`新增recommendation子包路由 |
| Vue后台 | `src/api/app/referral.ts` |
| | `src/views/cms/recommendation/index.vue` |

View File

@@ -20,21 +20,21 @@
- 邀请码:`src/dealer/qrcode/index`
- 导航工具:`src/utils/common.ts` (navTo函数)
## 首页结构 (2026-04-02 更新)
- Header (吸顶搜索栏)
- Menu (导航菜单hidden)
- Banner (轮播广告)
- Grid (功能菜单)
- NoticeBar (公告栏)
- **BrochureEntry** (品牌画册入口卡片 — 位于公告栏下方)
- BestSellers (热销商品)
- **TrustSection** (品牌信任区 - 3列水平布局)
- 品质保障10年质保德国进口五金
- 专业团队15年安装经验持证上岗
- 客户好评5000+家庭选择98%满意度
- ~~CaseShowcase~~ (已注释隐藏,待有真实素材后再恢复)
- **ContactSection** (联系方式 - 2x2网格布局)
- 客服热线、在线咨询、门店地址、关注我们
## 首页结构 (2026-04-09 重大重构)
- Header (吸顶搜索栏,深色渐变背景)
- **Hero区域** (Banner + Grid 融合,圆角过渡)
- **NoticeStrip** (自定义轻量公告条,黄色圆点+文字)
- **BestSellers** (热销推荐 — 横向图文卡片,左图右信息)
- **CatalogShowcase** (品牌画册 — 大面积渐变视觉卡片)
- **TrustSection** (品质信任区 — 横向滑动渐变卡片10年质保/15年经验/98%满意度)
- **ContactSection** (联系我们 — 全宽深色沉浸式底部)
- PopUpAd (弹窗广告)
### 设计特点
- 非豆腐块布局,差异化间距和视觉层次
- 页面背景:#f5f5f7
- 底部区域为深色渐变(#1e293b#0f172a)
- ~~CaseShowcase~~ (已注释隐藏)
## 图标使用注意事项
- NutUI图标库中不存在的图标
@@ -45,13 +45,23 @@
- 所有图标必须从 `@nutui/icons-react-taro` 导入
- 构建前需验证图标名称是否在可用导出列表中
## 字体大小规范
- 微信小程序使用 TailwindCSS 文本类,不使用固定像素值
- 主标题:`text-lg font-semibold text-gray-800`
- 副标题:`text-sm text-gray-500`
- 项目标题:`text-base font-semibold text-gray-800`
- 项目描述:`text-xs text-gray-500`
-文本:`text-xs text-gray-500`
## 字体大小规范 (2026-04-09 更新)
- 微信小程序端按移动端标准设计,最小辅助文字 13-14px
- 使用 TailwindCSS 工具类text-xs/sm/base/lg/xl/2xl/3xl/4xl不使用 SCSS font-size
- 扩展了 tailwind.config.jstext-15(15px)、text-17(17px)、text-28(28px)
- 标签/辅助14px (text-sm)
- 正文/描述15-16px (text-15/text-base)
-标题/按钮文字16-17px (text-base/text-17)
- 区块标题20-24px (text-xl/text-2xl)
- 强调数字价格、数据28-36px (text-28/text-4xl)
- 所有图标必须从 `@nutui/icons-react-taro` 导入
## Tailwind 小程序兼容性注意事项
- **禁止使用斜杠透明度简写**`text-white/40``bg-black/50``border-gray/30` 等含 `/` 的写法在小程序不兼容,需要透明度时改用 SCSS `color: rgba(...)` 或在 tailwind.config.js 中定义语义色
- **禁止使用小数间距**`mt-0.5``p-0.5``gap-0.5` 等含小数点的工具类在小程序不兼容,改用整数如 `mt-1``p-1`
- **禁止使用任意值 `-[?]` 写法**`text-[14px]``w-[100px]` 等方括号任意值写法在小程序不兼容,改用 Tailwind 预设类或在 tailwind.config.js 中扩展
- **颜色替代方案**`text-white` 在小程序中可能不生效,改用 `text-gray`(如 `text-gray-100`~`text-gray-50` 等),深色背景上的白色文字优先用 `text-gray-100`
- 当前代码中 ContactSection/TrustSection/CatalogShowcase 共有 9 处 `text-white/xx` 待修复
## 画册页正式版 (2026-04-01)
- 首页已实际挂载 `src/pages/index/BrochureEntry.tsx` 入口,位置在 Banner 下方。

112
src/api/app/referral.ts Normal file
View File

@@ -0,0 +1,112 @@
/**
* 推荐客户 APIapp 模块)
* 小程序端调用
*/
import request from '@/utils/request'
/**
* 报备参数
*/
export interface ReferralParam {
customerName: string
customerPhone: string
customerCompany?: string
requirement?: string
appointmentTime?: string
remarks?: string
}
/**
* 推荐记录
*/
export interface ReferralRecord {
id: number
referralCode: string
referrerId?: number
referrerName?: string
referrerPhone?: string
customerName: string
customerPhone: string
customerCompany?: string
requirement?: string
appointmentTime?: string
remarks?: string
referralFee: string
referralStatus: number
referralStatusText?: string
invalidReason?: string
invalidTime?: string
confirmedTime?: string
settledTime?: string
createTime: string
}
/**
* 我的推荐统计
*/
export interface ReferralStats {
totalCount: number
pendingCount: number
validCount: number
settledCount: number
pendingAmount: string
referralCode?: string
}
/**
* 分页结果
*/
export interface PageResult<T> {
list: T[]
total: number
pageNum: number
pageSize: number
pages: number
}
/**
* 报备客户
*/
export function addReferral(data: ReferralParam) {
return request.post<{ code: number; message: string; data: ReferralRecord }>(
'/app/lead/referral/add',
data
)
}
/**
* 获取我的推荐码
*/
export function getMyReferralCode() {
return request.get<{ code: number; message: string; data: string }>(
'/app/lead/referral/my/code'
)
}
/**
* 获取我的推荐记录(分页)
*/
export function getMyReferrals(params: { pageNum?: number; pageSize?: number }) {
return request.get<{ code: number; message: string; data: PageResult<ReferralRecord> }>(
'/app/lead/referral/my',
{ params }
)
}
/**
* 获取我的推荐统计
*/
export function getMyStats() {
return request.get<{ code: number; message: string; data: ReferralStats }>(
'/app/lead/referral/my/stats'
)
}
/**
* 根据推荐码获取推荐人信息
*/
export function getReferrerByCode(code: string) {
return request.get<{ code: number; message: string; data: { referrerId: number; referrerName: string; referralCode: string } }>(
`/app/lead/referral/referrer/${code}`
)
}

View File

@@ -105,8 +105,8 @@ export async function getCmsNavigation(id: number) {
const res = await request.get<ApiResult<CmsNavigation>>(
'/cms/cms-navigation/' + id
);
if (res.code === 0 && res.data) {
return res.data;
if (res.code === 0) {
return res.data ?? null;
}
return Promise.reject(new Error(res.message));
}

135
src/api/shop/referral.ts Normal file
View File

@@ -0,0 +1,135 @@
/**
* 客资推荐人 API
* 小程序端调用
*/
import request from '@/utils/request'
/**
* 推荐人报备参数
*/
export interface ReferralParam {
customerName: string
customerPhone: string
customerCompany?: string
requirement?: string
appointmentTime?: string
remarks?: string
}
/**
* 推荐人报备结果
*/
export interface ReferralResult {
referralId: number
referralCode: string
customerName: string
customerPhone: string
referralFee?: number
referralStatus: number
referralStatusText: string
createTime: string
}
/**
* 推荐人统计
*/
export interface ReferralStats {
totalCount: number
pendingCount: number
validCount: number
settledCount: number
pendingAmount: number
}
/**
* 推荐人记录
*/
export interface ReferralRecord {
referralId: number
referredLeadId: number
customerName: string
customerPhone: string
referralFee: number
referralStatus: number
referralStatusText: string
leadStatus?: number
leadStatusText?: string
dealAmount?: number
createTime: string
settlementTime?: string
}
/**
* 注册用户报备客户
*/
export function addReferral(data: ReferralParam) {
return request.post<{ code: number; message: string; data: ReferralResult }>(
'/lead/referral/user',
data
)
}
/**
* 获取推荐人的推荐记录
*/
export function getReferralList(params: { pageNum?: number; pageSize?: number }) {
return request.get<{ code: number; message: string; data: { list: ReferralRecord[]; total: number } }>(
'/lead/referral/page',
{ params }
)
}
/**
* 获取推荐人统计
*/
export function getReferralStats(userId: number) {
return request.get<{ code: number; message: string; data: ReferralStats }>(
`/lead/referral/stats/${userId}`
)
}
/**
* 生成推荐码
*/
export function generateReferralCode() {
return request.get<{ code: number; message: string; data: string }>(
'/lead/referral/generateCode'
)
}
/**
* 获取当前用户的推荐码
*/
export function getMyReferralCode() {
return request.get<{ code: number; message: string; data: { referralCode: string } }>(
'/lead/referral/my/code'
)
}
/**
* 确认推荐有效(管理员)
*/
export function confirmReferral(referralId: number) {
return request.put<{ code: number; message: string }>(
`/lead/referral/confirm/${referralId}`
)
}
/**
* 作废推荐(管理员)
*/
export function invalidateReferral(referralId: number, reason?: string) {
return request.put<{ code: number; message: string }>(
`/lead/referral/invalidate/${referralId}`,
{ reason }
)
}
/**
* 结算推荐费(管理员)
*/
export function settleReferral(referralId: number) {
return request.put<{ code: number; message: string }>(
`/lead/referral/settle/${referralId}`
)
}

View File

@@ -48,6 +48,10 @@ export interface ShopDealerApply {
nickName?: string;
// 推荐人名称
refereeName?: string;
// 接待人员用户ID
receptionistId?: number;
// 接待人员姓名
receptionistName?: string;
}
/**
@@ -62,4 +66,5 @@ export interface ShopDealerApplyParam extends PageParam {
userId?: number;
keywords?: string;
applyStatus?: number; // 申请状态筛选 (10待审核 20审核通过 30驳回)
receptionistId?: number; // 接待人员用户ID用于查询分配给自己的客户
}

View File

@@ -94,8 +94,8 @@ export async function getShopDealerReferee(id: number) {
const res = await request.get<ApiResult<ShopDealerReferee>>(
'/shop/shop-dealer-referee/' + id
);
if (res.code === 0 && res.data) {
return res.data;
if (res.code === 0) {
return res.data ?? null;
}
return Promise.reject(new Error(res.message));
}
@@ -107,8 +107,8 @@ export async function getShopDealerRefereeByUserId(userId: number) {
const res = await request.get<ApiResult<ShopDealerReferee>>(
'/shop/shop-dealer-referee/getByUserId/' + userId
);
if (res.code === 0 && res.data) {
return res.data;
if (res.code === 0) {
return res.data ?? null;
}
return Promise.reject(new Error(res.message));
}

View File

@@ -72,7 +72,14 @@ export default defineAppConfig({
"customer/trading",
"wechat/index",
"bank/index",
"bank/add"
"bank/add",
"referral/index"
]
},
{
"root": "recommendation",
"pages": [
"index"
]
},
// {

View File

@@ -207,7 +207,7 @@ const AddUserAddress = () => {
if (roles.length > 0) {
await updateUserRole({
...roles[0],
roleId: 1848
roleId: 1935
})
}
@@ -231,16 +231,20 @@ const AddUserAddress = () => {
icon: 'success'
});
setTimeout(() => {
Taro.navigateBack();
}, 1000);
// 注册成功后等待1.5秒,让权限同步生效
await new Promise(resolve => setTimeout(resolve, 1500));
} catch (error) {
console.error('验证邀请人失败:', error);
// 重新登录刷新用户状态(包括最新权限)
Taro.removeStorageSync('Token');
Taro.removeStorageSync('UserId');
Taro.reLaunch({ url: '/pages/index/index' });
} catch (error: any) {
console.error('注册失败:', error);
Taro.showToast({
title: '注册失败,请重试',
title: error?.message || '注册失败,请重试',
icon: 'error'
})
});
} finally {
setSubmitting(false)
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,276 @@
.add-page {
min-height: 100vh;
background: #f5f5f7;
}
/* ═══ 顶部模式提示条 ═══ */
.add-page__mode-bar {
display: flex;
align-items: center;
justify-content: center;
padding: 10px 16px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
font-size: 15px;
font-weight: 600;
color: white;
}
.add-page__mode-bar--edit {
background: linear-gradient(135deg, #f59e0b, #d97706);
}
/* ═══ 表单卡片分组 ═══ */
.add-page__card {
margin: 12px 12px 0;
border-radius: 12px;
background: white;
overflow: hidden;
}
/* ═══ NutUI Form/CellGroup 样式覆盖 ═══ */
.add-page__card .nut-cell-group {
border-radius: 12px;
overflow: hidden;
}
.add-page__card .nut-cell::after {
left: 16px;
right: 16px;
border-color: #f0f0f0;
}
.add-page__card .nut-form-item .nut-cell__title {
font-size: 15px;
font-weight: 500;
color: #374151;
}
.add-page__card .nut-form-item .nut-input {
font-size: 15px;
color: #111827;
}
.add-page__card .nut-form-item .nut-input__inner {
font-size: 15px;
color: #111827;
}
.add-page__card .nut-cell__value {
font-size: 15px;
color: #111827;
}
/* ═══ 章节标题 ═══ */
.add-page__section-title {
display: flex;
align-items: center;
padding: 16px 16px 8px;
font-size: 13px;
font-weight: 600;
color: #9ca3af;
letter-spacing: 0.5px;
}
.add-page__section-title::before {
content: '';
display: inline-block;
width: 3px;
height: 14px;
border-radius: 2px;
background: #3b82f6;
margin-right: 8px;
}
/* ═══ 接待人员选择 ═══ */
.add-page__receptionist-cell {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
}
.add-page__receptionist-value {
display: flex;
align-items: center;
}
.add-page__receptionist-name {
font-size: 15px;
color: #111827;
margin-right: 8px;
}
.add-page__receptionist-placeholder {
font-size: 15px;
color: #d1d5db;
}
.add-page__receptionist-clear {
display: flex;
align-items: center;
padding: 4px;
}
/* ═══ 日期选择器触发器 ═══ */
.add-page__date-trigger {
display: flex;
align-items: center;
padding: 8px 0;
}
.add-page__date-text {
font-size: 15px;
color: #111827;
}
.add-page__date-placeholder {
font-size: 15px;
color: #d1d5db;
}
/* ═══ 底部按钮区 ═══ */
.add-page__footer {
position: fixed;
z-index: 50;
bottom: 0;
left: 0;
right: 0;
padding: 12px 16px;
padding-bottom: calc(12px + env(safe-area-inset-bottom));
background: linear-gradient(to top, rgba(255, 255, 255, 1) 60%, rgba(255, 255, 255, 0));
}
.add-page__submit-btn {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 48px;
border: none;
border-radius: 12px;
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
font-size: 17px;
font-weight: 600;
letter-spacing: 1px;
box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
&:active {
opacity: 0.85;
}
&::after {
display: none;
}
}
.add-page__submit-btn--disabled {
opacity: 0.5;
pointer-events: none;
}
.add-page__bottom-spacer {
height: 100px;
width: 100%;
}
/* ═══ 审核状态区 ═══ */
.add-page__status-section {
margin: 12px 12px 0;
border-radius: 12px;
overflow: hidden;
}
.add-page__status-cell {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
}
.add-page__status-label {
font-size: 14px;
color: #6b7280;
}
.add-page__status-value {
font-size: 14px;
color: #374151;
}
/* ═══ Popup 选择接待人员 ═══ */
.add-page__picker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px;
border-bottom: 1px solid #f0f0f0;
}
.add-page__picker-title {
font-size: 17px;
font-weight: 600;
color: #111827;
}
.add-page__picker-cancel {
font-size: 15px;
color: #3b82f6;
padding: 4px 8px;
}
.add-page__picker-search {
padding: 12px 12px 8px;
}
.add-page__picker-list {
flex: 1;
overflow-y: auto;
}
.add-page__picker-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #f5f5f5;
}
.add-page__picker-item:active {
background: #f9fafb;
}
.add-page__picker-item-info {
display: flex;
flex-direction: column;
}
.add-page__picker-item-name {
font-size: 15px;
font-weight: 500;
color: #111827;
}
.add-page__picker-item-phone {
font-size: 13px;
color: #9ca3af;
margin-top: 2px;
}
.add-page__picker-item-selected {
font-size: 14px;
font-weight: 600;
color: #3b82f6;
}
.add-page__picker-empty {
display: flex;
align-items: center;
justify-content: center;
padding: 40px 0;
}
.add-page__picker-empty-text {
font-size: 14px;
color: #d1d5db;
}

View File

@@ -1,6 +1,6 @@
import {useEffect, useState, useRef} from "react";
import {Loading, CellGroup, Cell, Input, Form, Calendar} from '@nutui/nutui-react-taro'
import {Edit, Calendar as CalendarIcon} from '@nutui/icons-react-taro'
import {Loading, CellGroup, Cell, Input, Form, Calendar, Popup, SearchBar} from '@nutui/nutui-react-taro'
import {Edit, Calendar as CalendarIcon, ArrowRight, Del} from '@nutui/icons-react-taro'
import Taro from '@tarojs/taro'
import {useRouter} from '@tarojs/taro'
import {View, Text} from '@tarojs/components'
@@ -15,7 +15,7 @@ import {
extractDateForCalendar, formatDateForDisplay
} from "@/utils/dateUtils";
import {ShopDealerUser} from "@/api/shop/shopDealerUser/model";
import {getShopDealerUser} from "@/api/shop/shopDealerUser";
import {getShopDealerUser, pageShopDealerUser} from "@/api/shop/shopDealerUser";
const AddShopDealerApply = () => {
const {params} = useRouter();
@@ -62,6 +62,13 @@ const AddShopDealerApply = () => {
const [applyTime, setApplyTime] = useState<string>('')
const [contractTime, setContractTime] = useState<string>('')
// 接待人员选择状态
const [showReceptionistPicker, setShowReceptionistPicker] = useState<boolean>(false)
const [receptionistSearch, setReceptionistSearch] = useState<string>('')
const [receptionistList, setReceptionistList] = useState<ShopDealerUser[]>([])
const [receptionistLoading, setReceptionistLoading] = useState<boolean>(false)
const [selectedReceptionist, setSelectedReceptionist] = useState<ShopDealerUser | null>(null)
// 获取审核状态文字
const getApplyStatusText = (status?: number) => {
switch (status) {
@@ -133,6 +140,15 @@ const AddShopDealerApply = () => {
setContractTime(extractDateForCalendar(dealerApply.contractTime))
}
// 回填接待人员
if (dealerApply.receptionistId) {
setSelectedReceptionist({
userId: dealerApply.receptionistId,
dealerName: dealerApply.receptionistName || '',
realName: dealerApply.receptionistName || '',
})
}
Taro.setNavigationBarTitle({title: '签约'})
}
} catch (error) {
@@ -143,6 +159,43 @@ const AddShopDealerApply = () => {
}
}
// 加载接待人员列表
const loadReceptionistList = async (keyword?: string) => {
setReceptionistLoading(true)
try {
const res = await pageShopDealerUser({keywords: keyword || '', limit: 50, page: 1})
setReceptionistList(res?.list || [])
} catch (e) {
console.error('加载接待人员失败:', e)
} finally {
setReceptionistLoading(false)
}
}
// 打开接待人员选择
const openReceptionistPicker = () => {
setReceptionistSearch('')
loadReceptionistList()
setShowReceptionistPicker(true)
}
// 搜索接待人员
const handleReceptionistSearch = (val: string) => {
setReceptionistSearch(val)
loadReceptionistList(val)
}
// 选择接待人员
const handleSelectReceptionist = (user: ShopDealerUser) => {
setSelectedReceptionist(user)
setShowReceptionistPicker(false)
}
// 清除接待人员
const handleClearReceptionist = () => {
setSelectedReceptionist(null)
}
// 提交表单
// 计算保护期过期时间15天后
const calculateExpirationTime = (): string => {
@@ -455,7 +508,10 @@ const AddShopDealerApply = () => {
expirationTime: expirationTime,
// 确保日期数据正确提交(使用数据库格式)
applyTime: values.applyTime || (applyTime ? formatDateForDatabase(applyTime) : ''),
contractTime: values.contractTime || (contractTime ? formatDateForDatabase(contractTime) : '')
contractTime: values.contractTime || (contractTime ? formatDateForDatabase(contractTime) : ''),
// 接待人员
receptionistId: selectedReceptionist?.userId || undefined,
receptionistName: selectedReceptionist ? (selectedReceptionist.realName || selectedReceptionist.dealerName || '') : undefined,
};
// 调试信息
@@ -546,8 +602,33 @@ const AddShopDealerApply = () => {
onFinish={(values) => submitSucceed(values)}
onFinishFailed={(errors) => submitFailed(errors)}
>
<View className={'bg-gray-100 h-3'}></View>
<CellGroup style={{padding: '4px 0'}}>
<CellGroup style={{padding: '0'}}>
{/* 接待人员选择 */}
<Cell
title="接待人员"
extra={
<View className="flex items-center">
{selectedReceptionist ? (
<View className="flex items-center">
<Text className="text-sm text-gray-800 mr-2">
{selectedReceptionist.realName || selectedReceptionist.dealerName || '已选择'}
</Text>
<View
onClick={(e) => { e.stopPropagation(); handleClearReceptionist(); }}
className="flex items-center px-1"
>
<Del size={14} color="#999"/>
</View>
</View>
) : (
<Text className="text-sm text-gray-400"></Text>
)}
<ArrowRight size={14} color="#ccc"/>
</View>
}
onClick={openReceptionistPicker}
/>
<View className={'bg-gray-100 h-2'}></View>
<Form.Item name="address" label="小区" initialValue={FormData?.address} required>
<Input placeholder="幸福里" disabled={isEditMode}/>
</Form.Item>
@@ -566,6 +647,9 @@ const AddShopDealerApply = () => {
<Form.Item name="mobile" label="手机号" initialValue={FormData?.mobile} required>
<Input placeholder="手机号" disabled={isEditMode} maxLength={11}/>
</Form.Item>
<Form.Item name="comments" label="备注" initialValue={FormData?.comments}>
<Input placeholder="请输入备注信息" />
</Form.Item>
{isEditMode && (
<>
<Form.Item name="money" label="签约价格" initialValue={FormData?.money} required>
@@ -628,6 +712,59 @@ const AddShopDealerApply = () => {
onConfirm={handleContractTimeConfirm}
/>
{/* 接待人员选择弹出层 */}
<Popup
visible={showReceptionistPicker}
position="bottom"
round
onClose={() => setShowReceptionistPicker(false)}
style={{height: '70%'}}
>
<View className="flex flex-col h-full">
{/* 标题栏 */}
<View className="flex items-center justify-between px-4 py-3 border-b border-gray-100">
<Text className="text-base font-semibold text-gray-800"></Text>
<View onClick={() => setShowReceptionistPicker(false)}>
<Text className="text-sm text-blue-500"></Text>
</View>
</View>
{/* 搜索框 */}
<View className="px-3 py-2">
<SearchBar
value={receptionistSearch}
placeholder="搜索姓名/手机号"
onChange={handleReceptionistSearch}
/>
</View>
{/* 列表 */}
<View className="flex-1 overflow-y-auto">
{receptionistLoading ? (
<View className="flex justify-center items-center py-8">
<Loading></Loading>
</View>
) : receptionistList.length === 0 ? (
<View className="flex justify-center items-center py-8">
<Text className="text-sm text-gray-400"></Text>
</View>
) : (
receptionistList.map((user) => (
<Cell
key={user.userId}
title={user.realName || user.dealerName || '未知'}
description={user.mobile || user.dealerPhone || ''}
extra={
selectedReceptionist?.userId === user.userId ? (
<Text className="text-sm text-blue-500"></Text>
) : null
}
onClick={() => handleSelectReceptionist(user)}
/>
))
)}
</View>
</View>
</Popup>
{/* 审核状态显示(仅在编辑模式下显示) */}
{isEditMode && (
<CellGroup>

View File

@@ -1,4 +1,4 @@
import {useState, useEffect, useCallback, useRef} from 'react'
import {useState, useEffect, useCallback} from 'react'
import {View, Text} from '@tarojs/components'
import Taro, {useDidShow} from '@tarojs/taro'
import {Loading, InfiniteLoading, Empty, Space, Tabs, TabPane, Tag, Button, SearchBar} from '@nutui/nutui-react-taro'
@@ -33,24 +33,10 @@ const CustomerIndex = () => {
const [page, setPage] = useState(1)
const [hasMore, setHasMore] = useState(true)
// 非分销商不允许查看客户列表
const {user, hasRole, loading: userLoading} = useUser()
// 管理员允许查看全部;普通分销商仅查看自己
const isAdminUser = user?.isAdmin === true
const canView = hasRole('dealer') || isAdminUser
// 权限检查:只要登录就能查看客户列表
const {user, loading: userLoading} = useUser()
const roleCheckFinished = !userLoading
const noPermissionShownRef = useRef(false)
useEffect(() => {
if (!roleCheckFinished || canView) return
if (noPermissionShownRef.current) return
noPermissionShownRef.current = true
Taro.showToast({
title: '没有查看权限',
icon: 'none',
duration: 1500
})
}, [roleCheckFinished, canView])
const isLoggedIn = roleCheckFinished && user !== null
// Tab配置
const tabList = getStatusOptions();
@@ -201,14 +187,13 @@ const CustomerIndex = () => {
const currentUserId = Number(Taro.getStorageSync('UserId')) || user?.userId || 0;
// 构建API参数根据状态筛选
// 查看自己提交的(userId)或分配给自己的(receptionistId)的客户
const params: any = {
type: 4,
page: currentPage
page: currentPage,
userId: currentUserId,
receptionistId: currentUserId
};
// 非管理员:只看自己添加的客户
if (!isAdminUser && currentUserId > 0) {
params.userId = currentUserId;
}
const applyStatus = mapCustomerStatusToApplyStatus(statusFilter || activeTab);
if (applyStatus !== undefined) {
params.applyStatus = applyStatus;
@@ -251,7 +236,7 @@ const CustomerIndex = () => {
} finally {
setLoading(false);
}
}, [activeTab, page, isAdminUser, user?.userId]);
}, [activeTab, page, user?.userId]);
const reloadMore = async () => {
if (loading || !hasMore) return; // 防止重复加载
@@ -300,11 +285,11 @@ const CustomerIndex = () => {
const fetchStatusCounts = useCallback(async () => {
try {
const currentUserId = Number(Taro.getStorageSync('UserId')) || user?.userId || 0;
const baseParams: any = {type: 4};
// 非管理员:只统计自己添加的客户
if (!isAdminUser && currentUserId > 0) {
baseParams.userId = currentUserId;
}
const baseParams: any = {
type: 4,
userId: currentUserId,
receptionistId: currentUserId
};
// 并行获取各状态的数量
const [allRes, pendingRes, signedRes, cancelledRes] = await Promise.all([
@@ -323,7 +308,7 @@ const CustomerIndex = () => {
} catch (error) {
console.error('获取状态统计失败:', error);
}
}, [isAdminUser, user?.userId]);
}, [user?.userId]);
const getStatusCounts = () => statusCounts;
@@ -364,22 +349,22 @@ const CustomerIndex = () => {
// 初始化统计数据
useEffect(() => {
if (!roleCheckFinished || !canView) return;
if (!isLoggedIn) return;
fetchStatusCounts().then();
}, [roleCheckFinished, canView]);
}, [isLoggedIn]);
// 当activeTab变化时重新获取数据
useEffect(() => {
if (!roleCheckFinished || !canView) return;
if (!isLoggedIn) return;
setList([]); // 清空列表
setPage(1); // 重置页码
setHasMore(true); // 重置加载状态
fetchCustomerData(activeTab, true);
}, [activeTab, roleCheckFinished, canView]);
}, [activeTab, isLoggedIn]);
// 监听页面显示,当从其他页面返回时刷新数据
useDidShow(() => {
if (!roleCheckFinished || !canView) return;
if (!isLoggedIn) return;
// 刷新当前tab的数据和统计信息
setList([]);
setPage(1);
@@ -465,6 +450,13 @@ const CustomerIndex = () => {
<Text className={'text-xs text-gray-500'}>{customer?.refereeName}</Text>
</View>
{/* 接待人员 */}
{customer.receptionistName && (
<View className="flex items-center my-1">
<Text className="text-xs text-gray-500">{customer.receptionistName}</Text>
</View>
)}
{/* 显示 comments 字段 */}
<Space className="flex items-center">
<Text className="text-xs text-gray-500">{customer.comments || '暂无'}</Text>
@@ -586,10 +578,11 @@ const CustomerIndex = () => {
);
}
if (!canView) {
// 未登录时显示提示
if (!isLoggedIn) {
return (
<View className="bg-white flex flex-col items-center justify-center p-4">
<Empty description="没有查看权限"/>
<Empty description="请先登录"/>
<Button
size="small"
style={{marginTop: '12px'}}

View File

@@ -7,7 +7,8 @@ import {
QrCode,
ArrowRight,
Purse,
People
People,
Service
} from '@nutui/icons-react-taro'
import {useDealerUser} from '@/hooks/useDealerUser'
import {useThemeStyles} from '@/hooks/useTheme'
@@ -250,6 +251,14 @@ const DealerIndex: React.FC = () => {
</View>
</Grid.Item>
<Grid.Item text={'推荐客户'} onClick={() => navigateToPage('/dealer/referral/index')}>
<View className="text-center">
<View className="w-12 h-12 bg-pink-50 rounded-xl flex items-center justify-center mx-auto mb-2">
<Service color="#ec4899" 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">

View File

@@ -1,3 +1,6 @@
export default definePageConfig({
navigationBarTitleText: '推广二维码'
navigationBarTitleText: '账户管理中心',
// Enable "Share to friends" and "Share to Moments" (timeline) for this page.
enableShareAppMessage: true,
enableShareTimeline: true
})

View File

@@ -2,7 +2,7 @@ import React, {useState, useEffect} from 'react'
import {View, Text, Image} from '@tarojs/components'
import {Button, Loading} from '@nutui/nutui-react-taro'
import {Download, QrCode} from '@nutui/icons-react-taro'
import Taro from '@tarojs/taro'
import Taro, {useShareAppMessage} from '@tarojs/taro'
import {useDealerUser} from '@/hooks/useDealerUser'
import {generateInviteCode} from '@/api/invite'
// import type {InviteStats} from '@/api/invite'
@@ -10,10 +10,44 @@ import {businessGradients} from '@/styles/gradients'
const DealerQrcode: React.FC = () => {
const [miniProgramCodeUrl, setMiniProgramCodeUrl] = useState<string>('')
const [loading, setLoading] = useState<boolean>(false)
const [codeLoading, setCodeLoading] = useState<boolean>(false)
const [saving, setSaving] = useState<boolean>(false)
// const [inviteStats, setInviteStats] = useState<InviteStats | null>(null)
// const [statsLoading, setStatsLoading] = useState<boolean>(false)
const {dealerUser} = useDealerUser()
const {dealerUser, loading: dealerLoading, error, refresh} = useDealerUser()
// Enable "转发给朋友" + "分享到朋友圈" items in the share panel/menu.
useEffect(() => {
// Some clients require explicit call to show both share entries.
Taro.showShareMenu({
withShareTicket: true,
showShareItems: ['shareAppMessage', 'shareTimeline']
}).catch(() => {})
}, [])
// 转发给朋友(分享小程序链接)
useShareAppMessage(() => {
const inviterRaw = dealerUser?.userId ?? Taro.getStorageSync('UserId')
const inviter = Number(inviterRaw)
const hasInviter = Number.isFinite(inviter) && inviter > 0
const user = Taro.getStorageSync('User') || {}
const nickname = (user && (user.nickname || user.realName || user.username)) || ''
const title = hasInviter ? `${nickname || '我'}邀请你加入桂乐淘伙伴计划` : '桂乐淘伙伴计划'
return {
title,
path: hasInviter
? `/pages/index/index?inviter=${inviter}&source=dealer_qrcode&t=${Date.now()}`
: `/pages/index/index`,
success: function () {
Taro.showToast({title: '分享成功', icon: 'success', duration: 2000})
},
fail: function () {
Taro.showToast({title: '分享失败', icon: 'none', duration: 2000})
}
}
})
// 生成小程序码
const generateMiniProgramCode = async () => {
@@ -22,7 +56,7 @@ const DealerQrcode: React.FC = () => {
}
try {
setLoading(true)
setCodeLoading(true)
// 生成邀请小程序码
const codeUrl = await generateInviteCode(dealerUser.userId)
@@ -40,7 +74,7 @@ const DealerQrcode: React.FC = () => {
// 清空之前的二维码
setMiniProgramCodeUrl('')
} finally {
setLoading(false)
setCodeLoading(false)
}
}
@@ -67,6 +101,66 @@ const DealerQrcode: React.FC = () => {
}
}, [dealerUser?.userId])
const isAlbumAuthError = (errMsg?: string) => {
if (!errMsg) return false
// WeChat uses variants like: "saveImageToPhotosAlbum:fail auth deny",
// "saveImageToPhotosAlbum:fail auth denied", "authorize:fail auth deny"
return (
errMsg.includes('auth deny') ||
errMsg.includes('auth denied') ||
errMsg.includes('authorize') ||
errMsg.includes('scope.writePhotosAlbum')
)
}
const ensureWriteAlbumPermission = async (): Promise<boolean> => {
try {
const setting = await Taro.getSetting()
if (setting?.authSetting?.['scope.writePhotosAlbum']) return true
await Taro.authorize({scope: 'scope.writePhotosAlbum'})
return true
} catch (error: any) {
const modal = await Taro.showModal({
title: '提示',
content: '需要您授权保存图片到相册,请在设置中开启相册权限',
confirmText: '去设置'
})
if (modal.confirm) {
await Taro.openSetting()
}
return false
}
}
const downloadImageToLocalPath = async (url: string): Promise<string> => {
// saveImageToPhotosAlbum must receive a local temp path (e.g. `http://tmp/...` or `wxfile://...`).
// Some environments may return a non-existing temp path from getImageInfo, so we verify.
if (url.startsWith('http://tmp/') || url.startsWith('wxfile://')) {
return url
}
const token = Taro.getStorageSync('access_token')
const tenantId = Taro.getStorageSync('TenantId')
const header: Record<string, string> = {}
if (token) header.Authorization = token
if (tenantId) header.TenantId = tenantId
// 先下载到本地临时文件再保存到相册
const res = await Taro.downloadFile({url, header})
if (res.statusCode !== 200 || !res.tempFilePath) {
throw new Error(`图片下载失败(${res.statusCode || 'unknown'})`)
}
// Double-check file exists to avoid: saveImageToPhotosAlbum:fail no such file or directory
try {
await Taro.getFileInfo({filePath: res.tempFilePath})
} catch (_) {
throw new Error('图片临时文件不存在,请重试')
}
return res.tempFilePath
}
// 保存小程序码到相册
const saveMiniProgramCode = async () => {
if (!miniProgramCodeUrl) {
@@ -78,39 +172,64 @@ const DealerQrcode: React.FC = () => {
}
try {
// 先下载图片到本地
const res = await Taro.downloadFile({
url: miniProgramCodeUrl
})
if (saving) return
setSaving(true)
Taro.showLoading({title: '保存中...'})
if (res.statusCode === 200) {
// 保存到相册
await Taro.saveImageToPhotosAlbum({
filePath: res.tempFilePath
})
const hasPermission = await ensureWriteAlbumPermission()
if (!hasPermission) return
Taro.showToast({
title: '保存成功',
icon: 'success'
})
let filePath = await downloadImageToLocalPath(miniProgramCodeUrl)
try {
await Taro.saveImageToPhotosAlbum({filePath})
} catch (e: any) {
const msg = e?.errMsg || e?.message || ''
// Fallback: some devices/clients may fail to save directly from a temp path.
if (
msg.includes('no such file or directory') &&
(filePath.startsWith('http://tmp/') || filePath.startsWith('wxfile://'))
) {
const saved = (await Taro.saveFile({tempFilePath: filePath})) as unknown as { savedFilePath?: string }
if (saved?.savedFilePath) {
filePath = saved.savedFilePath
}
await Taro.saveImageToPhotosAlbum({filePath})
} else {
throw e
}
}
Taro.showToast({
title: '保存成功',
icon: 'success'
})
} catch (error: any) {
if (error.errMsg?.includes('auth deny')) {
Taro.showModal({
const errMsg = error?.errMsg || error?.message
if (errMsg?.includes('cancel')) {
Taro.showToast({title: '已取消', icon: 'none'})
return
}
if (isAlbumAuthError(errMsg)) {
const modal = await Taro.showModal({
title: '提示',
content: '需要您授权保存图片到相册',
success: (res) => {
if (res.confirm) {
Taro.openSetting()
}
}
confirmText: '去设置'
})
if (modal.confirm) {
await Taro.openSetting()
}
} else {
Taro.showToast({
// Prefer a modal so we can show the real reason (e.g. domain whitelist / network error).
await Taro.showModal({
title: '保存失败',
icon: 'error'
content: errMsg || '保存失败,请稍后重试',
showCancel: false
})
}
} finally {
Taro.hideLoading()
setSaving(false)
}
}
@@ -126,7 +245,7 @@ const DealerQrcode: React.FC = () => {
//
// const inviteText = `🎉 邀请您加入我的团队!
//
// 扫描小程序码或搜索"九云售电云"小程序,即可享受优质商品和服务!
// 扫描小程序码或搜索"桂乐淘"小程序,即可享受优质商品和服务!
//
// 💰 成为我的团队成员,一起赚取丰厚佣金
// 🎁 新用户专享优惠等你来拿
@@ -162,7 +281,7 @@ const DealerQrcode: React.FC = () => {
// })
// }
if (!dealerUser) {
if (dealerLoading) {
return (
<View className="bg-gray-50 min-h-screen flex items-center justify-center">
<Loading/>
@@ -171,6 +290,33 @@ const DealerQrcode: React.FC = () => {
)
}
if (error) {
return (
<View className="bg-gray-50 min-h-screen flex flex-col items-center justify-center p-6">
<Text className="text-gray-800 font-semibold"></Text>
<Text className="text-gray-500 text-sm mt-2">{error}</Text>
<Button className="mt-6" type="primary" onClick={refresh}></Button>
</View>
)
}
// 未成为分销商时给出明确引导,避免一直停留在“加载中”
if (!dealerUser) {
return (
<View className="bg-gray-50 min-h-screen flex flex-col items-center justify-center p-6">
<Text className="text-gray-800 font-semibold"></Text>
<Text className="text-gray-500 text-sm mt-2 text-center"></Text>
<Button
className="mt-6"
type="primary"
onClick={() => Taro.navigateTo({url: '/dealer/apply/add'})}
>
</Button>
</View>
)
}
return (
<View className="bg-gray-50 min-h-screen">
{/* 头部卡片 */}
@@ -185,9 +331,9 @@ const DealerQrcode: React.FC = () => {
}}></View>
<View className="relative z-10 flex flex-col">
<Text className="text-2xl font-bold mb-2 text-white"></Text>
<Text className="text-2xl font-bold mb-2 text-white"></Text>
<Text className="text-white text-opacity-80">
</Text>
</View>
</View>
@@ -196,7 +342,7 @@ const DealerQrcode: React.FC = () => {
{/* 小程序码展示区 */}
<View className="bg-white rounded-2xl p-6 mb-6 shadow-sm">
<View className="text-center">
{loading ? (
{codeLoading ? (
<View className="w-48 h-48 mx-auto mb-4 flex items-center justify-center bg-gray-50 rounded-xl">
<Loading/>
<Text className="text-gray-500 mt-2">...</Text>
@@ -239,10 +385,10 @@ const DealerQrcode: React.FC = () => {
)}
<View className="text-lg font-semibold text-gray-800 mb-2">
</View>
<View className="text-sm text-gray-500 mb-4">
| |
</View>
@@ -258,34 +404,12 @@ const DealerQrcode: React.FC = () => {
block
icon={<Download/>}
onClick={saveMiniProgramCode}
disabled={!miniProgramCodeUrl || loading}
disabled={!miniProgramCodeUrl || codeLoading || saving}
>
</Button>
</View>
{/*<View className={'my-2 bg-white'}>*/}
{/* <Button*/}
{/* size="large"*/}
{/* block*/}
{/* icon={<Copy/>}*/}
{/* onClick={copyInviteInfo}*/}
{/* disabled={!dealerUser?.userId || loading}*/}
{/* >*/}
{/* 复制邀请信息*/}
{/* </Button>*/}
{/*</View>*/}
{/*<View className={'my-2 bg-white'}>*/}
{/* <Button*/}
{/* size="large"*/}
{/* block*/}
{/* fill="outline"*/}
{/* icon={<Share/>}*/}
{/* onClick={shareMiniProgramCode}*/}
{/* disabled={!dealerUser?.userId || loading}*/}
{/* >*/}
{/* 分享给好友*/}
{/* </Button>*/}
{/*</View>*/}
</View>
{/* 推广说明 */}

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: '推荐客户赚佣金'
})

View File

@@ -0,0 +1,132 @@
.referral-page {
min-height: 100vh;
background-color: #f5f5f7;
}
.stats-section {
padding: 24px 16px;
color: #fff;
.stats-title {
margin-bottom: 16px;
text-align: center;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
.stat-item {
text-align: center;
.stat-value {
font-size: 20px;
font-weight: bold;
margin-bottom: 4px;
}
.stat-label {
font-size: 12px;
}
}
}
}
.form-section {
padding: 0 16px 16px;
.section-title {
margin-bottom: 12px;
}
.form-card {
background: #fff;
border-radius: 12px;
padding: 8px 0;
.nut-input-text {
flex: 1;
text-align: right;
}
.submit-btn {
padding: 16px;
button {
width: 100%;
border-radius: 8px;
height: 44px;
line-height: 44px;
}
}
.tips {
padding: 0 16px 16px;
text-align: center;
}
}
}
.records-section {
padding: 0 16px 16px;
.section-title {
margin-bottom: 12px;
}
.empty-state {
background: #fff;
border-radius: 12px;
padding: 40px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.record-card {
background: #fff;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
.record-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
.customer-info {
display: flex;
align-items: center;
}
.status-tag {
padding: 4px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
}
}
.record-body {
.record-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
&:not(:last-child) {
border-bottom: 1px solid #f0f0f0;
}
}
}
}
.no-more {
text-align: center;
padding: 16px;
}
}

View File

@@ -0,0 +1,323 @@
import React, {useState, useEffect} from 'react'
import {View, Text, ScrollView, Input, Button} from '@tarojs/components'
import {ConfigProvider, Field, Cell, CellGroup, Toast} from '@nutui/nutui-react-taro'
import {useDealerUser} from '@/hooks/useDealerUser'
import Taro from '@tarojs/taro'
import {addReferral, getMyReferrals, getMyStats} from '@/api/app/referral'
import './index.scss'
// 状态映射
const STATUS_MAP: Record<number, { text: string; color: string }> = {
0: {text: '待确认', color: '#ff9800'},
1: {text: '有效', color: '#4caf50'},
2: {text: '无效', color: '#9e9e9e'},
3: {text: '已结算', color: '#2196f3'}
}
const ReferralPage: React.FC = () => {
const {dealerUser} = useDealerUser()
const [loading, setLoading] = useState(false)
const [submitting, setSubmitting] = useState(false)
// 表单数据
const [formData, setFormData] = useState({
customerName: '',
customerPhone: '',
customerCompany: '',
requirement: '',
remarks: ''
})
// 统计
const [stats, setStats] = useState({
totalCount: 0,
pendingCount: 0,
validCount: 0,
settledCount: 0,
pendingAmount: 0
})
// 记录列表
const [records, setRecords] = useState<any[]>([])
const [page, setPage] = useState(1)
const [hasMore, setHasMore] = useState(true)
// 加载数据
const loadData = async () => {
if (!dealerUser?.userId) return
try {
setLoading(true)
// 获取统计
const statsRes = await getMyStats()
if (statsRes.data.code === 0) {
setStats(statsRes.data.data)
}
// 获取列表
const listRes = await getMyReferrals({pageNum: 1, pageSize: 10})
if (listRes.data.code === 0) {
setRecords(listRes.data.data.list || [])
setHasMore(listRes.data.data.list?.length === 10)
}
} catch (error) {
console.error('加载失败', error)
} finally {
setLoading(false)
}
}
useEffect(() => {
loadData()
}, [dealerUser])
// 输入处理
const handleInput = (field: string, value: string) => {
setFormData(prev => ({...prev, [field]: value}))
}
// 表单验证
const validateForm = () => {
if (!formData.customerName.trim()) {
Toast.text('请输入客户姓名')
return false
}
if (!formData.customerPhone.trim()) {
Toast.text('请输入客户电话')
return false
}
if (!/^1[3-9]\d{9}$/.test(formData.customerPhone)) {
Toast.text('请输入正确的手机号')
return false
}
return true
}
// 提交报备
const handleSubmit = async () => {
if (!validateForm()) return
try {
setSubmitting(true)
const res = await addReferral(formData)
if (res.data.code === 0) {
Toast.text('报备成功!')
// 清空表单
setFormData({
customerName: '',
customerPhone: '',
customerCompany: '',
requirement: '',
remarks: ''
})
// 刷新数据
loadData()
} else {
Toast.text(res.data.message || '报备失败')
}
} catch (error: any) {
Toast.text(error.message || '报备失败')
} finally {
setSubmitting(false)
}
}
// 拨打电话
const handleCall = (phone: string) => {
if (phone) {
Taro.makePhoneCall({phoneNumber: phone})
}
}
// 加载更多
const loadMore = async () => {
if (!hasMore || loading) return
try {
const nextPage = page + 1
const res = await getMyReferrals({pageNum: nextPage, pageSize: 10})
if (res.data.code === 0 && res.data.data.list) {
setRecords(prev => [...prev, ...res.data.data.list])
setPage(nextPage)
setHasMore(res.data.data.list.length === 10)
}
} catch (error) {
console.error('加载更多失败', error)
}
}
return (
<View className="referral-page">
{/* 头部统计 */}
<View className="stats-section" style={{background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'}}>
<View className="stats-title">
<Text className="text-white text-lg font-bold"></Text>
</View>
<View className="stats-grid">
<View className="stat-item">
<Text className="stat-value text-white">{stats.totalCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">{stats.pendingCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">{stats.validCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">¥{stats.pendingAmount.toFixed(2)}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
</View>
</View>
{/* 报备表单 */}
<View className="form-section">
<View className="section-title">
<Text className="font-bold text-gray-800"></Text>
</View>
<View className="form-card">
<CellGroup>
<Cell title="客户姓名">
<Input
className="nut-input-text"
placeholder="请输入客户姓名"
value={formData.customerName}
onInput={(e) => handleInput('customerName', e.detail.value)}
/>
</Cell>
<Cell title="联系电话">
<Input
className="nut-input-text"
type="number"
maxlength={11}
placeholder="请输入客户电话"
value={formData.customerPhone}
onInput={(e) => handleInput('customerPhone', e.detail.value)}
/>
</Cell>
<Cell title="公司名称">
<Input
className="nut-input-text"
placeholder="请输入公司名称(选填)"
value={formData.customerCompany}
onInput={(e) => handleInput('customerCompany', e.detail.value)}
/>
</Cell>
<Cell title="需求描述">
<Input
className="nut-input-text"
type="textarea"
placeholder="请描述客户需求(选填)"
value={formData.requirement}
onInput={(e) => handleInput('requirement', e.detail.value)}
style={{height: '80px', textAlign: 'left'}}
/>
</Cell>
</CellGroup>
<View className="submit-btn">
<Button
type="primary"
loading={submitting}
onClick={handleSubmit}
style={{
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
border: 'none'
}}
>
</Button>
</View>
<View className="tips">
<Text className="text-gray-500 text-sm">
</Text>
</View>
</View>
</View>
{/* 推荐记录 */}
<View className="records-section">
<View className="section-title">
<Text className="font-bold text-gray-800"></Text>
</View>
{records.length === 0 ? (
<View className="empty-state">
<Text className="text-gray-400"></Text>
<Text className="text-gray-400 text-sm"></Text>
</View>
) : (
<ScrollView
scrollY
onScrollToLower={loadMore}
style={{height: '300px'}}
>
{records.map((item) => {
const statusInfo = STATUS_MAP[item.referralStatus] || STATUS_MAP[0]
return (
<View key={item.referralId} className="record-card">
<View className="record-header">
<View className="customer-info">
<Text className="font-bold text-gray-800">{item.customerName}</Text>
<Text
className="text-blue-500 text-sm ml-2"
onClick={() => handleCall(item.customerPhone)}
>
{item.customerPhone}
</Text>
</View>
<View
className="status-tag"
style={{backgroundColor: statusInfo.color + '20', color: statusInfo.color}}
>
{statusInfo.text}
</View>
</View>
<View className="record-body">
<View className="record-row">
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-gray-700 text-sm">{item.createTime}</Text>
</View>
{item.referralFee > 0 && (
<View className="record-row">
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-red-500 font-bold text-sm">
¥{item.referralFee.toFixed(2)}
</Text>
</View>
)}
{item.leadStatusText && (
<View className="record-row">
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-gray-700 text-sm">{item.leadStatusText}</Text>
</View>
)}
</View>
</View>
)
})}
{!hasMore && records.length > 0 && (
<View className="no-more">
<Text className="text-gray-400 text-sm"></Text>
</View>
)}
</ScrollView>
)}
</View>
{/* 底部安全区 */}
<View className="h-20"></View>
</View>
)
}
export default ReferralPage

View File

@@ -325,7 +325,7 @@ const DealerTeam: React.FC = () => {
</View>
{/* 显示手机号(仅本级可见) */}
{showPhone && member.phone && (
<Text className="text-sm text-gray-500" onClick={(e) => {
<Text className="text-sm text-gray-500 hidden" onClick={(e) => {
e.stopPropagation();
makePhoneCall(member.phone || '');
}}>
@@ -334,14 +334,9 @@ const DealerTeam: React.FC = () => {
</Text>
)}
</View>
<Space>
<Text>
<Text className="text-xs text-gray-500">UID{member.userId}</Text>
</Text>
<Text className="text-xs text-gray-500">
{member.joinTime}
</Text>
</Space>
<Text className="text-xs text-gray-500">
{member.joinTime}
</Text>
</View>
</View>

View File

@@ -46,9 +46,17 @@ export const useDealerUser = (): UseDealerUserReturn => {
setDealerUser(dealer)
} else {
setDealerUser(null)
// 没有经销商记录,跳转到申请加入页面
Taro.redirectTo({ url: '/dealer/apply/add' })
}
} catch (err) {
const errorMessage = err instanceof Error ? err.message : '获取经销商信息失败'
// 如果错误消息是"操作成功"(接口返回成功但无数据),也跳转到申请页面
if (errorMessage === '操作成功' || errorMessage === '查询成功') {
setDealerUser(null)
Taro.redirectTo({ url: '/dealer/apply/add' })
return
}
setError(errorMessage)
setDealerUser(null)
} finally {

View File

@@ -52,7 +52,7 @@ const highlightItems = [
{
icon: <Star size={22} color="#ffffff" />,
title: '真实口碑',
description: '5000+家庭选择98%满意度,支持老房换窗与整屋升级。'
description: '10万+家庭选择98%满意度,支持老房换窗与整屋升级。'
}
]
@@ -220,15 +220,15 @@ const BrochurePage: React.FC = () => {
<View className="brochure-page__stats">
<View className="brochure-page__stat">
<Text className="brochure-page__stat-value">10</Text>
<Text className="brochure-page__stat-label"></Text>
<Text className="brochure-page__stat-value">20</Text>
<Text className="brochure-page__stat-label">()</Text>
</View>
<View className="brochure-page__stat">
<Text className="brochure-page__stat-value">15</Text>
<Text className="brochure-page__stat-label"></Text>
</View>
<View className="brochure-page__stat">
<Text className="brochure-page__stat-value">5000+</Text>
<Text className="brochure-page__stat-value">10+</Text>
<Text className="brochure-page__stat-label"></Text>
</View>
</View>

View File

@@ -0,0 +1,98 @@
.bestsellers-list {
padding: 0 16px;
}
.bestsellers-item {
display: flex;
background: #ffffff;
border-radius: 14px;
overflow: hidden;
margin-bottom: 12px;
transition: transform 0.15s;
&:active {
transform: scale(0.985);
}
&:last-child {
margin-bottom: 0;
}
/* ═══ 左侧图片 ═══ */
&__img-wrap {
width: 140px;
min-height: 140px;
flex-shrink: 0;
background: #f3f4f6;
}
&__img {
width: 100%;
height: 100%;
display: block;
}
/* ═══ 右侧信息 ═══ */
&__info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12px 12px 10px 14px;
min-height: 140px;
}
&__tags {
display: flex;
align-items: center;
gap: 10px;
margin-top: 6px;
}
/* ═══ 底部操作栏 ═══ */
&__bottom {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-top: auto;
padding-top: 8px;
}
&__price-wrap {
display: flex;
align-items: baseline;
}
&__actions {
display: flex;
align-items: center;
gap: 8px;
}
&__share-btn {
width: 34px;
height: 34px;
border-radius: 50%;
background: #f3f4f6;
display: flex;
align-items: center;
justify-content: center;
}
&__buy-btn {
height: 38px;
padding: 0 20px;
background: linear-gradient(135deg, #2563eb, #3b82f6);
border-radius: 100px;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
}
/* ═══ 空状态 ═══ */
.bestsellers-empty {
padding: 40px 0;
text-align: center;
}

View File

@@ -18,20 +18,15 @@ const BestSellers = () => {
})
}
// 处理分享点击
const handleShare = (item: ShopGoods) => {
setGoods(item);
// 显示分享选项菜单
Taro.showActionSheet({
itemList: ['分享给好友', '分享到朋友圈'],
success: (res) => {
if (res.tapIndex === 0) {
// 分享给好友 - 触发转发
Taro.showShareMenu({
withShareTicket: true,
success: () => {
// 提示用户点击右上角分享
Taro.showToast({
title: '请点击右上角分享给好友',
icon: 'none',
@@ -40,7 +35,6 @@ const BestSellers = () => {
}
});
} else if (res.tapIndex === 1) {
// 分享到朋友圈
Taro.showToast({
title: '请点击右上角分享到朋友圈',
icon: 'none',
@@ -58,32 +52,22 @@ const BestSellers = () => {
reload()
}, [])
// 分享给好友
useShareAppMessage(() => {
return {
title: goods?.name || '精选商品',
path: `/shop/goodsDetail/index?id=${goods?.goodsId}`,
imageUrl: goods?.image, // 分享图片
imageUrl: goods?.image,
success: function (res: any) {
console.log('分享成功', res);
Taro.showToast({
title: '分享成功',
icon: 'success',
duration: 2000
});
Taro.showToast({ title: '分享成功', icon: 'success', duration: 2000 });
},
fail: function (res: any) {
console.log('分享失败', res);
Taro.showToast({
title: '分享失败',
icon: 'none',
duration: 2000
});
Taro.showToast({ title: '分享失败', icon: 'none', duration: 2000 });
}
};
});
// 分享到朋友圈
useShareTimeline(() => {
return {
title: `${goods?.name || '精选商品'} - 南南佐顿门窗`,
@@ -93,49 +77,62 @@ const BestSellers = () => {
});
return (
<>
<View className={'py-1 px-4'}>
<View className={'flex flex-col justify-between items-center rounded-lg px-2'}>
{list?.map((item, index) => {
return (
<View key={index} className={'flex flex-col rounded-lg bg-white shadow-sm w-full mb-5'}>
<Image src={item.image} mode={'aspectFit'} lazyLoad={false}
radius="10px 10px 0 0" height="180"
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}/>
<View className={'flex flex-col p-2 rounded-lg'}>
<View>
<View className={'car-no text-sm'}>{item.name}</View>
<View className={'flex justify-between text-xs py-1'}>
<Text className={'text-orange-500'}>{item.comments}</Text>
<Text className={'text-gray-400'}> {item.sales}</Text>
</View>
<View className={'flex justify-between items-center py-2'}>
<View className={'flex text-red-500 text-xl items-baseline'}>
<Text className={'text-xs'}></Text>
<Text className={'font-bold text-2xl'}>{item.price}</Text>
</View>
<View className={'buy-btn'}>
<View className={'cart-icon flex items-center'}>
<View
className={'flex flex-col justify-center items-center text-white px-3 gap-1 text-nowrap whitespace-nowrap cursor-pointer'}
onClick={() => handleShare(item)}
>
<Share size={20}/>
</View>
</View>
<Text className={'text-white pl-4 pr-5'}
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}>
</Text>
</View>
</View>
</View>
<View className="bestsellers-list">
{list?.map((item, index) => (
<View
key={index}
className="bestsellers-item"
onClick={() => Taro.navigateTo({url: '/shop/goodsDetail/index?id=' + item.goodsId})}
>
{/* 左侧商品图 */}
<View className="bestsellers-item__img-wrap">
<Image
src={item.image}
mode="aspectFill"
lazyLoad={false}
className="bestsellers-item__img"
/>
</View>
{/* 右侧信息区 */}
<View className="bestsellers-item__info">
<Text className="text-base font-semibold text-gray-900 leading-snug">{item.name}</Text>
<View className="bestsellers-item__tags">
<Text className="text-sm text-amber-500 bg-amber-50 px-2 rounded">{item.comments}</Text>
<Text className="text-sm text-gray-400"> {item.sales}</Text>
</View>
<View className="bestsellers-item__bottom">
{/* 价格 */}
<View className="bestsellers-item__price-wrap">
<Text className="text-15 font-semibold text-red-500"></Text>
<Text className="text-28 font-extrabold text-red-500 leading-none">{item.price}</Text>
</View>
{/* 操作按钮 */}
<View className="bestsellers-item__actions">
<View
className="bestsellers-item__share-btn"
onClick={(e) => { e.stopPropagation(); handleShare(item) }}
>
<Share size={18} color="#9ca3af" />
</View>
<View className="bestsellers-item__buy-btn">
<Text className="text-base font-semibold text-white"></Text>
</View>
</View>
)
})}
</View>
</View>
</View>
</View>
</>
))}
{list.length === 0 && (
<View className="bestsellers-empty">
<Text className="text-base text-gray-400"></Text>
</View>
)}
</View>
)
}
export default BestSellers

View File

@@ -0,0 +1,110 @@
.catalog-card {
position: relative;
margin: 24px 16px 8px;
padding: 24px 20px;
background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%);
border-radius: 18px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(37, 99, 235, 0.3);
&:active {
opacity: 0.92;
}
/* ═══ 装饰圆 ═══ */
&__deco {
position: absolute;
border-radius: 50%;
pointer-events: none;
&--1 {
width: 160px;
height: 160px;
top: -40px;
right: -30px;
background: rgba(255, 255, 255, 0.06);
}
&--2 {
width: 100px;
height: 100px;
bottom: -20px;
left: 20%;
background: rgba(255, 255, 255, 0.04);
}
}
/* ═══ 内容区 ═══ */
&__content {
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
padding: 16px;
z-index: 1;
}
&__left {
flex: 1;
display: flex;
flex-direction: column;
gap: 6px;
padding-right: 16px;
}
&__cta {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 12px;
background: rgba(255, 255, 255, 0.15);
border-radius: 100px;
padding: 8px 16px;
align-self: flex-start;
backdrop-filter: blur(4px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
/* ═══ 右侧书本图形 ═══ */
&__right {
flex-shrink: 0;
}
&__book {
width: 142px;
height: 180px;
background: rgba(255, 255, 255, 0.12);
border-radius: 4px 10px 10px 4px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
border: 1px solid rgba(255, 255, 255, 0.2);
}
&__book-spine {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 6px;
background: rgba(255, 255, 255, 0.15);
border-radius: 4px 0 0 4px;
}
&__book-pages {
display: flex;
gap: 3px;
align-items: flex-end;
}
&__book-page {
width: 4px;
background: rgba(255, 255, 255, 0.25);
border-radius: 2px;
&:nth-child(1) { height: 28px; }
&:nth-child(2) { height: 40px; }
&:nth-child(3) { height: 32px; }
}
}

View File

@@ -0,0 +1,70 @@
import { View, Text } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { ArrowRight } from '@nutui/icons-react-taro'
import './CatalogShowcase.scss'
const CATALOG_URL = 'https://book.yunzhan365.com/mdfy/tjcs/mobile/index.html'
function CatalogShowcase() {
const handleViewCatalog = () => {
Taro.setClipboardData({
data: CATALOG_URL,
success: () => {
Taro.showToast({
title: '链接已复制',
icon: 'success',
duration: 2000
})
setTimeout(() => {
Taro.showModal({
title: '提示',
content: '链接已复制到剪贴板,请前往浏览器打开查看品牌画册',
showCancel: false,
confirmText: '知道了'
})
}, 2100)
},
fail: () => {
Taro.showToast({ title: '复制失败,请重试', icon: 'none' })
}
})
}
return (
<View className="catalog-card" onClick={handleViewCatalog}>
{/* 装饰性背景元素 */}
<View className="catalog-card__deco catalog-card__deco--1" />
<View className="catalog-card__deco catalog-card__deco--2" />
<View className="catalog-card__content">
<View className="catalog-card__left">
<Text className="text-xs text-gray-400 tracking-widest">BRAND CATALOG</Text>
<Text className="text-2xl font-bold text-white mb-1"></Text>
<Text className="text-xs text-gray-300 leading-relaxed" style={{
width: '90%'
}}>
线
</Text>
<View className="catalog-card__cta">
<Text className="text-base font-semibold text-white px-4"></Text>
<ArrowRight size={16} color="#ffffff" />
</View>
</View>
<View className="catalog-card__right">
<View className="catalog-card__book">
<View className="catalog-card__book-spine" />
<View className="catalog-card__book-pages">
<View className="catalog-card__book-page" />
<View className="catalog-card__book-page" />
<View className="catalog-card__book-page" />
</View>
<Text className="text-lg font-bold text-gray-300 px-1">2026</Text>
</View>
</View>
</View>
</View>
)
}
export default CatalogShowcase

View File

@@ -1,143 +1,68 @@
.contact-section {
background: #ffffff;
padding: 24px 16px;
margin: 16px 0;
border-radius: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 32px;
}
margin-top: 0;
padding: 32px 20px 24px;
background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
border-radius: 24px 24px 0 0;
color: #ffffff;
&__title {
text-align: center;
margin-bottom: 24px;
&-text {
display: block;
font-size: 18px;
font-weight: 600;
color: #1e293b;
margin-bottom: 4px;
}
}
&__subtitle {
font-size: 14px;
color: #64748b;
display: block;
}
&__grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 16px;
/* ═══ 引言区 ═══ */
&__intro {
margin-bottom: 24px;
}
&__item {
/* ═══ 操作按钮区 ═══ */
&__actions {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 28px;
}
&__action {
display: flex;
align-items: center;
padding: 16px;
background: #f8fafc;
border-radius: 12px;
padding: 16px 18px;
border-radius: 14px;
transition: opacity 0.2s;
border: none;
outline: none;
background: none;
font-size: inherit;
line-height: inherit;
text-align: left;
width: 100%;
box-sizing: border-box;
&::after {
display: none;
}
&:active {
background: #f1f5f9;
transform: scale(0.98);
transition: transform 0.1s;
opacity: 0.8;
}
}
&__icon {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
flex-shrink: 0;
&--blue {
background: rgba(59, 130, 246, 0.1);
}
&--green {
background: rgba(16, 185, 129, 0.1);
}
&--orange {
background: rgba(245, 158, 11, 0.1);
}
&--cyan {
background: rgba(6, 182, 212, 0.1);
}
&__action--primary {
background: linear-gradient(135deg, #3b82f6, #2563eb);
box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
&__content {
&__action--secondary {
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.12);
}
&__action-text {
flex: 1;
min-width: 0;
}
&__item-title {
display: block;
font-size: 14px;
color: #64748b;
margin-bottom: 4px;
}
&__item-value {
display: block;
font-size: 15px;
font-weight: 600;
color: #1e293b;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 14px;
display: flex;
flex-direction: column;
}
/* ═══ 底部信息 ═══ */
&__footer {
text-align: center;
padding-top: 20px;
border-top: 1px solid #e2e8f0;
}
&__footer-text {
display: block;
font-size: 12px;
color: #64748b;
line-height: 1.6;
&:first-child {
margin-bottom: 4px;
}
border-top: 1px solid rgba(255, 255, 255, 0.08);
}
}
// 响应式适配
@media (max-width: 375px) {
.contact-section {
padding: 20px 12px;
margin: 12px 0;
&__grid {
gap: 12px;
}
&__item {
padding: 12px;
}
&__icon {
width: 36px;
height: 36px;
margin-right: 10px;
}
}
}

View File

@@ -1,6 +1,6 @@
import React from 'react'
import Taro from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import {View, Text} from '@tarojs/components'
import {
Phone,
Message
@@ -8,59 +8,6 @@ import {
import './ContactSection.scss'
const ContactSection: React.FC = () => {
const contactItems = [
{
icon: <Phone size={20} color="#3b82f6" />,
title: '联系电话',
value: '13367810229',
action: 'call',
colorClass: 'contact-item--blue'
},
{
icon: <Message size={20} color="#10b981" />,
title: '在线咨询',
value: '点击立即咨询',
action: 'chat',
colorClass: 'contact-item--green'
},
// {
// icon: <Location size={20} color="#f59e0b" />,
// title: '门店地址',
// value: '上海市浦东新区XX路888号',
// action: 'map',
// colorClass: 'contact-item--orange'
// },
// {
// icon: <Share size={20} color="#06b6d4" />,
// title: '关注我们',
// value: '南南佐顿门窗',
// action: 'wechat',
// colorClass: 'contact-item--cyan'
// }
]
const handleAction = (action: string) => {
switch (action) {
case 'call':
handleCallPhone()
break
case 'chat':
handleOnlineChat()
break
case 'map':
console.log('查看地图')
// TODO: 跳转到地图导航
break
case 'wechat':
console.log('关注公众号')
// TODO: 显示公众号二维码
break
default:
break
}
}
// 拨打电话功能
const handleCallPhone = () => {
Taro.showModal({
title: '拨打电话',
@@ -76,10 +23,7 @@ const ContactSection: React.FC = () => {
},
fail: (err) => {
console.error('拨打电话失败:', err)
Taro.showToast({
title: '拨打电话失败',
icon: 'none'
})
Taro.showToast({title: '拨打电话失败', icon: 'none'})
}
})
}
@@ -87,85 +31,46 @@ const ContactSection: React.FC = () => {
})
}
// 在线咨询功能
const handleOnlineChat = () => {
// 检查是否已登录
Taro.getStorage({
key: 'userInfo',
success: (_) => {
// 用户已登录,跳转到聊天页面
Taro.navigateTo({
url: '/pages/user/chat/conversation/index',
success: () => {
console.log('跳转到聊天页面成功')
},
fail: (err) => {
console.error('跳转失败:', err)
Taro.showToast({
title: '跳转失败,请稍后重试',
icon: 'none'
})
}
})
},
fail: () => {
// 用户未登录,提示登录
Taro.showModal({
title: '登录提示',
content: '需要登录后才能在线咨询,是否立即登录?',
confirmText: '去登录',
cancelText: '稍后再说',
success: (loginRes) => {
if (loginRes.confirm) {
Taro.navigateTo({
url: '/pages/passport/login',
fail: (err) => {
console.error('跳转到登录页失败:', err)
Taro.showToast({
title: '跳转失败',
icon: 'none'
})
}
})
}
}
})
}
})
}
return (
<View className="contact-section px-4">
<View className="contact-section__title flex flex-col">
<Text className="text-lg font-semibold text-gray-800"></Text>
<Text className="text-sm text-gray-500"></Text>
</View>
<View className={'px-2'}>
<View className="contact-section">
{/* 顶部引言区 */}
<View className="contact-section__intro">
<Text className="block text-2xl font-bold text-white mb-1"></Text>
<Text className="block text-base text-white">
</Text>
</View>
<View className="contact-section__grid">
{contactItems.map((item, index) => (
<View
key={index}
className="contact-section__item"
onClick={() => handleAction(item.action)}
>
<View className={`contact-section__icon ${item.colorClass}`}>
{item.icon}
</View>
<View className="contact-section__content flex flex-col">
<Text className="text-xs text-gray-500">{item.title}</Text>
<Text className="text-sm font-semibold text-gray-800 truncate">{item.value}</Text>
{/* 操作按钮 — 全宽醒目 */}
<View className="contact-section__actions">
<View className="contact-section__action contact-section__action--primary" onClick={handleCallPhone}>
<Phone size={22} color="#ffffff"/>
<View className="contact-section__action-text">
<Text className="text-17 font-semibold text-white"></Text>
<Text className="text-sm text-white">13367810229</Text>
</View>
</View>
))}
</View>
<View className="contact-section__footer">
<Text className="text-xs text-gray-500">
8:30-18:00
</Text>
<Text className="text-xs text-gray-500">
</Text>
<button className="contact-section__action contact-section__action--secondary" open-type="contact">
<Message size={22} color="#3b82f6"/>
<View className="contact-section__action-text">
<Text className="text-17 font-semibold text-white">线</Text>
<Text className="text-sm text-white"></Text>
</View>
</button>
</View>
{/* 底部信息 */}
<View className="contact-section__footer">
<Text className="block text-sm text-white mb-1">
8:30 - 18:00
</Text>
<Text className="block text-xs text-white">
</Text>
</View>
</View>
</View>
)

View File

@@ -1,32 +1,44 @@
import {useEffect, useState} from 'react'
import {Grid} from '@nutui/nutui-react-taro'
import {Avatar} from '@nutui/nutui-react-taro'
import {View, Text} from '@tarojs/components'
import {listCmsNavigation} from "@/api/cms/cmsNavigation";
import {CmsNavigation} from "@/api/cms/cmsNavigation/model";
import navTo from "@/utils/common";
interface MenuItem {
id: number;
title: string;
icon: string;
path: string;
}
// 硬编码首页菜单数据
const menuList: MenuItem[] = [
{
id: 1,
title: '推荐客户',
icon: 'https://oss.wsdns.cn/20260330/5f54527123864193b0a2078f812b117f.png?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90',
path: '/dealer/customer/add'
},
{
id: 2,
title: '客户列表',
icon: 'https://oss.wsdns.cn/20260330/24485bb4684d4ae2a64cc7dd49ec4d3d.png?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90',
path: '/dealer/customer/index'
},
{
id: 3,
title: '邀请好友',
icon: 'https://oss.wsdns.cn/20260330/64cac0d5cbe645af8a574a257cd00302.png?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90',
path: '/dealer/team/index'
},
{
id: 4,
title: '个人中心',
icon: 'https://oss.wsdns.cn/20260330/6b198116f2d94b1e942c55ebe2f73728.png?x-oss-process=image/resize,m_fixed,w_750/quality,Q_90',
path: '/pages/user/user'
}
];
const MyGrid = () => {
const [list, setList] = useState<CmsNavigation[]>([])
const reload = async () => {
// 读取首页菜单
const home = await listCmsNavigation({model: 'index'});
const homeId = home[0].navigationId;
if(homeId){
const menu = await listCmsNavigation({home: 0, parentId: homeId, hide: 0})
setList(menu)
}
}
useEffect(() => {
reload().then()
}, [])
if (list.length == 0) {
return <></>
}
// @ts-ignore
return (
<>
<View className={'p-0'}>
@@ -36,8 +48,8 @@ const MyGrid = () => {
'--nutui-grid-border-color': 'transparent',
}}>
{
list.map((item) => (
<Grid.Item key={item.navigationId} onClick={() => navTo(`${item.path}`,true)}>
menuList.map((item) => (
<Grid.Item key={item.id} onClick={() => navTo(`${item.path}`,true)}>
<Avatar src={item.icon} className={'mb-1'} shape="square" style={{
backgroundColor: 'transparent',
}}/>

View File

@@ -1,101 +1,54 @@
.trust-section {
background: #ffffff;
padding: 24px 16px;
margin: 16px 0;
border-radius: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
&:first-child {
margin-top: 0;
}
&:last-child {
margin-bottom: 32px;
}
padding: 32px 0 24px;
background: #f5f5f7;
&__title {
text-align: center;
margin-bottom: 24px;
&-text {
display: block;
font-size: 18px;
font-weight: 600;
color: #1e293b;
margin-bottom: 4px;
}
}
&__subtitle {
font-size: 14px;
color: #64748b;
display: block;
}
&__grid {
display: flex;
justify-content: space-between;
gap: 12px;
}
&__item {
flex: 1;
&__header {
padding: 0 20px;
margin-bottom: 16px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
padding: 8px;
}
&__icon {
width: 56px;
height: 56px;
border-radius: 50%;
/* 横向滑动容器 */
&__scroll {
width: 100%;
white-space: nowrap;
}
&__track {
display: inline-flex;
gap: 12px;
padding: 0 20px 8px;
}
/* 单张渐变卡片 */
&__card {
display: inline-flex;
flex-direction: column;
width: 200px;
padding: 20px 16px;
border-radius: 16px;
color: #ffffff;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
vertical-align: top;
white-space: normal;
}
&__card-icon {
width: 48px;
height: 48px;
border-radius: 12px;
background: rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 12px;
&--blue {
background: rgba(59, 130, 246, 0.1);
}
&--green {
background: rgba(16, 185, 129, 0.1);
}
&--orange {
background: rgba(245, 158, 11, 0.1);
}
margin-bottom: 14px;
}
&__item-title {
font-size: 15px;
font-weight: 600;
color: #1e293b;
margin-bottom: 4px;
}
&__item-desc {
font-size: 12px;
color: #64748b;
line-height: 1.4;
&__card-highlight-row {
display: flex;
align-items: baseline;
gap: 6px;
margin-bottom: 6px;
}
}
// 响应式适配
@media (max-width: 375px) {
.trust-section {
padding: 20px 12px;
margin: 12px 0;
&__grid {
gap: 8px;
}
&__icon {
width: 48px;
height: 48px;
}
}
}

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { View, Text } from '@tarojs/components'
import { View, Text, ScrollView } from '@tarojs/components'
import {
ShieldCheck,
People,
@@ -10,43 +10,60 @@ import './TrustSection.scss'
const TrustSection: React.FC = () => {
const trustItems = [
{
icon: <ShieldCheck size={24} color="#3b82f6" />,
icon: <ShieldCheck size={28} color="#ffffff" />,
title: '品质保障',
description: '10年质保,德国进口五金',
colorClass: '--blue'
highlight: '20年',
description: '质保承诺(整窗)',
subDescription: '德国进口五金配件',
bg: 'linear-gradient(135deg, #3b82f6, #2563eb)',
},
{
icon: <People size={24} color="#10b981" />,
icon: <People size={28} color="#ffffff" />,
title: '专业团队',
description: '15年安装经验,持证上岗',
colorClass: '--green'
highlight: '15年',
description: '安装经验',
subDescription: '全员持证上岗',
bg: 'linear-gradient(135deg, #10b981, #059669)',
},
{
icon: <Star size={24} color="#f59e0b" />,
icon: <Star size={28} color="#ffffff" />,
title: '客户好评',
description: '5000+家庭选择98%满意度',
colorClass: '--orange'
highlight: '98%',
description: '满意度',
subDescription: '10万+家庭信赖之选',
bg: 'linear-gradient(135deg, #f59e0b, #d97706)',
}
]
return (
<View className="trust-section">
<View className="trust-section__title flex flex-col">
<Text className="text-lg font-semibold text-gray-800"> · </Text>
<Text className="text-sm text-gray-500"></Text>
<View className="trust-section__header">
<Text className="text-xs font-semibold text-gray-400 tracking-wider uppercase mb-1">WHY CHOOSE US</Text>
<Text className="text-xl font-bold text-gray-900"></Text>
</View>
<View className="trust-section__grid">
{trustItems.map((item, index) => (
<View key={index} className="trust-section__item">
<View className={`trust-section__icon trust-section__icon${item.colorClass}`}>
{item.icon}
<ScrollView
className="trust-section__scroll"
scrollX
enhanced
showScrollbar={false}
>
<View className="trust-section__track">
{trustItems.map((item, index) => (
<View key={index} className="trust-section__card" style={{background: item.bg}}>
<View className="trust-section__card-icon">
{item.icon}
</View>
<Text className="text-17 font-semibold text-white mb-2">{item.title}</Text>
<View className="trust-section__card-highlight-row">
<Text className="text-4xl font-extrabold leading-none text-white">{item.highlight}</Text>
<Text className="text-base text-white">{item.description}</Text>
</View>
<Text className="text-xs text-white mt-1">{item.subDescription}</Text>
</View>
<Text className="text-base font-semibold text-gray-800">{item.title}</Text>
<Text className="text-xs text-gray-500">{item.description}</Text>
</View>
))}
</View>
))}
</View>
</ScrollView>
</View>
)
}

View File

@@ -1,34 +1,132 @@
page {
//background: url('https://oss.wsdns.cn/20250621/33ca4ca532e647bc918a59d01f5d88a9.jpg?x-oss-process=image/resize,m_fixed,w_2000/quality,Q_90') no-repeat top center;
//background-size: 100%;
background: linear-gradient(to bottom, #3b82f6, #ffffff);
background: #f5f5f7;
min-height: 100vh;
}
// 底部内容区域统一间距
.bottom-content-section {
margin: 16px 0;
&:first-child {
margin-top: 0;
/* ═══ 首页容器 ═══ */
.home-page {
padding-bottom: env(safe-area-inset-bottom);
padding-bottom: constant(safe-area-inset-bottom);
}
/* ═══ Hero 顶部视觉区 ═══ */
.hero-banner-wrap {
padding: 0 16px;
padding-top: 6px;
/* 让Banner Swiper有圆角 */
.nut-swiper {
border-radius: 16px;
overflow: hidden;
}
&:last-child {
margin-bottom: 32px;
.nut-swiper-item {
border-radius: 16px;
overflow: hidden;
}
}
.buy-btn{
height: 70px;
background: linear-gradient(to bottom, #2563eb, #3b82f6);
/* Hero下方的Grid菜单区 */
.hero-grid {
margin: 0 16px;
margin-top: -12px;
position: relative;
z-index: 2;
border-radius: 16px;
overflow: hidden;
background: #ffffff;
/* 让NutUI Grid的白色背景更好融入 */
.nut-grid {
background: transparent;
}
.nut-grid-item__content {
padding: 10px 0;
}
}
/* ═══ 公告条 — 自定义样式替代NutUI NoticeBar ═══ */
.notice-strip {
display: flex;
align-items: center;
padding: 10px 20px;
margin: 0 16px 8px;
background: rgba(245, 158, 11, 0.08);
border-radius: 8px;
gap: 8px;
&__dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #f59e0b;
flex-shrink: 0;
}
&__text {
color: #92400e;
line-height: 1.5;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
}
/* ═══ 热销推荐 ═══ */
.section-hot {
padding: 20px 0 4px;
&__header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 16px 14px;
}
&__title-wrap {
display: flex;
align-items: center;
gap: 6px;
}
&__title {
font-weight: 700;
color: #1a1a1a;
letter-spacing: 0.5px;
}
&__more {
display: flex;
align-items: center;
gap: 2px;
color: #9ca3af;
}
}
/* ═══ 通用section间距重置去掉TrustSection/ContactSection自带的margin ═══ */
.home-page .trust-section,
.home-page .contact-section {
margin-left: 0;
margin-right: 0;
}
/* ═══ 底部购买按钮 ═══ */
.buy-btn {
height: 64px;
background: linear-gradient(135deg, #2563eb, #3b82f6);
border-radius: 100px;
color: #ffffff;
display: flex;
align-items: center;
justify-content: space-around;
.cart-icon{
background: linear-gradient(to bottom, #60a5fa, #3b82f6);
box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
.cart-icon {
background: rgba(255, 255, 255, 0.15);
border-radius: 100px 0 0 100px;
height: 70px;
height: 64px;
}
}

View File

@@ -1,27 +1,24 @@
import Header from './Header';
import BestSellers from './BestSellers';
import Taro from '@tarojs/taro';
import {useShareAppMessage, useShareTimeline} from "@tarojs/taro"
import {useEffect, useState} from "react";
import {getShopInfo} from "@/api/layout";
import {NoticeBar} from '@nutui/nutui-react-taro'
import {View} from '@tarojs/components'
import Menu from "./Menu";
import Banner from "./Banner";
import './index.scss'
import Grid from "@/pages/index/Grid";
import Banner from "./Banner";
import PopUpAd from "@/pages/index/PopUpAd";
import TrustSection from "./TrustSection";
import CaseShowcase from "./CaseShowcase";
import ContactSection from "./ContactSection";
import BrochureEntry from "./BrochureEntry";
import CatalogShowcase from "./CatalogShowcase";
import {configWebsiteField} from "@/api/cms/cmsWebsiteField";
import type {Config} from "@/api/cms/cmsWebsiteField/model";
import './index.scss'
function Home() {
// 吸顶状态
const [config, setConfig] = useState<Config>()
console.log(config)
useShareTimeline(() => {
return {
title: '南南佐顿门窗 - 网宿软件',
@@ -50,7 +47,6 @@ function Home() {
cancelText: '取消',
success: (res) => {
if (res.confirm) {
// 用户点击确认,打开授权设置页面
openSetting();
}
}
@@ -58,14 +54,11 @@ function Home() {
};
const openSetting = () => {
// Taro.openSetting调起客户端小程序设置界面返回用户设置的操作结果。设置界面只会出现小程序已经向用户请求过的权限。
Taro.openSetting({
success: (res) => {
if (res.authSetting['scope.userInfo']) {
// 用户授权成功,可以获取用户信息
reload();
} else {
// 用户拒绝授权,提示授权失败
Taro.showToast({
title: '授权失败',
icon: 'none'
@@ -80,29 +73,21 @@ function Home() {
};
useEffect(() => {
// 获取站点信息
getShopInfo().then(() => {
})
// 获取配置信息
getShopInfo().then(() => {})
configWebsiteField({}).then(data => {
setConfig(data)
})
// Taro.getSetting获取用户的当前设置。返回值中只会出现小程序已经向用户请求过的权限。
Taro.getSetting({
success: (res) => {
if (res.authSetting['scope.userInfo']) {
// 用户已经授权过,可以直接获取用户信息
console.log('用户已经授权过,可以直接获取用户信息')
reload();
} else {
// 用户未授权,需要弹出授权窗口
console.log('用户未授权,需要弹出授权窗口')
showAuthModal();
}
}
});
// 获取用户信息
Taro.getUserInfo({
success: (res) => {
const avatar = res.userInfo.avatarUrl;
@@ -113,19 +98,38 @@ function Home() {
return (
<>
{/*<Sticky threshold={0} onChange={() => onSticky(arguments)}>*/}
<Header/>
{/*</Sticky>*/}
<View className={'flex flex-col mt-1'}>
<Menu/>
<Banner/>
<Grid />
<NoticeBar content={config?.NoticeBar || '南南佐顿门窗专业门窗定制安装服务10年质保德国进口五金5000+家庭选择98%客户满意度'} />
<BrochureEntry />
<BestSellers/>
<TrustSection/>
{/* <CaseShowcase/> */}
<ContactSection/>
<Header/>
<View className={'home-page'}>
{/* ═══ Hero 区域Banner 融入头部渐变背景 ═══ */}
<View className={'hero-zone my-2'}>
<View className={'hero-banner-wrap'}>
<Banner />
</View>
{/* 功能菜单 — 直接铺在Banner下方无卡片包裹 */}
<View className={'hero-grid my-4'}>
<Grid />
</View>
</View>
{/* ═══ 滚动公告条 — 轻量嵌入 ═══ */}
{/*<View className={'notice-strip my-4'}>*/}
{/* <View className={'notice-strip__dot'} />*/}
{/* <Text className="text-15">*/}
{/* {config?.NoticeBar || '南南佐顿门窗专业门窗定制安装服务10年质保德国进口五金5000+家庭选择'}*/}
{/* </Text>*/}
{/*</View>*/}
{/* ═══ 品牌画册 — 沉浸式视觉卡片 ═══ */}
<CatalogShowcase />
{/* ═══ 品质信任区 — 横向滑动卡片 ═══ */}
<TrustSection />
{/* ═══ 联系我们 — 全宽底部 ═══ */}
<ContactSection />
</View>
<PopUpAd />
</>

View File

@@ -0,0 +1,156 @@
.referral-page {
min-height: 100vh;
background-color: #f5f5f7;
}
.stats-section {
padding: 24px 16px;
color: #fff;
.stats-title {
margin-bottom: 16px;
text-align: center;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
.stat-item {
text-align: center;
.stat-value {
font-size: 20px;
font-weight: bold;
margin-bottom: 4px;
}
.stat-label {
font-size: 12px;
}
}
}
}
.form-section {
padding: 0 16px 16px;
.section-title {
margin-bottom: 12px;
}
.form-card {
background: #fff;
border-radius: 12px;
padding: 16px 0;
.form-field {
display: flex;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #f0f0f0;
&:last-of-type {
border-bottom: none;
}
&.form-field-area {
flex-direction: column;
align-items: flex-start;
}
}
.form-label {
width: 70px;
font-size: 15px;
color: #333;
flex-shrink: 0;
}
.form-input {
flex: 1;
font-size: 15px;
text-align: right;
}
.submit-btn {
padding: 16px;
button {
width: 100%;
border-radius: 8px;
height: 44px;
line-height: 44px;
}
}
.tips {
padding: 0 16px 8px;
text-align: center;
}
}
}
.records-section {
padding: 0 16px 16px;
.section-title {
margin-bottom: 12px;
}
.empty-state {
background: #fff;
border-radius: 12px;
padding: 40px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
.record-card {
background: #fff;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
.record-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
.customer-info {
display: flex;
align-items: center;
}
.status-tag {
padding: 4px 10px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
}
}
.record-body {
.record-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 0;
&:not(:last-child) {
border-bottom: 1px solid #f0f0f0;
}
}
}
}
.no-more {
text-align: center;
padding: 16px;
}
}

View File

@@ -0,0 +1,319 @@
import React, {useState, useEffect} from 'react'
import {View, Text, ScrollView, Input, Button} from '@tarojs/components'
import {Toast} from '@nutui/nutui-react-taro'
import {useDealerUser} from '@/hooks/useDealerUser'
import Taro from '@tarojs/taro'
import {addReferral, getMyReferrals, getMyStats} from '@/api/app/referral'
import './index.scss'
// 状态映射
const STATUS_MAP: Record<number, { text: string; color: string }> = {
0: {text: '待确认', color: '#ff9800'},
1: {text: '有效', color: '#4caf50'},
2: {text: '无效', color: '#9e9e9e'},
3: {text: '已结算', color: '#2196f3'}
}
const ReferralPage: React.FC = () => {
const {dealerUser} = useDealerUser()
const [loading, setLoading] = useState(false)
const [submitting, setSubmitting] = useState(false)
// 表单数据
const [formData, setFormData] = useState({
customerName: '',
customerPhone: '',
customerCompany: '',
requirement: '',
remarks: ''
})
// 统计
const [stats, setStats] = useState({
totalCount: 0,
pendingCount: 0,
validCount: 0,
settledCount: 0,
pendingAmount: '0.00',
referralCode: ''
})
// 记录列表
const [records, setRecords] = useState<any[]>([])
const [page, setPage] = useState(1)
const [hasMore, setHasMore] = useState(true)
// 加载数据
const loadData = async () => {
if (!dealerUser?.userId) return
try {
setLoading(true)
// 获取统计
const statsRes = await getMyStats()
if (statsRes.data.code === 0) {
setStats(statsRes.data.data)
}
// 获取列表
const listRes = await getMyReferrals({pageNum: 1, pageSize: 10})
if (listRes.data.code === 0) {
setRecords(listRes.data.data.list || [])
setPage(1)
setHasMore(listRes.data.data.list?.length === 10)
}
} catch (error) {
console.error('加载失败', error)
} finally {
setLoading(false)
}
}
useEffect(() => {
loadData()
}, [dealerUser])
// 输入处理
const handleInput = (field: string, value: string) => {
setFormData(prev => ({...prev, [field]: value}))
}
// 表单验证
const validateForm = () => {
if (!formData.customerName.trim()) {
Toast.text('请输入客户姓名')
return false
}
if (!formData.customerPhone.trim()) {
Toast.text('请输入客户电话')
return false
}
if (!/^1[3-9]\d{9}$/.test(formData.customerPhone)) {
Toast.text('请输入正确的手机号')
return false
}
return true
}
// 提交报备
const handleSubmit = async () => {
if (!validateForm()) return
try {
setSubmitting(true)
const res = await addReferral(formData)
if (res.data.code === 0) {
Toast.text('报备成功!')
setFormData({
customerName: '',
customerPhone: '',
customerCompany: '',
requirement: '',
remarks: ''
})
loadData()
} else {
Toast.text(res.data.message || '报备失败')
}
} catch (error: any) {
Toast.text(error.message || '报备失败')
} finally {
setSubmitting(false)
}
}
// 拨打电话
const handleCall = (phone: string) => {
if (phone) {
Taro.makePhoneCall({phoneNumber: phone})
}
}
// 加载更多
const loadMore = async () => {
if (!hasMore || loading) return
try {
const nextPage = page + 1
const res = await getMyReferrals({pageNum: nextPage, pageSize: 10})
if (res.data.code === 0 && res.data.data.list) {
setRecords(prev => [...prev, ...res.data.data.list])
setPage(nextPage)
setHasMore(res.data.data.list.length === 10)
}
} catch (error) {
console.error('加载更多失败', error)
}
}
return (
<View className="referral-page">
{/* 头部统计 */}
<View className="stats-section" style={{background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'}}>
<View className="stats-title">
<Text className="text-white text-lg font-bold"></Text>
</View>
<View className="stats-grid">
<View className="stat-item">
<Text className="stat-value text-white">{stats.totalCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">{stats.pendingCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">{stats.validCount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
<View className="stat-item">
<Text className="stat-value text-white">¥{stats.pendingAmount}</Text>
<Text className="stat-label" style={{color: 'rgba(255,255,255,0.8)'}}></Text>
</View>
</View>
</View>
{/* 报备表单 */}
<View className="form-section">
<View className="section-title">
<Text className="font-bold text-gray-800"></Text>
</View>
<View className="form-card">
<View className="form-field">
<Text className="form-label"></Text>
<Input
className="form-input"
placeholder="请输入客户姓名"
value={formData.customerName}
onInput={(e) => handleInput('customerName', e.detail.value)}
/>
</View>
<View className="form-field">
<Text className="form-label"></Text>
<Input
className="form-input"
type="number"
maxlength={11}
placeholder="请输入客户电话"
value={formData.customerPhone}
onInput={(e) => handleInput('customerPhone', e.detail.value)}
/>
</View>
<View className="form-field">
<Text className="form-label"></Text>
<Input
className="form-input"
placeholder="请输入公司名称(选填)"
value={formData.customerCompany}
onInput={(e) => handleInput('customerCompany', e.detail.value)}
/>
</View>
<View className="form-field form-field-area">
<Text className="form-label"></Text>
<Input
className="form-input"
type="textarea"
placeholder="请描述客户需求(选填)"
value={formData.requirement}
onInput={(e) => handleInput('requirement', e.detail.value)}
style={{height: '80px', textAlign: 'left'}}
/>
</View>
<View className="submit-btn">
<Button
type="primary"
loading={submitting}
onClick={handleSubmit}
style={{
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
border: 'none'
}}
>
</Button>
</View>
<View className="tips">
<Text className="text-gray-500 text-sm">
</Text>
</View>
</View>
</View>
{/* 推荐记录 */}
<View className="records-section">
<View className="section-title">
<Text className="font-bold text-gray-800"></Text>
</View>
{records.length === 0 ? (
<View className="empty-state">
<Text className="text-gray-400"></Text>
<Text className="text-gray-400 text-sm"></Text>
</View>
) : (
<ScrollView
scrollY
onScrollToLower={loadMore}
style={{height: '300px'}}
>
{records.map((item) => {
const statusInfo = STATUS_MAP[item.referralStatus] || STATUS_MAP[0]
return (
<View key={item.id} className="record-card">
<View className="record-header">
<View className="customer-info">
<Text className="font-bold text-gray-800">{item.customerName}</Text>
<Text
className="text-blue-500 text-sm ml-2"
onClick={() => handleCall(item.customerPhone)}
>
{item.customerPhone}
</Text>
</View>
<View
className="status-tag"
style={{backgroundColor: statusInfo.color + '20', color: statusInfo.color}}
>
{statusInfo.text}
</View>
</View>
<View className="record-body">
<View className="record-row">
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-gray-700 text-sm">{item.createTime}</Text>
</View>
{parseFloat(item.referralFee) > 0 && (
<View className="record-row">
<Text className="text-gray-500 text-sm"></Text>
<Text className="text-red-500 font-bold text-sm">
¥{item.referralFee}
</Text>
</View>
)}
</View>
</View>
)
})}
{!hasMore && records.length > 0 && (
<View className="no-more">
<Text className="text-gray-400 text-sm"></Text>
</View>
)}
</ScrollView>
)}
</View>
{/* 底部安全区 */}
<View className="h-20"></View>
</View>
)
}
export default ReferralPage

View File

@@ -3,6 +3,7 @@ import {ArrowRight} from '@nutui/icons-react-taro'
import {useEffect, useState} from "react";
import {ConfigProvider} from '@nutui/nutui-react-taro'
import Taro, {getCurrentInstance} from '@tarojs/taro'
import {View, Text} from '@tarojs/components'
import {getUserInfo} from "@/api/layout";
import {TenantId} from "@/config/app";
import { TextArea } from '@nutui/nutui-react-taro'
@@ -34,7 +35,7 @@ interface InputEvent {
}
function Profile() {
const formId = Number(router?.params.id)
const {user, updateUser} = useUser()
const {user, updateUser, loading} = useUser()
const [sex, setSex] = useState<DictData[]>()
const [FormData, setFormData] = useState<User>(
@@ -49,16 +50,27 @@ function Profile() {
comments: undefined
}
)
const [pageLoading, setPageLoading] = useState(true)
const reload = () => {
// 获取数据字典
pageDictData({limit: 200}).then(res => {
setSex(res?.list.filter((item) => item.dictCode === 'sex'))
}).catch(err => {
console.error('获取数据字典失败:', err)
})
// 获取用户信息
getUserInfo().then((data) => {
// 更新表单数据
setFormData(data);
}).catch(err => {
console.error('获取用户信息失败:', err)
Taro.showToast({
title: '获取用户信息失败',
icon: 'none'
})
}).finally(() => {
setPageLoading(false)
})
}
@@ -140,9 +152,12 @@ function Profile() {
});
}
// 等待 useUser 初始化完成后再加载数据
useEffect(() => {
reload()
}, []);
if (!loading) {
reload()
}
}, [loading]);
// 监听 useUser hook 中的用户信息变化,同步更新表单数据
useEffect(() => {
@@ -151,6 +166,15 @@ function Profile() {
}
}, [user]);
// 加载中显示
if (loading || pageLoading) {
return (
<View className={'flex justify-center items-center h-screen'}>
<Text>...</Text>
</View>
)
}
return (
<>
<div className={'p-4'}>
@@ -223,14 +247,14 @@ function Profile() {
label="备注信息"
name="comments"
initialValue={FormData.comments}
rules={[{message: '备注信息'}]}
rules={[{message: '请输入备注信息'}]}
>
<TextArea
placeholder={'个性签名'}
value={FormData?.comments}
onChange={(value) => setFormData({...FormData, comments: value})}
/>
<Input placeholder={'个性签名'} />
<TextArea
name="comments"
placeholder={'个性签名'}
value={FormData?.comments}
onChange={(value) => setFormData({...FormData, comments: value})}
/>
</Form.Item>
</Form>
</ConfigProvider>

View File

@@ -3,7 +3,13 @@ module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
darkMode: 'media', // or 'media' or 'class'
theme: {
extend: {},
extend: {
fontSize: {
'15': '15px',
'17': '17px',
'28': '28px',
},
},
},
variants: {
extend: {},