Commit Graph

1100 Commits

Author SHA1 Message Date
hailin 8a0bff5010 fix(planting-service): Dockerfile添加自动seed步骤
启动时自动运行 prisma db seed 创建合同模板

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:29:46 -08:00
hailin 8ee65c95e1 fix(planting): 修复KycService构造函数参数
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:13:29 -08:00
hailin 59e9cddf5b feat(planting): 认种成功后检查实名认证状态
当CONTRACT_SIGNING_ENABLED=true时,认种成功后检查用户是否已完成实名认证:
- 如果未完成实名认证,显示提示弹窗引导用户去认证
- 如果已完成或功能未启用,按原有流程返回个人中心

新增:
- KycRequiredDialog 实名认证提示弹窗组件
- ContractSigningConfig 配置类和getConfig()方法
- kycServiceProvider 依赖注入

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:10:55 -08:00
hailin bc34907a84 fix(auth): 注册验证码页面显示完整手机号
验证码页面不再隐藏手机号中间数字,改为完整显示
格式: 138 1234 5678

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:03:30 -08:00
hailin 1d6cbf9335 feat(kyc): 实名认证前检查手机号验证状态
- 点击实名认证时检查手机号是否已验证
- 未验证时显示提示弹窗,引导用户先验证手机号
- 实名认证卡片显示"请先验证手机号"提示

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:00:53 -08:00
hailin 8b1db58318 fix(planting-service): 修复用户ID字段名与JwtAuthGuard一致
JwtAuthGuard 设置 req.user.id,controller 需要使用相同字段名

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:50:58 -08:00
hailin a7dc85d8e1 fix(frontend): 添加 geolocator 依赖并移除未使用的 webview_flutter
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:45:51 -08:00
hailin aa9370dc56 fix(planting-service): 排除 prisma 目录修复编译输出路径
prisma/seed.ts 导致 TypeScript 编译时目录结构变化,
dist/main.js 变成 dist/src/main.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:39:19 -08:00
hailin 80a854e9d8 chore(planting-service): 更新 package-lock.json
添加 @nestjs/schedule 依赖的锁文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:25:31 -08:00
hailin 33a5b79c2a fix(planting-service): 修复合同签署功能编译错误
- 修复 JwtAuthGuard 导入路径
- 添加 @nestjs/schedule 依赖

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:24:00 -08:00
hailin 5b8c6bc317 feat(frontend): 添加电子合同签署功能前端实现
- 添加 ContractSigningService 合同签署 API 调用服务
- 添加 ContractCheckService App 启动时检查待签署合同
- 添加 ContractSigningPage 完整签署流程页面
  - 24小时倒计时
  - 滚动阅读 → 确认法律效力 → 手写签名
  - 支持超时后补签
- 添加 PendingContractsPage 待签署合同列表
- 添加 SignaturePad 手写签名板组件
- HomeShellPage 启动时检查未签署合同,强制签署

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:15:13 -08:00
hailin 714ce42e4f feat(contract-signing): 添加电子合同签署功能及单点配置优化
- planting-service: 添加合同签署任务管理和超时检测
  - 新增 ContractSigningTask 领域模型
  - 添加 24 小时合同签署超时定时任务
  - 支付后资金保持冻结,由 referral-service 统一确认扣款

- referral-service: 单点配置 CONTRACT_SIGNING_ENABLED
  - 新增 ContractSigningHandler 处理合同签署/超时事件
  - 新增 WalletServiceClient 调用钱包服务确认扣款
  - planting.created 处理后根据配置决定是否等待合同签署

- reward-service: 移除 CONTRACT_SIGNING_ENABLED 配置
  - 扣款确认由 referral-service 在发送事件前完成
  - 保持奖励分配逻辑不变

