Commit Graph

21 Commits

Author SHA1 Message Date
hailin 0c3ef3b598 fix(mobile): fix version check API and platform detection in both apps
genex-mobile/lib/core/updater/version_checker.dart
- platform 从写死 'android' 改为运行时检测 Platform.isIOS ? 'IOS' : 'ANDROID'

admin-app/lib/core/updater/version_checker.dart
- API 路径修正: /api/app/version/check → /api/v1/app/version/check
- 新增 app_type: 'ADMIN_APP'(原缺失,后端默认返回 GENEX_MOBILE 版本)
- platform 从写死 'android' 改为运行时检测
- 响应解析修正: 原逻辑把外层 {code,data} 当版本数据用,
  改为正确取 response.data['data'] 内层对象
- 新增 downloadUrl 相对路径修复(向下兼容旧记录)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 00:50:42 -08:00
hailin ce9cc5b72e feat(telemetry): 完整实现 presence-service 迁移 + Flutter 遥测接入
## 后端 (backend/services/telemetry-service)

### 修复骨架中的关键缺陷
- 创建本地 JwtAuthGuard / AdminGuard,替换不存在的 @genex/common 包
- 修复 req.user.sub → req.user.id(与 JwtStrategy.validate() 返回值对齐)
- 重写 Dockerfile,移除对不存在的 packages/common 目录的引用
- 更新 telemetry.module.ts,将 JwtAuthGuard / AdminGuard 注册为 providers
- admin-telemetry.controller.ts 改用本地 AdminGuard(检查 role === 'admin')

### 新增功能
- GET /api/v1/telemetry/config:公开配置下发接口
  Flutter TelemetryConfig.syncFromRemote() 每小时拉取,返回全局开关、采样率、
  心跳间隔等配置,所有字段支持环境变量覆盖(TELEMETRY_GLOBAL_ENABLED 等)
- 设备字段(deviceBrand/deviceModel/deviceOs/appVersion/locale)提升为顶层列
  BatchEventsDto / TelemetryEvent 实体 / recordEvents() 全链路补齐
  原因:JSONB 内字段无法走 B-tree 索引,千万级数据分组查询需独立列

### DB 迁移
- 050_add_device_fields_to_telemetry_events.sql:为已有 telemetry_events 表
  新增 5 个设备字段列和 device_brand / app_version 索引

### docker-compose 环境变量
- telemetry-service 新增 TELEMETRY_GLOBAL_ENABLED / SAMPLING_RATE /
  HEARTBEAT_INTERVAL / CONFIG_VERSION 环境变量,支持生产环境热调整

## 前端

### genex-mobile (Flutter 消费者端)
- 复制 lib/core/telemetry/ 模块(11个文件):TelemetryService、
  HeartbeatService、SessionManager、TelemetryUploader、TelemetryStorage 等
- 修正 API 路径:presence/heartbeat → telemetry/heartbeat,
  analytics/events → telemetry/events
- pubspec.yaml 新增依赖:uuid ^4.3.3、equatable ^2.0.5、device_info_plus ^10.1.0
- main.dart:initState 首帧回调初始化 TelemetryService(需 BuildContext 采集设备信息)
  已登录时自动注入 accessToken
- auth_service.dart:_setAuth() 登录成功后注入 userId + accessToken;
  _clearAuth() 退出时清除(同时覆盖 Token 过期自动清除场景)

### admin-app (Flutter 发行方控制台)
- 复制 lib/core/telemetry/ 模块(同上)
- pubspec.yaml 新增依赖:uuid、equatable、device_info_plus、shared_preferences
- IssuerLoginPage:initState 首帧初始化 + 登录成功后注入 userId/token
  使用 api.gogenex.cn(与 UpdateService 域名一致)
- settings_page.dart:退出登录时调用 clearUserId() + clearAccessToken()

