feat: 入库单/商品详情展示产地保质期储存方式,商品详情显示建议零售价

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-08 07:57:10 +08:00
parent 1ec1d4209a
commit 4e64e5eb47
6 changed files with 87 additions and 3 deletions
+10
View File
@@ -18,6 +18,10 @@ class Product {
final String? remark;
final Map<String, dynamic>? customFields;
final List<ProductImage> images;
// 产地/保质期/储存方式名称(Detail 接口 Preload 后填充)
final String? originName;
final String? shelfLifeName;
final String? storageName;
const Product({
required this.id,
@@ -37,6 +41,9 @@ class Product {
this.remark,
this.customFields,
this.images = const [],
this.originName,
this.shelfLifeName,
this.storageName,
});
factory Product.fromJson(Map<String, dynamic> json) => Product(
@@ -68,6 +75,9 @@ class Product {
?.map((e) => ProductImage.fromJson(e as Map<String, dynamic>))
.toList() ??
[],
originName: (json['origin'] as Map<String, dynamic>?)?['name'] as String?,
shelfLifeName: (json['shelf_life'] as Map<String, dynamic>?)?['name'] as String?,
storageName: (json['storage'] as Map<String, dynamic>?)?['name'] as String?,
);
Map<String, dynamic> toJson() => {