feat(client): 入库列表 + 共享订单状态徽章设计语言重建

- StatusBadge → StatusPill(草稿/待审核/已审核/已拒绝 圆点软底,色走 token:
  infoSoft/warnBg/successBg/dangerBg)——入库/出库列表共享,一处升级两屏受益
- 入库列表副标「共 N 笔入库单」+ 详情弹窗斑马行/灰字 token 化(修暗色破绽)
- 整屏 golden ×三主题(桌面+移动)入回归闸

analyze 0 error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
wangjia
2026-06-25 13:29:56 +08:00
parent 7f92a51055
commit 99a2b533e6
9 changed files with 111 additions and 37 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@@ -0,0 +1,78 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:jiu_client/core/models/page_result.dart';
import 'package:jiu_client/core/auth/auth_state.dart';
import 'package:jiu_client/models/stock_in.dart';
import 'package:jiu_client/providers/stock_in_provider.dart';
import 'package:jiu_client/screens/stock_in/stock_in_list_screen.dart';
import '../support/golden_harness.dart';
/// design-distill 阶段4:入库列表整屏 golden × 三主题(桌面 + 移动)。
/// 重点验证 StatusBadge → StatusPill(草稿/待审核/已审核/已拒绝)随主题换色。
/// 更新基准:flutter test --update-goldens test/golden/stock_in_list_golden_test.dart
const _orders = [
StockInOrder(
id: 1, orderNo: 'RK-20260620-014', warehouseId: 1, warehouseName: '主仓',
partnerName: '贵州茅台经销', operatorName: '王经理', reviewerName: '张管理',
status: 'approved', orderDate: '2026-06-20', totalAmount: 34320),
StockInOrder(
id: 2, orderNo: 'RK-20260618-009', warehouseId: 1, warehouseName: '主仓',
partnerName: '宜宾五粮液', operatorName: '李销售',
status: 'pending', orderDate: '2026-06-18', totalAmount: 6700),
StockInOrder(
id: 3, orderNo: 'RK-20260615-003', warehouseId: 1, warehouseName: '二号仓',
partnerName: '泸州老窖', operatorName: '王经理',
status: 'draft', orderDate: '2026-06-15', totalAmount: 5000),
StockInOrder(
id: 4, orderNo: 'RK-20260612-001', warehouseId: 1, warehouseName: '主仓',
partnerName: '绵竹剑南春', operatorName: '李销售', reviewerName: '张管理',
status: 'rejected', orderDate: '2026-06-12', totalAmount: 3500),
];
class _FakeStockInNotifier extends StockInListNotifier {
@override
Future<PageResult<StockInOrder>> build() async =>
const PageResult(data: _orders, total: 4, page: 1, pageSize: 20);
@override
void setPage(int page) {}
@override
void setPageSize(int pageSize) {}
@override
void setStatus(String status) {}
@override
void setDateRange(String? startDate, String? endDate) {}
@override
void setKeyword(String keyword) {}
@override
void reload() {}
}
List<Override> _overrides() => [
stockInListProvider.overrideWith(() => _FakeStockInNotifier()),
isReadonlyProvider.overrideWithValue(false),
];
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
SharedPreferences.setMockInitialValues({});
goldenAcrossThemes(
'stock-in list 整屏(桌面)',
goldenPrefix: 'stock_in_list',
child: () => const Scaffold(body: StockInListScreen()),
overrides: _overrides,
logical: const Size(1280, 900),
);
goldenAcrossThemes(
'stock-in list 整屏(移动)',
goldenPrefix: 'stock_in_list_mobile',
child: () => const Scaffold(body: StockInListScreen()),
overrides: _overrides,
logical: const Size(390, 1300),
);
}