Commit ae92fae4 by pidan

备份私享房相关的代码

parent 3ace3508
Showing with 331 additions and 307 deletions
......@@ -57,6 +57,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, assign) BOOL pushFlowSizeSwitch;
/// 引导开启通知分钟数(7410起加)
@property (nonatomic, assign) NSInteger guideTime;
/// 私享房私信默认选中礼物ID
@property (nonatomic, assign) NSInteger initRoomPrivateImGiftId;
@end
......
......@@ -77,12 +77,12 @@ static const NSString *FUSCidUDKey = @"FUSCidUDKey";
/// App Version
- (NSString *)appVersion {
return @"7701";
return @"7702";
}
/// App Dot Version
- (NSString *)appDotVersion {
return @"7.7.0.1";
return @"7.7.0.2";
}
/// App Id
......
......@@ -32,6 +32,8 @@
- (void)fus_chatWithUser:(NSString *)userId nickname:(NSString *)nickname face:(NSString *)face;
- (void)fus_chatWithUser:(NSString *)userId nickname:(NSString *)nickname face:(NSString *)face jumpToGid:(NSString *)gid;
- (BOOL)conversationIsCaller;
- (NSString *)callOrderId;
......
......@@ -23,7 +23,8 @@ typedef NS_ENUM(NSInteger, FUSChatDetailFrom) {
+ (FUSChatDetailViewController *)fus_showChatDetailVCWithRootVC:(UIViewController *)rootVC
uid:(NSString *)uid
nickName:(NSString *)nickName
face:(NSString *)face;
face:(NSString *)face
jumpToGid:(NSString *)jumpToGid;
/**
会话ID
......@@ -62,7 +63,7 @@ typedef NS_ENUM(NSInteger, FUSChatDetailFrom) {
@param nickName 对方名字
@return
*/
- (instancetype)initWithUid:(NSString *)uid faceUrl:(NSString *)faceUrl nickName:(NSString *)nickName;
- (instancetype)initWithUid:(NSString *)uid faceUrl:(NSString *)faceUrl nickName:(NSString *)nickName jumpToGid:(NSString *)jumpToGid;
// 结束编辑状态,暴露出来的原因是为了给直播间页面强制结束键盘的弹起
- (void)fus_endEditState;
......
......@@ -130,6 +130,8 @@
// 贴纸动效
@property (nonatomic, strong) FUSImageFallDownFromTopView *fallDownImageView;
@property (nonatomic, copy) NSString *jumpToGid;
@end
@implementation FUSChatDetailViewController
......@@ -137,7 +139,8 @@
+ (FUSChatDetailViewController *)fus_showChatDetailVCWithRootVC:(UIViewController *)rootVC
uid:(NSString *)uid
nickName:(NSString *)nickName
face:(NSString *)face {
face:(NSString *)face
jumpToGid:(NSString *)jumpToGid {
// 是从聊天界面跳转过来的
if ([FUSIMChatService shareInstance].chatDelegate) {
......@@ -157,13 +160,13 @@
[[FUSIMChatService shareInstance] fus_jumpToNewChatDetailVcWithNewTalkID:uid nickname:nickName face:face];
return (FUSChatDetailViewController *)([FUSIMChatService shareInstance].chatDelegate);
} else {
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:uid faceUrl:face nickName:nickName];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:uid faceUrl:face nickName:nickName jumpToGid:jumpToGid];
[rootVC.navigationController pushViewController:chatDetailVC animated:YES];
return chatDetailVC;
}
} else {
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:uid faceUrl:face nickName:nickName];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:uid faceUrl:face nickName:nickName jumpToGid:jumpToGid];
[rootVC.navigationController pushViewController:chatDetailVC animated:YES];
return chatDetailVC;
}
......@@ -173,7 +176,7 @@
#pragma mark - init
- (instancetype)initWithUid:(NSString *)uid faceUrl:(NSString *)faceUrl nickName:(NSString *)nickName{
- (instancetype)initWithUid:(NSString *)uid faceUrl:(NSString *)faceUrl nickName:(NSString *)nickName jumpToGid:(NSString *)jumpToGid{
self = [super init];
if (self) {
......@@ -189,6 +192,7 @@
_talkID = uid;
_talkIcon = faceUrl;
_talkName = nickName;
_jumpToGid = jumpToGid;
_userFaceUrl = [[[FUSCacheDataShare shareStore] userDetailInfo] face];
}
return self;
......@@ -471,6 +475,12 @@
[self.view addSubview:self.fallDownImageView];
}
[[FUSIMChatService shareInstance] fus_playCurrentTalkMessageStickerEffect];
if (self.jumpToGid.length != 0) {
[self fus_showSendGiftState];
[self.inputToolbar.giftView fus_setSelectedGift:self.jumpToGid];
self.jumpToGid = nil;
}
}
- (void)viewWillDisappear:(BOOL)animated {
......@@ -1480,7 +1490,7 @@
UINavigationController *rootNav = self.targetVC.navigationController;
[self fus_onClickNavBackBtn];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:newTalkID faceUrl:faceUrl nickName:nickname];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:newTalkID faceUrl:faceUrl nickName:nickname jumpToGid:@""];
[rootNav pushViewController:chatDetailVC animated:NO];
}
......
......@@ -277,7 +277,7 @@ import SJAttributesStringMaker
} else {
// 非单聊控制器
if let singleChatVC = FUSChatDetailViewController(uid: fid, faceUrl: self?.callOtherInfo.value?.faceUrl, nickName: self?.callOtherInfo.value?.nickname) {
if let singleChatVC = FUSChatDetailViewController(uid: fid, faceUrl: self?.callOtherInfo.value?.faceUrl, nickName: self?.callOtherInfo.value?.nickname, jumpToGid: "") {
UIViewController.fus_top()?.navigationController?.pushViewController(singleChatVC, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: {
......@@ -1184,7 +1184,7 @@ extension FUSChatCallHelper {
} else {
// 非单聊控制器
if let singleChatVC = FUSChatDetailViewController(uid: fid, faceUrl: self?.callOtherInfo.value?.faceUrl, nickName: self?.callOtherInfo.value?.nickname) {
if let singleChatVC = FUSChatDetailViewController(uid: fid, faceUrl: self?.callOtherInfo.value?.faceUrl, nickName: self?.callOtherInfo.value?.nickname, jumpToGid: "") {
UIViewController.fus_top()?.navigationController?.pushViewController(singleChatVC, animated: true)
DispatchQueue.main.asyncAfter(deadline: .now() + 1, execute: {
......
......@@ -52,4 +52,9 @@
*/
- (void)fus_reloadGiftView;
/**
选中礼物
*/
- (void)fus_setSelectedGift:(NSString *)gid;
@end
......@@ -237,6 +237,27 @@
}
}
/**
选中礼物
*/
- (void)fus_setSelectedGift:(NSString *)gid {
for (NSInteger i = 0; i < self.dataSource.count; i++) {
FUSChatGiftDataModel *giftModel = [self.dataSource objectAtIndex:i];
NSInteger currentGidInt = giftModel.gid.integerValue;
NSInteger jumpGidInt = gid.integerValue;
if (currentGidInt == jumpGidInt) {
_selectedIndex = i;
// 取出 model
self.currentSelectedGiftModel = giftModel;
self.giftDesLabel.attributedText = [self handleGiftDescription:self.currentSelectedGiftModel];
[self.giftCollectionView reloadData];
return;
}
}
}
#pragma mark - Collection Delegate
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
......
......@@ -113,7 +113,7 @@
- (void)fus_initChatView
{
FUSZoneInfosModel *userInfo = [FUSRouter.userRouter selectZoneInfosTableWithUid:_uid];
_chatVC = [[FUSChatDetailViewController alloc] initWithUid:_uid faceUrl:userInfo.face nickName:userInfo.nickname];
_chatVC = [[FUSChatDetailViewController alloc] initWithUid:_uid faceUrl:userInfo.face nickName:userInfo.nickname jumpToGid:@""];
_chatVC.pushFrom = FUSChatDetailFromLive;
CGRect chatVCFrame = self.bounds;
......
......@@ -153,7 +153,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
FUSIntimatesFriendModel *model = self.friendsDataList[indexPath.row];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:model.uid faceUrl:model.face nickName:model.nickname];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:model.uid faceUrl:model.face nickName:model.nickname jumpToGid:@""];
if (self.didSelectedCellBlock) {
self.didSelectedCellBlock(model);
}
......
......@@ -137,7 +137,7 @@
[FUSRouter.chatRouter fus_pushToServiceControllerWithUID:model.uid face:model.face nikename:model.nickname welcome:nil animate:YES];
}else{
[FUSTalkingData fus_trackEvent:FUSChatEventTrackParams.fus_EVENT_MESSAGE_CHATPAGE];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:model.uid faceUrl:model.face nickName:model.nickname];
FUSChatDetailViewController *chatDetailVC = [[FUSChatDetailViewController alloc] initWithUid:model.uid faceUrl:model.face nickName:model.nickname jumpToGid:@""];
[self.viewController.navigationController pushViewController:chatDetailVC animated:YES];
}
} else if ([model.typeId hasPrefix:FUSChatPublicDefine.fus_officialMsgType]) {
......
......@@ -535,7 +535,7 @@
break;
case 8: // 跳转聊天界面
{
FUSChatDetailViewController *chatDetailVc = [[FUSChatDetailViewController alloc]initWithUid:msgModel.clickdata faceUrl:nil nickName:nil];
FUSChatDetailViewController *chatDetailVc = [[FUSChatDetailViewController alloc]initWithUid:msgModel.clickdata faceUrl:nil nickName:nil jumpToGid:@""];
[self.navigationController pushViewController:chatDetailVc animated:YES];
}
break;
......
......@@ -82,14 +82,18 @@
}
- (void)fus_chatWithUser:(NSString *)userId nickname:(NSString *)nickname face:(NSString *)face {
[self fus_chatWithUser:userId nickname:nickname face:face jumpToGid:@""];
}
- (void)fus_chatWithUser:(NSString *)userId nickname:(NSString *)nickname face:(NSString *)face jumpToGid:(NSString *)gid {
if ([EMClient sharedClient].isLoggedIn) {
[FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userId nickName:nickname face:face];
[FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userId nickName:nickname face:face jumpToGid:gid];
} else {
[FUSIMUserService shareInstance].imLoginSucceedHandler = ^{
[FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userId nickName:nickname face:face];
[FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userId nickName:nickname face:face jumpToGid:gid];
};
}
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "live_startv2_openScope_cell@2x.png",
"filename" : "live_start_openScope_cell@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_startv2_openScope_cell@3x.png",
"filename" : "live_start_openScope_cell@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,11 +5,12 @@
"scale" : "1x"
},
{
"filename" : "live_start_openScope_img@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_startv2_openScope_img@3x.png",
"filename" : "live_start_openScope_img@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "親密圈(選中)@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "親密圈(選中)@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "全公開@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "全公開@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "全公開(選中)@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "全公開(選中)@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,11 +5,12 @@
"scale" : "1x"
},
{
"filename" : "live_start_passwordScope_cell@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_startv2_followScope_img@3x.png",
"filename" : "live_start_passwordScope_cell@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "live_startv2_followScope_cell@2x.png",
"filename" : "live_start_passwordScope_img@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_startv2_followScope_cell@3x.png",
"filename" : "live_start_passwordScope_img@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "關注圈@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "關注圈@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "關注圈@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "關注圈@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "親密圈@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "親密圈@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "親密圈@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "親密圈@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "全公开@2x.png",
"filename" : "live_RoomScope_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "全公开@3x.png",
"filename" : "live_RoomScope_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "live_startv2_intimacyScope_cell@2x.png",
"filename" : "live_RoomScope_password@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_startv2_intimacyScope_cell@3x.png",
"filename" : "live_RoomScope_password@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "全公开@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "全公开@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_push_live_time_bg_follow_scope@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_push_live_time_bg_follow_scope@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_push_live_time_bg_intimate_scope@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "live_push_live_time_bg_intimate_scope@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "追蹤圈@2x.png",
"filename" : "live_push_live_time_bg_password_scope@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "追蹤圈@3x.png",
"filename" : "live_push_live_time_bg_password_scope@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "追蹤圈(選中)@2x.png",
"filename" : "live_room_password_room_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "追蹤圈(選中)@3x.png",
"filename" : "live_room_password_room_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -5,12 +5,12 @@
"scale" : "1x"
},
{
"filename" : "親密圈@2x.png",
"filename" : "live_start_view_password_btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "親密圈@3x.png",
"filename" : "live_start_view_password_btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
......
......@@ -170,6 +170,10 @@ typedef enum : NSUInteger {
- (NSString *)fus_getLiveBitrate;
- (void)fus_showPasswordBlurView;
- (void)fus_hidePasswordBlurView;
@end
@interface FUSLiveMainViewController(Pip)
......
......@@ -134,6 +134,9 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
@property (nonatomic, strong) VELPictureInPictureController *pipController;
@property (nonatomic, strong) UIVisualEffectView *passwordBlurView;
@end
@implementation FUSLiveMainViewController
......@@ -687,7 +690,7 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
[self.liveFunctionView.chatTableView fus_addEnterRoomSystemTipMessage];
[FUSLiveHttpHelper fus_enterRoomWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId vdoid:[FUSLiveHelper shareInstance].streamModel.vdoid success:^(FUSRoomInfoModel *roomInfoModel,BOOL micMode, NSString *streamUrl, NSString *pkInfo) {
[FUSLiveHttpHelper fus_enterRoomWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId vdoid:[FUSLiveHelper shareInstance].streamModel.vdoid password:@"" success:^(FUSRoomInfoModel *roomInfoModel,BOOL micMode, NSString *streamUrl, NSString *pkInfo) {
if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
FUSLogInfo(@"不是当前包房");
......@@ -2089,6 +2092,22 @@ typedef NS_ENUM(NSInteger, FUSStreamState) {
return nil;
}
- (void)fus_showPasswordBlurView {
self.passwordBlurView = [[UIVisualEffectView alloc] initWithFrame:self.view.bounds];
self.passwordBlurView.effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
self.passwordBlurView.alpha = 1;
[self.view addSubview:self.passwordBlurView];
}
- (void)fus_hidePasswordBlurView {
[self.passwordBlurView removeFromSuperview];
self.passwordBlurView = nil;
}
#pragma mark - ScrollView Delegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
......
......@@ -1199,6 +1199,7 @@
}
if ([NSString isNull:originalStreamUrl]) {
// 播放live
[[[FUSLiveHelper shareInstance] liveVC] initPlayView];
[[[self liveVC] playView] fus_playWithUID:currentRoomId Url:pullUrl];
}
......@@ -1207,11 +1208,38 @@
}
/// 密码房(0:否、1:是)
NSInteger encryption = [roomInfo[@"encryption"] integerValue];
if (encryption == 1) {
[self.liveVC fus_showPasswordBlurView];
[FUSLiveStartSetPasswordView fus_createForAudienceWithClickHandler:^(BOOL succeed, NSString *password) {
if (succeed == false) {
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
} else {
[self.liveVC fus_hidePasswordBlurView];
[self.roomInfoModel fus_setValueWithDict:roomInfo];
self.roomInfoModel.reminderKeys = reminderKey;
[self.currentFunctionView.chatTableView fus_addEnterRoomSystemTipMessage];
[self fus_audienceJoinRoomWithRoomId:currentRoomId password:password];
}
}];
} else {
[self.roomInfoModel fus_setValueWithDict:roomInfo];
self.roomInfoModel.reminderKeys = reminderKey;
[self.currentFunctionView.chatTableView fus_addEnterRoomSystemTipMessage];
[self fus_audienceJoinRoomWithRoomId:currentRoomId];
[self fus_audienceJoinRoomWithRoomId:currentRoomId password:@""];
}
} failure:^(NSDictionary * _Nonnull errorDict, NSString * _Nonnull msg, int code) {
......@@ -1241,11 +1269,11 @@
2. 调用 JoinRoom 接口
*/
- (void)fus_audienceJoinRoomWithRoomId:(NSString *)currentRoomId {
- (void)fus_audienceJoinRoomWithRoomId:(NSString *)currentRoomId password:(NSString *)password {
__weak typeof(self) weakSelf = self;
[FUSLiveHttpHelper fus_enterRoomWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId vdoid:[FUSLiveHelper shareInstance].streamModel.vdoid success:^(FUSRoomInfoModel *roomInfoModel,BOOL micMode, NSString *streamUrl, NSString *pkInfo) {
[FUSLiveHttpHelper fus_enterRoomWithRoomId:[FUSLiveHelper shareInstance].roomInfoModel.roomId vdoid:[FUSLiveHelper shareInstance].streamModel.vdoid password:password ?: @"" success:^(FUSRoomInfoModel *roomInfoModel,BOOL micMode, NSString *streamUrl, NSString *pkInfo) {
if (![roomInfoModel.roomId isEqualToString:[FUSLiveHelper shareInstance].roomInfoModel.roomId]) {
FUSLogInfo(@"不是当前包房");
......@@ -1413,7 +1441,7 @@
[FUSAlertView showAlertWithTitle:nil message:[NSString fus_localString:@"网络出错,是否重新进入包房?"] cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_localString:@"确定"], [NSString fus_localString:@"退出"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 0) {
[self fus_audienceJoinRoomWithRoomId:currentRoomId];
[self fus_audienceJoinRoomWithRoomId:currentRoomId password:password];
}else{
[FUSLiveHelper fus_quitLiveWithCompletion:nil];
}
......
......@@ -101,6 +101,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
+ (void)fus_enterRoomWithRoomId:(NSString *)roomId
vdoid:(NSString *)vdoid
password:(NSString *)password
success:(void(^)(FUSRoomInfoModel *roomInfoModel, BOOL micMode,NSString *streamUrl, NSString *pkInfo))success
failure:(void(^)(NSDictionary *errorDict, NSString *msg, int code))failure;
......@@ -191,6 +192,18 @@ NS_ASSUME_NONNULL_BEGIN
success:(void (^)(void))success
failure:(void (^)(NSString *msg, int code))failure;
/**
验证私享房密码
@param roomId 直播间 ID
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_verifyPasswordWithRoomId:(NSString *)roomId
password:(NSString *)password
success:(void(^)(NSDictionary *dataDict))success
failure:(void(^)(NSDictionary *errorDict, NSString *msg, int code))failure;
/// 更改直播间的类型
/// @param roomType 0:视频直播 1:聊天直播
......
......@@ -361,6 +361,44 @@
}];
}
/**
验证私享房密码
@param roomId 直播间 ID
@param success 成功回调
@param failure 失败回调
*/
+ (void)fus_verifyPasswordWithRoomId:(NSString *)roomId
password:(NSString *)password
success:(void(^)(NSDictionary *dataDict))success
failure:(void(^)(NSDictionary *errorDict, NSString *msg, int code))failure {
// 空值校验
if ([NSString isNullWithString:roomId]) {
if (failure) {
failure(nil, @"参数错误", ERROR_CODE);
}
return;
}
NSDictionary *params = @{@"fid":roomId,
@"password":password};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_ROOM_VERIFY_PASSWORD params:params success:^(NSDictionary *dataDict, int code) {
if (success) {
success(dataDict);
}
} failure:^(NSDictionary *dataDict, int code) {
if (failure) {
failure(dataDict, FAILURE_MESSAGE, code);
}
}];
}
/**
......@@ -374,6 +412,7 @@
*/
+ (void)fus_enterRoomWithRoomId:(NSString *)roomId
vdoid:(NSString *)vdoid
password:(NSString *)password
success:(void(^)(FUSRoomInfoModel *roomInfoModel, BOOL micMode, NSString *streamUrl, NSString *pkInfo))success
failure:(void(^)(NSDictionary *errorDict, NSString *msg, int code))failure
{
......@@ -390,7 +429,8 @@
}
NSDictionary *params = @{@"roomid":roomId,
@"vdoid":vdoid
@"vdoid":vdoid,
@"password":password
};
[FUSHttpHelper postRequestBinaryWithUrl:FUSShowRoomURLs.fus_URL_LIVE_ENTER_ROOM params:params success:^(NSDictionary *dataDict, int code) {
......
......@@ -132,7 +132,7 @@
break;
case FUSLiveBottomToolTypeRoomScope:
if (isSelect) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_preesed"];
// image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_preesed"];
} else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
}
......
......@@ -125,7 +125,6 @@
@(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeTool2),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeTool2;
} else {
if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
......@@ -134,7 +133,6 @@
@(FUSLiveBottomToolTypeBeautySticker),
// @(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeBeautySticker;
}else{
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeTool),
@(FUSLiveBottomToolTypeShare),
......@@ -142,21 +140,26 @@
@(FUSLiveBottomToolTypeBeautySticker),
@(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeRoomScope;
}
}
if (!isHaveGiftBtn) {
[_allBtnTypes removeObject:@(FUSLiveBottomToolTypeGift)];
}
[self initBtnsWithTypes:_allBtnTypes];
}else{
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeAudienceMessage),
@(FUSLiveBottomToolTypeTool),
// @(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeGift)]];
} else {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeAudienceMessage),
@(FUSLiveBottomToolTypeTool),
@(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeShare;
}
[self initBtnsWithTypes:_allBtnTypes];
}
......@@ -257,6 +260,7 @@
[btn removeFromSuperview];
[_allBtnTypes removeObjectAtIndex:index];
[_allBtns removeObjectAtIndex:index];
[self fus_updateDivisionBtnType];
[self fus_layoutBtnFrame];
}
}
......@@ -532,14 +536,25 @@
- (void)fus_updateRoomScoreType {
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
UIImage *image;
//TODO: 修改图片
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_intimate_normal"];
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_password"];
} else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
}
[self.roomScopeBtn setImage:image forState:UIControlStateNormal];
} else {
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
[self fus_removeBtnWithType:FUSLiveBottomToolTypeShare];
} else {
[self fus_insertBtnWithType:FUSLiveBottomToolTypeShare index:self.divisionBtnType];
}
[self fus_layoutBtnFrame];
}
}
- (void)fus_updateBtnImageWithType:(FUSLiveBottomToolType)type image:(UIImage *)image state:(UIControlState *)state{
......@@ -662,8 +677,6 @@
if (_gameEntranceModel.type == 1) {
} else {
_divisionBtnType = FUSLiveBottomToolTypeGameEntrance;
NSInteger lastIndex = 0;
if ([self.allBtnTypes containsObject:@(FUSLiveBottomToolTypeInteractionGameEntrance)]) {
lastIndex = FUSLiveBottomToolTypeInteractionGameEntrance;
......@@ -687,7 +700,6 @@
}else{
if (_viewType == FUSLiveBottomViewTypeGuest) {
_divisionBtnType = FUSLiveBottomToolTypeShare;
[self fus_removeBtnWithType:FUSLiveBottomToolTypeGameEntrance];
return;
}
......@@ -749,17 +761,12 @@
if (shown && ![self.allBtnTypes containsObject:@(FUSLiveBottomToolTypeInteractionGameEntrance)]) {
_divisionBtnType = FUSLiveBottomToolTypeInteractionGameEntrance;
if ([self.allBtnTypes containsObject:@(FUSLiveBottomToolTypeGameEntrance)]) {
_divisionBtnType = FUSLiveBottomToolTypeGameEntrance;
}
NSInteger lastIndex = 0;
if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor) {
if (FUSLiveHelper.shareInstance.liveRoomType == FUSRoomTypeLinkMic) {
lastIndex = FUSLiveBottomToolTypeTool2;
} else {
lastIndex = FUSLiveBottomToolTypeBeautySticker;
lastIndex = FUSLiveBottomToolTypeRoomScope;
}
} else {
lastIndex = FUSLiveBottomToolTypeShare;
......@@ -789,8 +796,14 @@
_divisionBtnType = FUSLiveBottomToolTypeRoomScope;
}
}else{
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
_divisionBtnType = FUSLiveBottomToolTypeTool;
} else {
_divisionBtnType = FUSLiveBottomToolTypeShare;
}
}
}
}
......@@ -952,7 +965,6 @@
@(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeTool2),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeTool2;
} else {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeTool),
@(FUSLiveBottomToolTypeShare),
......@@ -960,15 +972,21 @@
@(FUSLiveBottomToolTypeBeautySticker),
@(FUSLiveBottomToolTypeRoomScope),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeRoomScope;
}
} else {
if (FUSLiveHelper.shareInstance.roomScopeType == FUSLiveRoomScopeTypePassword) {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeAudienceMessage),
@(FUSLiveBottomToolTypeTool),
// @(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeGift)]];
} else {
_allBtnTypes = [NSMutableArray arrayWithArray:@[@(FUSLiveBottomToolTypeAudienceMessage),
@(FUSLiveBottomToolTypeTool),
@(FUSLiveBottomToolTypeShare),
@(FUSLiveBottomToolTypeGift)]];
_divisionBtnType = FUSLiveBottomToolTypeShare;
}
}
[self.chatTextView resetBulletsSelected];
self.chatTextView.textView.text = nil;
......
......@@ -336,12 +336,12 @@ public class FUSLiveChatInputToolView: UIView {
switch FUSLiveHelper.shareInstance()?.roomScopeType {
case .open:
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("公开屋")
break
case .password:
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_password"), for: UIControl.State.normal)
// itemBtn.setImage(FUSShowRoomCenterBunble.imageNamed("live_RoomScope_focus_preesed"), for: UIControl.State.highlighted)
titleLb.text = NSString.fus_localString("私享屋")
break
// case .intimacy:
......
......@@ -1719,11 +1719,11 @@
}
break;
case FUSLiveChatToolTypeRoomScope:
if (isSelect) {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_preesed"];
} else {
// if (isSelect) {
// image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_preesed"];
// } else {
image = [FUSShowRoomCenterBunble imageNamed:@"live_RoomScope_normal"];
}
// }
break;
default:
break;
......
......@@ -30,6 +30,10 @@ var isShowShareToolSheetView = true
private let shareTitleLabel = UILabel()
private let passwordDescLabel = UILabel()
private let passwordLabel = UILabel()
private let topShareView = FUSShareToolSheetSubView(frame: .zero)
private let bottomShareView = FUSShareToolSheetSubView(frame: .zero)
......@@ -105,6 +109,16 @@ var isShowShareToolSheetView = true
shareTitleLabel.textColor = .fus_textColorRich()
shareTitleLabel.textAlignment = .center
passwordDescLabel.text = String.fus_versionLocalString("私享屋-密码:")
passwordDescLabel.font = .fus_themeFont(12)
passwordDescLabel.textColor = .fus_textColorRich()
passwordDescLabel.isHidden = true
passwordLabel.font = .fus_themeFont(12)
passwordLabel.textColor = .fus_theme()
passwordLabel.isHidden = true
topLineView.backgroundColor = .fus_separatorLine()
bottomLineView.backgroundColor = .fus_separatorLine()
......@@ -128,6 +142,8 @@ var isShowShareToolSheetView = true
addSubview(bgView)
addSubview(topBgView)
topBgView.addSubview(shareTitleLabel)
topBgView.addSubview(passwordDescLabel)
topBgView.addSubview(passwordLabel)
topBgView.addSubview(topLineView)
topBgView.addSubview(topShareView)
topBgView.addSubview(bottomShareView)
......@@ -145,10 +161,20 @@ var isShowShareToolSheetView = true
}
shareTitleLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.centerX.equalToSuperview()
make.top.equalToSuperview()
make.height.equalTo(43)
}
passwordLabel.snp.makeConstraints { make in
make.centerY.equalTo(shareTitleLabel.snp.centerY)
make.right.equalToSuperview().offset(-15)
}
passwordDescLabel.snp.makeConstraints { make in
make.centerY.equalTo(passwordLabel.snp.centerY)
make.right.equalTo(passwordLabel.snp.left)
}
topLineView.snp.makeConstraints { make in
make.top.equalTo(shareTitleLabel.snp.bottom).offset(0)
make.left.equalTo(topBgView).offset(15)
......@@ -195,8 +221,19 @@ var isShowShareToolSheetView = true
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
isShowShareToolSheetView = true
}
guard self.superview == nil else { return }
view.addSubview(self)
if FUSLiveHelper.shareInstance().roomScopeType == .password {
self.passwordLabel.isHidden = false
self.passwordDescLabel.isHidden = false
self.passwordLabel.text = FUSLiveHelper.shareInstance().roomInfoModel?.encryptionData.password
} else {
self.passwordLabel.isHidden = true
self.passwordDescLabel.isHidden = true
}
self.frame = view.bounds;
if animated {
// 设置初始状态
......
......@@ -331,6 +331,8 @@ UIGestureRecognizerDelegate
/// 点赞需要请求的次数
@property (nonatomic, copy) NSArray<NSNumber *> *sendLikeSendConditionList;
@property (nonatomic, strong) UIImageView *passwordRoomIconImageView;
@end
@implementation FUSLiveFunctionView
......@@ -381,6 +383,7 @@ UIGestureRecognizerDelegate
[self initPushContentView];
}
[self initContentView];
[self initCloseButton];
......@@ -394,6 +397,8 @@ UIGestureRecognizerDelegate
[self fus_initVolumnView];
[self fus_initTreasureBoxListIcon];
[self fus_setupPopularView];
}
/**
......@@ -604,12 +609,28 @@ UIGestureRecognizerDelegate
_headView.delegate = self;
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:_headView];
self.popularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 75, 75)];
}
- (void)fus_setupPopularView {
__weak typeof(self) weakSelf = self;
if (self.popularView == nil) {
self.popularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 75, 75)];
self.popularView.tapPopularViewHandler = ^{
[weakSelf fus_headViewClickHeatPower];
};
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:self.popularView];
}
if ([FUSLiveHelper shareInstance].liveType == FUSLiveTypeAnchor) {
if (self.pusherPopularView == nil) {
self.pusherPopularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.pusherHeadView.bottom, 75, 75)];
self.pusherPopularView.tapPopularViewHandler = ^{
[weakSelf fus_headViewClickHeatPower];
};
[self.pusherContentView addSubview:self.pusherPopularView];
}
}
}
/**
......@@ -1074,13 +1095,6 @@ UIGestureRecognizerDelegate
[_pusherHeadView setHeatPowerClickHandler:^{
[weakSelf fus_headViewClickHeatPower];
}];
self.pusherPopularView = [[FUSPopularProgressView alloc] initWithFrame:CGRectMake(12, self.pusherHeadView.bottom, 75, 75)];
self.pusherPopularView.tapPopularViewHandler = ^{
[weakSelf fus_headViewClickHeatPower];
};
[self.pusherContentView addSubview:self.pusherPopularView];
}
/**
......@@ -4712,6 +4726,9 @@ UIGestureRecognizerDelegate
[self.listView removeFromSuperview];
self.listView = nil;
[self.passwordRoomIconImageView removeFromSuperview];
self.passwordRoomIconImageView = nil;
[self.chatFastInputView fus_endTimer];
[self.chatFastInputView removeFromSuperview];
self.chatFastInputView = nil;
......@@ -5759,27 +5776,48 @@ UIGestureRecognizerDelegate
- (void)fus_updateRoomScoreType {
if (FUSLiveHelper.shareInstance.liveType != FUSLiveTypeAnchor) {
return;
}
switch (FUSLiveHelper.shareInstance.roomScopeType) {
case FUSLiveRoomScopeTypeOpen:
if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor) {
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_open_scope"]];
}
[self fus_updateRewardViewIfNeeded];
[self fus_setupPopularView];
[self.passwordRoomIconImageView removeFromSuperview];
self.passwordRoomIconImageView = nil;
break;
case FUSLiveRoomScopeTypePassword:
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_follow_scope"]];
if (FUSLiveHelper.shareInstance.liveType == FUSLiveTypeAnchor) {
[_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_password_scope"]];
}
[self.anchorRewardView removeFromSuperview];
self.anchorRewardView = nil;
[self.popularView removeFromSuperview];
self.popularView = nil;
[self.pusherPopularView removeFromSuperview];
self.pusherPopularView = nil;
[self fus_showPasswordAnim];
break;
// case FUSLiveRoomScopeTypeIntimacy:
// [_liveTimeRecordView fus_updateRoomScopeTypeImage:[FUSShowRoomCenterBunble imageNamed:@"live_push_live_time_bg_intimate_scope"]];
// break;
}
[self.bottomToolView fus_updateRoomScoreType];
}
- (void)fus_showPasswordAnim {
[self.passwordRoomIconImageView removeFromSuperview];
self.passwordRoomIconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(12, self.headView.bottom, 49, 49)];
self.passwordRoomIconImageView.image = [FUSShowRoomCenterBunble imageNamed:@"live_room_password_room_icon"];
[[self fus_viewWithLayer:FUSLiveFunctionLayerRoomInfos] addSubview:self.passwordRoomIconImageView];
}
......
......@@ -44,7 +44,7 @@ import FUSCommon
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_openScope_img")
self.privacyLabel.text = .fus_versionLocalString("公开屋")
case .password:
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_followScope_img")
self.privacyImageView.image = FUSShowRoomCenterBunble.imageNamed("live_start_passwordScope_img")
self.privacyLabel.text = .fus_versionLocalString("私享屋")
// case .intimacy:
//
......@@ -77,9 +77,9 @@ import FUSCommon
privacyImageView.contentMode = .scaleAspectFit
privacyBtn.addSubview(privacyImageView)
privacyImageView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(8)
make.left.equalToSuperview().offset(10)
make.centerY.equalToSuperview()
make.size.equalTo(CGSizeMake(23, 16))
make.size.equalTo(CGSizeMake(16, 16))
}
privacyLabel.textColor = .white
......
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