Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
60b77571
authored
Mar 24, 2026
by
suolong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复点bug
parent
dc229f8e
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
205 additions
and
14 deletions
Modules/FUSShowRoomModule/FUSShowRoomModule.xcodeproj/project.pbxproj
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolSubView.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolView.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveChatInputHelper.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveChatInputHelper.m
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ShowTimePopups/FUSLiveShowTimeFrostCardPopView.h
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ShowTimePopups/FUSLiveShowTimeFrostCardPopView.m
Modules/FUSShowRoomModule/FUSShowRoomModule.xcodeproj/project.pbxproj
View file @
60b77571
...
...
@@ -1461,6 +1461,10 @@
BEF6C0BC2F0A1D3A0033D4E5
/* FUSLiveShowTimeCollectFrostedView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BEF6C0BA2F0A1D3A0033D4E5
/* FUSLiveShowTimeCollectFrostedView.m */
;
};
00F7FF502FAF000100AAAA09
/* FUSLiveShowTimeCancelConfirmPopView.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00F7FF402FAF000100AAAA09
/* FUSLiveShowTimeCancelConfirmPopView.h */
;
};
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 */
;
};
00F7FF212F9A100100AAAA02
/* FUSLiveShowTimeTicketActionPopView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00F7FF112F9A100100AAAA02
/* FUSLiveShowTimeTicketActionPopView.m */
;
};
00F7FF222F9A100100AAAA03
/* FUSLiveShowTimeTicketContributionCell.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00F7FF122F9A100100AAAA03
/* FUSLiveShowTimeTicketContributionCell.h */
;
};
...
...
@@ -3888,6 +3892,10 @@
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>"
;
};
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>"
;
};
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>"
;
};
...
...
@@ -6931,6 +6939,17 @@
path
=
ChatInputView
;
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 */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -7472,6 +7491,7 @@
BED655C12C5B745D00668116
/* Activity */
,
BED655DC2C5B745D00668116
/* AudienceListView */
,
BED656122C5B745D00668116
/* ChatInputView */
,
00F7FF882FB1000100AAAA09
/* ShowTimePopups */
,
BED6561B2C5B745D00668116
/* ChatTableView */
,
BED6562A2C5B745D00668116
/* FUSBulletsView */
,
0089FD722D13F3460030DAA7
/* FFGiftView */
,
...
...
@@ -8768,6 +8788,8 @@
BEA1B2C52F7A111100ABCDEF
/* FUSLiveRoomThemePopView.h in Headers */
,
BEF6C0BB2F0A1D3A0033D4E5
/* FUSLiveShowTimeCollectFrostedView.h in Headers */
,
00F7FF502FAF000100AAAA09
/* FUSLiveShowTimeCancelConfirmPopView.h in Headers */
,
00F7FF842FB1000100AAAA05
/* FUSLiveShowTimeMVPConfirmPopView.h in Headers */
,
00F7FF862FB1000100AAAA07
/* FUSLiveShowTimeFrostCardPopView.h in Headers */
,
00F7FF202F9A100100AAAA01
/* FUSLiveShowTimeTicketActionPopView.h in Headers */
,
00F7FF222F9A100100AAAA03
/* FUSLiveShowTimeTicketContributionCell.h in Headers */
,
00F7FF242F9A100100AAAA05
/* FUSLiveShowTimeTicketContributionListView.h in Headers */
,
...
...
@@ -10853,6 +10875,8 @@
BEA1B2C62F7A111100ABCDEF
/* FUSLiveRoomThemePopView.m in Sources */
,
BEF6C0BC2F0A1D3A0033D4E5
/* FUSLiveShowTimeCollectFrostedView.m in Sources */
,
00F7FF512FAF000100AAAA0A
/* FUSLiveShowTimeCancelConfirmPopView.m in Sources */
,
00F7FF852FB1000100AAAA06
/* FUSLiveShowTimeMVPConfirmPopView.m in Sources */
,
00F7FF872FB1000100AAAA08
/* FUSLiveShowTimeFrostCardPopView.m in Sources */
,
00F7FF212F9A100100AAAA02
/* FUSLiveShowTimeTicketActionPopView.m in Sources */
,
00F7FF232F9A100100AAAA04
/* FUSLiveShowTimeTicketContributionCell.m in Sources */
,
00F7FF252F9A100100AAAA06
/* FUSLiveShowTimeTicketContributionListView.m in Sources */
,
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolSubView.m
View file @
60b77571
...
...
@@ -14,6 +14,7 @@
#import "FUSScreenShotShareView.h"
#import "FUSBottomOptionalView.h"
#import "FUSLiveRoomThemePopView.h"
#import "FUSLiveChatInputHelper.h"
#import "FUSLiveAnchorSettingAlertView.h"
...
...
@@ -148,6 +149,22 @@
}
break
;
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
];
}
break
;
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveBottomToolView.m
View file @
60b77571
...
...
@@ -574,6 +574,7 @@
image
=
[
FUSShowRoomCenterBunble
imageNamed
:
@"live_RoomScope_normal"
];
}
[
self
.
roomScopeBtn
setImage
:
image
forState
:
UIControlStateNormal
];
[
self
.
roomScopeBtn
setImage
:
image
forState
:
UIControlStateHighlighted
];
// 房间私密度切换后,同步刷新「房间设置」弹窗的功能列表(例如:公开屋才显示“限时表演”)
[
self
.
bottomSubView
fus_updateToolView2Types
];
}
else
{
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveChatInputHelper.h
View file @
60b77571
...
...
@@ -63,4 +63,7 @@
/// @param roomInfoModel 进房接口返回的房间模型(collectTicket=1 表示当前处于集票中)
-
(
void
)
fus_syncShowTimeFrostedWithRoomInfoModel
:(
FUSRoomInfoModel
*
)
roomInfoModel
;
/// 限时表演阶段中是否需要拦截“设置私密度”入口;返回需要展示的 toast 文案,允许进入则返回 nil
-
(
nullable
NSString
*
)
fus_toastTextForBlockingRoomScopeSetting
;
@end
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ChatInputView/FUSLiveChatInputHelper.m
View file @
60b77571
...
...
@@ -34,6 +34,7 @@
#import "FUSLiveShowTimeTicketActionPopView.h"
#import "FUSLiveShowTimeTicketContributionPopView.h"
#import "FUSLiveShowTimeCancelConfirmPopView.h"
#import "FUSLiveShowTimeFrostCardPopView.h"
#import "FUSLiveFunctionLayerView.h"
#import <FUSFoundation/FUSFoundation-Swift.h>
...
...
@@ -410,9 +411,28 @@
[
cancelSelf
fus_destroyShowTimeFrostedIfNeeded
];
cancelSelf
.
showTimeRoundId
=
@""
;
cancelSelf
.
showTimeLastFinalTicketNum
=
-
1
;
cancelSelf
.
showTimeStageStatus
=
-
1
;
cancelSelf
.
showTimeReadyShowStartRequestedRoundId
=
@""
;
cancelSelf
.
isRequestingShowTimeReadyShowStart
=
NO
;
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
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -955,6 +975,40 @@
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 @@
FUSLiveShowTimeCollectFrostedView
*
bar
=
[
FUSLiveShowTimeCollectFrostedView
fus_showOnView
:
onView
];
innerSelf
.
showTimeFrostedView
=
bar
;
innerSelf
.
showTimeRoundId
=
model
.
stageData
.
roundId
?:
@""
;
innerSelf
.
showTimeStageStatus
=
(
model
.
stageData
?
model
.
stageData
.
showStatus
:
model
.
showStatus
);
[
innerSelf
fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded
:
bar
];
__weak
typeof
(
innerSelf
)
weakInnerSelf
=
innerSelf
;
...
...
@@ -1086,12 +1141,20 @@
[
FUSLoadingView
fus_dismissProgressView
];
[
cancelSelf
fus_destroyShowTimeFrostedIfNeeded
];
cancelSelf
.
showTimeRoundId
=
@""
;
cancelSelf
.
showTimeStageStatus
=
-
1
;
if
(
FUSLiveHelper
.
shareInstance
.
liveType
==
FUSLiveTypeAnchor
&&
weakBottomToolView
)
{
if
(
tool2ExistedBeforeStart
)
{
[
weakBottomToolView
fus_insertBtnWithType
:
FUSLiveBottomToolTypeTool2
index
:
2
];
}
[
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
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
...
...
@@ -1103,6 +1166,8 @@
NSInteger
target
=
(
model
.
targetTicketNum
>
0
?
model
.
targetTicketNum
:
ticketCount
);
NSInteger
finalNum
=
MAX
(
0
,
model
.
finalTicketNum
);
innerSelf
.
showTimeTargetTicketNum
=
target
;
innerSelf
.
showTimeLastFinalTicketNum
=
finalNum
;
NSInteger
remaining
=
MAX
(
0
,
target
-
finalNum
);
CGFloat
progress
=
(
target
>
0
?
((
CGFloat
)
finalNum
/
(
CGFloat
)
target
)
:
0
);
NSString
*
remainingText
=
[
NSString
stringWithFormat
:[
NSString
fus_localString
:
@"还差 %zd 张!"
],
(
NSInteger
)
remaining
];
...
...
@@ -1435,7 +1500,7 @@
return
;
}
if
(
roomInfoModel
.
collectTicket
!=
1
||
roomInfoModel
.
liveScope
!=
5
)
{
if
(
roomInfoModel
.
collectTicket
!=
1
&&
roomInfoModel
.
liveScope
!=
5
)
{
[
self
fus_destroyShowTimeFrostedIfNeeded
];
return
;
}
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ShowTimePopups/FUSLiveShowTimeFrostCardPopView.h
View file @
60b77571
...
...
@@ -6,6 +6,13 @@ NS_ASSUME_NONNULL_BEGIN
@interface
FUSLiveShowTimeFrostCardPopView
:
UIView
/// 展示到指定父视图(已存在则复用)
+
(
instancetype
)
fus_showOnView
:(
UIView
*
)
onView
;
/**
更新最终集票数的展示
@param finalTicketNum 最终集票总数(取消成功后用于反馈)
*/
-
(
void
)
fus_updateFinalTicketNum
:(
NSInteger
)
finalTicketNum
;
/// 主动关闭弹窗
-
(
void
)
fus_dismiss
;
...
...
Modules/FUSShowRoomModule/FUSShowRoomModule/Features/NewLive/Main/View/FunctionView/ShowTimePopups/FUSLiveShowTimeFrostCardPopView.m
View file @
60b77571
...
...
@@ -6,15 +6,17 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
@interface
FUSLiveShowTimeFrostCardPopView
()
/// 背景遮罩按钮(拦截点击,空白区域不关闭)
@property
(
nonatomic
,
strong
)
UIButton
*
bgBtn
;
/// 模糊卡片承载容器
@property
(
nonatomic
,
strong
)
UIView
*
contentView
;
/// 毛玻璃视图(系统暗色材质)
@property
(
nonatomic
,
strong
)
UIVisualEffectView
*
blurView
;
/// 内容纵向居中动画约束
@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
@implementation
FUSLiveShowTimeFrostCardPopView
...
...
@@ -46,13 +48,39 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
[
self
addSubview
:
self
.
bgBtn
];
self
.
contentView
=
[[
UIView
alloc
]
init
];
self
.
contentView
.
backgroundColor
=
UIColor
.
whiteColor
;
self
.
contentView
.
layer
.
cornerRadius
=
12
;
self
.
contentView
.
layer
.
masksToBounds
=
YES
;
[
self
addSubview
:
self
.
contentView
];
UIBlurEffect
*
effect
=
[
UIBlurEffect
effectWithStyle
:
UIBlurEffectStyleSystemThinMaterialDark
];
self
.
blurView
=
[[
UIVisualEffectView
alloc
]
initWithEffect
:
effect
];
[
self
.
contentView
addSubview
:
self
.
blurView
];
self
.
titleBgView
=
[[
UIView
alloc
]
init
];
self
.
titleBgView
.
backgroundColor
=
[
UIColor
colorWithHex
:
@"#F2F2F2"
];
[
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
)
{
make
.
edges
.
equalTo
(
self
);
...
...
@@ -61,29 +89,75 @@ static const NSInteger kFUSLiveShowTimeFrostCardPopViewTag = 8817402;
make
.
centerX
.
equalTo
(
self
);
self
.
contentCenterYConstraint
=
make
.
centerY
.
equalTo
(
self
).
offset
(
UIView
.
fus_screenH
);
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
.
blurView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
contentView
);
[
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
.
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
.
contentCenterYConstraint
setOffset
:
0
];
[
UIView
animateWithDuration
:
0
.
3
animations
:
^
{
[
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
{
[
self
.
contentCenterYConstraint
setOffset
:
UIView
.
fus_screenH
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
[
self
layoutIfNeeded
];
[
self
.
superview
layoutIfNeeded
];
}
completion
:^
(
BOOL
finished
)
{
[
self
removeFromSuperview
];
}];
}
-
(
void
)
fus_onTapConfirm
{
// 用户确认后关闭弹窗
[
self
fus_dismiss
];
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment