个播房无下一个房间时上划处理
This commit is contained in:
@@ -104,8 +104,6 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
@property (nonatomic,assign) BOOL isRequestSuperAdmin;
|
||||
///是否是最小化进房
|
||||
@property (nonatomic,assign) BOOL isMiniEnter;
|
||||
///个播房列表
|
||||
@property (nonatomic, strong) NSMutableArray *cycleAnchorList;
|
||||
///个播上划引导
|
||||
@property (nonatomic, strong) AnchorRoomSrollTipView *anchorScrollTipView;
|
||||
|
||||
@@ -651,7 +649,6 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
[self hideHUD];
|
||||
if (roomInfo.type == RoomType_Anchor) {//个播房,获取下一个房间
|
||||
[self handleInitAnchorRoom];
|
||||
[self.presenter getCycleAnchorRoomList:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
[self showAnchorScrollTipView];
|
||||
return;
|
||||
}
|
||||
@@ -716,7 +713,6 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
self.roomInfo = roomInfo;
|
||||
if (roomInfo.type == RoomType_Anchor) {
|
||||
[self handleInitAnchorRoom];
|
||||
[self.presenter getCycleAnchorRoomList:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
[self showAnchorScrollTipView];
|
||||
return;
|
||||
}
|
||||
@@ -758,17 +754,41 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
|
||||
///获取推荐滚动的个播房列表(只有第一次进房获取)
|
||||
- (void)getNextAnchorRoomSuccess:(RoomInfoModel *)roomInfo {
|
||||
[self.cycleAnchorList addObject:self.roomInfo];
|
||||
if (roomInfo) {
|
||||
[self.cycleAnchorList addObject:roomInfo];
|
||||
self.anchorScrollView.contentOffset = CGPointMake(0, 0);
|
||||
[self hideHUD];
|
||||
if (roomInfo) { //获取下一个房间成功
|
||||
//1、退出房间操作
|
||||
self.isRequestSuperAdmin = NO;
|
||||
[self exitOldRoom];
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[XPRoomMiniManager shareManager] resetLocalMessage];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
//2、移除房间子控件
|
||||
[self.backContainerView removeFromSuperview];
|
||||
[self.stageView removeFromSuperview];
|
||||
[self.messageContainerView removeFromSuperview];
|
||||
[self.activityContainerView removeFromSuperview];
|
||||
[self.roomHeaderView removeFromSuperview];
|
||||
[self.functionView removeFromSuperview];
|
||||
self.messageContainerView = nil;
|
||||
self.stageView = nil;
|
||||
[self.menuContainerView removeFromSuperview];
|
||||
self.menuContainerView = nil;
|
||||
//3、重新进入房间
|
||||
self.roomUid = [NSString stringWithFormat:@"%zd", roomInfo.uid];
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
/// 公屏 福袋礼物爆出的礼物 需要依赖 当前房间中的礼物列表 需要提前获取礼物列表 可以拿到礼物 没有想到别的方法去解决这个问题 有需要改的在修改吧
|
||||
[self.presenter getNormalGiftList:self.roomUid];
|
||||
///获取房间超管列表
|
||||
[self.presenter getRoomSuperAdmin:self.roomUid];
|
||||
} else {
|
||||
[self showErrorToast:@"已经到底啦~自动为您返回当前房间"];
|
||||
}
|
||||
//获取到下一个房间信息后,设置可以滚动
|
||||
[self.anchorScrollView updateForAnchorRoomList:self.cycleAnchorList];
|
||||
}
|
||||
|
||||
///个播房初始化一些操作
|
||||
- (void)handleInitAnchorRoom {
|
||||
[self.anchorScrollView updateForAnchorRoomList:nil];
|
||||
if (self.roomInfo.valid) { // 房间有效,直接进入房间
|
||||
if (self.roomInfo.roomPwd.length > 0 && self.roomInfo.uid != [AccountInfoStorage instance].getUid.integerValue && [XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {//进房密码的情况
|
||||
if (!self.isRequestSuperAdmin) {
|
||||
@@ -932,7 +952,6 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
[self.backContainerView onRoomUpdate];
|
||||
if (self.roomInfo.type == RoomType_Anchor && self.roomInfo.hadChangeRoomType) {///从其他房变为个播房
|
||||
[self handleInitAnchorRoom];
|
||||
[self.presenter getCycleAnchorRoomList:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[self showAnchorScrollTipView];
|
||||
} else if (anchorToOther) {
|
||||
[self.anchorScrollView removeFromSuperview];
|
||||
@@ -1310,34 +1329,8 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
return;
|
||||
}
|
||||
[self.view endEditing:YES];
|
||||
[self.anchorScrollView updateForAnchorRoomList:nil];
|
||||
[self showAnchorLoading];
|
||||
//1、退出房间操作
|
||||
self.isRequestSuperAdmin = NO;
|
||||
[self exitOldRoom];
|
||||
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
|
||||
[[XPRoomMiniManager shareManager] resetLocalMessage];
|
||||
[[RtcManager instance] exitRoom];
|
||||
[self.presenter reportUserOutRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
//2、移除房间子控件
|
||||
[self.backContainerView removeFromSuperview];
|
||||
[self.stageView removeFromSuperview];
|
||||
[self.messageContainerView removeFromSuperview];
|
||||
[self.activityContainerView removeFromSuperview];
|
||||
[self.roomHeaderView removeFromSuperview];
|
||||
[self.functionView removeFromSuperview];
|
||||
self.messageContainerView = nil;
|
||||
self.stageView = nil;
|
||||
[self.menuContainerView removeFromSuperview];
|
||||
self.menuContainerView = nil;
|
||||
//3、重新进入房间
|
||||
RoomInfoModel *roomInfo = [self.cycleAnchorList lastObject];
|
||||
self.roomUid = [NSString stringWithFormat:@"%zd", roomInfo.uid];
|
||||
[self.presenter initEnterRoom:self.roomUid user:[AccountInfoStorage instance].getUid];
|
||||
/// 公屏 福袋礼物爆出的礼物 需要依赖 当前房间中的礼物列表 需要提前获取礼物列表 可以拿到礼物 没有想到别的方法去解决这个问题 有需要改的在修改吧
|
||||
[self.presenter getNormalGiftList:self.roomUid];
|
||||
///获取房间超管列表
|
||||
[self.presenter getRoomSuperAdmin:self.roomUid];
|
||||
[self.presenter getCycleAnchorRoomList:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]];
|
||||
}
|
||||
|
||||
///个播开始滚动
|
||||
@@ -1504,13 +1497,6 @@ NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否
|
||||
return _anchorScrollView;
|
||||
}
|
||||
|
||||
- (NSMutableArray *)cycleAnchorList {
|
||||
if (!_cycleAnchorList) {
|
||||
_cycleAnchorList = [NSMutableArray array];
|
||||
}
|
||||
return _cycleAnchorList;
|
||||
}
|
||||
|
||||
- (AnchorRoomSrollTipView *)anchorScrollTipView {
|
||||
if (!_anchorScrollTipView) {
|
||||
_anchorScrollTipView = [[AnchorRoomSrollTipView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
Reference in New Issue
Block a user