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:
@@ -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