配置说明:
- CONTRACT_SIGNING_ENABLED=true (默认): 等待合同签署后分配奖励
- CONTRACT_SIGNING_ENABLED=false: 立即分配奖励(原有流程)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 20:12:12 -08:00
hailin 1b3d545c0d fix(admin-web): 优化通知表单标签选择体验
- 新建通知时自动刷新可用标签列表
- 添加"刷新标签"按钮方便手动刷新
- 优化空标签提示,说明需勾选"可用于广告定向"
- 改进"指定用户"输入框占位符文本和示例

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 18:33:14 -08:00
hailin 41a47b1b53 feat(admin-web): 添加用户标签分配和查看用户功能
- 在标签卡片添加"分配用户"和"查看用户"按钮
- 实现批量分配用户到标签的弹窗
- 实现查看标签下用户列表和移除用户功能
- 添加批量分配API (batch-assign)
- 添加获取标签用户API (tag/:id/users)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 17:36:07 -08:00
hailin 18f24d5f4b fix(frontend): 修复API响应格式解析问题
- 修复userTagService.getTags返回分页响应{items, total}的解析
- 修复audienceSegmentService.getSegments返回分页响应的解析
- 更新组件正确提取items数组

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 17:21:48 -08:00
hailin e6415f9217 fix(api): 修复前端API端点路径与后端Controller不匹配的问题
- 将 /v1/admin/classification-rules 改为 /v1/admin/rules
- 将 /v1/admin/audience-segments 改为 /v1/admin/segments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:54:41 -08:00
hailin fff88d0323 chore(db): 添加用户画像系统数据库迁移
新增表:
- tag_categories: 标签分类
- user_tags: 用户标签定义
- user_tag_assignments: 用户-标签关联
- user_classification_rules: 分类规则
- user_features: 用户特征 (RFM等)
- audience_segments: 人群包
- user_tag_logs: 标签变更日志
- notification_tag_targets: 通知-标签关联
- notification_user_targets: 通知-用户关联

新增枚举:
- TagType, TagValueType, TagAction, SegmentUsageType, TargetLogic

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:43:19 -08:00
hailin b5e45c4532 feat(user-profile): 实现用户画像系统和通知定向功能
后端 (admin-service):
- 新增用户标签系统:标签分类、标签定义、用户标签分配
- 新增分类规则引擎:支持自动打标规则
- 新增人群包管理:支持复杂条件组合筛选用户
- 增强通知系统:支持按标签、按人群包、指定用户定向发送
- 新增自动标签同步定时任务
- Prisma Schema 扩展支持新数据模型

前端 (admin-web):
- 通知管理页面新增 Tab 切换:通知列表、用户标签、人群包
- 用户标签管理:分类管理、标签 CRUD、颜色/类型配置
- 人群包管理:条件组编辑器、逻辑运算符配置
- 通知编辑器:支持按标签筛选和指定用户定向

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:19:05 -08:00
hailin 934323e4c6 feat(kyc): 优化手机号验证/更换流程
- 将入口重命名为"验证/更换手机号"
- 验证旧手机成功后更新 phoneVerified 状态
- 首次验证成功时显示恭喜弹窗,用户可选择完成或继续更换
- 已验证过的用户验证通过后直接进入下一步

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 07:50:54 -08:00
hailin 0a4ec49c8a fix(kyc): 修复更换手机号页面发送验证码按钮可重复点击的问题
- 添加 _isSendingCode 状态检查,防止发送中重复点击
- 发送中显示 loading 指示器
- 倒计时期间和发送中均禁用按钮

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 07:38:26 -08:00
hailin 0f745a17fd feat(kyc): 实现完整三层KYC认证功能
实现三层KYC认证系统,支持后台配置开关:
- 层级1: 实名认证 (二要素: 姓名+身份证号)
- 层级2: 实人认证 (人脸活体检测)
- 层级3: KYC (证件照上传验证)

后端变更:
- 更新 Schema 添加三层认证字段和 KycConfig 表
- 添加 migration 支持增量字段和配置表
- 重写 AliyunKycProvider 支持阿里云实人认证 API
- 重写 KycApplicationService 实现三层认证逻辑
- 更新 KycController 添加用户端和管理端 API

前端变更:
- 更新 KycService 支持三层认证 API
- 重构 KycEntryPage 显示三层认证状态
- 重构 KycIdPage 用于层级1实名认证
- 新增 KycFacePage 用于层级2人脸认证
- 新增 KycIdCardPage 用于层级3证件照上传
- 添加 uploadFile 方法到 ApiClient

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 07:14:11 -08:00
hailin a549768de4 feat(kyc): 实现实名认证和更换手机号功能
主要变更:
- 注册流程: 添加跳过短信验证选项(3分钟后显示)
- KYC功能: 手机号验证 + 身份证实名认证(阿里云二要素)
- 更换手机号: 四步验证流程(旧手机验证→输入新号→新手机验证→确认)
- 独立管控: phoneVerified, emailVerified, kycStatus 三个状态分别管理

