diff --git a/assets/images/broadcaster_empty.png b/assets/images/broadcaster_empty.png new file mode 100644 index 0000000..85d5895 Binary files /dev/null and b/assets/images/broadcaster_empty.png differ diff --git a/assets/images/female_empty.png b/assets/images/female_empty.png new file mode 100644 index 0000000..d732e8f Binary files /dev/null and b/assets/images/female_empty.png differ diff --git a/assets/images/male_empty.png b/assets/images/male_empty.png new file mode 100644 index 0000000..98357e8 Binary files /dev/null and b/assets/images/male_empty.png differ diff --git a/lib/controller/discover/discover_controller.dart b/lib/controller/discover/discover_controller.dart index da68c80..0ff7bb8 100644 --- a/lib/controller/discover/discover_controller.dart +++ b/lib/controller/discover/discover_controller.dart @@ -25,6 +25,9 @@ class DiscoverController extends GetxController { /// 获取 RTC 频道分页列表 Future loadRtcChannelPage() async { + if(isLoading.value){ + return; + } try { isLoading.value = true; final response = await _networkService.rtcApi.getRtcChannelPage(); diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index fc1fb2c..28561ce 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -80,6 +80,7 @@ class Assets { static const String imagesBankcardIcon = 'assets/images/bankcard_icon.png'; static const String imagesBgEditAvatars = 'assets/images/bg_edit_avatars.png'; static const String imagesBgInformation = 'assets/images/bg_information.png'; + static const String imagesBroadcasterEmpty = 'assets/images/broadcaster_empty.png'; static const String imagesBtnBgIcon = 'assets/images/btn_bg_icon.png'; static const String imagesCamera = 'assets/images/camera.png'; static const String imagesCert = 'assets/images/cert.png'; @@ -100,6 +101,7 @@ class Assets { static const String imagesEmoji = 'assets/images/emoji.png'; static const String imagesEmojiTab = 'assets/images/emoji_tab.png'; static const String imagesFemale = 'assets/images/female.png'; + static const String imagesFemaleEmpty = 'assets/images/female_empty.png'; static const String imagesFireIcon = 'assets/images/fire_icon.png'; static const String imagesFirstPay = 'assets/images/first_pay.png'; static const String imagesGift = 'assets/images/gift.png'; @@ -121,6 +123,7 @@ class Assets { static const String imagesLoginLogo = 'assets/images/login_logo.png'; static const String imagesMail = 'assets/images/mail.png'; static const String imagesMale = 'assets/images/male.png'; + static const String imagesMaleEmpty = 'assets/images/male_empty.png'; static const String imagesManIcon = 'assets/images/man_icon.png'; static const String imagesMessageNol = 'assets/images/message_nol.png'; static const String imagesMessagePre = 'assets/images/message_pre.png'; diff --git a/lib/pages/discover/dating_page.dart b/lib/pages/discover/dating_page.dart index 5a8cbb3..66dc723 100644 --- a/lib/pages/discover/dating_page.dart +++ b/lib/pages/discover/dating_page.dart @@ -114,13 +114,15 @@ class _DatingPageState extends State if (discoverController.rtcChannelList.isEmpty) { return Center( child: Text( - '暂无直播频道', + '暂无直播频道,点击刷新', style: TextStyle( fontSize: 14.w, color: Colors.black38, ), ), - ); + ).onTap((){ + discoverController.loadRtcChannelPage(); + }); } return EasyRefresh( controller: _refreshController, diff --git a/lib/pages/discover/live_room_page.dart b/lib/pages/discover/live_room_page.dart index ad6f922..bc5bba1 100644 --- a/lib/pages/discover/live_room_page.dart +++ b/lib/pages/discover/live_room_page.dart @@ -123,84 +123,90 @@ class _LiveRoomPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - body: Stack( - children: [ - Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Color.fromRGBO(248, 242, 255, 1), - Color.fromRGBO(247, 247, 247, 1), - ], + return PopScope( + onPopInvokedWithResult: (bool didPop, Object? result) async { + _overlayController.toggle(); + Get.back(); + }, + child: Scaffold( + body: Stack( + children: [ + Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Color.fromRGBO(248, 242, 255, 1), + Color.fromRGBO(247, 247, 247, 1), + ], + ), ), ), - ), - Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - Color.fromRGBO(19, 16, 47, 1), - Color.fromRGBO(19, 16, 47, 1), - ], + Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Color.fromRGBO(19, 16, 47, 1), + Color.fromRGBO(19, 16, 47, 1), + ], + ), ), ), - ), - Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), - child: Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - children: [ - SizedBox(height: 10.w), - Obx(() { - final detail = _roomController.rtcChannelDetail.value; - final anchorInfo = detail?.anchorInfo; - - final userName = anchorInfo!.nickName; - final avatarAsset = anchorInfo.profilePhoto; - const popularityText = '0'; // TODO: 使用真实数据 - - return LiveRoomUserHeader( - userName: userName, - popularityText: popularityText, - avatarAsset: avatarAsset, - onCloseTap: () { - Get.back(); - _overlayController.toggle(); - }, - ); - }), - SizedBox(height: 7.w), - LiveRoomAnchorShowcase(), - SizedBox(height: 5.w), - const LiveRoomActiveSpeaker(), - SizedBox(height: 9.w), - const LiveRoomNoticeChatPanel(), - SizedBox(height: 17.w), - ], + Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox(height: 10.w), + Obx(() { + final detail = _roomController.rtcChannelDetail.value; + final anchorInfo = detail?.anchorInfo; + + final userName = anchorInfo!.nickName; + final avatarAsset = anchorInfo.profilePhoto; + const popularityText = '0'; // TODO: 使用真实数据 + + return LiveRoomUserHeader( + userName: userName, + popularityText: popularityText, + avatarAsset: avatarAsset, + onCloseTap: () { + Get.back(); + _overlayController.toggle(); + }, + ); + }), + SizedBox(height: 7.w), + LiveRoomAnchorShowcase(), + SizedBox(height: 5.w), + const LiveRoomActiveSpeaker(), + SizedBox(height: 9.w), + const LiveRoomNoticeChatPanel(), + SizedBox(height: 17.w), + ], + ), ), ), - ), - LiveRoomActionBar( - messageController: _messageController, - onMessageChanged: (value) { - message = value; - }, - onSendTap: _sendMessage, - onGiftTap: _showGiftPopup, - onChargeTap: _showRechargePopup, - ), - ], + LiveRoomActionBar( + messageController: _messageController, + onMessageChanged: (value) { + message = value; + }, + onSendTap: _sendMessage, + onGiftTap: _showGiftPopup, + onChargeTap: _showRechargePopup, + ), + ], + ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 468459c..96450d9 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -9,6 +9,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:get/get_core/src/get_main.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class UserInformationPage extends StatelessWidget { final String miId; @@ -237,66 +238,6 @@ class UserInformationPage extends StatelessWidget { color: const Color.fromRGBO(144, 144, 144, 1) ), ), - Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: () { - // 跳转到聊天页面,传递用户ID和用户数据模型 - // Get.to(() => ChatPage( - // userId: userId, - // userData: controller.userData.value, - // )); - }, - child: Container( - width: 246.w, - height: 38.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(38.w)), - color: const Color.fromRGBO(51, 51, 51, 1) - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesChatBtn, - width: 13.w, - height: 12.w, - ), - SizedBox(width: 4.w,), - Text( - "发消息", - style: TextStyle( - fontSize: 15.w, - color: Colors.white, - fontWeight: FontWeight.w500 - ), - ) - ], - ), - ), - ), - Container( - width: 81.w, - height: 38.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(38.w)), - color: const Color.fromRGBO(117, 98, 249, 1) - ), - child: Center( - child: Text( - "关注", - style: TextStyle( - fontSize: 15.w, - color: Colors.white, - fontWeight: FontWeight.w500 - ), - ), - ), - ), - ], - ) ], ), ), @@ -414,6 +355,64 @@ class UserInformationPage extends StatelessWidget { ), ], ), + bottomNavigationBar: SafeArea( + child: SizedBox( + height: 48.h, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + TDButton( + text: '发消息', + width: 240.w, + size: TDButtonSize.medium, + type: TDButtonType.fill, + shape: TDButtonShape.round, + textStyle: TextStyle(fontSize: 14, color: Colors.white), + iconWidget: Image.asset( + Assets.imagesChatBtn, + width: 17.w, + height: 15.h + ), + style: TDButtonStyle( + textColor: Colors.white, + backgroundColor: Color(0xFF333333), + ), + activeStyle: TDButtonStyle( + textColor: Colors.white, + backgroundColor: Color(0xC3333333), + ), + onTap: (){ + // Get.to(() => ChatPage( + // userId: controller.userData.value.userId ?? "", + // userData: widget.userData, + // )); + }, + ), + const SizedBox(width: 10), + TDButton( + text: '关注', + width: 90, + size: TDButtonSize.medium, + type: TDButtonType.fill, + shape: TDButtonShape.round, + textStyle: TextStyle(fontSize: 14, color: Colors.white), + style: TDButtonStyle( + textColor: Colors.white, + backgroundColor: Color(0xFF7562F9), + ), + activeStyle: TDButtonStyle( + textColor: Colors.white, + backgroundColor: Color(0xC37562F9), + ), + onTap: (){ + // controller.tabIndex.value = 1; + }, + ) + ], + ), + ) + ), ) : SizedBox(); }, ); diff --git a/lib/pages/mine/user_help_center_page.dart b/lib/pages/mine/user_help_center_page.dart index e0e5cb8..07ac5cb 100644 --- a/lib/pages/mine/user_help_center_page.dart +++ b/lib/pages/mine/user_help_center_page.dart @@ -251,7 +251,7 @@ class _UserHelpCenterPageState extends State { bottomNavigationBar: SafeArea( child: SizedBox( - height: 40.w, + height: 40.h, child: Row( children: [ Expanded( diff --git a/lib/widget/live/live_room_anchor_showcase.dart b/lib/widget/live/live_room_anchor_showcase.dart index 6b4dbef..00acd48 100644 --- a/lib/widget/live/live_room_anchor_showcase.dart +++ b/lib/widget/live/live_room_anchor_showcase.dart @@ -130,7 +130,6 @@ class _LiveRoomAnchorShowcaseState extends State { if (_roomController.rtcChannelDetail.value?.anchorInfo == null || engine == null) { return _buildWaitingPlaceholder(); } - Get.log("buildAnchorVideo"); return ClipRRect( borderRadius: BorderRadius.all(Radius.circular(9.w)), child: SizedBox( @@ -165,16 +164,17 @@ class _LiveRoomAnchorShowcaseState extends State { height: 175.w, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(9.w)), - color: Colors.grey.withOpacity(0.5), ), - child: Center( - child: Text( - '等待主播', - style: TextStyle( - color: Colors.white.withOpacity(0.8), - fontSize: 12.w, - ), - ), + child: Stack( + children: [ + Image.asset(Assets.imagesBroadcasterEmpty), + Column( + children: [ + Image.asset(Assets.imagesWaitting), + Text('暂时离开', style: TextStyle(color: Colors.white,)) + ], + ) + ], ), ); } @@ -199,12 +199,7 @@ class _LiveRoomAnchorShowcaseState extends State { child: SizedBox( width: 177.w, height: 175.w, - child: - userInfo != null && - userInfo.uid != null && - joined && - engine != null - ? AgoraVideoView( + child: userInfo != null && userInfo.uid != null && joined && engine != null ? AgoraVideoView( controller: isCurrentUser ? VideoViewController( rtcEngine: engine, @@ -218,102 +213,87 @@ class _LiveRoomAnchorShowcaseState extends State { ), ), ) - : Container( - decoration: BoxDecoration( - borderRadius: isLeft - ? BorderRadius.horizontal(left: Radius.circular(18.w)) - : BorderRadius.horizontal( - right: Radius.circular(18.w), + : Stack( + children: [ + Image.asset(isLeft ? Assets.imagesMaleEmpty : Assets.imagesFemaleEmpty), + userInfo != null ? Positioned( + top: 5.w, + right: 5.w, + child: Container( + width: 20.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + ), + child: Center( + child: Image.asset( + Assets.imagesGiftIcon, + width: 19.w, + height: 19.w, + ), + ), + ), + ) : const SizedBox(), + userInfo != null ? Positioned( + bottom: 5.w, + right: 5.w, + child: Container( + width: 47.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: Colors.white, + ), + child: Center( + child: Text( + "加好友", + style: TextStyle( + fontSize: 11.w, + color: const Color.fromRGBO(117, 98, 249, 1), ), - color: const Color.fromRGBO(47, 10, 94, 1), - ), - child: Center( - child: Text( - '等待${isLeft ? "男" : "女"}嘉宾', - style: TextStyle( - color: Colors.white.withOpacity(0.8), - fontSize: 12.w, + ), ), ), - ), - ), - ), - ), - Positioned( - top: 5.w, - right: 5.w, - child: Container( - width: 20.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: const Color.fromRGBO(0, 0, 0, .3), - ), - child: Center( - child: Image.asset( - Assets.imagesGiftIcon, - width: 19.w, - height: 19.w, - ), - ), - ), - ), - Positioned( - bottom: 5.w, - right: 5.w, - child: Container( - width: 47.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: Colors.white, - ), - child: Center( - child: Text( - "加好友", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(117, 98, 249, 1), + ) : const SizedBox(), + if (userInfo != null) + Positioned( + left: 5.w, + bottom: 5.w, + child: Row( + children: [ + Container( + width: 20.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(4.w)), + color: const Color.fromRGBO(0, 0, 0, .65), + ), + child: Center( + child: Image.asset( + userInfo.isMicrophoneOn + ? Assets.imagesMicOpen + : Assets.imagesMicClose, + width: 10.w, + height: 11.w, + ), + ), + ), + SizedBox(width: 5.w), + Text( + userInfo.nickName, + style: TextStyle( + fontSize: 11.w, + color: Colors.white, + fontWeight: FontWeight.w500, + ), + ), + ], + ), + ), + ], ), - ), - ), ), ), - if (userInfo != null) - Positioned( - left: 5.w, - bottom: 5.w, - child: Row( - children: [ - Container( - width: 20.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(4.w)), - color: const Color.fromRGBO(0, 0, 0, .65), - ), - child: Center( - child: Image.asset( - userInfo.isMicrophoneOn - ? Assets.imagesMicOpen - : Assets.imagesMicClose, - width: 10.w, - height: 11.w, - ), - ), - ), - SizedBox(width: 5.w), - Text( - userInfo.nickName, - style: TextStyle( - fontSize: 11.w, - color: Colors.white, - fontWeight: FontWeight.w500, - ), - ), - ], - ), - ), ], ); }