Commit cebed0a8 by suolong

用户进入限时表演窗口

parent b6f574a1
......@@ -1494,6 +1494,8 @@
BED659092C5B745E00668116 /* FUSLiveChatInputToolView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BED656062C5B745D00668116 /* FUSLiveChatInputToolView.swift */; };
BED6590A2C5B745E00668116 /* FUSLiveChatInputView.h in Headers */ = {isa = PBXBuildFile; fileRef = BED656072C5B745D00668116 /* FUSLiveChatInputView.h */; };
BED6590B2C5B745E00668116 /* FUSLiveChatInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = BED656082C5B745D00668116 /* FUSLiveChatInputView.m */; };
00F7AA012FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.h in Headers */ = {isa = PBXBuildFile; fileRef = 00F7AA032FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.h */; };
00F7AA022FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F7AA042FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.m */; };
BED6590C2C5B745E00668116 /* FUSLiveChatToolGiftTipView.h in Headers */ = {isa = PBXBuildFile; fileRef = BED656092C5B745D00668116 /* FUSLiveChatToolGiftTipView.h */; };
BED6590D2C5B745E00668116 /* FUSLiveChatToolGiftTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = BED6560A2C5B745D00668116 /* FUSLiveChatToolGiftTipView.m */; };
BED6590E2C5B745E00668116 /* FUSLiveShareView.h in Headers */ = {isa = PBXBuildFile; fileRef = BED6560B2C5B745D00668116 /* FUSLiveShareView.h */; };
......@@ -3918,6 +3920,8 @@
BED656062C5B745D00668116 /* FUSLiveChatInputToolView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSLiveChatInputToolView.swift; sourceTree = "<group>"; };
BED656072C5B745D00668116 /* FUSLiveChatInputView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveChatInputView.h; sourceTree = "<group>"; };
BED656082C5B745D00668116 /* FUSLiveChatInputView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveChatInputView.m; sourceTree = "<group>"; };
00F7AA032FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShowTimeAudienceEntryMainView.h; sourceTree = "<group>"; };
00F7AA042FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveShowTimeAudienceEntryMainView.m; sourceTree = "<group>"; };
BED656092C5B745D00668116 /* FUSLiveChatToolGiftTipView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveChatToolGiftTipView.h; sourceTree = "<group>"; };
BED6560A2C5B745D00668116 /* FUSLiveChatToolGiftTipView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSLiveChatToolGiftTipView.m; sourceTree = "<group>"; };
BED6560B2C5B745D00668116 /* FUSLiveShareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FUSLiveShareView.h; sourceTree = "<group>"; };
......@@ -6921,6 +6925,7 @@
00E6CB0A2F4D509F00B63797 /* FUSLiveChatInputToolCell.swift */,
BED656072C5B745D00668116 /* FUSLiveChatInputView.h */,
BED656082C5B745D00668116 /* FUSLiveChatInputView.m */,
00F7AA052FA1234500AA0001 /* ShowTimeAudienceEntry */,
BED656092C5B745D00668116 /* FUSLiveChatToolGiftTipView.h */,
BED6560A2C5B745D00668116 /* FUSLiveChatToolGiftTipView.m */,
BED6560B2C5B745D00668116 /* FUSLiveShareView.h */,
......@@ -6939,6 +6944,15 @@
path = ChatInputView;
sourceTree = "<group>";
};
00F7AA052FA1234500AA0001 /* ShowTimeAudienceEntry */ = {
isa = PBXGroup;
children = (
00F7AA032FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.h */,
00F7AA042FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.m */,
);
path = ShowTimeAudienceEntry;
sourceTree = "<group>";
};
00F7FF882FB1000100AAAA09 /* ShowTimePopups */ = {
isa = PBXGroup;
children = (
......@@ -9167,6 +9181,7 @@
BE189E252C733B460008418B /* FSRLinkmicdictActiveView.h in Headers */,
BED658A92C5B745E00668116 /* FUSVideoEndedView.h in Headers */,
BED6590A2C5B745E00668116 /* FUSLiveChatInputView.h in Headers */,
00F7AA012FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -10968,6 +10983,7 @@
BED6586E2C5B745E00668116 /* VELPictureInPictureController.m in Sources */,
BED65A992C5B745F00668116 /* FUSLiveManagerCell.m in Sources */,
BED6590B2C5B745E00668116 /* FUSLiveChatInputView.m in Sources */,
00F7AA022FA1234500AA0001 /* FUSLiveShowTimeAudienceEntryMainView.m in Sources */,
00E6CB272F4E9AB800B63797 /* FUSLiveReleasePunishmentView.m in Sources */,
00E6CB282F4E9AB800B63797 /* FUSLiveGlobalSpecialEffectView.m in Sources */,
00E6CB292F4E9AB800B63797 /* FUSLivePunishListCell.m in Sources */,
......@@ -32,6 +32,8 @@
#import "FUSPayRoomCompanionDataModel.h"
#import "FUSPayRoomCompanionPopView.h"
#import "FUSRechargeViewController.h"
#import "FUSLiveShowTimeAudienceEntryMainView.h"
#import "FUSTicketShowCollectTicketToggleResultModel.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h>
......@@ -999,6 +1001,28 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
[FUSAlertView showAlertWithTitle:nil message:errorDict[@"msg"] cancelButtonTitle:[NSString fus_localString:@"确定"] otherButtonTitles:nil clickBlock:^(NSInteger buttonIndex) {
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
}];
} else if (code == -40013) {
dispatch_async(dispatch_get_main_queue(), ^{
FUSStreamPlayStatus status = [self.liveVC.playView fus_statusForUID:currentRoomId];
if (status == FUSStreamPlayStatusPlaying
|| status == FUSStreamPlayStatusLoading
|| status == FUSStreamPlayStatusPause) {
[self.liveVC.playView fus_stopWithUID:currentRoomId];
[self.liveVC.playView fus_destroyAllPlayer];
[self.liveVC fus_stopPlay];
[self.liveVC destroyPlayPictureInPicture];
}
UIView *rootView = self.liveVC.view ?: [UIViewController fus_topViewController].view;
FUSLiveShowTimeAudienceEntryMainView *entry = [FUSLiveShowTimeAudienceEntryMainView fus_showOnView:rootView actionHandler:^(FUSLiveShowTimeAudienceEntryMainViewAction action, NSInteger selectedOptionIndex) {
if (action == FUSLiveShowTimeAudienceEntryMainViewActionDismiss) {
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
}
}];
NSString *channelId = [[errorDict[@"channelId"] description] ?: @"" copy];
NSString *roundId = [[errorDict[@"roundId"] description] ?: @"" copy];
[self fus_requestTicketShowBuyGetDataAndFillEntry:entry roomId:currentRoomId channelId:channelId roundId:roundId];
});
return;
} else {
// 其他情况
[FUSAlertView showAlertWithTitle:nil message:msg cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_localString:@"确定"], [NSString fus_localString:@"退出"]] clickBlock:^(NSInteger buttonIndex) {
......@@ -1016,6 +1040,28 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
}
}
/// 请求 /ticketshow/buy/getdata 并用返回模型刷新“限时表演”观众入场弹窗
- (void)fus_requestTicketShowBuyGetDataAndFillEntry:(FUSLiveShowTimeAudienceEntryMainView *)entry
roomId:(NSString *)roomId
channelId:(NSString *)channelId
roundId:(NSString *)roundId
{
__weak typeof(self) weakSelf = self;
[FUSLiveHttpHelper fus_ticketShowBuyGetDataWithRoomId:(roomId ?: @"")
channelId:([NSString isNull:channelId] ? @"" : channelId)
roundId:([NSString isNull:roundId] ? @"" : roundId)
succeed:^(FUSTicketShowCollectTicketToggleResultModel *model) {
dispatch_async(dispatch_get_main_queue(), ^{
NSString *anchorFace = [[weakSelf.roomInfoModel.face description] length] > 0 ? [weakSelf.roomInfoModel.face description] : @"";
[entry fus_updateWithBuyGetDataModel:model anchorFacePath:anchorFace];
});
} failure:^(NSString *msg, NSInteger code) {
dispatch_async(dispatch_get_main_queue(), ^{
[FUSDialogView fus_showDialog:(msg ?: @"")];
});
}];
}
/**
付费房磨砂弹层(-20065)处理:拉取磨砂数据并展示付费入口视图
*/
......
......@@ -20,8 +20,8 @@
@property (nonatomic, strong) UIImageView *ticketImageView;
/// 票数文本(示例:x1 / x10)
@property (nonatomic, strong) UILabel *countLabel;
/// 价格前置小圆点(视觉分隔
@property (nonatomic, strong) UIView *priceDotView;
/// 价格前置小图标(home_list_pay
@property (nonatomic, strong) UIImageView *priceDotView;
/// 价格文本(示例:100)
@property (nonatomic, strong) UILabel *priceLabel;
/// 价格区域容器(用于让小圆点与价格文本整体居中)
......@@ -61,10 +61,9 @@
self.countLabel.text = @"x--";
[self.cardView addSubview:self.countLabel];
self.priceDotView = [[UIView alloc] initWithFrame:CGRectZero];
self.priceDotView.backgroundColor = [UIColor colorWithHex:@"#52DDE2"];
self.priceDotView.layer.cornerRadius = 3;
self.priceDotView.layer.masksToBounds = YES;
self.priceDotView = [[UIImageView alloc] initWithFrame:CGRectZero];
self.priceDotView.contentMode = UIViewContentModeScaleAspectFit;
self.priceDotView.image = [FUSShowRoomCenterBunble imageNamed:@"home_list_pay"];
[self.cardView addSubview:self.priceDotView];
self.priceLabel = [[UILabel alloc] initWithFrame:CGRectZero];
......@@ -108,13 +107,13 @@
make.top.equalTo(self.countLabel.mas_bottom).offset(6);
make.centerX.equalTo(self.cardView);
make.height.mas_equalTo(16);
make.width.equalTo(self.priceLabel.mas_width).offset(10);
make.width.equalTo(self.priceLabel.mas_width).offset(16);
}];
[self.priceDotView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.priceContainerView);
make.centerY.equalTo(self.priceContainerView);
make.width.height.mas_equalTo(6);
make.width.height.mas_equalTo(12);
}];
[self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
......
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class FUSTicketShowCollectTicketToggleResultModel;
/// 观众进入“限时表演中”房间时的入口弹窗交互类型
typedef NS_ENUM(NSInteger, FUSLiveShowTimeAudienceEntryMainViewAction) {
/// 关闭弹窗(点击背景或右上角关闭按钮)
FUSLiveShowTimeAudienceEntryMainViewActionDismiss = 0,
/// 点击“进入限时表演”主按钮
FUSLiveShowTimeAudienceEntryMainViewActionEnter = 1,
/// 点击“活动须知”入口
FUSLiveShowTimeAudienceEntryMainViewActionNotice = 2,
/// 点击票券档位(仅改变选择,不直接发起业务)
FUSLiveShowTimeAudienceEntryMainViewActionSelectTicketOption = 3,
};
/// 票券档位字典 Key:票数文案(示例:x1 / x10 / x5)
FOUNDATION_EXPORT NSString * const FUSLiveShowTimeAudienceEntryTicketOptionCountTextKey;
/// 票券档位字典 Key:价格文案(示例:100;不可用时建议传“--”,避免误导为免费)
FOUNDATION_EXPORT NSString * const FUSLiveShowTimeAudienceEntryTicketOptionPriceTextKey;
/// 票券档位字典 Key:贴附标签文案(示例:直接开始/抢当MVP;为空则不展示)
FOUNDATION_EXPORT NSString * const FUSLiveShowTimeAudienceEntryTicketOptionTagTextKey;
/// “限时表演中”观众入场弹窗(对齐 FUSPayRoomEntryMainView 的展示方式:全屏遮罩 + 居中白色卡片)
@interface FUSLiveShowTimeAudienceEntryMainView : UIView
/// 交互事件回调(仅分发用户意图;接口请求与跳转由外部决定)
@property (nonatomic, copy, nullable) void (^actionHandler)(FUSLiveShowTimeAudienceEntryMainViewAction action, NSInteger selectedOptionIndex);
/// 点击背景是否触发关闭(部分强引导场景可置 NO 以避免误触关闭)
@property (nonatomic, assign) BOOL dismissWhenTapBackground;
/// 在指定父视图上展示(会复用已存在实例,避免遮罩叠加造成层级/触摸问题)
/// - Parameters:
/// - rootView: 承载弹窗的父视图
/// - actionHandler: 交互回调(回传 action 与当前 selectedOptionIndex)
+ (instancetype)fus_showOnView:(UIView *)rootView
actionHandler:(void (^ _Nullable)(FUSLiveShowTimeAudienceEntryMainViewAction action, NSInteger selectedOptionIndex))actionHandler;
/// 基于 /ticketshow/buy/getdata 返回模型刷新整个弹窗展示(标题/倒计时/票档位等)
/// - Parameters:
/// - model: /ticketshow/buy/getdata 模型
/// - anchorFacePath: 主播头像地址(接口无头像,需外部传入)
- (void)fus_updateWithBuyGetDataModel:(FUSTicketShowCollectTicketToggleResultModel *)model
anchorFacePath:(nullable NSString *)anchorFacePath;
/// 关闭并移除弹窗(默认带渐隐缩放动画)
- (void)fus_dismissAnimated:(BOOL)animated;
@end
NS_ASSUME_NONNULL_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