后端:
- 新增 KYC 控制器和服务
- 新增更换手机号 API 端点
- Schema 添加 KYC 和验证状态字段
- 集成阿里云身份二要素验证

前端:
- 新增 KYC 入口页、手机验证页、身份证验证页
- 新增更换手机号页面
- Profile 页面添加实名认证入口

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 06:38:39 -08:00
hailin 50bc5a5a20 fix(stickman): 使用顶部对齐实现昵称与数量标签的中心对齐
昵称标签和数量标签高度相同,顶部对齐即可实现水平中心对齐

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 04:06:33 -08:00
hailin d4b802502e fix: 修复验证码竞态条件和火柴人对齐问题
1. 修复验证码发送的竞态条件:
   - 调整执行顺序,先存储验证码到 Redis,再发送短信/邮件
   - 避免用户收到验证码后立即输入但 Redis 中尚未存储的情况
   - 影响:sendSmsCode、sendWithdrawSmsCode、sendResetPasswordSmsCode、sendEmailCode

2. 修复火柴人组件昵称与数量标签对齐问题:
   - 使用底部对齐 + Padding 让昵称标签与数量标签在同一水平线

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:54:25 -08:00
hailin ee4cac59c7 fix(profile): 修复嵌套 Row 无界约束导致的白屏问题
在 _buildSettlementSection 的"已结算"区域,内层 Row 中使用了 Flexible,
但内层 Row 没有宽度约束,导致 RenderFlex unbounded width constraints 错误。
通过在内层 Row 外添加 Expanded 包裹来提供宽度约束。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:41:23 -08:00
hailin 1cd4b352a4 debug(mobile): 添加火柴人组件调试日志
- 记录宽度计算的各个参数
- 添加clamp保护防止负值宽度
- 打印排名数据详情

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:32:22 -08:00
hailin ba3e96c606 fix(mobile): 修复SVG头像渲染导致的布局问题
- 使用RepaintBoundary隔离SVG渲染
- 添加placeholderBuilder防止加载时闪烁
- 确保SizedBox固定尺寸约束

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:26:24 -08:00
hailin a38727eb7f Revert "revert(profile): 回滚profile_page.dart到稳定版本"
This reverts commit b06f186836.
2025-12-24 03:16:39 -08:00
hailin b06f186836 revert(profile): 回滚profile_page.dart到稳定版本
修复SVG头像渲染导致的白屏问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:11:24 -08:00
hailin e2872b13fb revert(mobile): 回滚火柴人组件到稳定版本
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 03:00:52 -08:00
hailin 27bee6d7f1 fix(mobile): 修复火柴人组件布局错误,避免嵌套Stack
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 02:53:21 -08:00
hailin 0623169d19 fix(mobile): 修正火柴人进度计算,使用固定目标值
- 省公司: 目标固定5万,达到或超过5万停在红旗
- 市公司: 目标固定1万,达到或超过1万停在红旗
- 进度 = completedCount / targetCount,clamp到0-1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 02:16:54 -08:00
hailin 7d1a392d9e fix(mobile): 调整火柴人终点位置,停在红旗左边
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 02:14:27 -08:00
hailin a823490c96 fix(mobile): 修正火柴人终点位置计算
- 起点: 70 (昵称区域右边)
- 终点: containerWidth - 92 (红旗左边 - 火柴人宽度)
- 100%时火柴人右边对齐红旗左边

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 02:12:36 -08:00
hailin 3e59d56f92 fix(mobile): 简化火柴人位置计算逻辑
使用简单直接的比例计算:
- 起点 = 昵称区域右边 (70px)
- 终点 = 红旗左边 (containerWidth - 62px)
- 火柴人位置 = 起点 + (终点 - 起点) * 进度

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:48:08 -08:00
hailin 71304dbb69 fix(mobile): 改进用户详情页风格和火柴人进度计算
- 用户详情页使用与"我的"页面一致的浅黄色渐变背景
- 移除深金棕色AppBar,改用简洁的顶部导航栏
- 火柴人进度使用后端返回的progressPercentage而非前端计算
- 添加finalTarget和progressPercentage字段到排名响应

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:41:41 -08:00
hailin 906279ee8a fix(mobile): 修复用户详情页头像和用户ID显示问题
- 修复avatarUrl为SVG数据时的渲染问题,添加SVG检测逻辑
- 修复后端getUserInfoBySequence响应解析,处理包装格式
- 将用户详情弹窗改为全屏页面,提供更好的用户体验
- 新增统计数据卡片展示直推人数、伞下用户、认种数量
- 改进卡片样式,添加图标和阴影效果

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:28:28 -08:00
hailin 3ed17bb4eb fix(notification): 修复通知中心API路径
问题: 前端调用 /admin-service/mobile/notifications 路径不存在于Kong网关

