diff --git a/lib/widget/live/live_room_anchor_showcase.dart b/lib/widget/live/live_room_anchor_showcase.dart index 8dd765c..74dc601 100644 --- a/lib/widget/live/live_room_anchor_showcase.dart +++ b/lib/widget/live/live_room_anchor_showcase.dart @@ -10,6 +10,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class LiveRoomAnchorShowcase extends StatefulWidget { const LiveRoomAnchorShowcase({super.key}); @@ -18,10 +19,18 @@ class LiveRoomAnchorShowcase extends StatefulWidget { State createState() => _LiveRoomAnchorShowcaseState(); } -class _LiveRoomAnchorShowcaseState extends State { +class _LiveRoomAnchorShowcaseState extends State with TickerProviderStateMixin { final RTCManager _rtcManager = RTCManager.instance; final RoomController _roomController = Get.find(); + TabController? _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + } + @override Widget build(BuildContext context) { return ValueListenableBuilder( @@ -384,8 +393,187 @@ class _LiveRoomAnchorShowcaseState extends State { _roomController.setDialogDismiss(false); }, builder: (context) { - return LiveRoomGuestListDialog( - initialTab: isMaleSeat ? 1 : 0, // 0: 女嘉宾, 1: 男嘉宾 + // return LiveRoomGuestListDialog( + // initialTab: isMaleSeat ? 1 : 0, // 0: 女嘉宾, 1: 男嘉宾 + // ); + return Material( + borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)), + child: Container( + height: 500.w, + padding: EdgeInsets.symmetric(vertical: 10.w), + child: Column( + children: [ + Container( + height: 42.w, + decoration: BoxDecoration( + ), + child: TDTabBar( + backgroundColor: Colors.transparent, + tabs: [ + TDTab(text: '房间内'), + TDTab(text: '上麦过'), + TDTab(text: '好友'), + ], + controller: _tabController, + showIndicator: true, + onTap: (int i) async { + + }, + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10.w), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.symmetric(vertical: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + Assets.imagesUserAvatar, + width: 40.w, + height: 40.w, + ), + SizedBox(width: 5.w,), + Column( + children: [ + Text( + "开心", + style: TextStyle( + fontSize: 12.w + ), + ), + Text( + "22岁", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(121, 121, 121, 1) + ), + ), + ], + ) + ], + ), + + Checkbox( + value: false, + onChanged: (value) { + + }, + activeColor: const Color.fromRGBO(117, 98, 249, 1), + side: const BorderSide(color: Colors.grey), + shape: const CircleBorder(), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + ], + ), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + Assets.imagesUserAvatar, + width: 40.w, + height: 40.w, + ), + SizedBox(width: 5.w,), + Column( + children: [ + Text( + "开心", + style: TextStyle( + fontSize: 12.w + ), + ), + Text( + "22岁", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(121, 121, 121, 1) + ), + ), + ], + ) + ], + ), + + Checkbox( + value: false, + onChanged: (value) { + + }, + activeColor: const Color.fromRGBO(117, 98, 249, 1), + side: const BorderSide(color: Colors.grey), + shape: const CircleBorder(), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + ], + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 170.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(237, 237, 237, 1) + ), + child: Center( + child: Text( + "取消", + style: TextStyle( + fontSize: 14.w, + fontWeight: FontWeight.w500 + ), + ), + ), + ), + Container( + width: 170.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(117, 98, 249, 1) + ), + child: Center( + child: Text( + "确认", + style: TextStyle( + fontSize: 14.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ) + ], + ) + ], + ), + ), ); }, ); diff --git a/lib/widget/live/live_room_user_header.dart b/lib/widget/live/live_room_user_header.dart index 6ef8a2d..199614a 100644 --- a/lib/widget/live/live_room_user_header.dart +++ b/lib/widget/live/live_room_user_header.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; /// 直播间顶部用户信息与操作区域 class LiveRoomUserHeader extends StatelessWidget { @@ -144,6 +145,205 @@ class LiveRoomUserHeader extends StatelessWidget { ), ), if (hasGuests) SizedBox(height: 15.w), + GestureDetector( + onTap: () async { + // 隐藏键盘 + FocusScope.of(context).unfocus(); + // 隐藏 overlay + SmartDialog.dismiss(); + roomController.setDialogDismiss(true); + + + SmartDialog.show( + alignment: Alignment.bottomCenter, + maskColor: TDTheme.of(context).fontGyColor2, + onDismiss: (){ + roomController.setDialogDismiss(false); + }, + + builder: (_) { + return Material( + borderRadius: BorderRadius.vertical(top: Radius.circular(9.w)), + color: Colors.white, + child: Container( + width: 375.w, + height: 300.w, + padding: EdgeInsets.all(10.w), + child: Column( + children: [ + Text( + "在麦用户", + style: TextStyle( + fontSize: 16.w, + fontWeight: FontWeight.w700 + ), + ), + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.symmetric(vertical: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + Assets.imagesUserAvatar, + width: 40.w, + height: 40.w, + ), + SizedBox(width: 5.w,), + Column( + children: [ + Text( + "开心", + style: TextStyle( + fontSize: 12.w + ), + ), + Text( + "22岁", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(121, 121, 121, 1) + ), + ), + ], + ) + ], + ), + + Checkbox( + value: false, + onChanged: (value) { + + }, + activeColor: const Color.fromRGBO(117, 98, 249, 1), + side: const BorderSide(color: Colors.grey), + shape: const CircleBorder(), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + ], + ), + ), + Container( + margin: EdgeInsets.symmetric(vertical: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Image.asset( + Assets.imagesUserAvatar, + width: 40.w, + height: 40.w, + ), + SizedBox(width: 5.w,), + Column( + children: [ + Text( + "开心", + style: TextStyle( + fontSize: 12.w + ), + ), + Text( + "22岁", + style: TextStyle( + fontSize: 12.w, + color: const Color.fromRGBO(121, 121, 121, 1) + ), + ), + ], + ) + ], + ), + + Checkbox( + value: false, + onChanged: (value) { + + }, + activeColor: const Color.fromRGBO(117, 98, 249, 1), + side: const BorderSide(color: Colors.grey), + shape: const CircleBorder(), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), + ], + ), + ), + ], + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: 170.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(237, 237, 237, 1) + ), + child: Center( + child: Text( + "取消", + style: TextStyle( + fontSize: 14.w, + fontWeight: FontWeight.w500 + ), + ), + ), + ), + Container( + width: 170.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(117, 98, 249, 1) + ), + child: Center( + child: Text( + "确认", + style: TextStyle( + fontSize: 14.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ) + ], + ) + ], + ), + ), + ); + }, + ); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + Assets.imagesExitRoom, + width: 15.w, + ), + SizedBox(width: 5.w), + Text( + '连麦管理', + style: TextStyle( + color: Colors.white, + fontSize: 13.sp, + ), + ), + ], + ), + ), + SizedBox(height: 15.w), GestureDetector( onTap: () async { await roomController.leaveChannel(); diff --git a/lib/widget/live/live_room_user_profile_dialog.dart b/lib/widget/live/live_room_user_profile_dialog.dart index f72d5b8..ff8afb3 100644 --- a/lib/widget/live/live_room_user_profile_dialog.dart +++ b/lib/widget/live/live_room_user_profile_dialog.dart @@ -1,3 +1,5 @@ +import 'package:dating_touchme_app/controller/discover/room_controller.dart'; +import 'package:dating_touchme_app/controller/overlay_controller.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/model/live/live_chat_message.dart'; import 'package:dating_touchme_app/pages/message/chat_page.dart'; @@ -12,6 +14,11 @@ void showUserProfileDialog( LiveChatMessage message, VoidCallback onShowGiftPopup, ) { + + + final roomController = Get.find(); + final overlayController = Get.find(); + final isHost = roomController.currentRole == CurrentRole.broadcaster; SmartDialog.show( alignment: Alignment.bottomCenter, builder: (context) { @@ -128,6 +135,16 @@ void showUserProfileDialog( SmartDialog.dismiss(); onShowGiftPopup(); }), + if(isHost) Container( + width: 1.w, + height: 12.w, + color: const Color.fromRGBO(229, 229, 229, 1), + margin: EdgeInsets.symmetric(horizontal: 15.w), + ), + if(isHost) _buildActionLink('邀请上麦', () { + SmartDialog.dismiss(); + onShowGiftPopup(); + }), ], ), ],