Commit 6121e428 by suolong

添加贡献列表

parent 75fc8c51
......@@ -32,6 +32,7 @@
#import "FUSLiveShowTimeCollectFrostedView.h"
#import "FUSLiveRoomThemePopView.h"
#import "FUSLiveShowTimeTicketActionPopView.h"
#import "FUSLiveShowTimeTicketContributionPopView.h"
#import "FUSLiveShowTimeCancelConfirmPopView.h"
#import "FUSLiveFunctionLayerView.h"
......@@ -208,6 +209,71 @@
}];
}
/// 绑定“限时表演磨砂条”头像点击回调(抛到外层展示“票的贡献”弹窗)
- (void)fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:(FUSLiveShowTimeCollectFrostedView *)bar {
if (!bar) {
return;
}
__weak typeof(self) weakSelf = self;
__weak typeof(bar) weakBar = bar;
bar.avatarTapHandler = ^(FUSLiveShowTimeCollectFrostedAvatarTapType tapType) {
(void)tapType;
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
return;
}
__strong typeof(weakBar) strongBar = weakBar;
if (!strongBar) {
return;
}
[strongSelf fus_presentShowTimeTicketContributionPopupFromBar:strongBar];
};
}
/// 展示“票的贡献”弹窗,并拉取贡献列表数据
- (void)fus_presentShowTimeTicketContributionPopupFromBar:(FUSLiveShowTimeCollectFrostedView *)bar {
(void)bar;
UIView *containerView = [[FUSLiveHelper shareInstance].currentFunctionView fus_viewWithLayer:FUSLiveFunctionLayerManualPopView];
if (!containerView) {
containerView = [UIViewController fus_topViewController].view;
}
if (!containerView) {
return;
}
FUSRoomInfoModel *roomInfoModel = FUSLiveHelper.shareInstance.roomInfoModel;
NSString *roomId = roomInfoModel.roomId;
NSString *channelId = roomInfoModel.channelId;
NSString *roundId = self.showTimeRoundId;
if ([NSString isNull:roomId] || [NSString isNull:channelId] || [NSString isNull:roundId]) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"当前回合信息异常"]];
return;
}
FUSLiveShowTimeTicketContributionPopView *popView = [FUSLiveShowTimeTicketContributionPopView fus_showOnView:containerView];
[popView fus_updateTotalCount:0];
[popView fus_updateContributionList:@[]];
__weak typeof(popView) weakPopView = popView;
[FUSLoadingView fus_showProgressViewWithMessage:@""];
[FUSLiveHttpHelper fus_ticketShowRankListWithRoomId:roomId channelId:channelId roundId:roundId succeed:^(FUSTicketShowRankListResultModel * _Nonnull model) {
dispatch_async(dispatch_get_main_queue(), ^{
[FUSLoadingView fus_dismissProgressView];
FUSLiveShowTimeTicketContributionPopView *strongPopView = weakPopView;
if (!strongPopView.superview) {
return;
}
[strongPopView fus_updateTotalCount:model.allTotal];
[strongPopView fus_updateContributionList:(model.dataList ?: @[])];
});
} failure:^(NSString * _Nonnull msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{
[FUSLoadingView fus_dismissProgressView];
[FUSDialogView fus_showDialog:([NSString isNull:msg] ? [NSString fus_localString:@"获取失败"] : msg)];
});
}];
}
#pragma mark - Getter
#pragma mark - Notification
// 注册消息回执通知
......@@ -300,6 +366,7 @@
FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView];
self.showTimeFrostedView = bar;
[self fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:bar];
// roundId 用于主播端取消集票
NSString *previousRoundId = (self.showTimeRoundId.length > 0 ? self.showTimeRoundId : @"");
......@@ -985,6 +1052,7 @@
FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView];
innerSelf.showTimeFrostedView = bar;
innerSelf.showTimeRoundId = model.stageData.roundId ?: @"";
[innerSelf fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:bar];
__weak typeof(innerSelf) weakInnerSelf = innerSelf;
bar.cancelHandler = ^{
......@@ -1356,6 +1424,7 @@
FUSLiveShowTimeCollectFrostedView *bar = [FUSLiveShowTimeCollectFrostedView fus_showOnView:onView];
self.showTimeFrostedView = bar;
[self fus_bindShowTimeFrostedAvatarTapHandlerIfNeeded:bar];
bar.displayMode = FUSLiveShowTimeCollectFrostedDisplayModeAudience;
bar.cancelHandler = nil;
bar.stageStatus = 0;
......
......@@ -22,6 +22,14 @@ typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedDisplayMode) {
FUSLiveShowTimeCollectFrostedDisplayModeAudience,
};
/// 磨砂条头像点击类型
typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedAvatarTapType) {
/// 顶部左侧:赠票用户头像
FUSLiveShowTimeCollectFrostedAvatarTapTypeGiftUser = 0,
/// 右侧:MVP 头像
FUSLiveShowTimeCollectFrostedAvatarTapTypeMVPUser,
};
/// 限时表演集票磨砂条:展示集票进度/倒计时/取消入口
@interface FUSLiveShowTimeCollectFrostedView : UIView
......@@ -85,6 +93,9 @@ typedef NS_ENUM(NSInteger, FUSLiveShowTimeCollectFrostedDisplayMode) {
/// 阶段状态(来自服务端 stageData.showStatus,用于展示“表演中”等状态标签)
@property (nonatomic, assign) NSInteger stageStatus;
/// 点击顶部头像回调(抛到外层处理:如展示“票的贡献”弹窗)
@property (nonatomic, copy, nullable) void (^avatarTapHandler)(FUSLiveShowTimeCollectFrostedAvatarTapType tapType);
/// 移除磨砂条
- (void)fus_dismiss;
......
......@@ -149,6 +149,9 @@ static const NSInteger kFUSShowTimeCollectSeconds = 10 * 60;
self.avatarView.layer.cornerRadius = 11;
self.avatarView.layer.masksToBounds = YES;
self.avatarView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
self.avatarView.userInteractionEnabled = YES;
UITapGestureRecognizer *giftAvatarTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onTapGiftAvatar)];
[self.avatarView addGestureRecognizer:giftAvatarTap];
[self.topTicketInfoContainerView addSubview:self.avatarView];
self.topTitleLabel = [[UILabel alloc] init];
......@@ -262,6 +265,9 @@ static const NSInteger kFUSShowTimeCollectSeconds = 10 * 60;
self.mvpAvatarView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.2];
self.mvpAvatarView.layer.cornerRadius = 21;
self.mvpAvatarView.layer.masksToBounds = YES;
self.mvpAvatarView.userInteractionEnabled = YES;
UITapGestureRecognizer *mvpAvatarTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fus_onTapMvpAvatar)];
[self.mvpAvatarView addGestureRecognizer:mvpAvatarTap];
[self.blurView.contentView addSubview:self.mvpAvatarView];
self.mvpTagLabel = [[UILabel alloc] init];
......@@ -862,4 +868,18 @@ static const NSInteger kFUSShowTimeCollectSeconds = 10 * 60;
[self fus_stopCountdownTimer];
}
/// 点击顶部赠票用户头像:抛到外层
- (void)fus_onTapGiftAvatar {
if (self.avatarTapHandler) {
self.avatarTapHandler(FUSLiveShowTimeCollectFrostedAvatarTapTypeGiftUser);
}
}
/// 点击右侧 MVP 头像:抛到外层
- (void)fus_onTapMvpAvatar {
if (self.avatarTapHandler) {
self.avatarTapHandler(FUSLiveShowTimeCollectFrostedAvatarTapTypeMVPUser);
}
}
@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