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:
@@ -8,6 +8,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import '../../core/responsive/responsive.dart';
|
||||
import '../../core/theme/context_tokens.dart';
|
||||
import '../../core/theme/app_dims.g.dart';
|
||||
import '../../models/stock_in.dart';
|
||||
import '../../providers/stock_in_provider.dart';
|
||||
import '../../repositories/stock_in_repository.dart';
|
||||
@@ -333,7 +334,20 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
||||
))
|
||||
.toList();
|
||||
|
||||
return DataTableCard(
|
||||
return Column(
|
||||
children: [
|
||||
// 副标(还原原型 .head .sub)
|
||||
Container(
|
||||
width: double.infinity,
|
||||
color: context.tokens.bg,
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
AppDims.sp3, AppDims.sp3, AppDims.sp3, 0),
|
||||
child: Text('共 $totalCount 笔入库单',
|
||||
style: TextStyle(
|
||||
fontSize: AppDims.fsSm, color: context.tokens.muted)),
|
||||
),
|
||||
Expanded(
|
||||
child: DataTableCard(
|
||||
totalCount: totalCount,
|
||||
page: page,
|
||||
pageSize: pageSize,
|
||||
@@ -512,6 +526,9 @@ class _StockInListScreenState extends ConsumerState<StockInListScreen> {
|
||||
columns: columns,
|
||||
rows: rows,
|
||||
mobileCards: orders.map((o) => _orderCard(context, o)).toList(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1228,8 +1245,9 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
|
||||
].join(' · ');
|
||||
return TableRow(
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
i.isEven ? Colors.white : const Color(0xFFFAFAFA)),
|
||||
color: i.isEven
|
||||
? context.tokens.surface
|
||||
: context.tokens.bg),
|
||||
children: [
|
||||
_TableCell('${i + 1}'),
|
||||
_TableCell(item.productCode ?? '-'),
|
||||
@@ -1244,9 +1262,9 @@ class _StockInDetailDialogState extends ConsumerState<_StockInDetailDialog> {
|
||||
style: const TextStyle(fontSize: 13)),
|
||||
if (attrs.isNotEmpty)
|
||||
Text(attrs,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Color(0xFF888888))),
|
||||
color: context.tokens.muted)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
import 'kpi_card.dart';
|
||||
|
||||
enum OrderStatus { draft, pending, approved, rejected }
|
||||
|
||||
@@ -24,37 +25,14 @@ class StatusBadge extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Color bg;
|
||||
final Color fg;
|
||||
switch (status) {
|
||||
case OrderStatus.draft:
|
||||
bg = const Color(0xFFF5F5F5);
|
||||
fg = context.tokens.muted;
|
||||
break;
|
||||
case OrderStatus.pending:
|
||||
bg = const Color(0xFFFFF3E0);
|
||||
fg = context.tokens.accent;
|
||||
break;
|
||||
case OrderStatus.approved:
|
||||
bg = const Color(0xFFE8F5E9);
|
||||
fg = context.tokens.success;
|
||||
break;
|
||||
case OrderStatus.rejected:
|
||||
bg = const Color(0xFFFFEBEE);
|
||||
fg = context.tokens.danger;
|
||||
break;
|
||||
}
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
|
||||
decoration: BoxDecoration(
|
||||
color: bg,
|
||||
borderRadius: BorderRadius.circular(3),
|
||||
),
|
||||
child: Text(
|
||||
status.label,
|
||||
style: TextStyle(
|
||||
color: fg, fontSize: 12, fontWeight: FontWeight.w500),
|
||||
),
|
||||
);
|
||||
final t = context.tokens;
|
||||
// 还原原型 .badge.b-*:圆点 + 软底,色全走 token。
|
||||
final (Color fg, Color bg) = switch (status) {
|
||||
OrderStatus.draft => (t.muted, t.infoSoft),
|
||||
OrderStatus.pending => (t.warn, t.warnBg),
|
||||
OrderStatus.approved => (t.success, t.successBg),
|
||||
OrderStatus.rejected => (t.danger, t.dangerBg),
|
||||
};
|
||||
return StatusPill(label: status.label, color: fg, background: bg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user