Commit 41ac5dbe by suolong

添加roundid

parent db487087
......@@ -94,6 +94,7 @@
@property (nonatomic, copy) NSString *faceimg; // 包房封面
@property (nonatomic, copy) NSString *gagEndTime; // 禁言时间
@property (nonatomic, copy) NSString *channelId;
@property (nonatomic, copy) NSString *roundId; // 付费房回合ID(主播端开启付费房/切换付费房时返回,用于付费房相关数据拉取与统计)
//@property (nonatomic, copy) NSString *guard; // 总榜守护 UID
@property (nonatomic, copy) NSString *monGuard; // 月榜守护 UID
@property (nonatomic, copy) NSString *weekGuard; // 周榜守护 UID
......
......@@ -914,6 +914,12 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
- (void)fus_startPushSucceedWithDict:(NSDictionary *)dict {
[self.liveFunctionView fus_LivePushSuccess];
FUSSwiftLiveHelper.shared.roomInfoModel.channelId = [dict[@"channelId"] description];
// roundId:付费房回合ID。主播端开播时若直接选择付费房(或后续切换为付费房),服务端会返回该回合ID,用于付费房数据拉取与展示。
NSString *roundId = [dict[@"roundId"] description];
if (![NSString isNull:roundId]) {
FUSSwiftLiveHelper.shared.roomInfoModel.roundId = roundId;
[FUSLiveHelper shareInstance].roomInfoModel.roundId = roundId;
}
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveNotificationKeys.fus_FUS_LIVE_ROOM_SHOW_PKBTN object:[dict[@"isShowPk"] description]];
......@@ -933,6 +939,10 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
}];
FUSSwiftLiveHelper.shared.roomInfoModel.channelId = [dict[@"channelId"] description];
if (![NSString isNull:roundId]) {
FUSSwiftLiveHelper.shared.roomInfoModel.roundId = roundId;
[FUSLiveHelper shareInstance].roomInfoModel.roundId = roundId;
}
[[NSNotificationCenter defaultCenter] postNotificationName:FUSLiveUDKeys.fus_IS_JOIN_ROOM_SUCCESS object:@(YES)];
......
......@@ -1063,6 +1063,16 @@ NS_ASSUME_NONNULL_BEGIN
roundId:(NSString *)roundId
succeed:(void (^)(NSDictionary *dataDict))succeed
failure:(void(^)(NSString *msg,NSInteger code))failure;
/// 切换付费模式V2
/// @param uid 用户ID
/// @param fid 主播ID
/// @param cancel 取消状态 0:否 1:是
/// @param failure 0
+(void)fus_requestLiveChangePayWithUid:(NSString *)uid
fid:(NSString *)fid
cancel:(NSString *)cancel
succeed:(void (^)(NSDictionary *dataDict))succeed
failure:(void(^)(NSString *msg,NSInteger code))failure;
@end
......
......@@ -2821,6 +2821,11 @@
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_Live_Before_GetLiveInfo params:@{} success:^(NSDictionary * _Nullable dataDict, int code) {
NSDictionary *liveGasStation = dataDict[@"liveGasStation"];
// roundId:付费房回合ID。用于“开播前/恢复直播”的场景同步当前回合,后续付费房数据请求会依赖该值进行准确匹配。
NSString *roundId = [dataDict[@"roundId"] description];
if (![NSString isNull:roundId] && FUSLiveHelper.shareInstance.roomInfoModel) {
FUSLiveHelper.shareInstance.roomInfoModel.roundId = roundId;
}
if (succeed) succeed(liveGasStation[@"publicizeConfig"],
liveGasStation[@"gasStationConfig"]);
......@@ -2974,5 +2979,27 @@
if (failure) failure(dataDict[@"msg"],code);
}];
}
/// 切换付费模式V2
/// @param uid 用户ID
/// @param fid 主播ID
/// @param cancel 取消状态 0:否 1:是
/// @param failure 0
+(void)fus_requestLiveChangePayWithUid:(NSString *)uid
fid:(NSString *)fid
cancel:(NSString *)cancel
succeed:(void (^)(NSDictionary *dataDict))succeed
failure:(void(^)(NSString *msg,NSInteger code))failure
{
NSDictionary *parm = @{@"uid": uid,
@"fid":fid,
@"cancel":cancel};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_liveChangePay params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
if (succeed) {
succeed(dataDict);
}
}failure:^(NSDictionary * _Nullable dataDict, int code) {
if (failure) failure(dataDict[@"msg"],code);
}];
}
@end
......@@ -142,7 +142,7 @@
self.titleLabel.font = [UIFont boldSystemFontOfSize:13];
self.titleLabel.textColor = [UIColor colorWithRed:0 green:(51.0 / 255.0) blue:(51.0 / 255.0) alpha:1.0];
self.titleLabel.textAlignment = NSTextAlignmentLeft;
self.titleLabel.text = [NSString fus_localString:@"付费"];
self.titleLabel.text = [NSString fus_localString:@"付费"];
[self.titleContainerView addSubview:self.titleLabel];
CGFloat statsY = self.headerView.bottom;
......@@ -262,7 +262,11 @@
FUSRoomInfoModel *roomInfoModel = [FUSLiveHelper shareInstance].roomInfoModel;
NSString *roomId = [roomInfoModel.roomId description];
NSString *channelId = [roomInfoModel.channelId description];
NSString *roundId = @"";
// roundId:付费房回合ID。用于把“本次付费房回合”的数据精确拉取出来(开播直接选择付费房 / 恢复直播 / 切换为付费房等场景会赋值)。
NSString *roundId = [roomInfoModel.roundId description];
if ([NSString isNull:roundId]) {
roundId = @"";
}
if ([NSString isNull:uid] || [NSString isNull:roomId] || [NSString isNull:channelId]) {
self.isRequestingPayRoomData = NO;
......
......@@ -545,7 +545,8 @@ NS_ASSUME_NONNULL_BEGIN
+ (NSString *)fus_URL_liveGetPayRoomData;
/// 获取首页自动跳转直播间
+ (NSString *)fus_URL_indexGetSuccessRecommendResult;
/// 切换付费模式V2
+ (NSString *)fus_URL_liveChangePay;
@end
......
......@@ -884,7 +884,13 @@
/// 主播获取左侧小窗付费房信息
+ (NSString *)fus_URL_liveGetPayRoomData
{
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"payRoom/getPayRoomData"];
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/payRoom/getPayRoomData"];
}
/// 切换付费模式V2
+ (NSString *)fus_URL_liveChangePay
{
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/change/pay"];
}
......
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