From d1cb2be6cf704cc8c1992f9256afed557b8aaf4b Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 13 Jan 2026 14:47:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor(chat):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 GestureDetector 移至 Column 外层以实现点击空白处收起键盘功能 - 调整消息列表区域的容器嵌套结构 - 重新组织组件层级以提升布局逻辑清晰度 --- lib/pages/message/chat_page.dart | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/pages/message/chat_page.dart b/lib/pages/message/chat_page.dart index c3e886b..d653424 100644 --- a/lib/pages/message/chat_page.dart +++ b/lib/pages/message/chat_page.dart @@ -305,18 +305,18 @@ class _ChatPageState extends State { }, ), ), - body: Column( - children: [ - // 消息列表区域 - Expanded( - child: Container( - color: Color(0xffF5F5F5), - child: GestureDetector( - onTap: () { - // 点击消息区域收起键盘 - FocusManager.instance.primaryFocus?.unfocus(); - }, - behavior: HitTestBehavior.opaque, + body: GestureDetector( + onTap: () { + // 点击空白处收起键盘 + FocusManager.instance.primaryFocus?.unfocus(); + }, + behavior: HitTestBehavior.opaque, + child: Column( + children: [ + // 消息列表区域 + Expanded( + child: Container( + color: Color(0xffF5F5F5), child: ListView.builder( controller: _scrollController, reverse: false, @@ -375,7 +375,6 @@ class _ChatPageState extends State { ), ), ), - ), // 使用抽离的聊天输入栏组件 ChatInputBar( onSendMessage: (message) async { @@ -404,6 +403,7 @@ class _ChatPageState extends State { }, ), ], + ), ), ), ); From 27f57ebb1c611d9b92b3872114a006ad459ce36e Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 13 Jan 2026 14:56:57 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat(chat):=20=E6=B7=BB=E5=8A=A0=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E8=BE=93=E5=85=A5=E6=A0=8F=E9=9D=A2=E6=9D=BF=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 ChatInputBar 中添加静态方法 closePanels 用于关闭面板 - 实现 closeAllPanels 方法供外部调用关闭所有面板 - 在 ChatPage 中添加 GlobalKey 用于引用 ChatInputBar - 点击空白区域时调用 ChatInputBar.closePanels 关闭底部面板 - 为 ChatInputBar 组件添加 key 属性以支持实例访问 --- lib/pages/message/chat_page.dart | 6 ++++++ lib/widget/message/chat_input_bar.dart | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/pages/message/chat_page.dart b/lib/pages/message/chat_page.dart index d653424..39d2eeb 100644 --- a/lib/pages/message/chat_page.dart +++ b/lib/pages/message/chat_page.dart @@ -62,6 +62,9 @@ class _ChatPageState extends State { // 礼物弹窗相关 final activeGift = ValueNotifier(null); final giftNum = ValueNotifier(1); + + // ChatInputBar 的 GlobalKey,用于关闭底部面板 + final GlobalKey> _chatInputBarKey = GlobalKey>(); @override void initState() { @@ -309,6 +312,8 @@ class _ChatPageState extends State { onTap: () { // 点击空白处收起键盘 FocusManager.instance.primaryFocus?.unfocus(); + // 关闭底部面板(表情、更多选项、语音输入) + ChatInputBar.closePanels(_chatInputBarKey); }, behavior: HitTestBehavior.opaque, child: Column( @@ -377,6 +382,7 @@ class _ChatPageState extends State { ), // 使用抽离的聊天输入栏组件 ChatInputBar( + key: _chatInputBarKey, onSendMessage: (message) async { await controller.sendMessage(message); }, diff --git a/lib/widget/message/chat_input_bar.dart b/lib/widget/message/chat_input_bar.dart index f761f96..f026941 100644 --- a/lib/widget/message/chat_input_bar.dart +++ b/lib/widget/message/chat_input_bar.dart @@ -31,6 +31,14 @@ class ChatInputBar extends StatefulWidget { @override State createState() => _ChatInputBarState(); + + // 静态方法:通过 key 关闭面板 + static void closePanels(GlobalKey? key) { + final state = key?.currentState; + if (state != null && state is _ChatInputBarState) { + state.closeAllPanels(); + } + } } class _ChatInputBarState extends State { @@ -109,6 +117,11 @@ class _ChatInputBarState extends State { } } + // 公开方法:从外部关闭所有面板 + void closeAllPanels() { + _closeAllPanels(); + } + @override void initState() { super.initState(); From f168658e8e7b16cf8bed7f1f31ea1b8e88152fdf Mon Sep 17 00:00:00 2001 From: Jolie <412895109@qq.com> Date: Tue, 13 Jan 2026 15:13:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?feat(video=5Fcall):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E9=80=9A=E8=AF=9D=E7=B1=BB=E5=9E=8B=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=B9=B6=E4=BC=98=E5=8C=96=E9=82=80=E8=AF=B7=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除不必要的 RTM 订阅操作 - 为 VideoCallInviteDialog 组件添加 callType 参数 - 在 RoseController 中添加 RoomController 余额刷新逻辑 - 为视频通话邀请弹窗添加日志记录功能 --- lib/controller/mine/rose_controller.dart | 11 +++++++++++ lib/im/im_manager.dart | 2 +- lib/widget/message/video_call_invite_dialog.dart | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/controller/mine/rose_controller.dart b/lib/controller/mine/rose_controller.dart index 12d21dc..984bc99 100644 --- a/lib/controller/mine/rose_controller.dart +++ b/lib/controller/mine/rose_controller.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:fluwx/fluwx.dart'; import 'package:get/get.dart'; +import '../discover/room_controller.dart'; class RoseController extends GetxController with WidgetsBindingObserver { @@ -96,6 +97,16 @@ class RoseController extends GetxController with WidgetsBindingObserver { launchWX.value = false; count.value = 0; getRoseNum(); + // 刷新 RoomController 的余额 + if (Get.isRegistered()) { + try { + final roomController = Get.find(); + await roomController.getVirtualAccount(); + print('✅ 已刷新 RoomController 的玫瑰余额'); + } catch (e) { + print('⚠️ 刷新 RoomController 余额失败: $e'); + } + } } else { count.value += 1; if(count.value < 3){ diff --git a/lib/im/im_manager.dart b/lib/im/im_manager.dart index ddac92d..5d9e24f 100644 --- a/lib/im/im_manager.dart +++ b/lib/im/im_manager.dart @@ -1902,7 +1902,6 @@ class IMManager { return; } - RTMManager.instance.subscribe(channelId ?? ''); // 获取用户信息 Map? attributes; try { @@ -1953,6 +1952,7 @@ class IMManager { tag: 'video_call_invite_dialog', builder: (context) { return VideoCallInviteDialog( + callType: callType, avatarUrl: finalAvatarUrl, nickName: finalNickName, onTap: () async { diff --git a/lib/widget/message/video_call_invite_dialog.dart b/lib/widget/message/video_call_invite_dialog.dart index f51c8f3..6e61459 100644 --- a/lib/widget/message/video_call_invite_dialog.dart +++ b/lib/widget/message/video_call_invite_dialog.dart @@ -2,6 +2,7 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; /// 视频通话邀请弹框 class VideoCallInviteDialog extends StatelessWidget { @@ -26,6 +27,7 @@ class VideoCallInviteDialog extends StatelessWidget { @override Widget build(BuildContext context) { + Get.log('VideoCallInviteDialog$callType'); return GestureDetector( onTap: onTap, child: Container( From a1ddf8ca2d53f1741a35ba00f65a274c22029c0a Mon Sep 17 00:00:00 2001 From: ZHR007 Date: Tue, 13 Jan 2026 15:44:56 +0800 Subject: [PATCH 4/5] no message --- lib/controller/message/call_controller.dart | 6 ++++++ lib/controller/setting/spread_controller.dart | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/controller/message/call_controller.dart b/lib/controller/message/call_controller.dart index c2c88b2..9fc8f32 100644 --- a/lib/controller/message/call_controller.dart +++ b/lib/controller/message/call_controller.dart @@ -57,6 +57,12 @@ class CallSession { final end = endTime ?? DateTime.now(); return end.difference(startTime).inSeconds; } + + @override + String toString() { + return '{callType: $callType, status: $status, isInitiator: $isInitiator}'; + } + } /// 通话相关控制器 diff --git a/lib/controller/setting/spread_controller.dart b/lib/controller/setting/spread_controller.dart index a915015..a02b00c 100644 --- a/lib/controller/setting/spread_controller.dart +++ b/lib/controller/setting/spread_controller.dart @@ -65,15 +65,15 @@ class SpreadController extends GetxController with WidgetsBindingObserver { ]; } else if(roseList[activePay.value].subCategory == 88802){ revenue.value = [ - {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, - {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, + {'icon': '1', 'desc': '礼物收益范围40%,嘉宾消费的分成10%;'}, + // {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, ]; } else if(roseList[activePay.value].subCategory == 88801){ revenue.value = [ - {'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'}, - {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, + {'icon': '1', 'desc': '礼物收益范围40%,嘉宾消费的分成10%;'}, + // {'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'}, {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, ]; 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 5/5] =?UTF-8?q?feat(discover):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E9=97=B4=E7=BB=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=B9=B4=E9=BE=84=E4=BF=A1=E6=81=AF=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E7=A7=AF=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,