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 int visitCount;
final List<PhotoItem> photoList; final List<PhotoItem> photoList;
final bool isLive; // final bool isLive; //
final bool liveStreaming; //
final String? isLiveChannelId;
// UI展示 // UI展示
String get name => nickName; String get name => nickName;
String get avatar => profilePhoto.trim().replaceAll('`', ''); // URL中的反引号 String get avatar => profilePhoto.trim().replaceAll('`', ''); // URL中的反引号
@ -51,8 +53,10 @@ class MarriageData {
required this.genderCode, required this.genderCode,
required this.visitCount, required this.visitCount,
this.isLive = false, this.isLive = false,
this.liveStreaming = false,
this.isLiveChannelId = null,
}); });
factory MarriageData.fromJson(Map<String, dynamic> json) { factory MarriageData.fromJson(Map<String, dynamic> json) {
return MarriageData( return MarriageData(
miId: json['miId'] ?? '', miId: json['miId'] ?? '',
@ -75,6 +79,8 @@ class MarriageData {
visitCount: json['visitCount'] ?? 0, visitCount: json['visitCount'] ?? 0,
photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [], photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [],
isLive: json['isLive'] ?? json['liveStatus'] ?? false, // isLive或liveStatus字段 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, miId: photo.miId ?? 0,
)).toList(), )).toList(),
isLive: false, // UserInfoData转换时默认为false isLive: false, // UserInfoData转换时默认为false
liveStreaming: false, // UserInfoData转换时默认为false
isLiveChannelId: null, // UserInfoData转换时默认为false
); );
} }
} }

Loading…
Cancel
Save