Browse Source

增加im在线监测

dev-2.0
王子贤 1 month ago
parent
commit
0adbbcf887
1 changed files with 10 additions and 2 deletions
  1. 12
      lib/model/home/marriage_data.dart

12
lib/model/home/marriage_data.dart

@ -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
);
}
}

Loading…
Cancel
Save