Commit 365c58d3 by suolong

添加部分限时表演 主播

parent c4be54a1
Showing with 219 additions and 5 deletions
......@@ -1435,6 +1435,8 @@
BED658F42C5B745E00668116 /* FUSLiveBottomToolSubView.m in Sources */ = {isa = PBXBuildFile; fileRef = BED655F12C5B745D00668116 /* FUSLiveBottomToolSubView.m */; };
BEF6C0A72F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF6C0A52F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.h */; };
BEF6C0A82F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.m in Sources */ = {isa = PBXBuildFile; fileRef = BEF6C0A62F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.m */; };
BEF6C0BB2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h in Headers */ = {isa = PBXBuildFile; fileRef = BEF6C0B92F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h */; };
BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */ = {isa = PBXBuildFile; fileRef = BEF6C0BA2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m */; };
BED658F52C5B745E00668116 /* FUSLiveBottomToolView.h in Headers */ = {isa = PBXBuildFile; fileRef = BED655F22C5B745D00668116 /* FUSLiveBottomToolView.h */; };
BED658F62C5B745E00668116 /* FUSLiveBottomToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = BED655F32C5B745D00668116 /* FUSLiveBottomToolView.m */; };
BED658F72C5B745E00668116 /* FUSLiveChatFastInputCell.h in Headers */ = {isa = PBXBuildFile; fileRef = BED655F42C5B745D00668116 /* FUSLiveChatFastInputCell.h */; };
......@@ -3818,6 +3820,8 @@
BED655F12C5B745D00668116 /* FUSLiveBottomToolSubView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveBottomToolSubView.m; sourceTree = "<group>"; };
BEF6C0A52F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimePopView.h; sourceTree = "<group>"; };
BEF6C0A62F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimePopView.m; sourceTree = "<group>"; };
BEF6C0B92F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeCollectFrostedView.h; sourceTree = "<group>"; };
BEF6C0BA2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeCollectFrostedView.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>"; };
......@@ -6768,6 +6772,8 @@
BED655F12C5B745D00668116 /* FUSLiveBottomToolSubView.m */,
BEF6C0A52F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.h */,
BEF6C0A62F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.m */,
BEF6C0B92F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h */,
BEF6C0BA2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m */,
BED655F22C5B745D00668116 /* FUSLiveBottomToolView.h */,
BED655F32C5B745D00668116 /* FUSLiveBottomToolView.m */,
BED655F42C5B745D00668116 /* FUSLiveChatFastInputCell.h */,
......@@ -8613,6 +8619,7 @@
BED65B0A2C5B746000668116 /* FUSOpenScreenPushHelp.h in Headers */,
BED658F32C5B745E00668116 /* FUSLiveBottomToolSubView.h in Headers */,
BEF6C0A72F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.h in Headers */,
BEF6C0BB2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.h in Headers */,
00B28CBA2D2FC4E10008476B /* FUSLiveEndLiveAssesModel.h in Headers */,
BE189DDF2C733B460008418B /* FSRRoomManagerViewController.h in Headers */,
BED65A442C5B745F00668116 /* FUSLiveBoxDetailSettingView.h in Headers */,
......@@ -10681,6 +10688,7 @@
BE189DBC2C733B460008418B /* FSRSettingRoomGuarderOnlineModel.m in Sources */,
BED658F42C5B745E00668116 /* FUSLiveBottomToolSubView.m in Sources */,
BEF6C0A82F0A1B2C0033D4E5 /* FUSLiveShowTimePopView.m in Sources */,
BEF6C0BC2F0A1D3A0033D4E5 /* FUSLiveShowTimeCollectFrostedView.m in Sources */,
BED6599E2C5B745F00668116 /* FUSLinkMicItemView.m in Sources */,
BED658802C5B745E00668116 /* FUSLivePropsModel.m in Sources */,
BE189DB82C733B460008418B /* FSRRoomManagerShowRoomModel.m in Sources */,
{
"images" : [
{
"filename" : "Live_bottom_countdown.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_bottom_countdown@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_bottom_countdown@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Live_bottom_mvp.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_bottom_mvp@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_bottom_mvp@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "Live_bottom_ticket.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Live_bottom_ticket@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Live_bottom_ticket@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -43,6 +43,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)fus_bottomSubViewDidClickPKBtn:(FUSLiveBottomToolSubView *)bottomSubView livePkBtnState:(FUSLiveChatToolPKBtnState)livePkBtnState;
/// 点击“限时表演”工具按钮(交由外部决定如何展示弹窗/后续逻辑)
/// - Parameters:
/// - bottomSubView: 当前工具子视图
/// - containerView: 建议承载弹窗的父视图
- (void)fus_bottomSubView:(FUSLiveBottomToolSubView *)bottomSubView didClickShowTimeOnView:(UIView *)containerView;
@end
@interface FUSLiveBottomToolSubView : UIView
......
......@@ -21,8 +21,6 @@
#import "FUSShowRoomModule/FUSShowRoomModule-Swift.h"
#import "FUSLiveShowTimePopView.h"
//#import "UIImageView+FUSTestImgeView.h"
@interface FUSLiveBottomToolSubView () <FUSLiveChatInputTextViewDelegate>
......@@ -172,7 +170,10 @@
break;
case FUSLiveBottomToolTypeShowTime:
{
[FUSLiveShowTimePopView fus_showOnView:bgView];
if ([self.delegate respondsToSelector:@selector(fus_bottomSubView:didClickShowTimeOnView:)]) {
UIView *container = bgView ?: self.bgView ?: [UIViewController fus_topViewController].view;
[self.delegate fus_bottomSubView:self didClickShowTimeOnView:container];
}
}
break;
case FUSLiveBottomToolTypeExchange:
......
......@@ -111,6 +111,12 @@ typedef NS_ENUM(NSUInteger, FUSLiveChatToolBeautyType) { //美颜工具按钮
- (void)fus_bottomToolViewDidBeautySetting:(FUSLiveBottomToolView *)bottomToolView
beautyType:(FUSLiveChatToolBeautyType)type;
/// 点击“限时表演”工具按钮(交由外部决定如何展示弹窗/后续逻辑)
/// - Parameters:
/// - bottomToolView: 当前工具栏
/// - containerView: 建议承载弹窗的父视图
- (void)fus_bottomToolView:(FUSLiveBottomToolView *)bottomToolView didClickShowTimeOnView:(UIView *)containerView;
@end
@interface FUSLiveBottomToolView : UIView
......
......@@ -1339,6 +1339,12 @@
}
}
- (void)fus_bottomSubView:(FUSLiveBottomToolSubView *)bottomSubView didClickShowTimeOnView:(UIView *)containerView {
if (self.delegate && [self.delegate respondsToSelector:@selector(fus_bottomToolView:didClickShowTimeOnView:)]) {
[self.delegate fus_bottomToolView:self didClickShowTimeOnView:containerView];
}
}
- (void)fus_bottomSubViewDidBeautySetting:(FUSLiveBottomToolSubView *)bottomToolView beautyType:(FUSLiveChatToolBeautyType)type{
if (_delegate && [_delegate respondsToSelector:@selector(fus_bottomToolViewDidBeautySetting:beautyType:)]) {
......
......@@ -54,4 +54,7 @@
// 取消未执行的任务并置空定时器
- (void)cancelTimerTaskAndDeleteTimer;
/// 销毁限时表演集票磨砂条(确认结束直播后调用)
- (void)fus_destroyShowTimeFrostedIfNeeded;
@end
......@@ -25,6 +25,10 @@
#import "FUSBottomOptionalView.h"
#import "FUSLiveShareToChatView.h"
#import "FUSLiveShowTimePopView.h"
#import "FUSLiveShowTimeCollectFrostedView.h"
#import "FUSLiveFunctionLayerView.h"
#import <FUSFoundation/FUSFoundation-Swift.h>
#import <FUSCommon/FUSCommon-Swift.h>
......@@ -40,6 +44,9 @@
@property (nonatomic, assign) BOOL isUpdating; // 是否正在更新礼物数据
// 限时表演集票磨砂条:由工具栏点击触发创建,用于后续 socket 刷新进度/新票
@property (nonatomic, strong) FUSLiveShowTimeCollectFrostedView *showTimeFrostedView;
@end
@implementation FUSLiveChatInputHelper
......@@ -419,6 +426,47 @@
FUSLogDebug(@"");
}
- (void)fus_bottomToolView:(FUSLiveBottomToolView *)bottomToolView didClickShowTimeOnView:(UIView *)containerView {
UIView *popContainer = (containerView ?: [UIViewController fus_topViewController].view);
__weak typeof(self) weakSelf = self;
FUSLiveShowTimePopView *popView = [FUSLiveShowTimePopView fus_showOnView:popContainer];
popView.startCollectHandler = ^(NSString * _Nonnull themeText, NSInteger ticketCount) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
UIView *onView = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerFunctionButtons];
if (!onView) {
onView = [FUSLiveHelper shareInstance].currentLiveVCView ?: popContainer;
}
if (!onView) {
onView = [UIViewController fus_topViewController].view;
}
if (strongSelf.showTimeFrostedView.superview) {
[strongSelf.showTimeFrostedView removeFromSuperview];
}
FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView];
strongSelf.showTimeFrostedView = bar;
bar.cancelHandler = ^{
__strong typeof(weakSelf) innerSelf = weakSelf;
innerSelf.showTimeFrostedView = nil;
};
NSString *finalTheme = (themeText.length > 0 ? themeText : [NSString fus_localString:@"我是表演主题表演主题"]);
NSString *remainingText = [NSString stringWithFormat:[NSString fus_localString:@"还差 %zd 张!"], (NSInteger)ticketCount];
[bar fus_updateWithState:FUSLiveShowTimeCollectFrostedStateStarted
themeText:finalTheme
progress:ticketCount
remainingText:remainingText
startTimestamp:[[NSDate date] timeIntervalSince1970]
newTicketCount:0
userModel:nil];
};
}
- (void)fus_bottomToolViewDidClickPKBtn:(FUSLiveBottomToolView *)bottomToolView livePkBtnState:(FUSLiveChatToolPKBtnState)livePkBtnState{
// switch (livePkBtnState) {
......@@ -673,4 +721,12 @@
[self closeTimer:self.giftTimer];
}
#pragma mark - 限时表演磨砂条
- (void)fus_destroyShowTimeFrostedIfNeeded {
if (self.showTimeFrostedView) {
[self.showTimeFrostedView fus_dismiss];
self.showTimeFrostedView = nil;
}
}
@end
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class FUSOnlineUserModel;
/// 集票磨砂条状态
typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedState) {
/// 刚开启
FUSLiveShowTimeCollectFrostedStateStarted = 0,
/// 有新票(展示 +N 提示)
FUSLiveShowTimeCollectFrostedStateNewTicket,
/// 集票完成
FUSLiveShowTimeCollectFrostedStateCompleted,
};
/// 限时表演集票磨砂条:展示集票进度/倒计时/取消入口
@interface FUSLiveShowTimeCollectFrostedView : UIView
/// 在指定视图底部展示磨砂条
/// @param onView 父视图
+ (instancetype)fus_showOnView:(UIView *)onView;
/// 更新展示内容(跟服务端对接时从这里刷新)
/// @param state 当前状态
/// @param themeText 表演主题
/// @param progress 0~1 进度
/// @param remainingText 剩余票提示,如“还差 49 张!”
/// @param startTimestamp 集票开始时间戳(秒)
/// @param newTicketCount 新票数(state=NewTicket 时使用)
/// @param userModel 新票贡献用户信息(nil 时不展示标题栏用户信息)
- (void)fus_updateWithState:(FUSLiveShowTimeCollectFrostedState)state
themeText:(NSString *)themeText
progress:(CGFloat)progress
remainingText:(NSString *)remainingText
startTimestamp:(NSTimeInterval)startTimestamp
newTicketCount:(NSInteger)newTicketCount
userModel:(FUSOnlineUserModel * _Nullable)userModel;
/// 取消按钮点击回调(预留服务端入口)
@property (nonatomic, copy, nullable) void (^cancelHandler)(void);
/// 移除磨砂条
- (void)fus_dismiss;
@end
NS_ASSUME_NONNULL_END
......@@ -2,6 +2,9 @@
NS_ASSUME_NONNULL_BEGIN
/// 开启集票点击回调
typedef void(^FUSLiveShowTimeStartCollectHandler)(NSString *themeText, NSInteger ticketCount);
/// “限时表演”底部弹窗(集票数量配置)
@interface FUSLiveShowTimePopView : UIView
......@@ -9,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
/// - Parameter onView: 承载弹窗的父视图
+ (instancetype)fus_showOnView:(UIView *)onView;
/// 点击“开启集票”后的回调(外部决定怎么展示集票磨砂条/调用接口)
@property (nonatomic, copy, nullable) FUSLiveShowTimeStartCollectHandler startCollectHandler;
@end
NS_ASSUME_NONNULL_END
......@@ -222,8 +222,10 @@ static const NSInteger kFUSShowTimeTicketMax = 50;
/// 点击主按钮:后续接入真实“开始集票/开启表演”逻辑
- (void)fus_onClickStart {
// 跟服务器相关逻辑先保留入口:后续接入接口时在这里提交 themeTextField/ticketCount
[FUSDialogView fus_showDialog:[NSString fus_localString:@"功能开发中"]];
if (self.startCollectHandler) {
NSString *themeText = (self.themeTextField.text.length > 0 ? self.themeTextField.text : @"");
self.startCollectHandler(themeText, self.ticketCount);
}
[self fus_dismiss];
}
......
......@@ -5813,6 +5813,9 @@ BDAlphaPlayerMetalViewDelegate
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_LIVE_ROOM_FUNCTION_VIEW_CLEAN_NOTIFICATION object:nil];
[_bottomToolView fus_cleanBottomToolView];
if (self.chatInputHelper) {
[self.chatInputHelper fus_destroyShowTimeFrostedIfNeeded];
}
[FUSLivePunishmentManager fus_removePunishData];
}
......
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