Commit 3ace3508 by pidan

备份代码

parent 0fe6d701
Showing with 354 additions and 76 deletions
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
#define ROOM_CID_LIKE 11003 // 点赞 #define ROOM_CID_LIKE 11003 // 点赞
#define ROOM_CID_LIVE_STATU 11004 // 直播状态改变 #define ROOM_CID_LIVE_STATU 11004 // 直播状态改变
#define ROOM_CID_RECOMMEND_ANCHOR_LIVE_STATU 11005 // 推荐的主播直播状态 #define ROOM_CID_RECOMMEND_ANCHOR_LIVE_STATU 11005 // 推荐的主播直播状态
#define ROOM_CID_LIVE_SCOPE_DID_CHANGED 11008 // 切换直播范围 #define ROOM_CID_LIVE_SCOPE_DID_CHANGED 11017 // 切换直播范围
#define ROOM_CID_LIVE_ROOM_TYPE_CHANGED 11009 // 切换直播类型 #define ROOM_CID_LIVE_ROOM_TYPE_CHANGED 11009 // 切换直播类型
#define ROOM_CID_BECOME_FANS_GROUP_MEMBER 11010 // 用户成为粉丝团成员 #define ROOM_CID_BECOME_FANS_GROUP_MEMBER 11010 // 用户成为粉丝团成员
#define ROOM_CID_RoomPopularChanged 11019 // 人气值变化消息 #define ROOM_CID_RoomPopularChanged 11019 // 人气值变化消息
......
...@@ -141,6 +141,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -141,6 +141,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 上一次开播的标题 /// 上一次开播的标题
+ (NSString *)fus_lastLiveTitleUDKey; + (NSString *)fus_lastLiveTitleUDKey;
/// 上一次设置的开播密码
+ (NSString *)fus_lastLivePasswordUDKEY;
@end @end
@interface FUSLiveNotificationKeys : NSObject @interface FUSLiveNotificationKeys : NSObject
......
...@@ -230,6 +230,11 @@ ...@@ -230,6 +230,11 @@
return @"fus_lastLiveTitleUDKey"; return @"fus_lastLiveTitleUDKey";
} }
/// 上一次设置的开播密码
+ (NSString *)fus_lastLivePasswordUDKEY {
return @"fus_lastLivePasswordUDKEY";
}
@end @end
......
...@@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -48,6 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 封面地址的icon /// 封面地址的icon
-(UIImage *)liveSmallCellAdressIcon; -(UIImage *)liveSmallCellAdressIcon;
- (NSString *)liveRoomPassword;
#pragma mark - Views #pragma mark - Views
- (FUSPublicLiveGiftSendView *)fus_createLiveGiftSendViewWithFrame:(CGRect)frame; - (FUSPublicLiveGiftSendView *)fus_createLiveGiftSendViewWithFrame:(CGRect)frame;
- (FUSPublicVideoChatUserInfoView *)fus_createVideoChatUserInfoView; - (FUSPublicVideoChatUserInfoView *)fus_createVideoChatUserInfoView;
......
...@@ -17,6 +17,21 @@ ...@@ -17,6 +17,21 @@
@end @end
@interface FUSRoomEncryptionData : FUSBaseModel
/// 初始密码
@property (nonatomic, copy) NSString *password;
/// 初始密码描述
@property (nonatomic, copy) NSString *passwordShow;
/// 开启公开房(-1:受限)
@property (nonatomic, copy) NSString *liveScopeOpen;
/// 受限提示文案
@property (nonatomic, copy) NSString *liveScopeOpenShow;
@end
@interface FUSRoomInfoModel : FUSBaseModel @interface FUSRoomInfoModel : FUSBaseModel
@property (nonatomic, copy) NSString *bonds; // 主播的萤火 @property (nonatomic, copy) NSString *bonds; // 主播的萤火
...@@ -91,6 +106,9 @@ ...@@ -91,6 +106,9 @@
/// 直播主题信息 /// 直播主题信息
@property (nonatomic, strong) FUSLiveThemeModel *theme; @property (nonatomic, strong) FUSLiveThemeModel *theme;
/// 私享房信息
@property (nonatomic, strong) FUSRoomEncryptionData *encryptionData;
@property (nonatomic, copy) NSArray<NSString *> *reminderKeys; @property (nonatomic, copy) NSArray<NSString *> *reminderKeys;
- (void)fus_setModelWithMyRoomInfos; - (void)fus_setModelWithMyRoomInfos;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
//嵌套的 model //嵌套的 model
+ (NSDictionary *)modelContainerPropertyGenericClass { + (NSDictionary *)modelContainerPropertyGenericClass {
return @{@"stateSwitch":[FUSLiveRoomStateSwitchModel class], @"theme":[FUSLiveThemeModel class]}; return @{@"stateSwitch":[FUSLiveRoomStateSwitchModel class], @"theme":[FUSLiveThemeModel class], @"encryptionData":[FUSRoomEncryptionData class]};
} }
...@@ -47,3 +47,7 @@ ...@@ -47,3 +47,7 @@
@implementation FUSLiveRoomStateSwitchModel @implementation FUSLiveRoomStateSwitchModel
@end @end
@implementation FUSRoomEncryptionData
@end
...@@ -1414,6 +1414,7 @@ ...@@ -1414,6 +1414,7 @@
BEF678162C6B156600A670FB /* live_treasure_box_bg_img.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */; }; BEF678162C6B156600A670FB /* live_treasure_box_bg_img.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */; };
BEF678172C6B156600A670FB /* live_userinfo_level_secrect.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */; }; BEF678172C6B156600A670FB /* live_userinfo_level_secrect.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */; };
C50E4ED36D48026661F4283F /* Pods_FUSShowRoomModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B2CC1956F16144828BF43D /* Pods_FUSShowRoomModule.framework */; }; C50E4ED36D48026661F4283F /* Pods_FUSShowRoomModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B2CC1956F16144828BF43D /* Pods_FUSShowRoomModule.framework */; };
D2C6D57E2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -2830,6 +2831,7 @@ ...@@ -2830,6 +2831,7 @@
BEF675ED2C6B156500A670FB /* live_pk_background_image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_pk_background_image.png; sourceTree = "<group>"; }; BEF675ED2C6B156500A670FB /* live_pk_background_image.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_pk_background_image.png; sourceTree = "<group>"; };
BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_treasure_box_bg_img.png; sourceTree = "<group>"; }; BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_treasure_box_bg_img.png; sourceTree = "<group>"; };
BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_userinfo_level_secrect.png; sourceTree = "<group>"; }; BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_userinfo_level_secrect.png; sourceTree = "<group>"; };
D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSLiveStartSetPasswordView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -3368,6 +3370,7 @@ ...@@ -3368,6 +3370,7 @@
BEEAB25F2D34CC60008CD059 /* FUSLiveStartContentThemeEditView.swift */, BEEAB25F2D34CC60008CD059 /* FUSLiveStartContentThemeEditView.swift */,
BEEAB2602D34CC60008CD059 /* FUSLiveStartContentWarningView.swift */, BEEAB2602D34CC60008CD059 /* FUSLiveStartContentWarningView.swift */,
BEEAB2612D34CC60008CD059 /* FUSLiveStartSetPrivacyView.swift */, BEEAB2612D34CC60008CD059 /* FUSLiveStartSetPrivacyView.swift */,
D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */,
BEEAB2622D34CC60008CD059 /* FUSLiveStartView.swift */, BEEAB2622D34CC60008CD059 /* FUSLiveStartView.swift */,
BEB5043C2D2E53E300EA6E6F /* FUSVideoStartSetThemeItemCell.h */, BEB5043C2D2E53E300EA6E6F /* FUSVideoStartSetThemeItemCell.h */,
BEB5043D2D2E53E300EA6E6F /* FUSVideoStartSetThemeItemCell.m */, BEB5043D2D2E53E300EA6E6F /* FUSVideoStartSetThemeItemCell.m */,
...@@ -6899,6 +6902,7 @@ ...@@ -6899,6 +6902,7 @@
00A3AB712CB665EA007646E1 /* FUSLiveQuickChatSetCell.m in Sources */, 00A3AB712CB665EA007646E1 /* FUSLiveQuickChatSetCell.m in Sources */,
00B90AD22CA5072100BE935B /* FUSPatAudienceGiftCell.swift in Sources */, 00B90AD22CA5072100BE935B /* FUSPatAudienceGiftCell.swift in Sources */,
BED6590D2C5B745E00668116 /* FUSLiveChatToolGiftTipView.m in Sources */, BED6590D2C5B745E00668116 /* FUSLiveChatToolGiftTipView.m in Sources */,
D2C6D57E2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift in Sources */,
BE189DBE2C733B460008418B /* FSRShowRoomEffectRecommondModel.m in Sources */, BE189DBE2C733B460008418B /* FSRShowRoomEffectRecommondModel.m in Sources */,
BED65A082C5B745F00668116 /* FUSPKEmptyView.m in Sources */, BED65A082C5B745F00668116 /* FUSPKEmptyView.m in Sources */,
BED659D32C5B745F00668116 /* FUSPKInfoModel.m in Sources */, BED659D32C5B745F00668116 /* FUSPKInfoModel.m in Sources */,
......
...@@ -290,6 +290,7 @@ ...@@ -290,6 +290,7 @@
BOOL isSelected = [naviView fus_isButtonSelected:FUSHomeNaviViewClickTypeFollow]; BOOL isSelected = [naviView fus_isButtonSelected:FUSHomeNaviViewClickTypeFollow];
FUSHomeViewAnchorListType turnToType = isSelected ? FUSHomeViewAnchorListTypeNormal : FUSHomeViewAnchorListTypeFollow; FUSHomeViewAnchorListType turnToType = isSelected ? FUSHomeViewAnchorListTypeNormal : FUSHomeViewAnchorListTypeFollow;
//如果跳转到的状态被判定为必须刷新的,那么就直接刷新,后续如果需要刷新普通列表的也在这里添加||判定就好 //如果跳转到的状态被判定为必须刷新的,那么就直接刷新,后续如果需要刷新普通列表的也在这里添加||判定就好
if (turnToType == FUSHomeViewAnchorListTypeFollow && self.followNeedUpdate) { if (turnToType == FUSHomeViewAnchorListTypeFollow && self.followNeedUpdate) {
...@@ -399,6 +400,12 @@ ...@@ -399,6 +400,12 @@
} }
} }
} else if (type == FUSHomeViewAnchorListTypeFollow && isLastSelected == NO) {
//上一次是普通,然后点了追踪
[FUSDialogView fus_showDialog:[NSString fus_versionLocalString:@"您已切换至关注主播再次点击可恢复全部"]];
} else if (type == FUSHomeViewAnchorListTypeNormal && isLastSelected == YES) {
//上一次是追踪,然后点了普通
[FUSDialogView fus_showDialog:[NSString fus_versionLocalString:@"您已切换至全部主播再次点击可恢复关注"]];
} }
} }
......
...@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 直播预告状态 0:未设置 1:已设置 /// 直播预告状态 0:未设置 1:已设置
@property (nonatomic, assign) NSInteger previewLive; @property (nonatomic, assign) NSInteger previewLive;
@property (nonatomic, strong) FUSRoomEncryptionData *encryptionData;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@implementation FUSLiveBeforeReadyModel @implementation FUSLiveBeforeReadyModel
+ (NSDictionary *)modelContainerPropertyGenericClass { + (NSDictionary *)modelContainerPropertyGenericClass {
return @{@"beforeLiveCond": [FUSBeforeLiveCondModel class]}; return @{@"beforeLiveCond": [FUSBeforeLiveCondModel class],@"encryptionData":[FUSRoomEncryptionData class]};
} }
@end @end
...@@ -63,9 +63,10 @@ typedef NS_ENUM(NSInteger,FUSbarrageType) { ...@@ -63,9 +63,10 @@ typedef NS_ENUM(NSInteger,FUSbarrageType) {
}; };
typedef NS_ENUM(NSInteger,FUSLiveRoomScopeType) { typedef NS_ENUM(NSInteger,FUSLiveRoomScopeType) {
FUSLiveRoomScopeTypeOpen = 0, // 全公开 FUSLiveRoomScopeTypeOpen = 0, // 公开屋
FUSLiveRoomScopeTypeFollow, // 追踪圈 FUSLiveRoomScopeTypePassword = 4, // 私享屋
FUSLiveRoomScopeTypeIntimacy, // 亲密圈 // FUSLiveRoomScopeTypeFollow, // 追踪圈
// FUSLiveRoomScopeTypeIntimacy, // 亲密圈
}; };
......
...@@ -132,9 +132,10 @@ ...@@ -132,9 +132,10 @@
NSString *roomId = dict[@"roomId"]; NSString *roomId = dict[@"roomId"];
if (roomId.integerValue == self.roomInfoModel.roomId.integerValue) { if (roomId.integerValue == self.roomInfoModel.roomId.integerValue) {
NSInteger liveScope = [dict[@"liveScope"] integerValue]; NSInteger liveScope = [dict[@"mode"] integerValue];
self.roomScopeType = liveScope; self.roomScopeType = liveScope == 1 ? FUSLiveRoomScopeTypePassword : FUSLiveRoomScopeTypeOpen;
} }
} }
/** /**
...@@ -445,6 +446,10 @@ ...@@ -445,6 +446,10 @@
[[[FUSLiveHelper shareInstance] roomInfoModel] fus_setModelWithMyRoomInfos]; [[[FUSLiveHelper shareInstance] roomInfoModel] fus_setModelWithMyRoomInfos];
} }
FUSRoomEncryptionData *data = model.encryptionData;
[FUSLiveHelper shareInstance].roomInfoModel.encryptionData = data;
[[FUSLiveHelper shareInstance] initLiveViewController]; [[FUSLiveHelper shareInstance] initLiveViewController];
[[[FUSLiveHelper shareInstance] liveVC] initPushPrepareView]; [[[FUSLiveHelper shareInstance] liveVC] initPushPrepareView];
[self fus_showLiveMainVCAnimation:YES Completion:nil]; [self fus_showLiveMainVCAnimation:YES Completion:nil];
......
...@@ -169,13 +169,25 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -169,13 +169,25 @@ NS_ASSUME_NONNULL_BEGIN
success:(void(^)(void))success success:(void(^)(void))success
failure:(void(^)(NSString *, int))failure; failure:(void(^)(NSString *, int))failure;
///// 切换直播范围
///// @param fid 当前主播的id
///// @param liveScope 直播范围 0:全公开、1:追踪圈、2:亲密圈
///// @param success 成功回调
///// @param failure 失败回调
//+ (void)fus_requestChangeLiveScope:(NSInteger)liveScope
// liveId:(NSInteger)liveId
// success:(void (^)(void))success
// failure:(void (^)(NSString *msg, int code))failure;
/// 切换直播范围 /// 切换直播范围
/// @param fid 当前主播的id /// @param fid 当前主播的id
/// @param liveScope 直播范围 0:全公开、1:追踪圈、2:亲密圈 /// @param cancel 取消状态 0:否 1:是
/// @param password 密码(cancel=0必传)
/// @param success 成功回调 /// @param success 成功回调
/// @param failure 失败回调 /// @param failure 失败回调
+ (void)fus_requestChangeLiveScope:(NSInteger)liveScope + (void)fus_requestChangedPassword:(NSInteger)cancel
liveId:(NSInteger)liveId fid:(NSInteger)fid
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;
......
...@@ -577,10 +577,16 @@ ...@@ -577,10 +577,16 @@
return; return;
} }
NSString *password = @"";
if (liveScope == 4) {
password = FUSRouter.liveRouter.liveRoomPassword;
}
NSDictionary *params = @{@"vdoid":vdoid, NSDictionary *params = @{@"vdoid":vdoid,
@"livingType":@"0", @"livingType":@"0",
@"liveWay":livingWay, @"liveWay":livingWay,
@"liveScope":@(liveScope), @"liveScope":@(liveScope),
@"password":password,
@"roomid":roomId}; @"roomid":roomId};
// params = [self addSocketParameterForDict:params]; // params = [self addSocketParameterForDict:params];
...@@ -2141,19 +2147,45 @@ ...@@ -2141,19 +2147,45 @@
} }
///// 切换直播范围
///// @param fid 当前主播的id
///// @param liveScope 直播范围 0:全公开、1:追踪圈、2:亲密圈
///// @param success 成功回调
///// @param failure 失败回调
//+ (void)fus_requestChangeLiveScope:(NSInteger)liveScope
// liveId:(NSInteger)liveId
// success:(void (^)(void))success
// failure:(void (^)(NSString *msg, int code))failure {
//
// NSDictionary *params = @{@"fid":@(liveId),@"liveScope":@(liveScope)};
//
// [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_CHANGE_LIVE_SCOPE params:params success:^(NSDictionary *dataDict, int code) {
// [[FUSLiveHelper shareInstance].currentFunctionView fus_startRecordLiveTimeWithTime:dataDict[@"livetime"]];
// if (success) {
// success();
// }
// } failure:^(NSDictionary *dataDict, int code) {
// if (failure) {
// failure(dataDict[@"msg"],code);
// }
// }];
//}
/// 切换直播范围 /// 切换直播范围
/// @param fid 当前主播的id /// @param fid 当前主播的id
/// @param liveScope 直播范围 0:全公开、1:追踪圈、2:亲密圈 /// @param cancel 取消状态 0:否 1:是
/// @param password 密码(cancel=0必传)
/// @param success 成功回调 /// @param success 成功回调
/// @param failure 失败回调 /// @param failure 失败回调
+ (void)fus_requestChangeLiveScope:(NSInteger)liveScope + (void)fus_requestChangedPassword:(NSInteger)cancel
liveId:(NSInteger)liveId fid:(NSInteger)fid
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":@(liveId),@"liveScope":@(liveScope)}; NSDictionary *params = @{@"fid":@(fid),@"cancel":@(cancel),@"password":password};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_CHANGE_LIVE_SCOPE params:params success:^(NSDictionary *dataDict, int code) { [FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_CHANGE_Password params:params success:^(NSDictionary *dataDict, int code) {
[[FUSLiveHelper shareInstance].currentFunctionView fus_startRecordLiveTimeWithTime:dataDict[@"livetime"]]; [[FUSLiveHelper shareInstance].currentFunctionView fus_startRecordLiveTimeWithTime:dataDict[@"livetime"]];
if (success) { if (success) {
success(); success();
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
return; return;
} }
if (FUSLiveHelper.shareInstance.roomScopeType != FUSLiveRoomScopeTypeOpen) {
return;
}
[FUSLiveHttpHelper fus_getLiveBeforeInfosWithSucceed:^(NSDictionary * _Nonnull publicizeConfig, NSDictionary * _Nonnull gasStationConfig) { [FUSLiveHttpHelper fus_getLiveBeforeInfosWithSucceed:^(NSDictionary * _Nonnull publicizeConfig, NSDictionary * _Nonnull gasStationConfig) {
if ([NSDictionary isNull:gasStationConfig]) { if ([NSDictionary isNull:gasStationConfig]) {
......
...@@ -516,9 +516,13 @@ ...@@ -516,9 +516,13 @@
- (void)ffupdateToolView2TypesPKState:(FUSPKLiveState)pkState { - (void)ffupdateToolView2TypesPKState:(FUSPKLiveState)pkState {
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) { if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting),@(FUSLiveBottomToolTypeRoomScope)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]]; [self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting)/*,@(FUSLiveBottomToolTypeRoomScope), @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else { } else {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), @(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]]; if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),@(FUSLiveBottomToolTypePK), @(FUSLiveBottomToolTypeNovaBuild)*/]];
} else {
[self.toolView2 showItemWithTypesWithToolTypes:@[@(FUSLiveBottomToolTypeLiveSetting),@(FUSLiveBottomToolTypeRoomSetting), /*@(FUSLiveBottomToolTypeRoomScope),*/@(FUSLiveBottomToolTypePK)/*, @(FUSLiveBottomToolTypeNovaBuild)*/]];
}
} }
} }
......
...@@ -192,6 +192,8 @@ typedef NS_ENUM(NSUInteger, FUSLiveChatToolBeautyType) { //美颜工具按钮 ...@@ -192,6 +192,8 @@ typedef NS_ENUM(NSUInteger, FUSLiveChatToolBeautyType) { //美颜工具按钮
- (void)fus_cleanBottomToolView; - (void)fus_cleanBottomToolView;
- (void)fus_updateRoomScoreType;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -57,6 +57,8 @@ ...@@ -57,6 +57,8 @@
@property (nonatomic, strong) UIButton *inputChatBtn; @property (nonatomic, strong) UIButton *inputChatBtn;
@property (nonatomic, strong) UIButton *roomScopeBtn;
@property (nonatomic, strong) UIButton *linkMicroBtn; @property (nonatomic, strong) UIButton *linkMicroBtn;
@property (nonatomic, strong) UIButton *msgBoxBtn; @property (nonatomic, strong) UIButton *msgBoxBtn;
...@@ -130,6 +132,7 @@ ...@@ -130,6 +132,7 @@
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeMessage), _allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeMessage),
@(FUSLiveBottomToolTypeBeauty), @(FUSLiveBottomToolTypeBeauty),
@(FUSLiveBottomToolTypeBeautySticker), @(FUSLiveBottomToolTypeBeautySticker),
// @(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]]; @(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeBeautySticker; _divisionBtnType = FUSLiveBottomToolTypeBeautySticker;
}else{ }else{
...@@ -137,8 +140,9 @@ ...@@ -137,8 +140,9 @@
@(FUSLiveBottomToolTypeShare), @(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeTool2), @(FUSLiveBottomToolTypeTool2),
@(FUSLiveBottomToolTypeBeautySticker), @(FUSLiveBottomToolTypeBeautySticker),
@(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]]; @(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeBeautySticker; _divisionBtnType = FUSLiveBottomToolTypeRoomScope;
} }
...@@ -168,6 +172,7 @@ ...@@ -168,6 +172,7 @@
if (self.viewType == FUSLiveBottomViewTypeHost) { if (self.viewType == FUSLiveBottomViewTypeHost) {
[self fus_removeBtnWithType:FUSLiveBottomToolTypeBeautySticker]; [self fus_removeBtnWithType:FUSLiveBottomToolTypeBeautySticker];
[self fus_removeBtnWithType:FUSLiveBottomToolTypeRoomScope];
} }
...@@ -512,12 +517,31 @@ ...@@ -512,12 +517,31 @@
btn = self.interactionGameBtn; btn = self.interactionGameBtn;
break; break;
case FUSLiveBottomToolTypeRoomScope:
[self fus_updateRoomScoreType];
btn = self.roomScopeBtn;
break;
default: default:
break; break;
} }
return btn; return btn;
} }
- (void)fus_updateRoomScoreType {
UIImage *image;
//TODO: 修改图片
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_intimate_normal"];
} else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
}
[self.roomScopeBtn setImage:image forState:UIControlStateNormal];
}
- (void)fus_updateBtnImageWithType:(FUSLiveBottomToolType)type image:(UIImage *)image state:(UIControlState *)state{ - (void)fus_updateBtnImageWithType:(FUSLiveBottomToolType)type image:(UIImage *)image state:(UIControlState *)state{
for (UIButton *btn in _allBtns) { for (UIButton *btn in _allBtns) {
...@@ -649,7 +673,7 @@ ...@@ -649,7 +673,7 @@
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) { if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
lastIndex = FUSLiveBottomToolTypeTool2; lastIndex = FUSLiveBottomToolTypeTool2;
} else { } else {
lastIndex = FUSLiveBottomToolTypeBeautySticker; lastIndex = FUSLiveBottomToolTypeRoomScope;
} }
} else { } else {
lastIndex = FUSLiveBottomToolTypeShare; lastIndex = FUSLiveBottomToolTypeShare;
...@@ -762,7 +786,7 @@ ...@@ -762,7 +786,7 @@
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) { if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
_divisionBtnType = FUSLiveBottomToolTypeTool2; _divisionBtnType = FUSLiveBottomToolTypeTool2;
} else { } else {
_divisionBtnType = FUSLiveBottomToolTypeBeautySticker; _divisionBtnType = FUSLiveBottomToolTypeRoomScope;
} }
}else{ }else{
_divisionBtnType = FUSLiveBottomToolTypeShare; _divisionBtnType = FUSLiveBottomToolTypeShare;
...@@ -934,8 +958,9 @@ ...@@ -934,8 +958,9 @@
@(FUSLiveBottomToolTypeShare), @(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeTool2), @(FUSLiveBottomToolTypeTool2),
@(FUSLiveBottomToolTypeBeautySticker), @(FUSLiveBottomToolTypeBeautySticker),
@(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]]; @(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeBeautySticker; _divisionBtnType = FUSLiveBottomToolTypeRoomScope;
} }
} else { } else {
...@@ -1110,6 +1135,17 @@ ...@@ -1110,6 +1135,17 @@
} }
- (UIButton *)roomScopeBtn {
if (!_roomScopeBtn) {
_roomScopeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
_roomScopeBtn.tag = FUSLiveBottomToolTypeRoomScope;
}
return _roomScopeBtn;
}
- (UIButton *)taskBtn{ - (UIButton *)taskBtn{
if (!_taskBtn) { if (!_taskBtn) {
_taskBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _taskBtn = [UIButton buttonWithType:UIButtonTypeCustom];
......
...@@ -121,7 +121,7 @@ public class FUSLiveChatInputToolView: UIView { ...@@ -121,7 +121,7 @@ public class FUSLiveChatInputToolView: UIView {
// 房间类型 // 房间类型
roomTypeView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypeRoomScope, withSize: CGSize(width: itemWith, height: buttomViewHeight)) roomTypeView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypeRoomScope, withSize: CGSize(width: itemWith, height: buttomViewHeight))
roomTypeView.x = liveSettingView.frame.maxX roomTypeView.x = liveSettingView.frame.maxX
toolViews.append(roomTypeView) // toolViews.append(roomTypeView)
// pk // pk
pkView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypePK, withSize: CGSize(width: itemWith, height: buttomViewHeight)) pkView = fus_createItemViewWithToolType(toolType: FUSLiveBottomToolTypePK, withSize: CGSize(width: itemWith, height: buttomViewHeight))
...@@ -196,9 +196,9 @@ public class FUSLiveChatInputToolView: UIView { ...@@ -196,9 +196,9 @@ public class FUSLiveChatInputToolView: UIView {
@objc public func fus_showToolViewWithClickHandler(handler:(@escaping (_ type: FUSLiveBottomToolType)->Void)) { @objc public func fus_showToolViewWithClickHandler(handler:(@escaping (_ type: FUSLiveBottomToolType)->Void)) {
if toolViewType == FUSLiveBottomToolTypeTool2 { // if toolViewType == FUSLiveBottomToolTypeTool2 {
fus_updateRoomTypeView() // fus_updateRoomTypeView()
} // }
UIView.animate(withDuration: 0.1) { UIView.animate(withDuration: 0.1) {
self.buttomView?.y = self.height - (self.buttomView?.height ?? buttomViewHeight) self.buttomView?.y = self.height - (self.buttomView?.height ?? buttomViewHeight)
...@@ -337,18 +337,18 @@ public class FUSLiveChatInputToolView: UIView { ...@@ -337,18 +337,18 @@ public class FUSLiveChatInputToolView: UIView {
case .open: case .open:
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_normal"), for: UIControl.State.normal) itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_normal"), for: UIControl.State.normal)
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_preesed"), for: UIControl.State.highlighted) itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_preesed"), for: UIControl.State.highlighted)
titleLb.text = NSString.fus_localString("全公开") titleLb.text = NSString.fus_localString("公开屋")
break break
case .follow: case .password:
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_focus_normal"), for: UIControl.State.normal) itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_focus_normal"), for: UIControl.State.normal)
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_focus_preesed"), for: UIControl.State.highlighted) itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_focus_preesed"), for: UIControl.State.highlighted)
titleLb.text = NSString.fus_localString("追踪圈") titleLb.text = NSString.fus_localString("私享屋")
break
case .intimacy:
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_intimate_normal"), for: UIControl.State.normal)
itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_intimate_preesed"), for: UIControl.State.highlighted)
titleLb.text = NSString.fus_localString("亲密圈")
break break
// case .intimacy:
// itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_intimate_normal"), for: UIControl.State.normal)
// itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_intimate_preesed"), for: UIControl.State.highlighted)
// titleLb.text = NSString.fus_localString("亲密圈")
// break
default: default:
break break
} }
......
...@@ -313,6 +313,8 @@ UIGestureRecognizerDelegate ...@@ -313,6 +313,8 @@ UIGestureRecognizerDelegate
@property (nonatomic, strong) FUSLiveEndChangeLinkMicModeView *changeView; @property (nonatomic, strong) FUSLiveEndChangeLinkMicModeView *changeView;
@property (nonatomic, weak) FusAnchorRewardView *anchorRewardView;
@property (nonatomic, assign) CGRect activityChangeFrame; @property (nonatomic, assign) CGRect activityChangeFrame;
/// 半屏网页的管理,内部全是弱引用,放心添加网页 /// 半屏网页的管理,内部全是弱引用,放心添加网页
...@@ -1036,9 +1038,15 @@ UIGestureRecognizerDelegate ...@@ -1036,9 +1038,15 @@ UIGestureRecognizerDelegate
[self initPusherActivityView]; [self initPusherActivityView];
[self initPusherTableView]; [self initPusherTableView];
[self fus_updateRewardViewIfNeeded];
}
- (void)fus_updateRewardViewIfNeeded {
__weak typeof(self) weakSelf = self;
[FusAnchorRewardView fus_showAnchorRewardViewIfNeeded:^(FusAnchorRewardView * _Nonnull view) { [FusAnchorRewardView fus_showAnchorRewardViewIfNeeded:^(FusAnchorRewardView * _Nonnull view) {
view.y = weakSelf.pusherPopularView.bottom; view.y = weakSelf.pusherPopularView.bottom;
weakSelf.anchorRewardView = view;
}]; }];
} }
...@@ -5758,14 +5766,21 @@ UIGestureRecognizerDelegate ...@@ -5758,14 +5766,21 @@ UIGestureRecognizerDelegate
switch (FUSLiveHelper.shareInstance.roomScopeType) { switch (FUSLiveHelper.shareInstance.roomScopeType) {
case FUSLiveRoomScopeTypeOpen: case FUSLiveRoomScopeTypeOpen:
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_open_scope"]]; [_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_open_scope"]];
[self fus_updateRewardViewIfNeeded];
break; break;
case FUSLiveRoomScopeTypeFollow: case FUSLiveRoomScopeTypePassword:
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_follow_scope"]]; [_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_follow_scope"]];
[self.anchorRewardView removeFromSuperview];
self.anchorRewardView = nil;
break; break;
case FUSLiveRoomScopeTypeIntimacy: // case FUSLiveRoomScopeTypeIntimacy:
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_intimate_scope"]]; // [_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_intimate_scope"]];
break; // break;
} }
[self.bottomToolView fus_updateRoomScoreType];
} }
- (void)fus_setAnchorAudioClose:(BOOL)closed { - (void)fus_setAnchorAudioClose:(BOOL)closed {
......
...@@ -118,8 +118,8 @@ ...@@ -118,8 +118,8 @@
case FUSLiveRoomScopeTypeOpen: case FUSLiveRoomScopeTypeOpen:
[self fus_requestRecentlyChat]; [self fus_requestRecentlyChat];
break; break;
case FUSLiveRoomScopeTypeFollow: case FUSLiveRoomScopeTypePassword:
case FUSLiveRoomScopeTypeIntimacy: // case FUSLiveRoomScopeTypeIntimacy:
[self fus_refreshFriendDatas]; [self fus_refreshFriendDatas];
break; break;
} }
...@@ -129,8 +129,8 @@ ...@@ -129,8 +129,8 @@
switch ([FUSLiveHelper shareInstance].roomScopeType) { switch ([FUSLiveHelper shareInstance].roomScopeType) {
case FUSLiveRoomScopeTypeOpen: case FUSLiveRoomScopeTypeOpen:
break; break;
case FUSLiveRoomScopeTypeFollow: case FUSLiveRoomScopeTypePassword:
case FUSLiveRoomScopeTypeIntimacy: // case FUSLiveRoomScopeTypeIntimacy:
[self fus_loadMoreFriendDatas]; [self fus_loadMoreFriendDatas];
break; break;
} }
...@@ -214,12 +214,12 @@ ...@@ -214,12 +214,12 @@
} }
switch ([FUSLiveHelper shareInstance].roomScopeType) { switch ([FUSLiveHelper shareInstance].roomScopeType) {
case FUSLiveRoomScopeTypeFollow: case FUSLiveRoomScopeTypePassword:
[FUSLiveShareHttpHelper fus_requestShareUserLikeFollowListWithPage:self.page // [FUSLiveShareHttpHelper fus_requestShareUserLikeFollowListWithPage:self.page
success:success // success:success
failure:failure]; // failure:failure];
break; // break;
case FUSLiveRoomScopeTypeIntimacy: // case FUSLiveRoomScopeTypeIntimacy:
[FUSLiveShareHttpHelper fus_requestShareIntimateFriendListWithPage:self.page [FUSLiveShareHttpHelper fus_requestShareIntimateFriendListWithPage:self.page
success:success success:success
failure:failure]; failure:failure];
......
...@@ -42,15 +42,14 @@ import FUSCommon ...@@ -42,15 +42,14 @@ import FUSCommon
switch type{ switch type{
case .open: case .open:
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_openScope_img") self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_openScope_img")
self.privacyLabel.text = .fus_localString("全公开") self.privacyLabel.text = .fus_versionLocalString("公开屋")
case .follow: case .password:
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_followScope_img") self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_followScope_img")
self.privacyLabel.text = .fus_localString("追踪圈") self.privacyLabel.text = .fus_versionLocalString("私享屋")
case .intimacy: // case .intimacy:
//
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_intimacyScope_img") // self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_intimacyScope_img")
self.privacyLabel.text = .fus_localString("私密圈") // self.privacyLabel.text = .fus_localString("私密圈")
@unknown default: @unknown default:
break break
} }
......
...@@ -106,18 +106,23 @@ import FUSCommon ...@@ -106,18 +106,23 @@ import FUSCommon
} }
//这里特殊用户有不一样的逻辑 //这里特殊用户有不一样的逻辑
let iconImagesList = ["live_start_openScope_cell","live_start_followScope_cell","live_start_intimacyScope_cell"] let iconImagesList = ["live_start_openScope_cell","live_start_followScope_cell"/*,"live_start_intimacyScope_cell"*/]
let titlesList = [String.fus_localString("全公开"), .fus_localString("追踪圈"), .fus_localString("亲密圈")] let titlesList = [String.fus_versionLocalString("公开屋"), .fus_versionLocalString("私享屋")/*, .fus_localString("亲密圈")*/]
let subTitlesList = [String.fus_localString("所有人可进入房间"), .fus_localString("仅追踪主播超过24小的粉丝可进入房间"), .fus_localString("仅亲密好友可进入房间")] let subTitlesList = [String.fus_localString("所有人可进入房间"), .fus_versionLocalString("已关闭窗帘,玩家输入密码打开")/*, .fus_localString("仅亲密好友可进入房间")*/]
let selectIndex = fus_getIndexWithScopeType() let selectIndex = fus_getIndexWithScopeType()
for (index, iconStr) in iconImagesList.enumerated() { for (index, iconStr) in iconImagesList.enumerated() {
var canSelect = true
let itemView = FUSLiveStartSetPrivacyItemView.fus_create(icon: iconStr, title: titlesList[index], subTitle: subTitlesList[index]) if index == 0 {
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpen.intValue == -1 {
canSelect = false
}
}
let itemView = FUSLiveStartSetPrivacyItemView.fus_create(icon: iconStr, title: titlesList[index], subTitle: subTitlesList[index], canSelect: canSelect)
itemView.selected = selectIndex == index itemView.selected = selectIndex == index
self.privacyContentView.addArrangedSubview(itemView) self.privacyContentView.addArrangedSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(UIView.fus_screenW() - 18.0*2.0, 56)) make.size.equalTo(CGSizeMake(UIView.fus_screenW() - 18.0*2.0, 85))
} }
itemView.bgTapBtn.rx.tap.subscribe(onNext: {[weak self] in itemView.bgTapBtn.rx.tap.subscribe(onNext: {[weak self] in
self?.fus_itemDidSelected(index: index) self?.fus_itemDidSelected(index: index)
...@@ -139,8 +144,22 @@ import FUSCommon ...@@ -139,8 +144,22 @@ import FUSCommon
self.clickHandler?(self.scopeType) self.clickHandler?(self.scopeType)
self.fus_dismissWithAnimation() self.fus_dismissWithAnimation()
}else if self.requestType == 1 { }else if self.requestType == 1 {
if self.scopeType == .open {
self.fus_changeScopeRequest(scopeType: self.scopeType, password: "")
} else {
UIView.animate(withDuration: 0.3) {
self.contentView.y = UIView.fus_screenH()
} completion: { _ in
FUSLiveStartSetPasswordView.fus_create { [weak self] password in
guard let self = self else { return }
//在内部请求 //在内部请求
self.fus_changeScopeRequest(scopeType: self.scopeType) self.fus_changeScopeRequest(scopeType: self.scopeType, password: password)
}
}
}
} }
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
...@@ -158,11 +177,16 @@ import FUSCommon ...@@ -158,11 +177,16 @@ import FUSCommon
switch index{ switch index{
case 0: case 0:
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpen.intValue == -1 {
self.scopeType = .password
} else {
self.scopeType = .open self.scopeType = .open
}
case 1: case 1:
self.scopeType = .follow self.scopeType = .password
case 2: // case 2:
self.scopeType = .intimacy // self.scopeType = .intimacy
default: default:
break break
} }
...@@ -184,10 +208,10 @@ import FUSCommon ...@@ -184,10 +208,10 @@ import FUSCommon
switch self.scopeType{ switch self.scopeType{
case .open: case .open:
return 0 return 0
case .follow: case .password:
return 1 return 1
case .intimacy: // case .intimacy:
return 2 // return 2
@unknown default: @unknown default:
return 0 return 0
} }
...@@ -207,13 +231,14 @@ import FUSCommon ...@@ -207,13 +231,14 @@ import FUSCommon
} }
private func fus_changeScopeRequest(scopeType: FUSLiveRoomScopeType) { 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 }
// FUSIndicator.showProgress(withMessage: "") // FUSIndicator.showProgress(withMessage: "")
FUSLoadingIndicator.fus_show(canTouch: true) FUSLoadingIndicator.fus_show(canTouch: true)
FUSLiveHttpHelper.fus_requestChangeLiveScope(scopeType.rawValue, liveId: roomID.intValue, success: { [weak self] in
FUSLiveHttpHelper.fus_requestChangedPassword(scopeType == .password ? 1 : 0, fid: roomID.intValue, password: password, success: { [weak self] in
self?.fus_dismissWithAnimation() self?.fus_dismissWithAnimation()
...@@ -222,11 +247,13 @@ import FUSCommon ...@@ -222,11 +247,13 @@ import FUSCommon
FUSLiveHelper.shareInstance().roomScopeType = scopeType FUSLiveHelper.shareInstance().roomScopeType = scopeType
switch scopeType{ switch scopeType{
case .open: case .open:
//TODO: 文案:added by pidan
FUSDialogView.fus_showDialog(.fus_localString("房间已切换到全公开模式,所有人可进入房间")) FUSDialogView.fus_showDialog(.fus_localString("房间已切换到全公开模式,所有人可进入房间"))
case .follow: case .password:
FUSDialogView.fus_showDialog(.fus_localString("房间已切换到追踪圈模式,仅追踪直播超过24小时的粉丝可进入房间,直播时长不计入直播奖励活动")) //TODO: 文案:added by pidan
case .intimacy: FUSDialogView.fus_showDialog(.fus_versionLocalString("房间已切换到私享屋模式,仅追踪直播超过24小时的粉丝可进入房间,直播时长不计入直播奖励活动"))
FUSDialogView.fus_showDialog(.fus_localString("房间已切换到亲密圈模式,仅亲密好友的用户可进入房间,直播时长不计入直播奖励活动")) // case .intimacy:
// FUSDialogView.fus_showDialog(.fus_localString("房间已切换到亲密圈模式,仅亲密好友的用户可进入房间,直播时长不计入直播奖励活动"))
@unknown default: @unknown default:
break break
} }
...@@ -254,6 +281,7 @@ class FUSLiveStartSetPrivacyItemView: UIView { ...@@ -254,6 +281,7 @@ class FUSLiveStartSetPrivacyItemView: UIView {
let titleLabel = UILabel() let titleLabel = UILabel()
let subTitleLabel = UILabel() let subTitleLabel = UILabel()
let selectedBtn = UIButton(type: .custom) let selectedBtn = UIButton(type: .custom)
let cantSelectTipLabel = UILabel()
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
...@@ -311,6 +339,18 @@ class FUSLiveStartSetPrivacyItemView: UIView { ...@@ -311,6 +339,18 @@ class FUSLiveStartSetPrivacyItemView: UIView {
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
cantSelectTipLabel.font = .fus_themeFont(11)
cantSelectTipLabel.textColor = .fus_textColorMedium()
cantSelectTipLabel.numberOfLines = 0
titleContentView.addSubview(cantSelectTipLabel)
cantSelectTipLabel.isHidden = true
cantSelectTipLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.liveScopeOpenShow
cantSelectTipLabel.snp.makeConstraints { make in
make.right.equalToSuperview().inset(12)
make.centerY.equalToSuperview()
}
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
...@@ -318,13 +358,16 @@ class FUSLiveStartSetPrivacyItemView: UIView { ...@@ -318,13 +358,16 @@ class FUSLiveStartSetPrivacyItemView: UIView {
} }
///这个创建 ///这个创建
static func fus_create(icon: String, title: String, subTitle: String) -> FUSLiveStartSetPrivacyItemView{ static func fus_create(icon: String, title: String, subTitle: String, canSelect:Bool = true) -> FUSLiveStartSetPrivacyItemView{
let subView = FUSLiveStartSetPrivacyItemView(frame: .zero) let subView = FUSLiveStartSetPrivacyItemView(frame: .zero)
subView.iconImageView.image = FUSShowRoomCenterBunble.imageNamed(icon) subView.iconImageView.image = FUSShowRoomCenterBunble.imageNamed(icon)
subView.titleLabel.text = title subView.titleLabel.text = title
subView.subTitleLabel.text = subTitle subView.subTitleLabel.text = subTitle
subView.cantSelectTipLabel.isHidden = canSelect
subView.selectedBtn.isHidden = canSelect == false
return subView return subView
} }
} }
...@@ -26,10 +26,19 @@ import FUSCommon ...@@ -26,10 +26,19 @@ import FUSCommon
//下面三个在私密哪一块获得,自动获取 //下面三个在私密哪一块获得,自动获取
///私密程度 ///私密程度
public var scopeType = FUSLiveRoomScopeType.open public var scopeType = FUSLiveRoomScopeType.open
/// 私享房密码
public var password = ""
/// 清晰度 /// 清晰度
// var clarityOptionId = 0 // var clarityOptionId = 0
public override init() {
super.init()
if FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData?.liveScopeOpen.intValue == -1 {
scopeType = .password
}
}
} }
@objcMembers public class FUSLiveStartView: UIView { @objcMembers public class FUSLiveStartView: UIView {
...@@ -61,6 +70,7 @@ import FUSCommon ...@@ -61,6 +70,7 @@ import FUSCommon
let contentView = UIView() let contentView = UIView()
let closeBtn = UIButton(type: .custom) let closeBtn = UIButton(type: .custom)
let privacyView = FUSLiveStartContentPrivacyView() let privacyView = FUSLiveStartContentPrivacyView()
let passwordBtn = FUSStyleButton(type: .custom)
let themeView = FUSLiveStartContentThemeEditView() let themeView = FUSLiveStartContentThemeEditView()
let shareView = FUSLiveStartContentShareView() let shareView = FUSLiveStartContentShareView()
let bottomView = FUSLiveStartContentBottomView() let bottomView = FUSLiveStartContentBottomView()
...@@ -99,6 +109,23 @@ import FUSCommon ...@@ -99,6 +109,23 @@ import FUSCommon
} }
privacyView.isHidden = FUSConfig.sharedInstanced().devConfigs.appStatus == true privacyView.isHidden = FUSConfig.sharedInstanced().devConfigs.appStatus == true
self.passwordBtn.isHidden = true
headerView.addSubview(self.passwordBtn)
self.passwordBtn.setTitle(.fus_versionLocalString("密码"), for: .normal)
self.passwordBtn.titleLabel?.font = .fus_themeFont(14)
self.passwordBtn.style = .blue
self.passwordBtn.layer.cornerRadius = 14
self.passwordBtn.layer.masksToBounds = true
self.passwordBtn.snp.makeConstraints { make in
make.left.equalTo(self.privacyView.snp.right).offset(8)
make.centerY.equalTo(self.privacyView)
make.width.equalTo(60)
make.height.equalTo(28)
}
contentView.addSubview(themeView) contentView.addSubview(themeView)
themeView.snp.makeConstraints { make in themeView.snp.makeConstraints { make in
make.top.equalTo(headerView.snp.bottom).offset(18) make.top.equalTo(headerView.snp.bottom).offset(18)
...@@ -173,15 +200,34 @@ import FUSCommon ...@@ -173,15 +200,34 @@ import FUSCommon
guard let model = self?.startLiveModel.value else { return } guard let model = self?.startLiveModel.value else { return }
FUSLiveStartSetPrivacyView.fus_create(defaultScopeType: model.scopeType) {[weak self] scopeType in FUSLiveStartSetPrivacyView.fus_create(defaultScopeType: model.scopeType) {[weak self] scopeType in
model.scopeType = scopeType model.scopeType = scopeType
if scopeType == .password {
FUSLiveStartSetPasswordView.fus_create { password in
model.password = password
self?.startLiveModel.accept(model)
}
} else {
self?.startLiveModel.accept(model) self?.startLiveModel.accept(model)
} }
} }
}
warningView.clickHandler = { model, index in warningView.clickHandler = { model, index in
FUSRouter.userRouter().fus_handleTaskJumpAction(withJumpType: model.jumpurl, tid: 0, url: model.jumpval) { FUSRouter.userRouter().fus_handleTaskJumpAction(withJumpType: model.jumpurl, tid: 0, url: model.jumpval) {
} }
} }
//关闭按钮
passwordBtn.rx.tap.subscribe(onNext: {[weak self] in
guard let model = self?.startLiveModel.value else { return }
FUSLiveStartSetPasswordView.fus_create { password in
model.password = password
self?.startLiveModel.accept(model)
}
}).disposed(by: disposeBag)
//关闭按钮 //关闭按钮
closeBtn.rx.tap.subscribe(onNext: {[weak self] in closeBtn.rx.tap.subscribe(onNext: {[weak self] in
self?.clickCloseBtnActionHandler?(self?.closeBtn) self?.clickCloseBtnActionHandler?(self?.closeBtn)
...@@ -274,6 +320,10 @@ import FUSCommon ...@@ -274,6 +320,10 @@ import FUSCommon
self.startLiveModel.subscribe(onNext: {[weak self] model in self.startLiveModel.subscribe(onNext: {[weak self] model in
self?.privacyView.type = model.scopeType self?.privacyView.type = model.scopeType
self?.passwordBtn.isHidden = model.scopeType != .password
self?.liveActivityView.isHidden = model.scopeType == .password
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
self.fus_updateWithLiveBeforeReadyInfo() self.fus_updateWithLiveBeforeReadyInfo()
......
...@@ -270,6 +270,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -270,6 +270,9 @@ NS_ASSUME_NONNULL_BEGIN
// 切换直播范围 // 切换直播范围
+ (NSString *)fus_URL_LIVE_CHANGE_LIVE_SCOPE; + (NSString *)fus_URL_LIVE_CHANGE_LIVE_SCOPE;
// 切换私享房
+ (NSString *)fus_URL_LIVE_CHANGE_Password;
// 贴纸列表 // 贴纸列表
+ (NSString *)fus_URL_LIVE_STICKER_LIST; + (NSString *)fus_URL_LIVE_STICKER_LIST;
......
...@@ -440,6 +440,11 @@ ...@@ -440,6 +440,11 @@
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/change/liveScope"]; return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/change/liveScope"];
} }
// 切换私享房
+ (NSString *)fus_URL_LIVE_CHANGE_Password {
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/change/password"];
}
// 贴纸列表 // 贴纸列表
+ (NSString *)fus_URL_LIVE_STICKER_LIST { + (NSString *)fus_URL_LIVE_STICKER_LIST {
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/sticker/list"]; return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/live/sticker/list"];
......
...@@ -86,6 +86,28 @@ ...@@ -86,6 +86,28 @@
return [FUSLiveHelper shareInstance].roomScopeType; return [FUSLiveHelper shareInstance].roomScopeType;
} }
- (NSString *)liveRoomPassword {
if (FUSLiveHelper.shareInstance.roomInfoModel.encryptionData.password.length > 0) {
return FUSLiveHelper.shareInstance.roomInfoModel.encryptionData.password;
}
NSString *uid = [FUSCacheDataShare shareStore].userDetailInfo.uid ?: @"";
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:uid];
// 从 UserDefaults 中获取上次设置的密码
NSString *password = [userDefaults stringForKey:FUSLiveUDKeys.fus_lastLivePasswordUDKEY] ?: @"";
// 判断密码是否有效(假设 isValidString 是一个判断字符串是否非空且长度 >=4 的方法)
if (![NSString isNullWithString:password] && uid.length >= 4) {
// 取 uid 最后四个字符
NSUInteger startIndex = uid.length >= 4 ? uid.length - 4 : 0;
password = [uid substringFromIndex:startIndex];
}
return password;
}
- (FUSLiveRoomType)fus_liveRoomType { - (FUSLiveRoomType)fus_liveRoomType {
return [FUSLiveHelper shareInstance].liveRoomType; return [FUSLiveHelper shareInstance].liveRoomType;
......
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