feat(client): 商品详情页展示所有字段,补全分类/库存预警/备注/自定义字段/描述文档
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,10 +18,14 @@ class Product {
|
||||
final String? remark;
|
||||
final Map<String, dynamic>? customFields;
|
||||
final List<ProductImage> images;
|
||||
// 产地/保质期/储存方式名称(Detail 接口 Preload 后填充)
|
||||
// 产地/保质期/储存方式/分类名称(Detail 接口 Preload 后填充)
|
||||
final String? originName;
|
||||
final String? shelfLifeName;
|
||||
final String? storageName;
|
||||
final String? categoryName;
|
||||
// 描述文档(关联的字典记录)
|
||||
final String? descriptionDocTitle;
|
||||
final String? descriptionDocContent;
|
||||
|
||||
const Product({
|
||||
required this.id,
|
||||
@@ -44,6 +48,9 @@ class Product {
|
||||
this.originName,
|
||||
this.shelfLifeName,
|
||||
this.storageName,
|
||||
this.categoryName,
|
||||
this.descriptionDocTitle,
|
||||
this.descriptionDocContent,
|
||||
});
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||
@@ -78,6 +85,9 @@ class Product {
|
||||
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?,
|
||||
categoryName: (json['category'] as Map<String, dynamic>?)?['name'] as String?,
|
||||
descriptionDocTitle: (json['description_doc'] as Map<String, dynamic>?)?['title'] as String?,
|
||||
descriptionDocContent: (json['description_doc'] as Map<String, dynamic>?)?['content'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
||||
Reference in New Issue
Block a user