feat(client): 登录/注册页照原型重建,ds 真相源组件族统一全部屏

- 登录/注册(login.html/register.html 1:1):两栏卡片+品牌渐变面板+主题小衣服
  pill(onSurface 变体)+记住我(记录并预填最近账号)+原型式 toast 校验;
  登录 fidelity 1.4–2.1% 三主题全绿;注册暂不入闸(少 门店编号/兑换券 字段,
  已记 CONTRACT,screens.mjs 留存根)
- ds 原子补齐:DsToast(.toast 单例)/DsCheck(.check/.agree)/DsButton lg 档/
  DsSelect 替换全部旧 DropdownButton/DsField label 在上/DsInput 后缀与密码形态
- 全屏统一:对话框按钮全 DsButton、盒式输入主题钉死(visualDensity.standard、
  h38、InputDecorationTheme 渗漏修复)、图标全 lucide、JetBrains Mono 三端同源、
  BrandMark 真相源 logo、只读模式写操作全量守卫(WriteGuard+DsToast)
- 出入库列表:版式对齐原型(卡片对齐+搜索框居中)、KPI 近30天滚动、结清后
  失效财务应收应付表;商品编辑抽屉介绍库改搜索下拉、图片双击全屏预览
- 删除旧 UI 死代码:DataTableCard/FormDialog/PageScaffold/SearchChip/
  SelectProductDialog/tabStateProvider
- golden/fidelity:stock-in/out 补注册(9%)、login 入册(8%)、goldens 全量重打;
  修复 pubspec flutter_web_plugins 非法声明(CI pub get 阻断)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
wangjia
2026-07-03 09:58:14 +08:00
parent ca7595b113
commit 6238b86dcb
286 changed files with 16831 additions and 11136 deletions
+87 -15
View File
@@ -1,44 +1,116 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:jiu_client/providers/update_provider.dart';
import 'package:jiu_client/core/utils/clock.dart';
import 'package:jiu_client/providers/changelog_provider.dart';
import 'package:jiu_client/providers/license_provider.dart';
import 'package:jiu_client/screens/about/about_screen.dart';
import '../support/golden_harness.dart';
import '../support/shell_harness.dart';
// 覆盖更新检查器,避免其后台 Timer 在 golden 结束后仍 pending
class _FakeUpdateNotifier extends UpdateNotifier {
/// design-distill 阶段4:关于我们 golden × 三主题(回归闸 + 保真基准)
/// Hero/产品信息/授权信息/更新日志 数据照抄原型 screens/about.html
/// (授权 2027-03-15 · CHANGELOG 4 条,默认 2 条展示):
/// node tools/fidelity.mjs about
/// 更新基准:flutter test --update-goldens test/golden/about_golden_test.dart
class _FakeLicense extends LicenseNotifier {
@override
Future<AppUpdateInfo?> build() async => null;
Future<LicenseInfo?> build() async => LicenseInfo(
id: 1,
type: 'annual',
isActive: true,
maxDevices: 3,
phase: 'normal',
expiresAt: DateTime(2027, 3, 15),
);
}
// 原型 CHANGELOG4 条;v1.0.60/63 属折叠区,默认只展示前 2 条)
const _changelog = [
ChangelogEntry(version: '1.0.72', date: '2026-06-22', sections: [
(
type: 'feat',
items: [
'用户管理新增四级角色:超级管理员 / 管理员 / 操作员 / 只读',
'商品公开页编辑器:图片、品鉴笔记、适饮建议可视化编辑并实时预览',
]
),
(
type: 'impr',
items: [
'顶栏 / 侧栏 / 状态栏统一为单一来源,全局一处生效',
'金额卡片改用「万」单位展示,更符合阅读习惯',
]
),
]),
ChangelogEntry(version: '1.0.66', date: '2026-06-18', sections: [
(
type: 'feat',
items: [
'入库 / 出库列表新增搜索框,支持单号、商品、往来单位关键字检索',
'入库 / 出库 / 库存页新增一键刷新',
]
),
(
type: 'fix',
items: [
'入库审核库存沿用明细真实快照名',
'库存列表过滤软删商品,修复历史导入占位顶替',
]
),
]),
ChangelogEntry(version: '1.0.63', date: '2026-06-05', sections: [
(
type: 'feat',
items: [
'新增设备管理:标签机 / 小票机 / 扫码枪 / 电子秤接入与测试打印',
'商品名搜索支持全拼与首字母',
]
),
]),
ChangelogEntry(version: '1.0.60', date: '2026-05-22', sections: [
(type: 'feat', items: ['往来单位对账单与应收应付明细抽屉']),
]),
];
List<Override> _overrides() => [
updateProvider.overrideWith(() => _FakeUpdateNotifier()),
appVersionProvider.overrideWith((ref) => 'v1.0.72'),
licenseProvider.overrideWith(() => _FakeLicense()),
changelogProvider.overrideWith((ref) async => _changelog),
];
/// design-distill 阶段4:关于我们整屏 golden × 三主题(桌面 + 移动)。
/// 该屏正文已全 token 化;golden 锁住版本/帮助/关于卡片随主题换色。
/// 版本/更新 provider 在测试环境降级为默认值(无插件/无网络)。
/// 更新基准:flutter test --update-goldens test/golden/about_golden_test.dart
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
SharedPreferences.setMockInitialValues({});
PackageInfo.setMockInitialValues(
appName: 'jiu',
packageName: 'com.yanmei.jiu',
version: '1.0.72',
buildNumber: '72',
buildSignature: '',
);
// 冻结授权剩余天数基准
appClock = () => DateTime(2026, 7, 13, 9, 30, 15);
goldenAcrossThemes(
'about 整屏(桌面)',
// 桌面:外壳挂载整框
shellGoldenAcrossThemes(
'about 整框(桌面)',
path: '/about',
screen: (_) => const AboutScreen(),
goldenPrefix: 'about',
child: () => const Scaffold(body: AboutScreen()),
overrides: _overrides,
logical: const Size(1280, 1000),
logical: const Size(1280, 900),
);
// 移动:窄屏单列
goldenAcrossThemes(
'about 整屏(移动)',
goldenPrefix: 'about_mobile',
child: () => const Scaffold(body: AboutScreen()),
overrides: _overrides,
logical: const Size(390, 1100),
logical: const Size(390, 1600),
);
}