Browse Source

优化用户详情页面,优化编辑信息

ios
王子贤 4 months ago
parent
commit
8372a633ec
10 changed files with 233 additions and 240 deletions
  1. BIN
      assets/images/broadcaster_empty.png
  2. BIN
      assets/images/female_empty.png
  3. BIN
      assets/images/male_empty.png
  4. 3
      lib/controller/discover/discover_controller.dart
  5. 3
      lib/generated/assets.dart
  6. 6
      lib/pages/discover/dating_page.dart
  7. 148
      lib/pages/discover/live_room_page.dart
  8. 119
      lib/pages/home/user_information_page.dart
  9. 2
      lib/pages/mine/user_help_center_page.dart
  10. 192
      lib/widget/live/live_room_anchor_showcase.dart

BIN
assets/images/broadcaster_empty.png

Before After
Width: 710  |  Height: 700  |  Size: 92 KiB

BIN
assets/images/female_empty.png

Before After
Width: 710  |  Height: 700  |  Size: 12 KiB

BIN
assets/images/male_empty.png

Before After
Width: 710  |  Height: 700  |  Size: 63 KiB

3
lib/controller/discover/discover_controller.dart

@ -25,6 +25,9 @@ class DiscoverController extends GetxController {
/// RTC /// RTC
Future<void> loadRtcChannelPage() async { Future<void> loadRtcChannelPage() async {
if(isLoading.value){
return;
}
try { try {
isLoading.value = true; isLoading.value = true;
final response = await _networkService.rtcApi.getRtcChannelPage(); final response = await _networkService.rtcApi.getRtcChannelPage();

3
lib/generated/assets.dart

@ -80,6 +80,7 @@ class Assets {
static const String imagesBankcardIcon = 'assets/images/bankcard_icon.png'; static const String imagesBankcardIcon = 'assets/images/bankcard_icon.png';
static const String imagesBgEditAvatars = 'assets/images/bg_edit_avatars.png'; static const String imagesBgEditAvatars = 'assets/images/bg_edit_avatars.png';
static const String imagesBgInformation = 'assets/images/bg_information.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 imagesBtnBgIcon = 'assets/images/btn_bg_icon.png';
static const String imagesCamera = 'assets/images/camera.png'; static const String imagesCamera = 'assets/images/camera.png';
static const String imagesCert = 'assets/images/cert.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 imagesEmoji = 'assets/images/emoji.png';
static const String imagesEmojiTab = 'assets/images/emoji_tab.png'; static const String imagesEmojiTab = 'assets/images/emoji_tab.png';
static const String imagesFemale = 'assets/images/female.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 imagesFireIcon = 'assets/images/fire_icon.png';
static const String imagesFirstPay = 'assets/images/first_pay.png'; static const String imagesFirstPay = 'assets/images/first_pay.png';
static const String imagesGift = 'assets/images/gift.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 imagesLoginLogo = 'assets/images/login_logo.png';
static const String imagesMail = 'assets/images/mail.png'; static const String imagesMail = 'assets/images/mail.png';
static const String imagesMale = 'assets/images/male.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 imagesManIcon = 'assets/images/man_icon.png';
static const String imagesMessageNol = 'assets/images/message_nol.png'; static const String imagesMessageNol = 'assets/images/message_nol.png';
static const String imagesMessagePre = 'assets/images/message_pre.png'; static const String imagesMessagePre = 'assets/images/message_pre.png';

6
lib/pages/discover/dating_page.dart

@ -114,13 +114,15 @@ class _DatingPageState extends State<DatingPage>
if (discoverController.rtcChannelList.isEmpty) { if (discoverController.rtcChannelList.isEmpty) {
return Center( return Center(
child: Text( child: Text(
'暂无直播频道',
'暂无直播频道,点击刷新',
style: TextStyle( style: TextStyle(
fontSize: 14.w, fontSize: 14.w,
color: Colors.black38, color: Colors.black38,
), ),
), ),
);
).onTap((){
discoverController.loadRtcChannelPage();
});
} }
return EasyRefresh( return EasyRefresh(
controller: _refreshController, controller: _refreshController,

148
lib/pages/discover/live_room_page.dart

@ -123,84 +123,90 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
@override @override
Widget build(BuildContext context) { 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,
),
],
),
), ),
),
],
],
),
), ),
); );
} }

119
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:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_core/src/get_main.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class UserInformationPage extends StatelessWidget { class UserInformationPage extends StatelessWidget {
final String miId; final String miId;
@ -237,66 +238,6 @@ class UserInformationPage extends StatelessWidget {
color: const Color.fromRGBO(144, 144, 144, 1) 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(); ) : SizedBox();
}, },
); );

2
lib/pages/mine/user_help_center_page.dart

@ -251,7 +251,7 @@ class _UserHelpCenterPageState extends State<UserHelpCenterPage> {
bottomNavigationBar: bottomNavigationBar:
SafeArea( SafeArea(
child: SizedBox( child: SizedBox(
height: 40.w,
height: 40.h,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(

192
lib/widget/live/live_room_anchor_showcase.dart

@ -130,7 +130,6 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
if (_roomController.rtcChannelDetail.value?.anchorInfo == null || engine == null) { if (_roomController.rtcChannelDetail.value?.anchorInfo == null || engine == null) {
return _buildWaitingPlaceholder(); return _buildWaitingPlaceholder();
} }
Get.log("buildAnchorVideo");
return ClipRRect( return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(9.w)), borderRadius: BorderRadius.all(Radius.circular(9.w)),
child: SizedBox( child: SizedBox(
@ -165,16 +164,17 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
height: 175.w, height: 175.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)), 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<LiveRoomAnchorShowcase> {
child: SizedBox( child: SizedBox(
width: 177.w, width: 177.w,
height: 175.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 controller: isCurrentUser
? VideoViewController( ? VideoViewController(
rtcEngine: engine, rtcEngine: engine,
@ -218,102 +213,87 @@ class _LiveRoomAnchorShowcaseState extends State<LiveRoomAnchorShowcase> {
), ),
), ),
) )
: 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,
),
),
],
),
),
], ],
); );
} }

Loading…
Cancel
Save