## 架构说明
- 在线人数:Redis Sorted Set (genex:presence:online),心跳 60s/次,180s 窗口判定在线
- DAU:app_session_start 事件写入 telemetry_events,每天凌晨 1 点聚合到
  daily_active_stats 表,同时每小时滚动更新当日 DAU
- 设备字段采用 Amplitude 风格:前端本地队列存 properties 内,
  toServerJson() 上传时自动提升为顶层字段,后端写入独立索引列
- 心跳需要 JWT 认证(未登录用户自动跳过,不报错)
- 遥测完全异步,任何失败只打 debug 日志,不影响主流程

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 23:33:13 -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 3180114469 fix(admin-app): use correct desugar_jdk_libs artifact
Wrong: com.android.tools.build:desugaring-api:2.0.4
Correct: com.android.tools:desugar_jdk_libs:2.1.4 (matches genex-mobile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 23:34:59 -08:00
hailin 4a2e6182be fix(admin-app): enable core library desugaring for flutter_local_notifications
flutter_local_notifications requires coreLibraryDesugaringEnabled = true
and the desugaring-api dependency to build on Android.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 23:33:09 -08:00
hailin 89dbdb55b8 fix(admin-app): fix dynamic→int type errors in service files
- notification_service: cast total/unreadCount in NotificationListResponse,
  cast count in getUnreadCount/getAnnouncementUnreadCount (Future<int>)
- auth_service: fix unsafe (value ?? 300) as int → (value as int?) ?? 300

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 23:31:35 -08:00
hailin af5aba8efe fix(admin-app): fix 4 compile errors
- credit_page.dart: remove const from Padding containing context.t() call
- issuer_coupon_service/redemption_service/issuer_finance_service:
  cast inner['total'] to int? to match named record return type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-04 23:23:39 -08:00
hailin 0cd5c58ecb feat(android): APK versionCode 自动递增 — 每次编译自增,各环境独立计数
参考 rwadurian mobile-app 的 version.properties 方案,为 genex-mobile
和 admin-app 添加 build 时 versionCode 自动 +1 逻辑:

- build.gradle.kts: calculateNextVersionCode() 读取 version.properties,
  自增后写回;versionName 格式 "pubspec版本.buildNumber"(如 1.0.0.42)
- .gitignore: 排除 /android/app/version.properties,每个构建环境
  (本机、CI、服务器)各自维护独立计数器,互不干扰
- 首次编译从 1 开始,后续跨日期持续递增,保证 APK 版本始终唯一

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 09:09:13 -08:00
hailin 24400ad663 fix(admin-app): 消除UI层硬编码中文,补充i18n keys(zh/en/ja)
- 新增 29 个 i18n keys 到三语言文件(credit_score_unit, finance_confirm_withdraw,
  redemption_failed, store_no_stores, settings_confirm_logout, coupon_status_* 等)
- 修复 10 个页面中的硬编码中文字符串:
  credit_page: 分数单位、权重、空状态
  finance_page: 提现对话框、SnackBar、时间格式、空状态
  redemption_page: 错误消息、批量结果、空状态、时间格式
  store_management_page: 门店/员工空状态
  settings_page: 退出确认对话框、层级权益描述
  coupon_list_page: 状态徽章(在售/待审/售罄/下架)
  coupon_detail_page: 面值/发行价标签
  ai_agent_page: 错误回复消息
  issuer_dashboard_page: 信用分单位
- 剩余中文仅存于 /// 注释和 mock 数据数组中(将被真实API数据替换)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 23:29:10 -08:00
hailin e8d9bdc2fb fix(api): 修复前后端 API 对接 — 响应结构+字段名对齐
端到端审查发现并修复 4 类前后端不匹配问题:

## 1. 响应结构嵌套不匹配
后端返回 `{ data: { user, tokens: { accessToken, refreshToken } } }`
但 miniapp/admin-app/admin-web 均按扁平结构解析

- miniapp services/auth.ts: 新增 AuthResponse→LoginResult 映射层
- miniapp store/auth.ts: 从 `resp.tokens.accessToken` 取 token
- admin-app auth_service.dart: LoginResult.fromJson 优先从 tokens 子对象取
- admin-web auth-context.tsx: 从 `result.tokens.accessToken` 取 token

## 2. 密码登录字段名不匹配
后端 LoginDto 字段为 `identifier`, 但 admin-app 发 `email`, admin-web 发 `email`

- admin-app: `'email' → 'identifier'`
- admin-web: `{ email, password } → { identifier: email, password }`

## 3. 注册 password 字段必填 vs 前端可选
miniapp h5-register 只收集手机+验证码, 不传 password, 会触发 400 校验

- backend RegisterDto: password 改为 @IsOptional
- auth.service.ts: 未传 password 时自动生成随机密码

## 4. miniapp LoginResult 类型导出
- 导出 LoginResult 接口供外部使用

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 21:39:26 -08:00
hailin c29067eee7 feat(miniapp+admin-app): 同步 SMS 认证 API 变更
Phase 7 — Taro miniapp + admin-app 前端同步后端 SMS 认证系统:

miniapp (Taro/React):
- auth.ts: 新增 SmsCodeType 类型,sendSmsCode 支持 type 参数
  · 端点从 /auth/send-sms-code → /auth/sms/send
  · 新增 loginByPassword / resetPassword API
  · register 支持 password + nickname 可选参数
- store/auth.ts: sendSmsCode 同步 type 参数 + 新端点
- login/index.tsx: 发送验证码时指定 type='LOGIN'
- h5-register/index.tsx: 发送验证码时指定 type='REGISTER'
  · 修复注册后 token 存储使用 config.TOKEN_KEY 而非硬编码
- i18n: 3语言新增 7 key (login_code_sent, login_error_*,
  register_success, register_error_agree)

admin-app (Flutter):
- auth_service.dart: 新增 SmsCodeType 枚举
  · sendSmsCode 支持 type 参数,端点同步 /auth/sms/send
  · 返回 expiresIn (秒)
- issuer_login_page.dart: 发送验证码时指定 SmsCodeType.login
- i18n: 3语言新增 4 key (login_error_phone, login_error_code,
  login_error_network, login_code_sent)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:24:47 -08:00
hailin 2ff8b48e50 fix(branding): 统一Logo色调与App主色调 #6C5CE7
旧Logo用 #9B5CF6/#D946EF 紫粉渐变,与App主色 #6C5CE7 不一致。
现统一为 Left=#6C5CE7→#7B6DEE, Right=#9B8FFF→#B8ADFF。

- 更新源SVG (genex-icon/lockup) 渐变色
- 重新生成PNG并分发至全部5个前端应用
- 修正 welcome_page EX ShaderMask 渐变色
- 替换 miniapp share-card 硬编码旧色值

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:12:35 -08:00
hailin a92f00af25 feat(branding+fix): 中文品牌名、miniapp logo资源、编译错误修复
## 中文品牌名更新
- admin-app: 中文环境下 app_name → "企业券信",login_title/ai_welcome/settings_about 同步更新
- miniapp: 中文环境下 app_name → "券信",6处内联文本(share/activity/register/ai_chat等)同步更新
- genex-mobile: zh_cn + zh_tw 共12处 "Genex" → "券信"(login/register/aiChat/profile/aiFab)
- 英文/日文环境保持 "Genex" 不变

## miniapp logo 资源集成
- 新增 src/assets/images/ 目录:logo.png, logo_icon.png, logo_icon.svg, logo_full.svg
- login 页:CSS模拟logo(.logo-left/.logo-right) → <image src={logoIcon}>
- h5-share 页:💎 emoji → <img src={logoIcon}> (header + RegisterGuidePage)
- h5-activity 页:"G" 文字方块 → <image src={logoIcon}> (footer)
- h5-register 页:"G" 文字方块 → <image src={logoIcon}> (branding section)

## genex-mobile 编译错误修复
- wallet_coupons_page: EmptyState.noCoupons() + StatusTags.active/pending/expired/used() 添加 context 参数
- trading_page: StatusTags.onSale/completed/cancelled() 添加 context 参数
- message_page: EmptyState.noMessages() 添加 context 参数
- coupon_service: inner['total'] 添加 `as int?` 显式类型转换

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:57:30 -08:00
hailin 3a57b0fd4d feat: 全平台API对齐 — 4个前端应用55+页面接入真实后端API
跨越 genex-mobile、admin-app、admin-web、miniapp 四个前端应用,
将所有页面从 mock 硬编码数据替换为真实后端 API 调用,
同时补建后端缺失的 27+ 个端点,实现前后端完整联通。

## 后端新增 (4个微服务, 27+端点)

### issuer-service — 5个新Controller, 19个新文件
- IssuerStatsController: GET /issuers/me/stats, /credit (发行商仪表盘统计+信用)
- IssuerFinanceController: GET/POST balance/stats/transactions/withdraw/reconciliation
- IssuerStoreController: CRUD /issuers/me/stores + /employees (门店+员工管理)
- RedemptionController: POST scan/manual/batch, GET history/today-stats (核销)
- CouponBatchController: POST issue/recall/price-adjust, GET operations (批量操作)
- CouponController扩展: GET /search, /:id/nearby-stores, /:id/similar
- 新实体: Employee, Redemption; Store 增加 level/parentId
- 新迁移: 032_create_stores_employees_redemptions.sql

### trading-service (Go)
- GET /api/v1/trades/my/orders — 用户订单列表(分页+状态筛选)
- POST /api/v1/trades/coupons/:id/transfer — 券转赠

### user-service
- GET/PUT /api/v1/users/me/settings — 用户偏好设置(语言/货币/通知)

### auth-service
- POST /api/v1/auth/send-sms-code — 发送短信验证码(Redis存储, 5分钟TTL)
- POST /api/v1/auth/login-phone — 手机号+验证码登录(自动注册)

### Kong 路由
- 新增5条路由: issuers/me, redemptions, coupons/batch, trades/my, trades/coupons

## genex-mobile (Flutter, 2页)
- HomePage: 接入 CouponApiService.getFeaturedCoupons() + getHoldingsSummary()
- WalletCouponsPage: 接入持仓列表API, 支持Tab状态筛选
- 修复 NotificationService/PushService 7+2个路径缺少 /api/v1/ 前缀
- 新增 CouponApiService, CouponModel, HoldingsSummaryModel

## admin-app (Flutter发行商控制台, 11页 + router + i18n)
- 修复 NotificationService 7个路径 + PushService 2个路径前缀
- 新增9个Service: auth, issuer, coupon, finance, credit, store, redemption, analytics, ai_chat
- 11页全部从 StatelessWidget→StatefulWidget, mock→API:
  IssuerLoginPage(SMS登录), Dashboard(统计), CouponList(分页+筛选),
  CreateCoupon(提交审核), CouponDetail(详情), Redemption(扫码/手动/批量核销),
  Finance(余额/流水/对账), Credit(评分), StoreManagement(门店+员工),
  AiAgent(真实AI对话), Settings(资料+登出)
- 所有页面添加 loading/error/pull-to-refresh 状态

## admin-web (Next.js 15管理后台, 24页)
- 新建API基础设施: api-client.ts(axios), auth-context.tsx, use-api.ts(react-query)
- providers.tsx 接入 QueryClientProvider + AuthProvider
- 24页全部替换 useState(mockArray) 为 useApi<T>('/api/v1/admin/...'):
  Dashboard, Users, Issuers, Coupons, Trading, Risk, Finance, System,
  Compliance(SAR/SEC/License/SOX/Tax/IPO), Analytics(User/Coupon/MM/Consumer),
  Disputes, Chain, Reports, Merchant, Agent, Insurance
- 所有页面添加 TypeScript 接口, loading/error 状态, 'use client' 指令
- 状态比较改用原始API字符串(非t()翻译值)

## miniapp (Taro/React小程序, 20页)
- 新建API基础设施: config/index.ts, utils/request.ts(Taro.request封装), store/auth.ts
- 新增8个Service: auth, coupon, my-coupon, user, trading, wallet, notification, ai
- 20页全部替换硬编码数据为Service调用:
  Home, Search, Detail, Purchase, PaymentSuccess,
  MyCoupons, MyCouponDetail, Redeem, Transfer,
  Profile, Orders, Messages, Wallet, Settings, KYC, AIChat,
  Login, H5Share, H5Activity, H5Register
- 统一 useState+useEffect 数据获取模式, 错误处理, 加载状态

## 统计
- 新建文件: ~51个 (后端26 + 前端25)
- 修改文件: ~93个 (后端24 + 前端69)
- 新增后端端点: 27+
- 前端页面接入API: 55+ (genex-mobile 2 + admin-app 11 + admin-web 24 + miniapp 20)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 22:53:07 -08:00
hailin e44e052efa fix(branding): 重新生成全平台图标 — 基于更新后的Logo SVG v2
## 变更
- genex-icon.svg: viewBox 72→100, 去除圆角路径, 调整notch半径和形状尺寸
- genex-04.svg → genex-lockup.svg: 重命名, 缩放0.7x, viewBox 380→200

## 重新生成的资源 (80+ 文件)
- 3 Flutter apps × (5 Android mipmap + 15 iOS AppIcon + 3 LaunchImage + 2 assets)
- admin-web: favicon.ico/png, logo.png, logo_icon.png, icon-512.png, SVG源文件

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 08:00:19 -08:00
hailin 295ebcdac7 feat(branding): 全平台品牌Logo替换 — 新双色渐变券印标识
## 概述
将全平台(5个前端应用)的品牌Logo从旧版钻石图标统一替换为新设计的
双色渐变券印标识(紫色#9B5CF6 + 品红#D946EF),体现券金融平台定位。

## 新Logo资源
- logo/genex-icon.svg: 纯图标(72x72),用于App图标和favicon
- logo/genex-04.svg: 带品牌名(380x72),用于启动画面和品牌展示

## 替换范围

### Flutter Apps(genex-mobile / admin-app / mobile)
- Android: 5个密度mipmap ic_launcher.png (48~192px)
- iOS: 15个AppIcon尺寸 (20~1024px) + 3个LaunchImage尺寸
- assets/images/: 新增 logo.png(760x144) + logo_icon.png(192x192)
- pubspec.yaml: 新增 assets 声明
- welcome_page.dart: Icons.diamond_rounded → Image.asset('logo_icon.png')
- issuer_login_page.dart: Icons.storefront_rounded → Image.asset('logo_icon.png')
- issuer_dashboard_page.dart: 同上
- settings_page.dart: 同上

### admin-web(Next.js 15)
- public/: favicon.ico/png, logo.png, logo_icon.png, icon-512.png, SVG源文件
- layout.tsx: 更新metadata icons配置
- AdminLayout.tsx: 侧栏inline "G"文字 → <img src="/logo_icon.png">

### miniapp(Taro/React 小程序)
- login/index.tsx: "G"文字Logo → CSS双色分割旋转方块
- share-card/index.tsx: 同上 + 品牌色从#6C5CE7更新为#9B5CF6/#D946EF

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 04:07:46 -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 3cdb6a5eb9 feat: 全部前端项目完成国际化(i18n),支持中/英/日三语言
- miniapp (Taro/React): 11个页面/组件,~300翻译键
- admin-app (Flutter): 19个页面,475翻译键 (zh_CN/en_US/ja_JP)
- admin-web (Next.js): 25个视图+布局,2000+翻译键
- mobile (Flutter): 33+页面/组件,686翻译键 (zh_CN/zh_TW/en/ja)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 03:45:37 -08:00
hailin 5abb614d03 feat: Wire all navigation callbacks across mobile and admin-app
Replace empty onPressed/onTap placeholder callbacks with actual
Navigator route calls so all pages are navigable during testing.

Mobile (16 pages):
- Auth flow: welcome → login/register → main shell, forgot password
- Home: search bar → /search, coupon cards → /coupon/detail, AI FAB → /ai-chat
- Market: coupon cards → /coupon/detail
- Coupon detail: buy → /order/confirm
- Order confirm: payment auth → /payment
- Payment: confirm → /payment/success (fixed route typo)
- Payment success: buttons → /main (clear stack)
- My coupons: cards → /coupon/mine/detail
- My coupon detail: transfer → /transfer, sell → /sell
- Search: result cards → /coupon/detail
- Profile: KYC → /kyc, payment → /payment/manage, wallet → /wallet,
  trading → /trading, pro mode → /pro-mode, settings → /settings,
  logout → / (clear stack)
- Settings: KYC → /kyc, logout → / (clear stack)
- Wallet: deposit → /wallet/deposit, withdraw → /wallet/withdraw,
  records → /wallet/records
- Messages: items → /message/detail

Admin-app (13 pages):
- Dashboard: AI insight → createCoupon, credit suggestion → credit
- Coupon list: coupon cards → couponDetail, FAB → createCoupon
- Create coupon: save draft → pop back
- Settings: store mgmt, employee mgmt → storeManagement,
  AI assistant → aiAgent, tier upgrade → credit, logout → login
- Financing analysis: AI recommendation → aiAgent
- Onboarding: complete → main shell
- Login: register link → onboarding
- Fix: pass BuildContext to _buildTierCard in settings_page.dart

Both apps verified building successfully (flutter build apk --debug).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 06:54:22 -08:00
hailin 5f3e660b05 feat: Add Flutter build configuration for admin-app and mobile
- Initialize Android/iOS platform code for both Flutter apps
  - admin-app: cn.gogenex.issuer (Genex发行方)
  - mobile: cn.gogenex.consumer (Genex消费者端)
- Configure Android build.gradle.kts with:
  - Release signing config (keystore + key.properties)
  - Debug build type with .debug applicationId suffix
  - Release build type with ProGuard minification
  - minSdk 21, targetSdk from Flutter
- Fix Flutter 3.38 API compatibility:
  - CardTheme → CardThemeData
  - TabBarTheme → TabBarThemeData
  - DialogTheme → DialogThemeData
- Implement missing ForgotPasswordPage for mobile
- Create cross-platform build scripts (build.sh + build.bat)
  - Supports: debug/release/clean/run modes
  - Supports: apk/appbundle/ios platforms
  - Unified build-output/ directory for APK artifacts
- All 4 builds verified: debug + release × 2 apps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 06:22:13 -08:00
hailin e450bef7cd feat: Complete all 4 frontend UI prototypes covering guides 00-04
Add 116 UI prototype files across 4 frontend applications, achieving
~95% coverage of all functional requirements from development guides.

## mobile/ (Flutter Consumer + Merchant App) — 48 files
- Auth: welcome, login, register, forgot-password
- Coupons: home, market, search, detail, my-coupons, my-coupon-detail,
  order-confirm, payment, payment-success, redeem-qr
- Trading: trading, sell-order (AI pricing), transfer
- Wallet: wallet, deposit, withdraw, transaction-records
- Profile: profile, kyc (L0-L3), settings, payment-management, pro-mode
  (WalletConnect, chain address, tx hash, track selection)
- AI Agent: agent-chat, ai-fab (floating button with unread count)
- Merchant: merchant-home (scanner, confirm, success, history, dashboard),
  merchant-ai-assistant (redeem assist, traffic prediction, anomaly alerts)
- Message: message-list, message-detail
- Issuer: issuer-main-page
- Shared widgets: coupon-card, price-tag, credit-badge, kyc-badge,
  status-tag, empty-state, skeleton-loader, confirm-sheet, genex-button,
  ai-confirm-dialog (3-level risk confirmation)
- Theme: app-colors, app-typography, app-spacing, app-theme
- i18n: zh-CN, en-US, ja-JP

## admin-app/ (Flutter Issuer Console) — 27 files
- Auth: issuer-login
- Onboarding: 5-step enterprise onboarding with AI compliance check
- Dashboard: issuer-dashboard (stats, AI insight, credit/quota),
  user-portrait (age/geo/preference/repurchase/AI insight)
- Coupon management: list, create (template-based, AI pricing),
  detail (recall/delist), batch-operations (issue/recall/price-adjust)
- Redemption: scan-to-redeem with offline mode
- Finance: overview, reconciliation (auto-reconcile, export PDF/Excel),
  financing-analysis (cost-benefit, liquidity, risk indicators, AI strategy)
- Credit: credit-scoring (4-factor, tier progress, AI suggestions),
  quota-management (usage gauge, type breakdown, tier upgrade, increase requests)
- AI Agent: full conversation UI with quick actions
- Settings: account, notification, support, tier display
- Store management: hierarchy (HQ/regional/store), employee roles
- Shared: ai-suggestion-card
- Theme: app-colors, app-theme, app-typography, app-spacing
- i18n: zh-CN, en-US, ja-JP

## admin-web/ (React + Next.js Platform Admin) — 26 files
- Layout: AdminLayout with collapsible sidebar, 10 nav sections
- Dashboard: key metrics, transaction feed, system health
- Users: user management with KYC filtering, risk tags
- Issuers: issuer review with AI pre-screening, credit rating display
- Trading: real-time monitor, order book, abnormal detection
- Risk: risk dashboard, AI warnings, suspicious transactions, OFAC logs
- Compliance: SAR/CTR management, audit logs, AI report generation
- SEC Filing: S-1/10-K/10-Q/8-K tracker, filing timeline, auto-disclosure
- License management: FinCEN MSB, BitLicense, MTL (48 states), renewal alerts
- SOX compliance: ICFR/ITGC/access/change-mgmt controls, deficiency tracking
- Tax compliance: Federal + 4 states, 8 IRS forms, tax calendar
- IPO readiness: 28-item checklist (legal/financial/SOX/governance/insurance),
  blocker tracking, milestone timeline, category progress, key contacts
- Finance: fee revenue, settlement queue, breakage tracking
- Disputes: case management with SLA countdown, chain evidence
- Analytics: user (DAU/MAU, cohort retention, geographic), coupon (category,
  breakage, secondary market), market-maker (TVL, spread, health, risk alerts),
  consumer-protection (complaints, CSAT, fund utilization, non-compliant issuers)
- Insurance: consumer protection fund, claims, IPO checklist overview
- Chain monitor: smart contract status, blockchain metrics
- Reports: platform-wide report center
- AI Agent panel: session stats, top questions, module accuracy
- Merchant redemption: stats, store ranking, real-time feed
- Design tokens: CSS custom properties (colors, typography, spacing, shadows)
- i18n: zh-CN, en-US, ja-JP

## miniapp/ (Taro Mini Program + H5) — 15 files
- Pages: home, detail, purchase, orders, my-coupons, login, redeem, profile
- H5 pages: h5-share, h5-activity (countdown, featured coupons),
  h5-register (benefits, phone/SMS form, WeChat login)
- Components: coupon-card, ai-guide (recommendation bar + purchase bubble),
  share-card (brand header, QR code, coupon info)
- i18n: zh-CN, en-US, ja-JP

## Design System
- Primary: #6C5CE7 (innovation purple), Material 3 style
- Consistent design tokens across all platforms
- Zero blockchain terminology — "我的券" not "NFT", "订单号" not "TX Hash"
- Utility Track MVP only; Securities Track reserved as "coming soon"

## Not included (by design)
- Data/Domain layers (API, state management, business logic) — UI prototypes only
- Securities Track full UI — MVP focuses on Utility Track
- P2 "求购" (want-to-buy) feature — marked as optional

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 01:16:44 -08:00