From 0adbbcf887469dcf89e3603da0c208ae67ed1775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E8=B4=A4?= Date: Wed, 25 Feb 2026 18:25:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0im=E5=9C=A8=E7=BA=BF=E7=9B=91?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/model/home/marriage_data.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/model/home/marriage_data.dart b/lib/model/home/marriage_data.dart index ffd60cd..474a56f 100644 --- a/lib/model/home/marriage_data.dart +++ b/lib/model/home/marriage_data.dart @@ -22,7 +22,9 @@ class MarriageData { final int visitCount; final List 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 json) { return MarriageData( miId: json['miId'] ?? '', @@ -75,6 +79,8 @@ class MarriageData { visitCount: json['visitCount'] ?? 0, photoList: (json['photoList'] as List?)?.map((e) => PhotoItem.fromJson(e as Map)).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 ); } }