Commit e388292f by suolong

新增fromlivescope和tolivescope

parent b8414d4b
...@@ -691,7 +691,7 @@ ...@@ -691,7 +691,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260053; CURRENT_PROJECT_VERSION = 202506260054;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
...@@ -956,7 +956,7 @@ ...@@ -956,7 +956,7 @@
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements; CODE_SIGN_ENTITLEMENTS = FuSiLive/FuSiLive.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 202506260053; CURRENT_PROJECT_VERSION = 202506260054;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
......
...@@ -1667,6 +1667,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) { ...@@ -1667,6 +1667,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
if (![roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) { if (![roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
return; return;
} }
NSInteger liveScope = [dict[@"liveScope"] integerValue];
[FUSLiveHelper shareInstance].roomInfoModel.liveScope = liveScope;
[FUSLiveHelper shareInstance].roomScopeType = liveScope;
if ([dict[@"mode"] integerValue] != 0) { if ([dict[@"mode"] integerValue] != 0) {
return; return;
......
...@@ -242,9 +242,9 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor ...@@ -242,9 +242,9 @@ static NSString *const KLiveDataCenter_store_liveRTCData = @"LiveDataCenter_stor
NSDictionary *encryptionData = [FUSHttpHelper fus_parseJSONDictionaryLayerByLayerWithObject:dict[@"encryptionData"]]; NSDictionary *encryptionData = [FUSHttpHelper fus_parseJSONDictionaryLayerByLayerWithObject:dict[@"encryptionData"]];
[self.roomInfoModel.encryptionData fus_setValueWithDict:encryptionData]; [self.roomInfoModel.encryptionData fus_setValueWithDict:encryptionData];
NSInteger liveScope = [dict[@"liveScope"] integerValue];
NSInteger liveScope = [dict[@"mode"] integerValue]; self.roomInfoModel.liveScope = liveScope;
self.roomScopeType = liveScope == 1 ? FUSLiveRoomScopeTypePassword : FUSLiveRoomScopeTypeOpen; self.roomScopeType = liveScope;
} }
} }
......
...@@ -200,11 +200,15 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -200,11 +200,15 @@ NS_ASSUME_NONNULL_BEGIN
/// 切换直播范围 /// 切换直播范围
/// @param fid 当前主播的id /// @param fid 当前主播的id
/// @param cancel 取消状态 0:否 1:是 /// @param cancel 取消状态 0:否 1:是
/// @param fromLiveScope 当前房间范围(0公开屋 3付费屋 4私享屋)
/// @param toLiveScope 要切换成的房间范围(0公开屋 3付费屋 4私享屋)
/// @param password 密码(cancel=0必传) /// @param password 密码(cancel=0必传)
/// @param success 成功回调 /// @param success 成功回调
/// @param failure 失败回调 /// @param failure 失败回调
+ (void)fus_requestChangedPassword:(NSInteger)cancel + (void)fus_requestChangedPassword:(NSInteger)cancel
fid:(NSInteger)fid fid:(NSInteger)fid
fromLiveScope:(NSInteger)fromLiveScope
toLiveScope:(NSInteger)toLiveScope
password:(NSString *)password password:(NSString *)password
success:(void (^)(void))success success:(void (^)(void))success
failure:(void (^)(NSString *msg, int code))failure; failure:(void (^)(NSString *msg, int code))failure;
...@@ -1243,10 +1247,14 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -1243,10 +1247,14 @@ NS_ASSUME_NONNULL_BEGIN
/// @param uid 用户ID /// @param uid 用户ID
/// @param fid 主播ID /// @param fid 主播ID
/// @param cancel 取消状态 0:否 1:是 /// @param cancel 取消状态 0:否 1:是
/// @param fromLiveScope 当前房间范围(0公开屋 3付费屋 4私享屋)
/// @param toLiveScope 要切换成的房间范围(0公开屋 3付费屋 4私享屋)
/// @param failure 0 /// @param failure 0
+(void)fus_requestLiveChangePayWithUid:(NSString *)uid +(void)fus_requestLiveChangePayWithUid:(NSString *)uid
fid:(NSString *)fid fid:(NSString *)fid
cancel:(NSString *)cancel cancel:(NSString *)cancel
fromLiveScope:(NSInteger)fromLiveScope
toLiveScope:(NSInteger)toLiveScope
succeed:(void (^)(NSDictionary *dataDict))succeed succeed:(void (^)(NSDictionary *dataDict))succeed
failure:(void(^)(NSString *msg,NSInteger code))failure; failure:(void(^)(NSString *msg,NSInteger code))failure;
/// 视图-获取用户列表:陪伴中、试看中 /// 视图-获取用户列表:陪伴中、试看中
......
...@@ -2537,16 +2537,24 @@ ...@@ -2537,16 +2537,24 @@
/// 切换直播范围 /// 切换直播范围
/// @param fid 当前主播的id /// @param fid 当前主播的id
/// @param cancel 取消状态 0:否 1:是 /// @param cancel 取消状态 0:否 1:是
/// @param fromLiveScope 当前房间范围(0公开屋 3付费屋 4私享屋)
/// @param toLiveScope 要切换成的房间范围(0公开屋 3付费屋 4私享屋)
/// @param password 密码(cancel=0必传) /// @param password 密码(cancel=0必传)
/// @param success 成功回调 /// @param success 成功回调
/// @param failure 失败回调 /// @param failure 失败回调
+ (void)fus_requestChangedPassword:(NSInteger)cancel + (void)fus_requestChangedPassword:(NSInteger)cancel
fid:(NSInteger)fid fid:(NSInteger)fid
fromLiveScope:(NSInteger)fromLiveScope
toLiveScope:(NSInteger)toLiveScope
password:(NSString *)password password:(NSString *)password
success:(void (^)(void))success success:(void (^)(void))success
failure:(void (^)(NSString *msg, int code))failure { failure:(void (^)(NSString *msg, int code))failure {
NSDictionary *params = @{@"fid":@(fid),@"cancel":@(cancel),@"password":password}; NSDictionary *params = @{@"fid":@(fid),
@"cancel":@(cancel),
@"password":password,
@"fromLiveScope":@(fromLiveScope),
@"toLiveScope":@(toLiveScope)};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_CHANGE_Password params:params success:^(NSDictionary *dataDict, int code) { [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_CHANGE_Password params:params success:^(NSDictionary *dataDict, int code) {
if (cancel == 0) { if (cancel == 0) {
...@@ -3683,16 +3691,22 @@ ...@@ -3683,16 +3691,22 @@
/// @param uid 用户ID /// @param uid 用户ID
/// @param fid 主播ID /// @param fid 主播ID
/// @param cancel 取消状态 0:否 1:是 /// @param cancel 取消状态 0:否 1:是
/// @param fromLiveScope 当前房间范围(0公开屋 3付费屋 4私享屋)
/// @param toLiveScope 要切换成的房间范围(0公开屋 3付费屋 4私享屋)
/// @param failure 0 /// @param failure 0
+(void)fus_requestLiveChangePayWithUid:(NSString *)uid +(void)fus_requestLiveChangePayWithUid:(NSString *)uid
fid:(NSString *)fid fid:(NSString *)fid
cancel:(NSString *)cancel cancel:(NSString *)cancel
fromLiveScope:(NSInteger)fromLiveScope
toLiveScope:(NSInteger)toLiveScope
succeed:(void (^)(NSDictionary *dataDict))succeed succeed:(void (^)(NSDictionary *dataDict))succeed
failure:(void(^)(NSString *msg,NSInteger code))failure failure:(void(^)(NSString *msg,NSInteger code))failure
{ {
NSDictionary *parm = @{@"uid": uid, NSDictionary *parm = @{@"uid": uid,
@"fid":fid, @"fid":fid,
@"cancel":cancel}; @"cancel":cancel,
@"fromLiveScope":@(fromLiveScope),
@"toLiveScope":@(toLiveScope)};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_liveChangePay params:parm success:^(NSDictionary * _Nullable dataDict, int code) { [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_liveChangePay params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
if (succeed) { if (succeed) {
......
...@@ -309,17 +309,21 @@ import FUSCommon ...@@ -309,17 +309,21 @@ import FUSCommon
/// - 设计说明: /// - 设计说明:
/// - scopeType == .password:调用 /live/change/password(0) 开启私享屋(设置密码) /// - scopeType == .password:调用 /live/change/password(0) 开启私享屋(设置密码)
/// - scopeType == .open:调用 /live/change/password(1) 取消私享屋(恢复公开) /// - scopeType == .open:调用 /live/change/password(1) 取消私享屋(恢复公开)
/// - fromLiveScope:当前房间范围(主播当前所在房间)
/// - toLiveScope:要切换成的房间范围(主播目标房间)
/// - 注意: /// - 注意:
/// - “付费屋 → 公开屋”不调用该接口(由 /live/change/pay(cancel=1) 撤销付费并回到公开) /// - “付费屋 → 公开屋”不调用该接口(由 /live/change/pay(cancel=1) 撤销付费并回到公开)
/// - “付费屋 → 私享屋”需先撤销付费,再进入设置密码流程 /// - “付费屋 → 私享屋”需先撤销付费,再进入设置密码流程
private func fus_changeScopeRequest(scopeType: FUSLiveRoomScopeType, password:String) { private func fus_changeScopeRequest(scopeType: FUSLiveRoomScopeType, password:String) {
guard let roomID = FUSLiveHelper.shareInstance().roomInfoModel?.roomId else { return } guard let roomID = FUSLiveHelper.shareInstance().roomInfoModel?.roomId else { return }
let fromLiveScope = FUSLiveHelper.shareInstance().roomScopeType.rawValue
let toLiveScope = scopeType.rawValue
// FUSIndicator.showProgress(withMessage: "") // FUSIndicator.showProgress(withMessage: "")
FUSLoadingIndicator.fus_show(canTouch: true) FUSLoadingIndicator.fus_show(canTouch: true)
FUSLiveHttpHelper.fus_requestChangedPassword(scopeType == .password ? 0 : 1, fid: roomID.intValue, password: password, success: { [weak self] in FUSLiveHttpHelper.fus_requestChangedPassword(scopeType == .password ? 0 : 1, fid: roomID.intValue, fromLiveScope: fromLiveScope, toLiveScope: toLiveScope, password: password, success: { [weak self] in
self?.fus_dismissWithAnimation() self?.fus_dismissWithAnimation()
...@@ -440,9 +444,11 @@ import FUSCommon ...@@ -440,9 +444,11 @@ import FUSCommon
completion(false) completion(false)
return return
} }
let fromLiveScope = FUSLiveHelper.shareInstance().roomScopeType.rawValue
let toLiveScope = FUSLiveRoomScopeType.open.rawValue
FUSLoadingIndicator.fus_show(canTouch: true) FUSLoadingIndicator.fus_show(canTouch: true)
FUSLiveHttpHelper.fus_requestChangedPassword(1, fid: roomID.intValue, password: "", success: { FUSLiveHttpHelper.fus_requestChangedPassword(1, fid: roomID.intValue, fromLiveScope: fromLiveScope, toLiveScope: toLiveScope, password: "", success: {
FUSLoadingIndicator.fus_dismiss() FUSLoadingIndicator.fus_dismiss()
FUSLiveHelper.shareInstance().roomScopeType = .open FUSLiveHelper.shareInstance().roomScopeType = .open
FUSLiveHelper.shareInstance().currentFunctionView?.fus_updateRoomScoreType() FUSLiveHelper.shareInstance().currentFunctionView?.fus_updateRoomScoreType()
...@@ -457,6 +463,8 @@ import FUSCommon ...@@ -457,6 +463,8 @@ import FUSCommon
/// 切换“付费屋”接口封装 /// 切换“付费屋”接口封装
/// - 参数: /// - 参数:
/// - cancel: "0" 表示开启付费(切到付费屋);"1" 表示撤销付费(回到公开屋) /// - cancel: "0" 表示开启付费(切到付费屋);"1" 表示撤销付费(回到公开屋)
/// - fromLiveScope:当前房间范围(主播当前所在房间)
/// - toLiveScope:要切换成的房间范围(主播目标房间)
/// - 成功后: /// - 成功后:
/// - cancel == "0":同步 roundId(付费回合ID),设置 .pay 并刷新 UI /// - cancel == "0":同步 roundId(付费回合ID),设置 .pay 并刷新 UI
/// - cancel == "1":清空 roundId,设置 .open 并刷新 UI /// - cancel == "1":清空 roundId,设置 .open 并刷新 UI
...@@ -467,9 +475,11 @@ import FUSCommon ...@@ -467,9 +475,11 @@ import FUSCommon
completion?(false) completion?(false)
return return
} }
let fromLiveScope = FUSLiveHelper.shareInstance().roomScopeType.rawValue
let toLiveScope = (cancel ? FUSLiveRoomScopeType.open.rawValue : FUSLiveRoomScopeType.pay.rawValue)
FUSLoadingIndicator.fus_show(canTouch: true) FUSLoadingIndicator.fus_show(canTouch: true)
FUSLiveHttpHelper.fus_requestLiveChangePay(withUid: uid, fid: fid, cancel: cancel ? "1" : "0", succeed: { [weak self] dataDict in FUSLiveHttpHelper.fus_requestLiveChangePay(withUid: uid, fid: fid, cancel: cancel ? "1" : "0", fromLiveScope: fromLiveScope, toLiveScope: toLiveScope, succeed: { [weak self] dataDict in
guard let self = self else { return } guard let self = self else { return }
FUSLoadingIndicator.fus_dismiss() FUSLoadingIndicator.fus_dismiss()
......
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