From 20fd31efed1541c1cf78a77527b22381eb7927ad Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 13 Jan 2026 16:34:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(discover):=20=E6=9B=B4=E6=96=B0=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E9=97=B4=E7=BB=84=E4=BB=B6=E6=98=BE=E7=A4=BA=E5=B9=B4?= =?UTF-8?q?=E9=BE=84=E4=BF=A1=E6=81=AF=E5=B9=B6=E7=A7=BB=E9=99=A4=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E4=B8=8D=E8=B6=B3=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在RtcChannelModel模型中添加age字段用于存储年龄信息 - 修改live_item_widget.dart中的UI逻辑,将频道名称和年龄信息合并显示 - 移除直播间控制器中的积分不足toast提示信息 - 优化直播间成员信息展示格式,支持年龄信息动态显示 --- lib/controller/discover/room_controller.dart | 1 - lib/model/discover/rtc_channel_model.dart | 3 +++ lib/pages/discover/live_item_widget.dart | 18 +----------------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/controller/discover/room_controller.dart b/lib/controller/discover/room_controller.dart index 0468175..717db64 100644 --- a/lib/controller/discover/room_controller.dart +++ b/lib/controller/discover/room_controller.dart @@ -272,7 +272,6 @@ class RoomController extends GetxController with WidgetsBindingObserver { return; } if (!response.data.data['success']) { - SmartDialog.showToast('积分不足'); return; } currentRole = role; diff --git a/lib/model/discover/rtc_channel_model.dart b/lib/model/discover/rtc_channel_model.dart index d90e79f..575e3d6 100644 --- a/lib/model/discover/rtc_channel_model.dart +++ b/lib/model/discover/rtc_channel_model.dart @@ -3,11 +3,13 @@ class RtcChannelModel { final String channelId; final String channelPic; final String channelName; + final int age; RtcChannelModel({ required this.channelId, required this.channelPic, required this.channelName, + required this.age, }); factory RtcChannelModel.fromJson(Map json) { @@ -15,6 +17,7 @@ class RtcChannelModel { channelId: json['channelId']?.toString() ?? '', channelPic: json['channelPic']?.toString() ?? '', channelName: json['channelName']?.toString() ?? '', + age: json['age'] ?? 0, ); } diff --git a/lib/pages/discover/live_item_widget.dart b/lib/pages/discover/live_item_widget.dart index 0038634..738f53f 100644 --- a/lib/pages/discover/live_item_widget.dart +++ b/lib/pages/discover/live_item_widget.dart @@ -187,27 +187,11 @@ class _LiveItemWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - width: 64.w, - child: Text( - widget.channel != null && widget.channel!.channelName.isNotEmpty - ? widget.channel!.channelName - : "一直一直在等你一直一直在等你......", - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 8.w, - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ), - SizedBox(height: 2.w), Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Text( - "福州 | 28岁", + widget.channel?.age != 0 && widget.channel?.age != null ? "${widget.channel?.channelName} | ${widget.channel?.age}岁" : widget.channel?.channelName ?? '', style: TextStyle( fontSize: 11.w, color: Colors.white,