diff --git a/lib/controller/message/chat_controller.dart b/lib/controller/message/chat_controller.dart index d9a20ed..0373cbc 100644 --- a/lib/controller/message/chat_controller.dart +++ b/lib/controller/message/chat_controller.dart @@ -1742,9 +1742,9 @@ class ChatController extends GetxController { requestData, ); - if (!response.data.isSuccess) { + if (response.data.isSuccess && !response.data.data['success']) { SmartDialog.showToast( - response.data.message.isNotEmpty ? response.data.message : '发送礼物失败', + response.data.data['code'] == 'E0002' ? '玫瑰不足请充值' : '发送礼物失败', ); return false; } diff --git a/lib/widget/message/call_item.dart b/lib/widget/message/call_item.dart index 5f93448..9aa5169 100644 --- a/lib/widget/message/call_item.dart +++ b/lib/widget/message/call_item.dart @@ -368,15 +368,8 @@ class CallItem extends StatelessWidget { ), ); } else if (status == MessageStatus.PROGRESS) { - // 发送中,显示加载动画 - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(Colors.grey), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { // 发送成功,不显示任何状态 return SizedBox.shrink(); diff --git a/lib/widget/message/chat_gift_popup.dart b/lib/widget/message/chat_gift_popup.dart index f000fea..a99bec8 100644 --- a/lib/widget/message/chat_gift_popup.dart +++ b/lib/widget/message/chat_gift_popup.dart @@ -146,45 +146,45 @@ class _ChatGiftPopupState extends State { ? MediaQuery.of(context).padding.bottom : 10.h, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - // 数量选择(暂时不实现,固定为1) - SizedBox(width: 1.w), - ValueListenableBuilder( - valueListenable: widget.giftNum, - builder: (context, num, _) { - return Row( - children: [ - GestureDetector( - onTap: () => _handleSendGift(), - child: Container( - width: 63.w, - height: 30.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(30.w)), - gradient: const LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - colors: [ - Color.fromRGBO(61, 138, 224, 1), - Color.fromRGBO(131, 89, 255, 1), - ], - ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // 数量选择(暂时不实现,固定为1) + SizedBox(width: 1.w), + ValueListenableBuilder( + valueListenable: widget.giftNum, + builder: (context, num, _) { + return Row( + children: [ + GestureDetector( + onTap: () => _handleSendGift(), + child: Container( + width: 63.w, + height: 30.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(30.w)), + gradient: const LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [ + Color.fromRGBO(61, 138, 224, 1), + Color.fromRGBO(131, 89, 255, 1), + ], ), - child: Center( - child: Text( - "赠送", - style: TextStyle(fontSize: 13.w, color: Colors.white), - ), + ), + child: Center( + child: Text( + "赠送", + style: TextStyle(fontSize: 13.w, color: Colors.white), ), ), ), - ], - ); - }, - ), - ], + ), + ], + ); + }, + ), + ], ), ), ); diff --git a/lib/widget/message/gift_item.dart b/lib/widget/message/gift_item.dart index 8c2590e..9a43b50 100644 --- a/lib/widget/message/gift_item.dart +++ b/lib/widget/message/gift_item.dart @@ -346,15 +346,8 @@ class GiftItem extends StatelessWidget { ), ); } else if (status == MessageStatus.PROGRESS) { - // 发送中,显示加载动画 - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(Colors.grey), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { // 发送成功,不显示任何状态 return SizedBox.shrink(); diff --git a/lib/widget/message/image_item.dart b/lib/widget/message/image_item.dart index f29ffd2..146882a 100644 --- a/lib/widget/message/image_item.dart +++ b/lib/widget/message/image_item.dart @@ -701,18 +701,8 @@ class _ImageItemState extends State { ), ); } else if (status == MessageStatus.PROGRESS) { - // 如果应该隐藏PROGRESS状态(已超时且有远程路径),不显示loading - if (_shouldHideProgressStatus) { - return SizedBox.shrink(); - } - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(Colors.grey), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { return SizedBox.shrink(); } diff --git a/lib/widget/message/room_item.dart b/lib/widget/message/room_item.dart index 7678e3d..cea6bbf 100644 --- a/lib/widget/message/room_item.dart +++ b/lib/widget/message/room_item.dart @@ -467,15 +467,8 @@ class RoomItem extends StatelessWidget { ), ); } else if (status == MessageStatus.PROGRESS) { - // 发送中,显示加载动画 - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(Colors.grey), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { // 发送成功,不显示任何状态 return SizedBox.shrink(); diff --git a/lib/widget/message/text_item.dart b/lib/widget/message/text_item.dart index fe303b6..78f0ad7 100644 --- a/lib/widget/message/text_item.dart +++ b/lib/widget/message/text_item.dart @@ -301,17 +301,8 @@ class TextItem extends StatelessWidget { ), ); } else if (status == MessageStatus.PROGRESS) { - // 发送中,显示加载动画 - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - Colors.grey, - ), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { // 发送成功,不显示任何状态 return SizedBox.shrink(); diff --git a/lib/widget/message/video_item.dart b/lib/widget/message/video_item.dart index ea3599e..62e365c 100644 --- a/lib/widget/message/video_item.dart +++ b/lib/widget/message/video_item.dart @@ -508,17 +508,8 @@ class _VideoItemState extends State { ), ); } else if (status == MessageStatus.PROGRESS) { - // 发送中,显示加载动画 - return Container( - width: 16.w, - height: 16.w, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation( - Colors.grey, - ), - ), - ); + // 发送中,不显示loading + return SizedBox.shrink(); } else { // 发送成功,不显示任何状态 return SizedBox.shrink();