feat(client): 登录/注册页照原型重建,ds 真相源组件族统一全部屏
- 登录/注册(login.html/register.html 1:1):两栏卡片+品牌渐变面板+主题小衣服 pill(onSurface 变体)+记住我(记录并预填最近账号)+原型式 toast 校验; 登录 fidelity 1.4–2.1% 三主题全绿;注册暂不入闸(少 门店编号/兑换券 字段, 已记 CONTRACT,screens.mjs 留存根) - ds 原子补齐:DsToast(.toast 单例)/DsCheck(.check/.agree)/DsButton lg 档/ DsSelect 替换全部旧 DropdownButton/DsField label 在上/DsInput 后缀与密码形态 - 全屏统一:对话框按钮全 DsButton、盒式输入主题钉死(visualDensity.standard、 h38、InputDecorationTheme 渗漏修复)、图标全 lucide、JetBrains Mono 三端同源、 BrandMark 真相源 logo、只读模式写操作全量守卫(WriteGuard+DsToast) - 出入库列表:版式对齐原型(卡片对齐+搜索框居中)、KPI 近30天滚动、结清后 失效财务应收应付表;商品编辑抽屉介绍库改搜索下拉、图片双击全屏预览 - 删除旧 UI 死代码:DataTableCard/FormDialog/PageScaffold/SearchChip/ SelectProductDialog/tabStateProvider - golden/fidelity:stock-in/out 补注册(9%)、login 入册(8%)、goldens 全量重打; 修复 pubspec flutter_web_plugins 非法声明(CI pub get 阻断) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJ1g8XV1YhhmHRzhwWEW7o
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import 'dart:async';
|
||||
|
||||
import '../core/utils/dialog_util.dart';
|
||||
@@ -5,6 +6,8 @@ import 'package:flutter/material.dart';
|
||||
import '../core/responsive/responsive.dart';
|
||||
import 'package:lpinyin/lpinyin.dart';
|
||||
import '../core/theme/context_tokens.dart';
|
||||
import 'ds/ds_atoms.dart';
|
||||
import 'ds/ds_toast.dart';
|
||||
|
||||
class OptionItem {
|
||||
final int id;
|
||||
@@ -106,10 +109,10 @@ class SearchableOptionField extends StatelessWidget {
|
||||
suffixIcon: selected
|
||||
? GestureDetector(
|
||||
onTap: () => onChanged(null),
|
||||
child: Icon(Icons.close,
|
||||
child: Icon(LucideIcons.x,
|
||||
size: 14, color: context.tokens.muted),
|
||||
)
|
||||
: Icon(Icons.arrow_drop_down,
|
||||
: Icon(LucideIcons.chevronDown,
|
||||
size: 16, color: context.tokens.muted),
|
||||
),
|
||||
isEmpty: !selected,
|
||||
@@ -117,7 +120,7 @@ class SearchableOptionField extends StatelessWidget {
|
||||
selected ? _displayText : hint,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: selected ? Colors.black87 : context.tokens.muted,
|
||||
color: selected ? context.tokens.text : context.tokens.muted,
|
||||
),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -190,18 +193,14 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
child: TextField(
|
||||
controller: nameCtrl,
|
||||
autofocus: true,
|
||||
decoration: const InputDecoration(labelText: '名称', isDense: true),
|
||||
decoration: const InputDecoration(hintText: '名称', isDense: true),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('确认新增'),
|
||||
),
|
||||
DsButton('取消', onPressed: () => Navigator.of(context).pop(false)),
|
||||
DsButton('确认新增',
|
||||
variant: DsBtnVariant.primary,
|
||||
onPressed: () => Navigator.of(context).pop(true)),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -216,16 +215,12 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
Navigator.of(context).pop(newId); // 回填并自动选中
|
||||
} else {
|
||||
setState(() => _creating = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('新增失败,请重试')),
|
||||
);
|
||||
showDsToast(context, '新增失败,请重试');
|
||||
}
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() => _creating = false);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('新增失败:$e')),
|
||||
);
|
||||
showDsToast(context, '新增失败:$e');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,7 +249,7 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
autofocus: true,
|
||||
decoration: InputDecoration(
|
||||
hintText: '搜索...',
|
||||
prefixIcon: const Icon(Icons.search, size: 18),
|
||||
prefixIcon: const Icon(LucideIcons.search, size: 18),
|
||||
suffixIcon: _searching
|
||||
? const Padding(
|
||||
padding: EdgeInsets.all(10),
|
||||
@@ -310,7 +305,7 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
height: 14,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
)
|
||||
: const Icon(Icons.add, size: 16),
|
||||
: const Icon(LucideIcons.plus, size: 16),
|
||||
label: Text('新增「$kw」到基础数据',
|
||||
style: const TextStyle(fontSize: 12)),
|
||||
),
|
||||
@@ -320,15 +315,8 @@ class _SearchDialogState extends State<_SearchDialog> {
|
||||
),
|
||||
actions: [
|
||||
if (widget.selectedId != null)
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(-1),
|
||||
child: Text('清除选择',
|
||||
style: TextStyle(color: context.tokens.muted)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(null),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
DsButton('清除选择', onPressed: () => Navigator.of(context).pop(-1)),
|
||||
DsButton('取消', onPressed: () => Navigator.of(context).pop(null)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user