9445042cb4
- 系统设置窄屏改 hub 三组(门店/偏好/数据):门店信息/编号规则/默认仓库走 底部 sheet,主题外观接 showThemeSheet,?tab= 深链窄屏忽略;桌面 subnav 不动 - 用户管理窄屏:m-section + 头像卡片流 + 角色图标徽章 + FAB 新增; 点卡开详情 sheet(drow + 重置密码/启停/编辑),表单复用为 sheet 形态 - 设备管理窄屏:会话卡流(本机标注/在线图标徽章)+ 外设卡流(mc-foot 脚注), 「+ 添加设备」在区块标题行右侧(m-pill 选择 sheet),打印模板窄屏不渲染 - 关于我们窄屏:品牌 hero + hub 链接组 + 产品信息 drow 卡 + 时间线 pill 标签 + 意见反馈 sheet(类型 pill/描述/联系方式);授权信息不显示(已迁 /me/license) - golden:四屏窄屏基准独立成 *_mobile_golden_test.dart(390×844 @2x 三主题), 桌面 golden 零漂移 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
108 lines
3.5 KiB
Dart
108 lines
3.5 KiB
Dart
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/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/shell_harness.dart';
|
||
|
||
/// design-distill 阶段4:关于我们 golden × 三主题(回归闸 + 保真基准)。
|
||
/// Hero/产品信息/授权信息/更新日志 数据照抄原型 screens/about.html
|
||
/// (授权 2027-03-15 · CHANGELOG 4 条,默认 2 条展示):
|
||
/// node tools/fidelity.mjs about
|
||
/// 窄屏 hero+hub 形态另见 about_mobile_golden_test.dart。
|
||
/// 更新基准:flutter test --update-goldens test/golden/about_golden_test.dart
|
||
|
||
class _FakeLicense extends LicenseNotifier {
|
||
@override
|
||
Future<LicenseInfo?> build() async => LicenseInfo(
|
||
id: 1,
|
||
type: 'annual',
|
||
isActive: true,
|
||
maxDevices: 3,
|
||
phase: 'normal',
|
||
expiresAt: DateTime(2027, 3, 15),
|
||
);
|
||
}
|
||
|
||
// 原型 CHANGELOG(4 条;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() => [
|
||
licenseProvider.overrideWith(() => _FakeLicense()),
|
||
changelogProvider.overrideWith((ref) async => _changelog),
|
||
];
|
||
|
||
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);
|
||
|
||
// 桌面:外壳挂载整框
|
||
shellGoldenAcrossThemes(
|
||
'about 整框(桌面)',
|
||
path: '/about',
|
||
screen: (_) => const AboutScreen(),
|
||
goldenPrefix: 'about',
|
||
overrides: _overrides,
|
||
logical: const Size(1280, 900),
|
||
);
|
||
}
|