|
|
|
@ -22,7 +22,9 @@ class MarriageData { |
|
|
|
final int visitCount; |
|
|
|
final List<PhotoItem> photoList; |
|
|
|
final bool isLive; // 是否为直播类型 |
|
|
|
|
|
|
|
final bool liveStreaming; // 是否为直播类型 |
|
|
|
final String? isLiveChannelId; |
|
|
|
|
|
|
|
// 为了兼容UI展示,添加一些计算属性 |
|
|
|
String get name => nickName; |
|
|
|
String get avatar => profilePhoto.trim().replaceAll('`', ''); // 移除照片URL中的反引号 |
|
|
|
@ -51,8 +53,10 @@ class MarriageData { |
|
|
|
required this.genderCode, |
|
|
|
required this.visitCount, |
|
|
|
this.isLive = false, |
|
|
|
this.liveStreaming = false, |
|
|
|
this.isLiveChannelId = null, |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
factory MarriageData.fromJson(Map<String, dynamic> json) { |
|
|
|
return MarriageData( |
|
|
|
miId: json['miId'] ?? '', |
|
|
|
@ -75,6 +79,8 @@ class MarriageData { |
|
|
|
visitCount: json['visitCount'] ?? 0, |
|
|
|
photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [], |
|
|
|
isLive: json['isLive'] ?? json['liveStatus'] ?? false, // 支持isLive或liveStatus字段 |
|
|
|
liveStreaming: json['liveStreaming'] ?? json['liveStreaming'] ?? false, // 支持isLive或liveStatus字段 |
|
|
|
isLiveChannelId: json['isLiveChannelId'], // 支持isLive或liveStatus字段 |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ -106,6 +112,8 @@ class MarriageData { |
|
|
|
miId: photo.miId ?? 0, |
|
|
|
)).toList(), |
|
|
|
isLive: false, // 从UserInfoData转换时默认为false |
|
|
|
liveStreaming: false, // 从UserInfoData转换时默认为false |
|
|
|
isLiveChannelId: null, // 从UserInfoData转换时默认为false |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|