红包bug 修复
This commit is contained in:
parent
85e6d88472
commit
fec672dfb6
@ -502,7 +502,7 @@
|
|||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 11;
|
CURRENT_PROJECT_VERSION = 12;
|
||||||
DEVELOPMENT_TEAM = S9X2AJ2US9;
|
DEVELOPMENT_TEAM = S9X2AJ2US9;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -511,7 +511,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.3.0;
|
MARKETING_VERSION = 1.3.1;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -693,7 +693,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/RunnerDebug.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 11;
|
CURRENT_PROJECT_VERSION = 12;
|
||||||
DEVELOPMENT_TEAM = F33K8VUZ62;
|
DEVELOPMENT_TEAM = F33K8VUZ62;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -702,7 +702,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.3.0;
|
MARKETING_VERSION = 1.3.1;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
@ -722,7 +722,7 @@
|
|||||||
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 11;
|
CURRENT_PROJECT_VERSION = 12;
|
||||||
DEVELOPMENT_TEAM = F33K8VUZ62;
|
DEVELOPMENT_TEAM = F33K8VUZ62;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
@ -731,7 +731,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.3.0;
|
MARKETING_VERSION = 1.3.1;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
PRODUCT_BUNDLE_IDENTIFIER = com.org.yumiparty;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
|
|||||||
@ -52,6 +52,7 @@ class VoiceRoomPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _VoiceRoomPageState extends State<VoiceRoomPage>
|
class _VoiceRoomPageState extends State<VoiceRoomPage>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
|
static const int _chatTabCount = 3;
|
||||||
static const Duration _luckyGiftComboWindow = Duration(seconds: 3);
|
static const Duration _luckyGiftComboWindow = Duration(seconds: 3);
|
||||||
static const Duration _luckyGiftQueueDrainWindow = Duration(seconds: 3);
|
static const Duration _luckyGiftQueueDrainWindow = Duration(seconds: 3);
|
||||||
static const int _maxLuckyGiftTrackedAnimations = 5;
|
static const int _maxLuckyGiftTrackedAnimations = 5;
|
||||||
@ -65,7 +66,6 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
static const Duration _giftVisualBatchDedupeWindow = Duration(seconds: 4);
|
static const Duration _giftVisualBatchDedupeWindow = Duration(seconds: 4);
|
||||||
|
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
final List<Widget> _pages = [AllChatPage(), ChatPage(), GiftChatPage()];
|
|
||||||
late StreamSubscription _subscription;
|
late StreamSubscription _subscription;
|
||||||
final RoomGiftSeatFlightController _giftSeatFlightController =
|
final RoomGiftSeatFlightController _giftSeatFlightController =
|
||||||
RoomGiftSeatFlightController();
|
RoomGiftSeatFlightController();
|
||||||
@ -80,7 +80,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_tabController = TabController(length: _pages.length, vsync: this);
|
_tabController = TabController(length: _chatTabCount, vsync: this);
|
||||||
_enableRoomVisualEffects();
|
_enableRoomVisualEffects();
|
||||||
_tabController.addListener(_handleTabChange);
|
_tabController.addListener(_handleTabChange);
|
||||||
_subscription = eventBus.on<SCGiveRoomLuckPageDisposeEvent>().listen((
|
_subscription = eventBus.on<SCGiveRoomLuckPageDisposeEvent>().listen((
|
||||||
@ -277,6 +277,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final chatRoomKey = _chatRoomKey(context);
|
||||||
return PopScope(
|
return PopScope(
|
||||||
canPop: false,
|
canPop: false,
|
||||||
onPopInvokedWithResult: (bool didPop, Object? result) {
|
onPopInvokedWithResult: (bool didPop, Object? result) {
|
||||||
@ -334,7 +335,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
_buildChatView(),
|
_buildChatView(chatRoomKey),
|
||||||
const RoomBottomWidget(showGiftComboButton: false),
|
const RoomBottomWidget(showGiftComboButton: false),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -373,7 +374,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
///消息
|
///消息
|
||||||
Widget _buildChatView() {
|
Widget _buildChatView(String chatRoomKey) {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
alignment: AlignmentDirectional.bottomEnd,
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
@ -418,7 +419,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
SCGlobalConfig.businessLogicStrategy
|
SCGlobalConfig.businessLogicStrategy
|
||||||
.getVoiceRoomTabDividerColor(),
|
.getVoiceRoomTabDividerColor(),
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
tabs: List<Widget>.generate(_pages.length, _buildImageTab),
|
tabs: List<Widget>.generate(_chatTabCount, _buildImageTab),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -436,7 +437,7 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
removeTop: true,
|
removeTop: true,
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
controller: _tabController,
|
controller: _tabController,
|
||||||
children: _pages,
|
children: _buildChatPages(chatRoomKey),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -449,6 +450,28 @@ class _VoiceRoomPageState extends State<VoiceRoomPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _chatRoomKey(BuildContext context) {
|
||||||
|
final roomProfile =
|
||||||
|
context.read<RtcProvider>().currenRoom?.roomProfile?.roomProfile;
|
||||||
|
final roomId = roomProfile?.id?.trim() ?? "";
|
||||||
|
final groupId = roomProfile?.roomAccount?.trim() ?? "";
|
||||||
|
return "$roomId|$groupId";
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Widget> _buildChatPages(String chatRoomKey) {
|
||||||
|
return <Widget>[
|
||||||
|
KeyedSubtree(
|
||||||
|
key: ValueKey("all_chat_$chatRoomKey"),
|
||||||
|
child: const AllChatPage(),
|
||||||
|
),
|
||||||
|
KeyedSubtree(key: ValueKey("chat_$chatRoomKey"), child: ChatPage()),
|
||||||
|
KeyedSubtree(
|
||||||
|
key: ValueKey("gift_chat_$chatRoomKey"),
|
||||||
|
child: const GiftChatPage(),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildImageTab(int index) {
|
Widget _buildImageTab(int index) {
|
||||||
return Tab(
|
return Tab(
|
||||||
height: 32.w,
|
height: 32.w,
|
||||||
|
|||||||
@ -1048,6 +1048,9 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
lastMsgID: null,
|
lastMsgID: null,
|
||||||
);
|
);
|
||||||
final messages = result.data ?? const <V2TimMessage>[];
|
final messages = result.data ?? const <V2TimMessage>[];
|
||||||
|
if (!_isCurrentVoiceRoomGroup(normalizedGroupId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (final message in messages.reversed) {
|
for (final message in messages.reversed) {
|
||||||
_addRoomHistoryMessage(normalizedGroupId, message);
|
_addRoomHistoryMessage(normalizedGroupId, message);
|
||||||
}
|
}
|
||||||
@ -1722,6 +1725,11 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _isCurrentVoiceRoomGroup(String groupId) {
|
||||||
|
final currentGroupId = _currentVoiceRoomGroupId();
|
||||||
|
return currentGroupId.isNotEmpty && currentGroupId == groupId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
bool _shouldRouteUntrackedRoomRedPacketBroadcast(
|
bool _shouldRouteUntrackedRoomRedPacketBroadcast(
|
||||||
String groupId,
|
String groupId,
|
||||||
V2TimMessage message,
|
V2TimMessage message,
|
||||||
@ -1956,8 +1964,11 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
///红包触发飘屏
|
///红包触发飘屏
|
||||||
var fData = data["data"];
|
var fData = data["data"];
|
||||||
final payload = _broadcastPayloadMap(fData);
|
final payload = _broadcastPayloadMap(fData);
|
||||||
final packetId = _payloadText(payload['packetId']);
|
|
||||||
final packetRoomId = _payloadText(payload["roomId"]);
|
final packetRoomId = _payloadText(payload["roomId"]);
|
||||||
|
if (isRegionBroadcastGroup &&
|
||||||
|
!_isDelayedRoomRedPacketPayload(fData)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!_isSameRoomRedPacketRegion(fData)) {
|
if (!_isSameRoomRedPacketRegion(fData)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2554,6 +2565,7 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
Future<void> sendRoomRedPacketBroadcast(
|
Future<void> sendRoomRedPacketBroadcast(
|
||||||
Map<String, dynamic> payload, {
|
Map<String, dynamic> payload, {
|
||||||
String roomGroupId = '',
|
String roomGroupId = '',
|
||||||
|
bool includeRegionBroadcast = false,
|
||||||
}) async {
|
}) async {
|
||||||
if (payload.isEmpty) {
|
if (payload.isEmpty) {
|
||||||
return;
|
return;
|
||||||
@ -2564,13 +2576,15 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
targetGroupIds.add(normalizedRoomGroupId);
|
targetGroupIds.add(normalizedRoomGroupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
var regionGroupId = roomRedPacketBroadcastGroupId?.trim() ?? '';
|
if (includeRegionBroadcast) {
|
||||||
if (regionGroupId.isEmpty) {
|
var regionGroupId = roomRedPacketBroadcastGroupId?.trim() ?? '';
|
||||||
await syncRoomRedPacketBroadcastGroup();
|
if (regionGroupId.isEmpty) {
|
||||||
regionGroupId = roomRedPacketBroadcastGroupId?.trim() ?? '';
|
await syncRoomRedPacketBroadcastGroup();
|
||||||
}
|
regionGroupId = roomRedPacketBroadcastGroupId?.trim() ?? '';
|
||||||
if (regionGroupId.isNotEmpty) {
|
}
|
||||||
targetGroupIds.add(regionGroupId);
|
if (regionGroupId.isNotEmpty) {
|
||||||
|
targetGroupIds.add(regionGroupId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetGroupIds.isEmpty) {
|
if (targetGroupIds.isEmpty) {
|
||||||
@ -2620,6 +2634,18 @@ class RealTimeMessagingManager extends ChangeNotifier {
|
|||||||
return _isSameRegionBroadcastPayload(payload);
|
return _isSameRegionBroadcastPayload(payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool _isDelayedRoomRedPacketPayload(dynamic payload) {
|
||||||
|
final map = _broadcastPayloadMap(payload);
|
||||||
|
final packetMode = _payloadText(map['packetMode']).toUpperCase();
|
||||||
|
if (packetMode == 'DELAYED') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (packetMode == 'IMMEDIATE') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return _payloadText(map['claimStartTime']).isNotEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
bool _isSameRegionBroadcastPayload(dynamic payload) {
|
bool _isSameRegionBroadcastPayload(dynamic payload) {
|
||||||
final map = _broadcastPayloadMap(payload);
|
final map = _broadcastPayloadMap(payload);
|
||||||
final packetRegion = map['regionCode']?.toString().trim();
|
final packetRegion = map['regionCode']?.toString().trim();
|
||||||
|
|||||||
@ -584,6 +584,9 @@ class OverlayManager {
|
|||||||
if (message.isRegionBroadcast) {
|
if (message.isRegionBroadcast) {
|
||||||
return _shouldDisplayRegionBroadcastMessage(context, message);
|
return _shouldDisplayRegionBroadcastMessage(context, message);
|
||||||
}
|
}
|
||||||
|
if (message.type == 4) {
|
||||||
|
return _isCurrentRoomFloatingMessage(context, message);
|
||||||
|
}
|
||||||
if (SCGlobalConfig.isFloatingBroadcastRoomOnly) {
|
if (SCGlobalConfig.isFloatingBroadcastRoomOnly) {
|
||||||
return _isCurrentRoomFloatingMessage(context, message);
|
return _isCurrentRoomFloatingMessage(context, message);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -664,7 +664,8 @@ class _RoomRedPacketSendPanelState extends State<RoomRedPacketSendPanel> {
|
|||||||
currentUser?.userNickname ?? result.userName ?? 'Lucky Pack';
|
currentUser?.userNickname ?? result.userName ?? 'Lucky Pack';
|
||||||
final senderAvatar = currentUser?.userAvatar ?? result.userAvatar ?? '';
|
final senderAvatar = currentUser?.userAvatar ?? result.userAvatar ?? '';
|
||||||
final claimStartTime = (result.claimStartTime ?? '').trim();
|
final claimStartTime = (result.claimStartTime ?? '').trim();
|
||||||
if (_isDelayedRedPacketResult(result) && claimStartTime.isEmpty) {
|
final isDelayedPacket = _isDelayedRedPacketResult(result);
|
||||||
|
if (isDelayedPacket && claimStartTime.isEmpty) {
|
||||||
debugPrint(
|
debugPrint(
|
||||||
'[RoomRedPacket][SendFallback] skip delayed local UI because server '
|
'[RoomRedPacket][SendFallback] skip delayed local UI because server '
|
||||||
'claimStartTime is empty packetId=$packetId',
|
'claimStartTime is empty packetId=$packetId',
|
||||||
@ -718,6 +719,7 @@ class _RoomRedPacketSendPanelState extends State<RoomRedPacketSendPanel> {
|
|||||||
rtmProvider.sendRoomRedPacketBroadcast(
|
rtmProvider.sendRoomRedPacketBroadcast(
|
||||||
payload,
|
payload,
|
||||||
roomGroupId: roomProfile?.roomAccount ?? '',
|
roomGroupId: roomProfile?.roomAccount ?? '',
|
||||||
|
includeRegionBroadcast: isDelayedPacket,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
OverlayManager().addMessage(
|
OverlayManager().addMessage(
|
||||||
@ -730,7 +732,8 @@ class _RoomRedPacketSendPanelState extends State<RoomRedPacketSendPanel> {
|
|||||||
toUserId: packetId,
|
toUserId: packetId,
|
||||||
coins: result.totalAmount ?? _selectedAmount,
|
coins: result.totalAmount ?? _selectedAmount,
|
||||||
number: result.totalCount ?? _selectedCount,
|
number: result.totalCount ?? _selectedCount,
|
||||||
broadcastScope: SCFloatingMessage.broadcastScopeRegion,
|
broadcastScope:
|
||||||
|
isDelayedPacket ? SCFloatingMessage.broadcastScopeRegion : '',
|
||||||
priority: 1000,
|
priority: 1000,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.3.0+11
|
version: 1.3.1+12
|
||||||
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user