修复:
1. Kong网关添加 /api/v1/mobile/notifications 路由到 admin-service
2. 前端 NotificationService 修正 API 路径:
   - /admin-service/mobile/notifications -> /mobile/notifications
   - /admin-service/mobile/notifications/unread-count -> /mobile/notifications/unread-count
   - /admin-service/mobile/notifications/mark-read -> /mobile/notifications/mark-read

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:20:43 -08:00
hailin 12c0c796f4 fix(mobile): 修正火柴人100%进度时到达红旗位置的计算
- 精确计算终点位置:火柴人列右边缘对齐红旗左边缘
- 起点从昵称标签右边4px间距开始

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:18:27 -08:00
hailin c1c4a52ad3 fix(mobile): 优化火柴人动画布局避免标签重叠
- 昵称和数量标签顶部对齐在同一水平高度
- 添加4px最小间距防止起步阶段标签重叠
- 火柴人从昵称右边开始移动到红旗位置

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:09:27 -08:00
hailin 6745721399 fix: 修复火柴人排名点击查看用户详情功能
- 后端DTO添加accountSequence字段
- 后端服务返回accountSequence
- 前端映射accountSequence到StickmanRankingData
- 优化错误提示样式与页面风格一致

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:05:18 -08:00
hailin f73e477041 fix(mobile-app): 待领取奖励卡片也去掉重复的权益类型前缀
与可结算卡片保持一致,只显示"来自用户xxx的认种"部分

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:02:38 -08:00
hailin e8f65f3fcd fix(mobile-app): 可结算奖励卡片去掉重复的权益类型前缀
memo 中已包含权益类型(如"分享权益:来自用户xxx的认种"),
卡片标题也显示了权益类型,所以只显示"来自用户xxx的认种"部分

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:01:19 -08:00
hailin e9a64a8163 fix(identity): 使用Prisma直接查询用户详情
getUserDetailBySequence 方法改用 Prisma 直接查询数据库,
以获取 email 和 realName 等领域模型中未暴露的字段。

之前的实现通过领域模型 UserAccount 访问这些字段会导致编译错误,
因为领域模型没有直接暴露这些属性。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:46:45 -08:00
hailin 93f6a53bdb feat(mobile): 优化火柴人赛跑组件布局
- 将昵称移到左侧固定位置,与右边红旗相呼应
- 保持数量标签在火柴人上方,间距2像素

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:37:42 -08:00
hailin 5ed1a0b143 feat(mobile): 优化火柴人赛跑组件布局
- 将昵称移到左侧固定位置,与右边红旗相呼应
- 缩小数量标签与动画之间的间距

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:28:01 -08:00
hailin bf64391c0c feat(identity): 改用创意组合名字替代序号命名
将用户名格式从"榴莲皇后x号"改为"榴莲皇后xxx",
其中xxx是2-4字的创意组合,包含前缀、核心词和后缀。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:25:03 -08:00
hailin f0f4aa474a feat(mobile-app): 可结算奖励卡片显示来源信息
在"我的"页面可结算板块中,每笔收益现在会显示来源信息(通过 memo 字段)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:21:58 -08:00
hailin ed1f863919 fix(authorization): 修复团队升级竞态条件,改用事件链模式
问题:authorization-service 和 referral-service 并行消费 TreePlanted 事件,
导致升级检查时统计数据尚未更新完成。

解决方案:
- referral-service: 批量更新团队统计后发布 TeamStatisticsUpdatedEvent
- authorization-service: 监听该事件触发升级检查,替代原有的即时检查
- TeamStatistics 聚合添加 accountSequence 字段用于事件发布

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:13:39 -08:00
hailin ca95c1decf fix(admin-web): 修复通知表单类型错误
为 priority 和 targetType 添加正确的类型断言

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:57:38 -08:00