feat: 入库单/商品详情展示产地保质期储存方式,商品详情显示建议零售价
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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() => {
|
||||
|
||||
@@ -12,6 +12,9 @@ class StockInItem {
|
||||
final String? productSeries;
|
||||
final String? productSpec;
|
||||
final String? productUnit;
|
||||
final String? productOrigin;
|
||||
final String? productShelfLife;
|
||||
final String? productStorage;
|
||||
|
||||
const StockInItem({
|
||||
this.orderId,
|
||||
@@ -26,6 +29,9 @@ class StockInItem {
|
||||
this.productSeries,
|
||||
this.productSpec,
|
||||
this.productUnit,
|
||||
this.productOrigin,
|
||||
this.productShelfLife,
|
||||
this.productStorage,
|
||||
});
|
||||
|
||||
factory StockInItem.fromJson(Map<String, dynamic> json) => StockInItem(
|
||||
@@ -43,6 +49,12 @@ class StockInItem {
|
||||
productSeries: (json['product'] as Map<String, dynamic>?)?['series'] as String?,
|
||||
productSpec: (json['product'] as Map<String, dynamic>?)?['spec'] as String?,
|
||||
productUnit: (json['product'] as Map<String, dynamic>?)?['unit'] as String?,
|
||||
productOrigin: ((json['product'] as Map<String, dynamic>?)?['origin']
|
||||
as Map<String, dynamic>?)?['name'] as String?,
|
||||
productShelfLife: ((json['product'] as Map<String, dynamic>?)?['shelf_life']
|
||||
as Map<String, dynamic>?)?['name'] as String?,
|
||||
productStorage: ((json['product'] as Map<String, dynamic>?)?['storage']
|
||||
as Map<String, dynamic>?)?['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
||||
Reference in New Issue
Block a user