fix(client): 退单按钮改红色实心样式,与原型一致突出危险操作

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YZ4DskSRKsSiheQonFtQvx
This commit is contained in:
wangjia
2026-06-21 22:51:40 +08:00
parent 51acee2705
commit 6c43800354
+22 -2
View File
@@ -35,16 +35,36 @@ List<Widget> buildOrderRowActions({
onPressed: onPressed,
child: Text(text, style: TextStyle(fontSize: 12, color: color)),
);
// 实心强调按钮(用于「退单」这类需突出的危险操作,与原型一致)。
Widget filledBtn(String text, Color color, VoidCallback onPressed, {Key? key}) =>
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: ElevatedButton(
key: key,
onPressed: onPressed,
style: ElevatedButton.styleFrom(
backgroundColor: color,
foregroundColor: Colors.white,
elevation: 0,
visualDensity: VisualDensity.compact,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
minimumSize: const Size(0, 30),
padding: const EdgeInsets.symmetric(horizontal: 12),
textStyle: const TextStyle(fontSize: 12, fontWeight: FontWeight.w500),
),
child: Text(text),
),
);
return [
btn('详情', AppTheme.primary, onDetail),
btn('打印', AppTheme.primary, onPrint),
...afterPrint,
if (!readonly && status == 'approved')
WriteGuard(child: btn('结清', AppTheme.accent, onSettle)),
// 退单(已审核单退货):error 样式,按权限显示
// 退单(已审核单退货):红色实心按钮突出(与原型一致),按权限显示
if (!readonly && status == 'approved' && canReturn)
WriteGuard(
child: btn('退单', AppTheme.danger, onReturn,
child: filledBtn('退单', AppTheme.danger, onReturn,
key: Key('btn_return_$orderId'))),
if (!readonly && status == 'draft') ...[
WriteGuard(child: btn('修改', AppTheme.primary, onEdit)),