hailin
af7fdfd428
fix(mobile/share): fix referral code overflow, remove team stats & team reward section
...
- Fix RIGHT OVERFLOWED BY 17 PIXELS: use Flexible on code Text,
reduce letterSpacing 4→2, reduce horizontal padding
- Remove stats card (direct/team count) from page layout
- Remove 团队层级收益 reward item from reward plan card
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 11:46:13 -08:00
hailin
9bcb1f864d
feat(mobile): implement invite friends share page with APK QR code & referral marketing
...
- SharePage: QR code now encodes actual APK download URL from admin-service
(GET /api/v1/app/version/download/{id} via Kong), referral code shown
separately below QR for manual entry on registration
- Add referral reward marketing section: direct bonus / team levels (50
layers) / new user welcome package — drives viral growth
- Show referrer info card when current user was invited via referral code
- Share text updated to marketing copy with APK link + referral code
- VersionChecker.getLatestApkUrl(): fetches latest APK URL regardless of
needUpdate (passes version=0.0.0 to force server response)
- UpdateService.getLatestApkUrl(): exposes APK URL fetch for UI layer
- i18n (zh-CN/zh-TW/en/ja): add 14 new keys for marketing content,
APK download hints, reward program descriptions, and referrer info
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 10:17:59 -08:00
hailin
8f3d0f5d17
fix: comprehensive API compatibility fixes across issuer/user/ai services and Flutter
...
Backend:
- issuer-service: fix credit-metric entity column names to match DB schema
(breakage_ratio, market_tenure_months, user_satisfaction, computed_score, etc.)
- issuer-service: add page/limit to ListStoresQueryDto and ListEmployeesQueryDto
- issuer-service: add period field to ReconciliationQueryDto
- issuer-service: fix IssuerStatsController to use req.user.id→issuerId lookup
- issuer-service: add analytics stubs (users/demographics/repurchase/ai-insights)
- issuer-service: add issuers/me/coupons endpoint
- user-service: add GET /users/payment-methods stub before /:id route
- ai-service: add GET /ai/sessions/current/messages stub endpoint
Flutter:
- genex-mobile: fix /users/kyc/status → /users/kyc
- genex-mobile: fix announcements offset→page param
- genex-mobile: fix trading paths (/trading/* → /trades/*)
- admin-app: fix announcements offset→page param
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 09:29:44 -08:00
hailin
4957b2ef85
feat(genex-mobile): 重构为 Clean Architecture + Riverpod
...
- 添加 flutter_riverpod ^2.5.1 依赖
- 搭建 core/error/failures.dart 和 core/usecases/usecase.dart 基础骨架
- auth feature 完整 3 层重构:
- domain: AuthUser + AuthSession 实体, IAuthRepository 接口, 全套 UseCases
- data: AuthRepositoryImpl(Strangler Fig,委托给 AuthService 保留 token 刷新逻辑)
- presentation: AuthNotifier + authProvider + currentUserProvider + isAuthenticatedProvider
- 4 个 auth 页面升级为 ConsumerStatefulWidget,使用 ref.read(authProvider.notifier)
- main.dart: ProviderScope 包裹 GenexConsumerApp,改为 ConsumerStatefulWidget
- 桥接 AuthService ValueNotifier → Riverpod authProvider(会话过期自动导航)
- 12 个 feature 全部创建 Riverpod providers(FutureProvider/NotifierProvider)
- 修复 my_coupons_page.dart 中 EmptyState/StatusTags 缺少 BuildContext 的预存在错误
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 20:12:50 -08:00
hailin
1c36c849e2
docs(genex-mobile): 完善邀请分享模块注释与说明
...
SharePage:
- 文件头注释:完整功能概述、支持的分享场景、数据来源、URL格式、依赖包说明
- 类注释:生命周期描述、Widget 树结构图(ASCII)
- 状态变量:详细说明 _info/_loading/_error/_baseInviteUrl
- _inviteLink:注释已加载/未加载两种输出示例
- _loadInfo:成功/失败两条路径说明
- _showCopied:SnackBar 样式描述
- _copyCode/_copyLink:示例复制内容
- _shareNative:iOS/Android 行为说明 + 文案模板示例
- _buildHeroCard:视觉层次注释 + QR 参数说明
- _buildStatsCard:布局描述 + 数据来源注释
- _buildShareActions:三项操作的点击行为说明
ReferralService:
- 文件头:完整端点一览、推荐码格式、推荐链规则
- ReferralInfo:字段含义 + 后端响应 JSON 示例
- getMyInfo:登录要求说明
- validateCode:用途说明 + 返回值降级策略
- getDirectReferrals:分页参数范围 + 响应 JSON 示例
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 01:42:47 -08:00
hailin
46d2404d19
feat(genex-mobile): 邀请好友 — 分享二维码页面全链路实现
...
- 新增 SharePage:推荐码 QR 码 + 邀请进度 + 一键复制/原生分享
- ProfilePage 添加「邀请好友」渐变横幅入口
- 新增 ReferralService(getMyInfo / getDirectReferrals)
- pubspec.yaml 引入 qr_flutter ^4.1.0、share_plus ^10.0.2
- 路由 /share 注册
- i18n:4 语言新增 share.* 共 20 个翻译键(zh-CN / zh-TW / en / ja)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 01:28:22 -08:00
hailin
e7c1e33355
fix(genex-mobile): 语言偏好持久化 — 用户选择不再因重启丢失
...
修复 LocaleManager 仅用内存 ValueNotifier 存储语言选择的问题,
重启 App 后用户选的语言会丢失,回退到系统语言。
改动:
- pubspec.yaml: 添加 shared_preferences 依赖
- locale_manager.dart: 新增 init() 启动恢复 + setLocale() 写入持久化
· null = 跟随系统语言(清除 SP 记录)
· 非 null = 持久化到 SharedPreferences,重启后自动恢复
- main.dart: 启动时调用 await LocaleManager.init()
- settings_page.dart: 语言选择改用 LocaleManager.setLocale()
行为:首次安装跟随系统语言 → 用户选择后持久化 → 重启保持不变
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 19:39:07 -08:00
hailin
184a7d16db
feat: 三端集成 App升级 + 内部推送 + FCM外部推送框架 (genex-mobile/admin-app/mobile)
...
从 rwadurian/frontend/mobile-app 移植升级系统和通知系统到 Genex 三个 Flutter 客户端,
适配目标项目轻量架构(ValueNotifier 替代 Riverpod,Dio HTTP 客户端,移除 screenutil)。
## 新增核心模块 (每个 app 13 个 Dart 文件)
### 升级系统 (core/updater/)
- UpdateService: 统一升级服务单例,支持 Google Play + 自建服务器双渠道
- VersionChecker: 版本检测器,调用 GET /api/app/version/check
- DownloadManager: APK 下载管理,支持断点续传 + SHA256 校验
- ApkInstaller: APK 安装器 (Platform Channel)
- AppMarketDetector: 应用市场来源检测
- SelfHostedUpdater: 自建服务器渠道更新对话框 (i18n 化)
- GooglePlayUpdater: Google Play 应用内更新
### 通知系统 (core/services/ + core/providers/)
- NotificationService: 通知 + 公告 API 服务
- GET /notifications, /notifications/unread-count
- PUT /notifications/:id/read
- GET /announcements, /announcements/unread-count
- PUT /announcements/:id/read, /announcements/read-all
- NotificationBadgeManager: 未读徽章管理器
- ValueNotifier<int> 驱动 UI
- 30秒定时自动刷新 + 前后台切换刷新 (WidgetsBindingObserver)
### FCM 推送框架 (core/push/)
- PushService: Firebase 推送服务框架
- Firebase 代码注释保护,无配置文件时静默跳过
- 设备 token 注册 POST /device-tokens
- 待 Firebase 配置文件就绪后取消注释即可启用
### HTTP 客户端 (core/network/)
- ApiClient: Dio 封装单例,baseUrl = https://api.gogenex.cn
## Android 原生配置 (每个 app)
- AndroidManifest.xml: 添加 REQUEST_INSTALL_PACKAGES 权限 + FileProvider
- res/xml/file_paths.xml: FileProvider 路径配置
- MainActivity.kt: APK 安装器 + 应用市场检测 MethodChannel
## UI 层改造 (每个 app)
- main.dart: 异步启动,初始化 UpdateService/PushService/NotificationBadgeManager
- MainShell: 消息 Tab 徽章改为 ValueListenableBuilder 动态未读数,进入后 3 秒检查更新
- SettingsPage: StatefulWidget 化,动态版本号 (PackageInfo),点击版本号手动检查更新
- MessagePage: 移除 mock 数据,接入 NotificationService API,4 Tab 分类 + 下拉刷新 + 标记已读
## i18n 新增 (~35 keys/语言)
- update.*: 25 个升级相关 keys
- notification.*: 9 个通知相关 keys
- genex-mobile: 4 语言 (zh_CN/zh_TW/en/ja) 分文件
- admin-app: 3 语言 (zh_CN/en_US/ja_JP) 内联单文件
- mobile: 4 语言 (zh_CN/zh_TW/en/ja) 分文件
## 三端差异化配置
| App | MethodChannel 前缀 | applicationId |
|-----|-------------------|---------------|
| genex-mobile | cn.gogenex.consumer | cn.gogenex.consumer |
| admin-app | cn.gogenex.issuer | cn.gogenex.issuer |
| mobile | cn.gogenex.mobile | cn.gogenex.mobile |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 07:02:14 -08:00
hailin
4da8a373f2
refactor: 全项目清除MVP字样,统一为正式系统用语
...
## 变更范围:21个文件,覆盖全栈
### SRS需求文档 (4个文件,20处修改)
docs/券金融平台-软件需求规格.md (7处):
- "MVP策略" → "运营策略"/"合规策略"
- "MVP阶段GNX不上交易所" → "Phase 1阶段GNX不上交易所"
- "MVP同步" → "同步发布"
- "MVP阶段优先级" → "阶段优先级"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "基础发行与交易(MVP,仅Utility Track)" → "基础发行与交易(仅Utility Track)"
docs/券金融平台-需求规格综合评估报告.md (4处):
- "MVP分期" → "阶段分期"
- "MVP回避策略" → "合规回避策略"
- "MVP仅Utility Track" → "Phase 1仅Utility Track"
docs/闲券交易平台-架构开发需求.md (4处):
- "MVP阶段只开放" → "当前阶段只开放"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "基础平台(MVP,仅Utility Track)" → "基础平台(仅Utility Track)"
docs/闲券平台-软件开发需求.md (5处):
- "MVP阶段用户不接触" → "当前阶段用户不接触"
- "MVP策略" → "运营策略"
- "Phase 1(MVP)" → "Phase 1(基础平台)"
- "Phase 1 — MVP" → "Phase 1 — 基础平台"
### 后端服务代码 (7个文件,13处修改)
trading-service (Go):
- admin_trade_handler.go: 3处 "for MVP"/"In MVP" 注释清除
- admin_mm_handler.go: 2处 "In MVP"/"for MVP" 注释清除
chain-indexer (Go):
- admin_chain_handler.go: 1处 "for MVP" 注释清除
compliance-service (NestJS):
- admin-compliance.service.ts: 3处 "(mock for MVP)" 注释清除
issuer-service (NestJS):
- admin-issuer.service.ts: 1处 "For MVP" 注释清除
- admin-merchant.service.ts: 2处 "For MVP" 注释清除
notification-service (NestJS):
- event-consumer.service.ts: 1处 "In MVP" 注释清除
### 前端代码 (10个文件)
mobile (5个文件):
- i18n: en/zh_cn/zh_tw/ja 4语言 "MVP版本仅支持" → "当前仅支持"
- i18n key: proMode.mvpNote → proMode.trackNote
- pro_mode_page.dart: 更新key引用
genex-mobile (5个文件):
- 同mobile,4语言+1页面引用全部更新
### 验证结果
全项目grep (?i)\bMVP\b = 0 matches,彻底清除完毕
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 18:13:47 -08:00
hailin
5bc1cbe4d8
feat: 完成全量国际化(i18n),支持简中/繁中/英文/日文四语言
...
## 概述
实现 Genex Mobile 全量国际化支持,覆盖全部 UI 字符串。
支持语言:简体中文(zh_CN)、繁体中文(zh_TW)、英文(en)、日文(ja)。
共计 720+ 翻译键值对,涉及 51 个文件。
## 新增文件
- lib/app/i18n/strings/zh_cn.dart — 简体中文翻译(基础语言)
- lib/app/i18n/strings/zh_tw.dart — 繁体中文翻译
- lib/app/i18n/strings/en.dart — 英文翻译
- lib/app/i18n/strings/ja.dart — 日文翻译
- lib/app/i18n/locale_manager.dart — 全局语言/货币状态管理器
## i18n 基础架构
- AppLocalizations: 基于 Map<String, String> 的翻译查找
- AppLocalizationsDelegate: Flutter 本地化委托集成
- context.t('key') 扩展方法:便捷取用翻译文本
- 回退链:缺失 key → zh_CN → key 本身
- LocaleManager: ValueNotifier<Locale?> 响应式语言切换
- 货币绑定:根据 locale 自动匹配货币符号(CNY/TWD/USD/JPY)
## 页面级国际化(46 个文件)
### 认证模块 (auth)
- welcome_page, login_page, register_page, forgot_password_page
### 券模块 (coupons)
- home_page, market_page, search_page, coupon_detail_page
- my_coupons_page, my_coupon_detail_page, wallet_coupons_page
- order_confirm_page, payment_page, payment_success_page
- redeem_qr_page, receive_coupon_sheet
### 交易模块 (trading)
- trading_page, trading_detail_page, sell_order_page, transfer_page
### 钱包模块 (wallet)
- wallet_page, deposit_page, withdraw_page, transaction_records_page
### 用户模块 (profile)
- profile_page, settings_page, kyc_page
- payment_management_page, pro_mode_page
### 消息模块 (message)
- message_page, message_detail_page
### 商户模块 (merchant)
- merchant_home_page, merchant_ai_assistant_page
### 发行方模块 (issuer)
- issuer_main_page
### AI 模块 (ai_agent)
- agent_chat_page, ai_fab
### 公共组件 (shared/widgets)
- coupon_card, price_tag, status_tag, empty_state
- ai_confirm_dialog, kyc_badge
### 应用层 (app)
- main.dart (本地化委托/Locale解析配置)
- main_shell.dart, app_localizations.dart, pubspec.yaml
## 技术处理
- Widget getter → method(BuildContext): 需要 context 的属性转为方法
- const 默认参数 → nullable: 无法在 const 中使用 context.t(),改为可空参数在 build() 中解析
- Mock 数据保留中文:示例/演示数据将来自 API,无需国际化
- 语言选择器原生显示:中文/English/日本語 等按各语言原生名称展示
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 00:16:00 -08:00
hailin
b639e8c823
feat: 设置页面新增货币选择器和语言选择器
...
- 设置页面从StatelessWidget改为StatefulWidget
- 新增货币选择器bottom sheet,支持USD/CNY/EUR/GBP/JPY/HKD
- 新增语言选择器bottom sheet,支持简体中文/繁體中文/English/日本語
- 通知开关改为可交互状态
- 货币subtitle动态显示已选货币代码和符号
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 21:18:11 -08:00
hailin
b63414542b
feat: Create genex-mobile app with coupon lifecycle management redesign
...
基于 frontend/mobile 创建全新的 genex-mobile 应用,重新设计为券的生命周期管理平台。
## 底部导航重构 (5 tabs → 4 tabs)
- 首页 / 交易 / 消息 / 我的
- 移除独立的"我的券"Tab,功能合并到首页券钱包中
- "市场"重命名为"交易",图标改为行情图标
## 首页改造
### 券钱包(替代原Banner轮播区域)
- 紫色渐变卡片展示"我的钱包",含券数量统计(可使用/待核销/已过期)
- 水平滚动的券迷你卡片列表,支持Tab筛选(全部/可使用/待核销/已过期)
- 快捷操作栏:接收 / 转赠 / 出售 / 核销
- 接收功能:点击弹出底部Sheet,展示接收ID和接收二维码
- 对方可通过扫码或输入ID转赠券到钱包
- 接收ID支持一键复制
### 分类网格重新设计(从商品品类改为省钱机制)
- 原8个商品分类(餐饮/购物/娱乐/出行/生活/品牌/折扣/全部)
- 改为6个省钱导向分类:限时抢购 / 新券首发 / 折扣排行 / 即将到期 / 比价 / 全部分类
- 3列×2行布局,每个入口强调"怎么省"而非"卖什么"
### 其他区域保持不变
- AI智能推荐卡片
- 精选好券列表
- AI FAB浮动按钮
## 交易页(币安交易所风格)
### 一级市场(打新申购 / Launchpad风格)
- 券发行卡片:品牌信息 / 发行价 / 面值 / 折扣 / 发行量
- 销售进度条和百分比
- 状态标签:即将开始(含倒计时)/ 申购中 / 已结束
### 二级市场(交易所行情列表)
- 交易对分类Tab:券/法币 | 券/数字货币 | 券/稳定币 | 收藏
- 行情列表:交易对名称 / 最新价格 / 24h涨跌幅(红绿色块)
- 成交量和USD等价显示
- 支持的交易对示例:SBUX/USD, NIKE/BTC, AMZN/USDT 等
### 交易对详情页(K线 + 盘口 + 下单)
- 价格头部:当前价 / 24h涨跌 / OHLC数据(高/低/开盘/成交量)
- K线图(含模拟蜡烛图渲染 + 成交量柱状图)
- 时间周期选择器:1m / 5m / 15m / 1h / 4h / 1D / 1W
- 交易深度:买卖盘口(Bid/Ask)带深度条可视化
- 下单表单:买入/卖出切换 / 限价单/市价单 / 价格数量输入 / 比例快选(25%/50%/75%/100%)
- 当前委托和历史委托列表
- 底部买入/卖出快捷按钮
## 券详情页增强
- 新增"附近可用门店"区域(LBS定位功能入口)
- 展示附近门店列表:门店名 / 距离 / 营业状态
## 技术细节
- 保持原有设计系统:紫色主色调 #6C5CE7 / Material 3 / 亮色模式
- Flutter analyze 零错误通过
- 所有新增页面使用 mock 数据,便于后续接入真实API
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 17:57:16 -08:00