hailin
94d4524ee3
fix(c2c): 积分股→积分值,C2C交易对象修正为积分值(cash)
...
C2C交易的产品是积分值,支付方式是绿积分(外部1.0系统),与积分股无关。
前端:
- c2c_publish_page: 余额卡、数量输入、提示文案、确认弹窗全部改为积分值
- c2c_market_page: 余额概览(availableShares→availableCash)、订单数量标签、接单弹窗
- c2c_order_detail_page: 订单详情、划转提示、确认收款弹窗
后端 c2c.service.ts:
- createOrder SELL: freezeShares→freezeCash
- takeOrder BUY(taker=卖方): freezeShares→freezeCash
- takeOrder SELL(taker=买方): 移除冻结(买方通过外部支付绿积分)
- cancelOrder SELL: unfreezeShares→unfreezeCash
- expireOrder: unfreezeShares→unfreezeCash,SELL不再解冻taker
- executeTransfer: 统一BUY/SELL为单向积分值划转,assetType改为CASH
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:41:23 -08:00
hailin
cfa0e2ca40
fix(mining-app): 更新弹窗点击"立即更新"无反应 — 进度流订阅竞态修复
...
问题根因:
SelfHostedUpdater._listenToProgress() 在 initState 和 _startDownload 中
订阅 UpdateService.downloadProgressStream,但该 getter 返回
_downloadManager?.progressStream —— _downloadManager 在 downloadUpdate()
调用前为 null,?.listen 无操作。downloadUpdate() 创建新 _downloadManager
后,其 progressStream 无人监听,进度事件全部丢失,UI 无任何反馈。
修复:
1. UpdateService 新增持久化广播流 _downloadProgressController,
downloadUpdate() 创建新 DownloadManager 后将其进度转发到此流
2. downloadProgressStream getter 改为返回持久化流(非 nullable)
3. SelfHostedUpdater 在 initState 中一次性订阅持久化流,
dispose 时取消订阅,_startDownload 不再重复订阅
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:24:47 -08:00
hailin
bde7f0c53b
fix(mining-app): 自动更新检查未触发 — 修复双重节流 + 添加调试日志
...
问题原因:
1. checkForUpdate() 未传 force:true,被 UpdateService 内部的60分钟
SharedPreferences 间隔二次节流,导致实际请求被跳过
2. 缺少日志输出,无法诊断检查流程是否执行
修复:
- checkForUpdate(force: true) 跳过内部60分钟限制,
因为 MainShell 已有自己的90-300秒随机冷却节流
- 在 initState / dispose / didChangeAppLifecycleState /
_checkForUpdateIfNeeded 各关键节点添加 debugPrint 日志,
方便 flutter run 控制台追踪完整检查流程
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:20:56 -08:00
hailin
53a2e64cad
feat(mining-app): 启动和切回前台自动检测升级
...
MainShell 从 StatelessWidget 转为 StatefulWidget + WidgetsBindingObserver,
参考 mobile-app HomeShellPage 模式,实现:
- initState 首帧后自动检查更新
- didChangeAppLifecycleState(resumed) 从后台恢复时自动检查
- 90-300秒随机冷却间隔防止频繁请求(static 变量跨 rebuild 保持)
- 延迟3秒启动检查,避免干扰用户操作
- 有更新时弹出 SelfHostedUpdater 对话框(支持强制更新)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:07:40 -08:00
hailin
187b82e9ac
feat(c2c): 修复6项C2C交易问题 (#11-#16)
...
- #11 : 价格固定1:1,最小交易数量为1
- #12 : BUY买单不再冻结买方积分值(绿积分通过外部1.0系统支付)
- #13 : 支持部分成交,taker可指定数量,剩余自动拆分为新PENDING订单
- #14 : 发布页双向输入,积分股数量与积分值金额1:1联动
- #15 : 接BUY单时弹出收款信息输入(收款方式、账号、姓名)
- #16 : BUY单创建时验证积分值余额但不冻结
后端: cancelOrder/expireOrder/executeTransfer 均按BUY/SELL分别处理
前端: 发布页价格只读、市场页接单对话框增加数量和收款输入
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:36:57 -08:00
hailin
c28ccb6206
fix(mining-app): 总资产估值仅显示积分值,未包含积分股估值
...
问题:_calculateTotalAssetValue() 依赖 WebSocket 推送的 _currentPrice
和定时器初始化的 _currentShareBalance,在 WebSocket 未连接或定时器未
启动时这些值均为 0,导致 shareValue=0,总资产仅显示现金余额。
修复:当 WebSocket/_timer 未初始化时,回退到 API 返回的
asset.currentPrice、asset.burnMultiplier 和 asset.shareBalance,
与 _buildAssetList 中积分股估值的计算逻辑保持一致。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:03:41 -08:00
hailin
ca4e5393be
feat(p2p-transfer): 实现P2P划转手续费功能(全栈)
...
## 功能概述
- P2P转账(积分值)支持手续费收取,手续费存入系统成本费账户 S0000000002
- 发送方实际扣除 = 转账金额 + 手续费,接收方全额收到转账金额
- 手续费金额和最小划转金额可在管理后台动态配置(默认: 手续费5, 最小划转6)
## 后端 — mining-admin-service
- GET /configs/p2p-transfer-fee: 管理端获取手续费配置(需鉴权)
- POST /configs/p2p-transfer-fee: 管理端设置手续费配置,校验最小划转 > 手续费
- GET /configs/internal/p2p-transfer-fee: 内部调用端点(@Public 无鉴权)
## 后端 — trading-service
- Prisma schema: P2pTransfer model 新增 fee Decimal(30,8) 字段
- docker-compose: 新增 MINING_ADMIN_SERVICE_URL 环境变量
- p2p-transfer.service: 动态获取手续费配置,余额校验含手续费,
事务内分别记录转账流水和手续费流水(P2P_TRANSFER_FEE),
手续费存入系统成本费账户 S0000000002
- p2p-transfer.controller: 新增 GET /p2p/transfer-fee-config 代理端点
- 转账结果和历史记录新增 fee 字段返回
## 前端 — mining-admin-web
- configs.api.ts: 新增 getP2pTransferFee / setP2pTransferFee API
- use-configs.ts: 新增 useP2pTransferFee / useSetP2pTransferFee hooks
- configs/page.tsx: 新增"P2P划转手续费设置"卡片(手续费 + 最小划转金额)
## 前端 — mining-app (Flutter)
- api_endpoints.dart: 新增 p2pTransferFeeConfig 端点常量
- p2p_transfer_fee_config_model.dart: 新增手续费配置 Model
- trading_remote_datasource.dart: 新增 getP2pTransferFeeConfig 方法
- transfer_providers.dart: 新增 p2pTransferFeeConfigProvider
- send_shares_page.dart: 发送页面显示手续费信息、最小划转金额提示、
实际扣除金额计算、"全部"按钮扣除手续费、确认弹窗展示手续费明细
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 06:44:19 -08:00
hailin
830d99a504
feat(mining-app): 分离发送/接收记录 + 隐藏买入待开启
...
- 发送页右上角"转出记录"只显示转出明细
- 接收页右上角新增"接收记录"只显示转入明细
- P2pTransferRecordsPage 支持 filterDirection 参数过滤方向
- 兑换页隐藏"买入待开启" Tab(_showBuyTab=false,保留代码备启用)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 22:10:47 -08:00
hailin
263f1ecf8e
feat(c2c): 卖单自动获取账户ID和Kava地址,移除手动输入
...
后端创建卖单时自动从 identity-service 获取卖家 Kava 地址并存入订单,
前端发布页面自动展示 accountSequence(只读),不再需要手动输入1.0系统ID。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 11:08:56 -08:00
hailin
2b7a30983e
fix(mining-app): 修复贡献值明细筛选栏溢出问题
...
使用 SingleChildScrollView 包装筛选栏,支持横向滚动
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:52:37 -08:00
hailin
c02d0b4c3c
fix(mining-app): 移除遗留的 kDebugMode 调试代码
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:48:51 -08:00
hailin
7560940e14
fix(mining-app): 修复贡献值明细页面筛选和文字溢出问题
...
- 将贡献值记录筛选从客户端过滤改为服务端过滤,解决同伴上贡献值记录无法显示的问题
- 使用 FittedBox 包装三栏统计标签文字,防止"同伴上贡献值"溢出
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:44:12 -08:00
hailin
776d181ef3
fix(trading-service): 修复P2P转账API响应双重包装问题
...
- 移除controller中的手动包装,由TransformInterceptor统一处理
- 前端增加类型检查防止解析错误
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 09:11:59 -08:00
hailin
1448435b06
chore(mining-app): 移除发送页面调试日志
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:40:37 -08:00
hailin
6ebc1f8767
fix(mining-app): 添加收款方验证成功提示和调试日志
...
- 验证成功时显示绿色 SnackBar 提示
- 添加调试日志帮助诊断可用余额问题
- 温馨提示中添加积分值获取方式说明
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:26:22 -08:00
hailin
8fe38525a2
fix(mining-app): 验证收款方失败时显示提示信息
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 08:19:39 -08:00
hailin
6bcfa18b01
fix(mining-app): 修复转账二维码扫描无效问题
...
- 修改二维码生成格式为 durian://transfer/?phone=xxx (添加路径分隔符)
- 更新解析函数使用正则匹配,兼容新旧格式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 07:39:42 -08:00
hailin
76d566d145
feat: 集成 mining-app 升级和遥测功能,扩展 mobile-upgrade 支持多应用
...
## mining-app (Flutter)
- 新增 updater 模块: 版本检查、APK下载(断点续传+SHA256校验)、安装
- 新增 telemetry 模块: 事件上报、会话追踪、心跳检测(DAU统计)
- 集成原生 MethodChannel 实现 APK 安装
- 在关于页面添加"检查更新"功能入口
## mining-admin-service (NestJS)
- 新增版本管理 API (/api/v2/versions)
- 实现 DDD 架构: Entity, Value Objects, Repository
- 支持 APK/IPA 解析 (需安装 adbkit-apkreader, jszip, plist)
- 支持文件上传和静态文件服务
## mobile-upgrade (Next.js)
- 扩展支持多后端: 榴莲 App (admin-service) + 股行 App (mining-admin-service)
- 添加应用选择器 UI
- 配置独立的 API 端点
## 修复
- 移除未使用的 _apiBaseUrl 字段 (Flutter)
- 替换废弃的 WillPopScope 为 PopScope (Flutter)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 20:03:26 -08:00
hailin
a2da841d59
feat(transfer): 添加扫码转账功能
...
- 添加 mobile_scanner 依赖用于二维码扫描
- 创建 QrScannerSheet 组件,支持底部弹窗扫码
- 发送积分值页面添加扫码按钮,扫描后自动填入收款方手机号
- 支持解析 durian://transfer?phone={phone} 格式的二维码
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 16:22:53 -08:00
hailin
0c0750ce93
feat(c2c): 前端添加 Bot 自动购买信息展示
...
- C2cOrderModel 添加 botPurchased/sellerKavaAddress/paymentTxHash 字段
- 订单详情页新增 Bot 支付信息卡片,显示 dUSDT 交易哈希
- 支持复制 Kava 地址和交易哈希
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 07:26:36 -08:00
hailin
2597d0ef46
feat: 实现P2P转账功能及前端资产页面优化
...
- trading-service: 添加P2pTransfer模型和P2P转账API
- auth-service: 添加用户手机号查询接口用于转账验证
- frontend: 修复资产页面冻结份额显示和转账页面余额字段
- frontend: 添加P2P转账记录页面
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 06:25:42 -08:00
hailin
f3d460ba09
fix(mining-app): 修复批量补发记录解析字段名
...
API 返回 records 字段,而非 data 或 items
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 02:11:10 -08:00
hailin
623e695353
fix(mining-app): 修正批量补发记录 API 路径
...
添加 /admin 前缀以匹配 mining-service 的 AdminController 路由
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 01:45:41 -08:00
hailin
b6d723333c
fix(mining-app): 修复 BatchMiningRecordsPage 类名冲突
...
将页面类重命名为 BatchMiningRecordsListPage 以避免与实体类冲突
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 01:42:46 -08:00
hailin
d5dc248a16
feat(mining-app): 添加补发记录功能
...
- 添加批量补发记录 API endpoint
- 创建 BatchMiningRecord 实体和模型
- 添加批量补发记录 provider 和页面
- 在"我的"页面动态显示补发记录入口(仅当用户有记录时显示)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 01:35:53 -08:00
hailin
7a5faad665
feat(mining-app): UI调整 - 隐藏部分功能和文案修改
...
- 兑换页面:将"挖矿账户"改为"分配账户"
- 我的页面:隐藏"账户设置"栏目(2.0版本暂不需要)
- 贡献值页面:隐藏"今日预估收益"栏目
- 贡献值明细页:同伴上贡献值不显示用户ID
- 参与记录页:将"算力"改为"贡献值"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 18:00:40 -08:00
hailin
1d5e3ebff2
fix(contribution): 使用 upsert 替代 update 避免记录不存在错误
...
将 addContribution 方法改为 upsert,当系统账户不存在时自动创建,
存在时增加算力余额。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 08:43:37 -08:00
hailin
5668de0a58
fix(asset): formatCompact保留原始精度(最多8位小数)
...
修复资产页面累计卖出等数字显示没有小数位的问题
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 05:27:50 -08:00
hailin
995dfa898e
feat(trading): 添加涨跌幅显示及修复成交明细数据
...
1. 后端:
- 添加 getFirstSnapshot() 获取上线首日价格
- PriceInfo 接口增加 priceChangePercent 和 initialPrice 字段
- 计算涨跌幅 = (当前价格 - 首日价格) / 首日价格 × 100%
- 修复 originalQuantity 为0时的数据计算逻辑
2. 前端:
- 交易页面涨跌幅移到价格下方单独显示
- 添加"较上线首日"说明文字
- 根据涨跌正负显示不同颜色和图标
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 05:24:23 -08:00
hailin
7ff7157115
refactor(ui): 隐藏"我的"页面中的"同伴与收益"栏
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:44:16 -08:00
hailin
e1cc364b0d
refactor(ui): 兑换页面文案调整
...
- 标题"积分股交易"改为"积分股兑换"
- "当前积分股价格"改为"当前积分股价值"
- 移除价格前的¥符号
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:43:08 -08:00
hailin
93c06920bd
refactor(ui): 引荐人数改为引荐
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:32:48 -08:00
hailin
9fb51fa30a
fix(ui): 恢复同伴下贡献值统计卡片的两行布局
...
- 恢复"已解锁上"项(去掉"级"字)
- 保持两行四项布局:引荐人数、已解锁上、已解锁下、是否参与
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:31:54 -08:00
hailin
33bf14b225
refactor(ui): 调整同伴下贡献值统计卡片
...
- 删除"已解锁上级"项
- "引荐人数"去掉"人"单位
- "已解锁下级"改为"已解锁下"
- 三个统计项改为单行显示
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:29:40 -08:00
hailin
728497afc1
refactor(ui): 将"个人"替换为"本人"
...
- team_tree_widget.dart: 节点详情弹窗中"个人参与"改为"本人参与"
- team_page.dart: 统计卡片中"个人参与"改为"本人参与"
- contribution_page.dart: 贡献值统计中"个人贡献值"改为"本人贡献值","个人参与产生的贡献值"改为"本人参与产生的贡献值"
- contribution_records_page.dart: 筛选标签"个人"改为"本人",来源类型标签"个人参与"改为"本人参与"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:28:10 -08:00
hailin
9c705d7478
fix(ui): 将UI界面上所有"团队"替换为"同伴"
...
- team_tree_widget: 团队参与 → 同伴参与
- contribution_records_page: 团队下/上贡献值 → 同伴下/上贡献值
- about_page: 团队收益 → 同伴收益
- help_center_page: 团队收益/计算 → 同伴收益/计算
- contribution_page: 团队下/上贡献值 → 同伴下/上贡献值
- team_page: 我的团队 → 我的同伴, 团队参与 → 同伴参与
- profile_page: 团队与收益 → 同伴与收益, 我的团队 → 我的同伴
- contribution_record: 团队奖励/额外奖励 → 同伴奖励/额外奖励
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:24:54 -08:00
hailin
21e536d829
fix(ui): 移除所有人民币符号,统一使用积分值单位
...
- asset_page: 总资产估值改为显示"积分值"后缀
- asset_page: 估值占位符移除¥符号
- c2c_publish_page: 交易总额、单价、总额改为积分值单位
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:19:52 -08:00
hailin
14d29b62ef
fix(asset): 隐藏总资产卡片的每秒增长显示
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:16:42 -08:00
hailin
1aa655f243
fix(asset): 移除积分值冗余的人民币估值显示
...
积分值与人民币1:1对应,不需要显示"≈ ¥xxx"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:15:11 -08:00
hailin
8728fdce4c
feat(trading): 成交明细显示完整卖出信息(销毁倍数、有效积分股、手续费等)
...
- 后端Trade表新增originalQuantity字段存储原始卖出数量
- quantity字段改为存储有效积分股(含销毁倍数)
- API返回完整明细:销毁倍数、有效积分股、交易总额、进入积分股池
- 前端成交明细页面显示完整卖出信息,类似确认卖出弹窗样式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 04:07:52 -08:00
hailin
7da98c248b
feat(trading): 交易记录页面添加成交明细Tab,显示手续费
...
后端:
- trading-service 添加 GET /trading/trades API 获取成交记录
- 成交记录包含: 交易总额、手续费(10%)、实际收到金额
前端:
- 新增 TradeRecord 实体和 TradesPageModel
- 交易记录页面添加 Tab: "订单记录" 和 "成交明细"
- 成交明细显示: 价格、数量、交易总额、手续费、实际收到
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 03:15:25 -08:00
hailin
63e02666ea
fix(asset): 积分股估值计算加入倍数(burnMultiplier)
...
之前只用了 shareBalance * currentPrice,
正确公式应该是 shareBalance * (1 + burnMultiplier) * currentPrice
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 03:07:03 -08:00
hailin
0fddd3164a
fix(trading): 交易记录金额单位从USDT改为积分值
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:18:40 -08:00
hailin
b1d8561ca5
fix(asset): 积分股估值显示积分值而非人民币
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:17:22 -08:00
hailin
edfdb1a899
fix(asset): 冻结积分值为0时状态显示为"无"而非"挂单中"
...
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 02:16:35 -08:00
hailin
d332ef99a7
feat(auth): 隐藏验证码登录和注册功能
...
- 移除登录方式切换(验证码登录选项卡)
- 隐藏注册入口
- 简化登录页面,仅保留密码登录
- 清理未使用的变量和方法
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 23:10:24 -08:00
hailin
d31bfc4221
feat(c2c): 修改C2C交易为积分值并添加绿积分支付方式
...
- C2C交易的商品从积分股改为积分值
- 添加绿积分作为默认且不可取消的支付方式
- 添加1.0系统ID输入框(绿积分支付必填)
- 支持多种支付方式同时选择
- 更新交易提示说明
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 23:07:35 -08:00
hailin
9333cd81c3
fix(kline): auto-load more history when data doesn't fill screen
...
- Always assume hasMoreHistory=true on initial load
- Auto-trigger loadMoreHistory when klines don't fill drawable area
- This ensures sparse data periods load all available history
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 22:53:48 -08:00
hailin
84d920f98f
fix(kline): stop loading when no unique new history data
...
When deduplicated new klines are empty, mark hasMoreHistory as false
to prevent infinite loading attempts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 22:31:38 -08:00
hailin
13f1b687ee
feat(kline): add dynamic history loading on pan
...
Add support for loading more K-line history data when user pans to the
left edge. Backend API now accepts 'before' parameter for pagination.
Frontend uses KlinesNotifier to manage accumulated data with proper
deduplication.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 22:21:39 -08:00