个播房无下一个房间时上划处理

This commit is contained in:
chenguilong
2022-07-19 18:00:30 +08:00
parent 87f76c8d9b
commit 9109ff4686
3 changed files with 31 additions and 78 deletions

View File

@@ -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)];