Commit 60b77571 by suolong

修复点bug

parent dc229f8e
...@@ -1461,6 +1461,10 @@ ...@@ -1461,6 +1461,10 @@
BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */ = {isa = PBXBuildFile; fileRef = BEF6C0BA2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m */; }; BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */ = {isa = PBXBuildFile; fileRef = BEF6C0BA2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m */; };
00F7FF502FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF402FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h */; }; 00F7FF502FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF402FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h */; };
00F7FF512FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF412FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m */; }; 00F7FF512FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF412FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m */; };
00F7FF842FB1000100AAAA05 /* FUSLiveShowTimeMVPConfirmPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF802FB1000100AAAA01 /* FUSLiveShowTimeMVPConfirmPopView.h */; };
00F7FF852FB1000100AAAA06 /* FUSLiveShowTimeMVPConfirmPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF812FB1000100AAAA02 /* FUSLiveShowTimeMVPConfirmPopView.m */; };
00F7FF862FB1000100AAAA07 /* FUSLiveShowTimeFrostCardPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF822FB1000100AAAA03 /* FUSLiveShowTimeFrostCardPopView.h */; };
00F7FF872FB1000100AAAA08 /* FUSLiveShowTimeFrostCardPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF832FB1000100AAAA04 /* FUSLiveShowTimeFrostCardPopView.m */; };
00F7FF202F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF102F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h */; }; 00F7FF202F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF102F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h */; };
00F7FF212F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF112F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m */; }; 00F7FF212F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7FF112F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m */; };
00F7FF222F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF122F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h */; }; 00F7FF222F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7FF122F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h */; };
...@@ -3888,6 +3892,10 @@ ...@@ -3888,6 +3892,10 @@
00F7FF172F9A100100AAAA08 /* FUSLiveShowTimeTicketNoticeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeTicketNoticeView.m; sourceTree = "<group>"; }; 00F7FF172F9A100100AAAA08 /* FUSLiveShowTimeTicketNoticeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeTicketNoticeView.m; sourceTree = "<group>"; };
00F7FF702FAF000100AAAA19 /* FUSLiveShowTimeTicketContributionPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeTicketContributionPopView.h; sourceTree = "<group>"; }; 00F7FF702FAF000100AAAA19 /* FUSLiveShowTimeTicketContributionPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeTicketContributionPopView.h; sourceTree = "<group>"; };
00F7FF712FAF000100AAAA1A /* FUSLiveShowTimeTicketContributionPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeTicketContributionPopView.m; sourceTree = "<group>"; }; 00F7FF712FAF000100AAAA1A /* FUSLiveShowTimeTicketContributionPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeTicketContributionPopView.m; sourceTree = "<group>"; };
00F7FF802FB1000100AAAA01 /* FUSLiveShowTimeMVPConfirmPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeMVPConfirmPopView.h; sourceTree = "<group>"; };
00F7FF812FB1000100AAAA02 /* FUSLiveShowTimeMVPConfirmPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeMVPConfirmPopView.m; sourceTree = "<group>"; };
00F7FF822FB1000100AAAA03 /* FUSLiveShowTimeFrostCardPopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeFrostCardPopView.h; sourceTree = "<group>"; };
00F7FF832FB1000100AAAA04 /* FUSLiveShowTimeFrostCardPopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeFrostCardPopView.m; sourceTree = "<group>"; };
BED655F22C5B745D00668116 /* FUSLiveBottomToolView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveBottomToolView.h; sourceTree = "<group>"; }; BED655F22C5B745D00668116 /* FUSLiveBottomToolView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveBottomToolView.h; sourceTree = "<group>"; };
BED655F32C5B745D00668116 /* FUSLiveBottomToolView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveBottomToolView.m; sourceTree = "<group>"; }; BED655F32C5B745D00668116 /* FUSLiveBottomToolView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveBottomToolView.m; sourceTree = "<group>"; };
BED655F42C5B745D00668116 /* FUSLiveChatFastInputCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveChatFastInputCell.h; sourceTree = "<group>"; }; BED655F42C5B745D00668116 /* FUSLiveChatFastInputCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveChatFastInputCell.h; sourceTree = "<group>"; };
...@@ -6931,6 +6939,17 @@ ...@@ -6931,6 +6939,17 @@
path = ChatInputView; path = ChatInputView;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
00F7FF882FB1000100AAAA09 /* ShowTimePopups */ = {
isa = PBXGroup;
children = (
00F7FF802FB1000100AAAA01 /* FUSLiveShowTimeMVPConfirmPopView.h */,
00F7FF812FB1000100AAAA02 /* FUSLiveShowTimeMVPConfirmPopView.m */,
00F7FF822FB1000100AAAA03 /* FUSLiveShowTimeFrostCardPopView.h */,
00F7FF832FB1000100AAAA04 /* FUSLiveShowTimeFrostCardPopView.m */,
);
path = ShowTimePopups;
sourceTree = "<group>";
};
00F7FF302F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPop */ = { 00F7FF302F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPop */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -7472,6 +7491,7 @@ ...@@ -7472,6 +7491,7 @@
BED655C12C5B745D00668116 /* Activity */, BED655C12C5B745D00668116 /* Activity */,
BED655DC2C5B745D00668116 /* AudienceListView */, BED655DC2C5B745D00668116 /* AudienceListView */,
BED656122C5B745D00668116 /* ChatInputView */, BED656122C5B745D00668116 /* ChatInputView */,
00F7FF882FB1000100AAAA09 /* ShowTimePopups */,
BED6561B2C5B745D00668116 /* ChatTableView */, BED6561B2C5B745D00668116 /* ChatTableView */,
BED6562A2C5B745D00668116 /* FUSBulletsView */, BED6562A2C5B745D00668116 /* FUSBulletsView */,
0089FD722D13F3460030DAA7 /* FFGiftView */, 0089FD722D13F3460030DAA7 /* FFGiftView */,
...@@ -8768,6 +8788,8 @@ ...@@ -8768,6 +8788,8 @@
BEA1B2C52F7A111100ABCDEF /* FUSLiveRoomThemePopView.h in Headers */, BEA1B2C52F7A111100ABCDEF /* FUSLiveRoomThemePopView.h in Headers */,
BEF6C0BB2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h in Headers */, BEF6C0BB2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h in Headers */,
00F7FF502FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h in Headers */, 00F7FF502FAF000100AAAA09 /* FUSLiveShowTimeCancelConfirmPopView.h in Headers */,
00F7FF842FB1000100AAAA05 /* FUSLiveShowTimeMVPConfirmPopView.h in Headers */,
00F7FF862FB1000100AAAA07 /* FUSLiveShowTimeFrostCardPopView.h in Headers */,
00F7FF202F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h in Headers */, 00F7FF202F9A100100AAAA01 /* FUSLiveShowTimeTicketActionPopView.h in Headers */,
00F7FF222F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h in Headers */, 00F7FF222F9A100100AAAA03 /* FUSLiveShowTimeTicketContributionCell.h in Headers */,
00F7FF242F9A100100AAAA05 /* FUSLiveShowTimeTicketContributionListView.h in Headers */, 00F7FF242F9A100100AAAA05 /* FUSLiveShowTimeTicketContributionListView.h in Headers */,
...@@ -10853,6 +10875,8 @@ ...@@ -10853,6 +10875,8 @@
BEA1B2C62F7A111100ABCDEF /* FUSLiveRoomThemePopView.m in Sources */, BEA1B2C62F7A111100ABCDEF /* FUSLiveRoomThemePopView.m in Sources */,
BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */, BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */,
00F7FF512FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m in Sources */, 00F7FF512FAF000100AAAA0A /* FUSLiveShowTimeCancelConfirmPopView.m in Sources */,
00F7FF852FB1000100AAAA06 /* FUSLiveShowTimeMVPConfirmPopView.m in Sources */,
00F7FF872FB1000100AAAA08 /* FUSLiveShowTimeFrostCardPopView.m in Sources */,
00F7FF212F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m in Sources */, 00F7FF212F9A100100AAAA02 /* FUSLiveShowTimeTicketActionPopView.m in Sources */,
00F7FF232F9A100100AAAA04 /* FUSLiveShowTimeTicketContributionCell.m in Sources */, 00F7FF232F9A100100AAAA04 /* FUSLiveShowTimeTicketContributionCell.m in Sources */,
00F7FF252F9A100100AAAA06 /* FUSLiveShowTimeTicketContributionListView.m in Sources */, 00F7FF252F9A100100AAAA06 /* FUSLiveShowTimeTicketContributionListView.m in Sources */,
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#import "FUSScreenShotShareView.h" #import "FUSScreenShotShareView.h"
#import "FUSBottomOptionalView.h" #import "FUSBottomOptionalView.h"
#import "FUSLiveRoomThemePopView.h" #import "FUSLiveRoomThemePopView.h"
#import "FUSLiveChatInputHelper.h"
#import "FUSLiveAnchorSettingAlertView.h" #import "FUSLiveAnchorSettingAlertView.h"
...@@ -148,6 +149,22 @@ ...@@ -148,6 +149,22 @@
} }
break; break;
case FUSLiveBottomToolTypeRoomScope:{ case FUSLiveBottomToolTypeRoomScope:{
FUSLiveBottomToolView *bottomToolView = self.bottomToolView;
if (!bottomToolView) {
UIView *container = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerFunctionButtons];
for (UIView *sub in container.subviews) {
if ([sub isKindOfClass:FUSLiveBottomToolView.class]) {
bottomToolView = (FUSLiveBottomToolView *)sub;
break;
}
}
}
FUSLiveChatInputHelper *chatHelper = (FUSLiveChatInputHelper *)bottomToolView.delegate;
NSString *toastText = (chatHelper ? [chatHelper fus_toastTextForBlockingRoomScopeSetting] : nil);
if (![NSString isNull:toastText]) {
[FUSDialogView fus_showDialog:toastText];
return;
}
[FUSLiveStartSetPrivacyView fus_createInLive]; [FUSLiveStartSetPrivacyView fus_createInLive];
} }
break; break;
......
...@@ -574,6 +574,7 @@ ...@@ -574,6 +574,7 @@
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"]; image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
} }
[self.roomScopeBtn setImage:image forState:UIControlStateNormal]; [self.roomScopeBtn setImage:image forState:UIControlStateNormal];
[self.roomScopeBtn setImage:image forState:UIControlStateHighlighted];
// 房间私密度切换后,同步刷新「房间设置」弹窗的功能列表(例如:公开屋才显示“限时表演”) // 房间私密度切换后,同步刷新「房间设置」弹窗的功能列表(例如:公开屋才显示“限时表演”)
[self.bottomSubView fus_updateToolView2Types]; [self.bottomSubView fus_updateToolView2Types];
} else { } else {
......
...@@ -63,4 +63,7 @@ ...@@ -63,4 +63,7 @@
/// @param roomInfoModel 进房接口返回的房间模型(collectTicket=1 表示当前处于集票中) /// @param roomInfoModel 进房接口返回的房间模型(collectTicket=1 表示当前处于集票中)
- (void)fus_syncShowTimeFrostedWithRoomInfoModel:(FUSRoomInfoModel *)roomInfoModel; - (void)fus_syncShowTimeFrostedWithRoomInfoModel:(FUSRoomInfoModel *)roomInfoModel;
/// 限时表演阶段中是否需要拦截“设置私密度”入口;返回需要展示的 toast 文案,允许进入则返回 nil
- (nullable NSString *)fus_toastTextForBlockingRoomScopeSetting;
@end @end
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#import "FUSLiveShowTimeTicketActionPopView.h" #import "FUSLiveShowTimeTicketActionPopView.h"
#import "FUSLiveShowTimeTicketContributionPopView.h" #import "FUSLiveShowTimeTicketContributionPopView.h"
#import "FUSLiveShowTimeCancelConfirmPopView.h" #import "FUSLiveShowTimeCancelConfirmPopView.h"
#import "FUSLiveShowTimeFrostCardPopView.h"
#import "FUSLiveFunctionLayerView.h" #import "FUSLiveFunctionLayerView.h"
#import <FUSFoundation/FUSFoundation-Swift.h> #import <FUSFoundation/FUSFoundation-Swift.h>
...@@ -410,9 +411,28 @@ ...@@ -410,9 +411,28 @@
[cancelSelf fus_destroyShowTimeFrostedIfNeeded]; [cancelSelf fus_destroyShowTimeFrostedIfNeeded];
cancelSelf.showTimeRoundId = @""; cancelSelf.showTimeRoundId = @"";
cancelSelf.showTimeLastFinalTicketNum = -1; cancelSelf.showTimeLastFinalTicketNum = -1;
cancelSelf.showTimeStageStatus = -1;
cancelSelf.showTimeReadyShowStartRequestedRoundId = @""; cancelSelf.showTimeReadyShowStartRequestedRoundId = @"";
cancelSelf.isRequestingShowTimeReadyShowStart = NO; cancelSelf.isRequestingShowTimeReadyShowStart = NO;
cancelSelf.showTimeAnchorPopupRemainingSeconds = -1; cancelSelf.showTimeAnchorPopupRemainingSeconds = -1;
if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor) {
FUSLiveBottomToolView *bottomToolView = [cancelSelf fus_currentBottomToolView];
if (bottomToolView) {
BOOL hasTool2 = !CGRectEqualToRect([bottomToolView fus_getBtnFrameWithToolType:FUSLiveBottomToolTypeTool2], CGRectZero);
if (!hasTool2) {
[bottomToolView fus_insertBtnWithType:FUSLiveBottomToolTypeTool2 index:2];
}
[bottomToolView fus_updateRoomScoreType];
}
}
// 取消成功后弹出磨砂卡片,展示最终集票数
UIView *onView = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerManualPopView];
if (!onView) onView = [UIViewController fus_topViewController].view;
if (!onView) return;
FUSLiveShowTimeFrostCardPopView *pop = [FUSLiveShowTimeFrostCardPopView fus_showOnView:onView];
[pop fus_updateFinalTicketNum:cancelModel.finalTicketNum];
}); });
} failure:^(NSString * _Nonnull msg, NSInteger code) { } failure:^(NSString * _Nonnull msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
...@@ -955,6 +975,40 @@ ...@@ -955,6 +975,40 @@
return YES; return YES;
} }
- (FUSLiveBottomToolView *)fus_currentBottomToolView {
UIView *container = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerFunctionButtons];
if (!container) {
return nil;
}
for (UIView *sub in container.subviews) {
if ([sub isKindOfClass:FUSLiveBottomToolView.class]) {
return (FUSLiveBottomToolView *)sub;
}
}
return nil;
}
- (NSString *)fus_toastTextForBlockingRoomScopeSetting {
if (FUSLiveHelper.shareInstance.liveType != FUSLiveTypeAnchor) {
return nil;
}
if (self.showTimeStageStatus == 0) {
return [NSString fus_localString:@"请先取消集票"];
}
if (self.showTimeStageStatus == 1 || self.showTimeStageStatus == 2) {
return [NSString fus_localString:@"请先完成限时表演"];
}
FUSRoomInfoModel *roomInfoModel = FUSLiveHelper.shareInstance.roomInfoModel;
if (roomInfoModel.collectTicket == 1) {
return [NSString fus_localString:@"请先取消集票"];
}
if (roomInfoModel.liveScope == 5) {
return [NSString fus_localString:@"请先完成限时表演"];
}
return nil;
}
/** /**
* 是否是@的用户 * 是否是@的用户
* *
...@@ -1067,6 +1121,7 @@ ...@@ -1067,6 +1121,7 @@
FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView]; FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView];
innerSelf.showTimeFrostedView = bar; innerSelf.showTimeFrostedView = bar;
innerSelf.showTimeRoundId = model.stageData.roundId ?: @""; innerSelf.showTimeRoundId = model.stageData.roundId ?: @"";
innerSelf.showTimeStageStatus = (model.stageData ? model.stageData.showStatus : model.showStatus);
[innerSelf fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:bar]; [innerSelf fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:bar];
__weak typeof(innerSelf) weakInnerSelf = innerSelf; __weak typeof(innerSelf) weakInnerSelf = innerSelf;
...@@ -1086,12 +1141,20 @@ ...@@ -1086,12 +1141,20 @@
[FUSLoadingView fus_dismissProgressView]; [FUSLoadingView fus_dismissProgressView];
[cancelSelf fus_destroyShowTimeFrostedIfNeeded]; [cancelSelf fus_destroyShowTimeFrostedIfNeeded];
cancelSelf.showTimeRoundId = @""; cancelSelf.showTimeRoundId = @"";
cancelSelf.showTimeStageStatus = -1;
if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor && weakBottomToolView) { if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor && weakBottomToolView) {
if (tool2ExistedBeforeStart) { if (tool2ExistedBeforeStart) {
[weakBottomToolView fus_insertBtnWithType:FUSLiveBottomToolTypeTool2 index:2]; [weakBottomToolView fus_insertBtnWithType:FUSLiveBottomToolTypeTool2 index:2];
} }
[weakBottomToolView fus_updateRoomScoreType]; [weakBottomToolView fus_updateRoomScoreType];
} }
// 取消成功后弹出磨砂卡片,展示最终集票数
UIView *onView = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerManualPopView];
if (!onView) onView = [UIViewController fus_topViewController].view;
if (!onView) return;
FUSLiveShowTimeFrostCardPopView *pop = [FUSLiveShowTimeFrostCardPopView fus_showOnView:onView];
[pop fus_updateFinalTicketNum:cancelModel.finalTicketNum];
}); });
} failure:^(NSString * _Nonnull msg, NSInteger code) { } failure:^(NSString * _Nonnull msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
...@@ -1103,6 +1166,8 @@ ...@@ -1103,6 +1166,8 @@
NSInteger target = (model.targetTicketNum > 0 ? model.targetTicketNum : ticketCount); NSInteger target = (model.targetTicketNum > 0 ? model.targetTicketNum : ticketCount);
NSInteger finalNum = MAX(0, model.finalTicketNum); NSInteger finalNum = MAX(0, model.finalTicketNum);
innerSelf.showTimeTargetTicketNum = target;
innerSelf.showTimeLastFinalTicketNum = finalNum;
NSInteger remaining = MAX(0, target - finalNum); NSInteger remaining = MAX(0, target - finalNum);
CGFloat progress = (target > 0 ? ((CGFloat)finalNum / (CGFloat)target) : 0); CGFloat progress = (target > 0 ? ((CGFloat)finalNum / (CGFloat)target) : 0);
NSString *remainingText = [NSString stringWithFormat:[NSString fus_localString:@"还差 %zd 张!"], (NSInteger)remaining]; NSString *remainingText = [NSString stringWithFormat:[NSString fus_localString:@"还差 %zd 张!"], (NSInteger)remaining];
...@@ -1435,7 +1500,7 @@ ...@@ -1435,7 +1500,7 @@
return; return;
} }
if (roomInfoModel.collectTicket != 1 || roomInfoModel.liveScope != 5) { if (roomInfoModel.collectTicket != 1 && roomInfoModel.liveScope != 5) {
[self fus_destroyShowTimeFrostedIfNeeded]; [self fus_destroyShowTimeFrostedIfNeeded];
return; return;
} }
......
...@@ -6,6 +6,13 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -6,6 +6,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSLiveShowTimeFrostCardPopView : UIView @interface FUSLiveShowTimeFrostCardPopView : UIView
/// 展示到指定父视图(已存在则复用) /// 展示到指定父视图(已存在则复用)
+ (instancetype)fus_showOnView:(UIView *)onView; + (instancetype)fus_showOnView:(UIView *)onView;
/**
更新最终集票数的展示
@param finalTicketNum 最终集票总数(取消成功后用于反馈)
*/
- (void)fus_updateFinalTicketNum:(NSInteger)finalTicketNum;
/// 主动关闭弹窗 /// 主动关闭弹窗
- (void)fus_dismiss; - (void)fus_dismiss;
......
...@@ -6,15 +6,17 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402; ...@@ -6,15 +6,17 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
@interface FUSLiveShowTimeFrostCardPopView () @interface FUSLiveShowTimeFrostCardPopView ()
/// 背景遮罩按钮(拦截点击,空白区域不关闭)
@property (nonatomic, strong) UIButton *bgBtn; @property (nonatomic, strong) UIButton *bgBtn;
/// 模糊卡片承载容器
@property (nonatomic, strong) UIView *contentView; @property (nonatomic, strong) UIView *contentView;
/// 毛玻璃视图(系统暗色材质)
@property (nonatomic, strong) UIVisualEffectView *blurView;
/// 内容纵向居中动画约束
@property (nonatomic, strong) MASConstraint *contentCenterYConstraint; @property (nonatomic, strong) MASConstraint *contentCenterYConstraint;
@property (nonatomic, strong) UIView *titleBgView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *ticketCountLabel;
@property (nonatomic, strong) UIButton *confirmBtn;
@property (nonatomic, assign) BOOL didAnimateIn;
@end @end
@implementation FUSLiveShowTimeFrostCardPopView @implementation FUSLiveShowTimeFrostCardPopView
...@@ -46,13 +48,39 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402; ...@@ -46,13 +48,39 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
[self addSubview:self.bgBtn]; [self addSubview:self.bgBtn];
self.contentView = [[UIView alloc] init]; self.contentView = [[UIView alloc] init];
self.contentView.backgroundColor = UIColor.whiteColor;
self.contentView.layer.cornerRadius = 12; self.contentView.layer.cornerRadius = 12;
self.contentView.layer.masksToBounds = YES; self.contentView.layer.masksToBounds = YES;
[self addSubview:self.contentView]; [self addSubview:self.contentView];
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleSystemThinMaterialDark]; self.titleBgView = [[UIView alloc] init];
self.blurView = [[UIVisualEffectView alloc] initWithEffect:effect]; self.titleBgView.backgroundColor = [UIColor colorWithHex:@"#F2F2F2"];
[self.contentView addSubview:self.blurView]; [self.contentView addSubview:self.titleBgView];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.font = [UIFont fus_themeBoldFont:16];
self.titleLabel.textColor = [UIColor colorWithHex:@"#333333"];
self.titleLabel.text = [NSString fus_localString:@"集票失败"];
[self.titleBgView addSubview:self.titleLabel];
self.ticketCountLabel = [[UILabel alloc] init];
self.ticketCountLabel.textAlignment = NSTextAlignmentCenter;
self.ticketCountLabel.font = [UIFont fus_themeBoldFont:18];
self.ticketCountLabel.textColor = [UIColor colorWithHex:@"#333333"];
self.ticketCountLabel.text = @"";
[self.contentView addSubview:self.ticketCountLabel];
self.confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.confirmBtn setTitle:[NSString fus_localString:@"确认"] forState:UIControlStateNormal];
self.confirmBtn.titleLabel.font = [UIFont fus_themeBoldFont:16];
[self.confirmBtn setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
self.confirmBtn.backgroundColor = [UIColor colorWithHex:@"#01D9E0"];
self.confirmBtn.layer.cornerRadius = 22;
self.confirmBtn.layer.masksToBounds = YES;
// 单一关闭入口:点击确认后收起弹窗
[self.confirmBtn addTarget:self action:@selector(fus_onTapConfirm) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.confirmBtn];
[self.bgBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self); make.edges.equalTo(self);
...@@ -61,29 +89,75 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402; ...@@ -61,29 +89,75 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
make.centerX.equalTo(self); make.centerX.equalTo(self);
self.contentCenterYConstraint = make.centerY.equalTo(self).offset(UIView.fus_screenH); self.contentCenterYConstraint = make.centerY.equalTo(self).offset(UIView.fus_screenH);
make.width.mas_equalTo(MIN(UIView.fus_screenW - 32, 320)); make.width.mas_equalTo(MIN(UIView.fus_screenW - 32, 320));
make.height.mas_equalTo(MIN(UIView.fus_screenH * 0.5, 360)); make.height.mas_equalTo(190);
}];
[self.titleBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self.contentView);
make.height.mas_equalTo(45);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.titleBgView);
}];
[self.ticketCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16);
make.right.equalTo(self.contentView).offset(-16);
make.top.equalTo(self.titleBgView.mas_bottom).offset(24);
make.height.mas_equalTo(26);
}]; }];
[self.blurView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView); [self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.contentView);
make.top.equalTo(self.ticketCountLabel.mas_bottom).offset(24);
make.width.mas_equalTo(180);
make.height.mas_equalTo(44);
}]; }];
return self;
}
- (void)didMoveToSuperview {
[super didMoveToSuperview];
if (!self.superview || self.didAnimateIn) {
return;
}
self.didAnimateIn = YES;
// 将入场动画放到加入父视图后执行,避免 superview 为空导致动画约束更新异常
[self.superview layoutIfNeeded]; [self.superview layoutIfNeeded];
[self.contentCenterYConstraint setOffset:0]; [self.contentCenterYConstraint setOffset:0];
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
[self.superview layoutIfNeeded]; [self.superview layoutIfNeeded];
}]; }];
}
return self;
- (void)fus_updateFinalTicketNum:(NSInteger)finalTicketNum {
NSInteger safeNum = MAX(0, finalTicketNum);
// 文案兜底:避免负数,统一展示为非负整型
NSString *content = [NSString stringWithFormat:@"%zd %@", (NSInteger)safeNum, [NSString fus_localString:@"张票已全部退回"]];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content];
[attr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHex:@"#333333"] range:NSMakeRange(0, content.length)];
NSString *numText = [NSString stringWithFormat:@"%zd", (NSInteger)safeNum];
NSRange numRange = [content rangeOfString:numText];
if (numRange.location != NSNotFound && numRange.length > 0) {
[attr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHex:@"#01D9E0"] range:numRange];
}
self.ticketCountLabel.attributedText = attr;
} }
/// 关闭弹窗,执行退场动画后移除 /// 关闭弹窗,执行退场动画后移除
- (void)fus_dismiss { - (void)fus_dismiss {
[self.contentCenterYConstraint setOffset:UIView.fus_screenH]; [self.contentCenterYConstraint setOffset:UIView.fus_screenH];
[UIView animateWithDuration:0.25 animations:^{ [UIView animateWithDuration:0.25 animations:^{
[self layoutIfNeeded]; [self.superview layoutIfNeeded];
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[self removeFromSuperview]; [self removeFromSuperview];
}]; }];
} }
- (void)fus_onTapConfirm {
// 用户确认后关闭弹窗
[self fus_dismiss];
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment