feat(client): 基础数据加商品档案全量表 + 原型 5 tab 置前
非破坏式向原型靠拢: - 新增「商品档案」tab(productListProvider 全量商品表:商品 name+code/系列/规格/ 分类/单位/默认成本价/查看,行点进详情),原型头牌功能(此前基础数据页只管字典) - tab 重排:原型 5 个(商品档案/商品介绍/系列/规格/香型)置前;描述文档→商品介绍 - 保留 商品名称/产地/保质期/储存/仓库 字典 tab 在后(不删管理入口、不孤立数据) 整屏 golden ×三主题入回归闸。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TSKEiHsvauyxYUW2itzUXX
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,59 @@
|
||||
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/product.dart';
|
||||
import 'package:jiu_client/providers/product_provider.dart';
|
||||
import 'package:jiu_client/screens/products/products_screen.dart';
|
||||
|
||||
import '../support/golden_harness.dart';
|
||||
|
||||
/// design-distill 阶段4:基础数据「商品档案」全量商品表 golden × 三主题。
|
||||
/// 锁住原型头牌 tab(商品 name+code / 系列 / 规格 / 分类 / 单位 / 默认成本价)。
|
||||
/// 更新基准:flutter test --update-goldens test/golden/products_archive_golden_test.dart
|
||||
|
||||
const _products = [
|
||||
Product(
|
||||
id: 1, code: 'MT-FT-500', name: '茅台 飞天 53°', unit: '件',
|
||||
series: '飞天', spec: '500ml×6', categoryName: '酱香', purchasePrice: 2680),
|
||||
Product(
|
||||
id: 2, code: 'WLY-PW-500', name: '五粮液 普五 52°', unit: '件',
|
||||
series: '普五', spec: '500ml×6', categoryName: '浓香', purchasePrice: 1050),
|
||||
Product(
|
||||
id: 3, code: 'JNC-SJ-500', name: '剑南春 水晶剑', unit: '件',
|
||||
series: '水晶剑', spec: '500ml×6', categoryName: '浓香', purchasePrice: 438),
|
||||
];
|
||||
|
||||
class _FakeProductList extends ProductListNotifier {
|
||||
@override
|
||||
Future<PageResult<Product>> build() async =>
|
||||
const PageResult(data: _products, total: 3, page: 1, pageSize: 20);
|
||||
@override
|
||||
void setPage(int page) {}
|
||||
@override
|
||||
void setPageSize(int pageSize) {}
|
||||
@override
|
||||
void setKeyword(String keyword) {}
|
||||
@override
|
||||
void setCategoryId(int? categoryId) {}
|
||||
@override
|
||||
void reload() {}
|
||||
}
|
||||
|
||||
void main() {
|
||||
TestWidgetsFlutterBinding.ensureInitialized();
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
|
||||
goldenAcrossThemes(
|
||||
'products 商品档案 tab',
|
||||
goldenPrefix: 'products_archive',
|
||||
child: () => const Scaffold(body: ProductsScreen()),
|
||||
overrides: () => [
|
||||
productListProvider.overrideWith(() => _FakeProductList()),
|
||||
isReadonlyProvider.overrideWithValue(false),
|
||||
],
|
||||
logical: const Size(1280, 760),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user