个播PK入口状态调整,异常结束弹窗逻辑处理

This commit is contained in:
chenguilong
2022-04-18 18:12:57 +08:00
parent ab14c922bc
commit 4c56587ca8
12 changed files with 174 additions and 55 deletions

View File

@@ -329,9 +329,7 @@
[Api getAcrossRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:data.data];
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
self.delegate.getRoomInfo.pkUid = acrossPKPanelInfo.aUid;
self.delegate.getRoomInfo.pkRoomId = acrossPKPanelInfo.aRoomId;
[self updateAnchorPkInfo:acrossPKPanelInfo];
if (acrossPKPanelInfo.pkType == AcrossRoomPkTypeAnchor) {
if (acrossPKPanelInfo.aUid.integerValue > 0) {
if (!self.anchorPKPanelView.superview) {
@@ -547,7 +545,7 @@
});
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
[[RtcManager instance] connectOtherRoom:acrossPKPanelInfo.aRoomId userId:acrossPKPanelInfo.aUid];
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
[self updateAnchorPkInfo:acrossPKPanelInfo];
}
}
}];
@@ -589,7 +587,7 @@
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
[self updateAnchorPkInfo:acrossPKPanelInfo];
}
break;
case Custom_Message_Sub_AnchorPK_End://PK
@@ -603,9 +601,16 @@
}
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
self.anchorPKPanelView.pkPanelInfo = acrossPKPanelInfo;
XPAnchorPKResultView *view = [[XPAnchorPKResultView alloc] initWithFrame:CGRectMake(0, 0, 300, 472)];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
[self updateAnchorPkInfo:acrossPKPanelInfo];
if (acrossPKPanelInfo.isForce) {
XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
} else {
XPAnchorPKResultView *view = [[XPAnchorPKResultView alloc] initWithFrame:CGRectMake(0, 0, 300, 472)];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
}
break;
case Custom_Message_Sub_AnchorPK_Finish://PK
@@ -613,11 +618,8 @@
[self.anchorPKPanelView resetAcrossPKViewData];
[self.anchorPKPanelView removeFromSuperview];
self.anchorPKPanelView = nil;
[self resetAnchorPkInfo];
[[RtcManager instance] disconnectOtherRoom];
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
XPAnchorPKFinishView *view = [[XPAnchorPKFinishView alloc] init];
view.data = acrossPKPanelInfo;
[TTPopup popupView:view style:TTPopupStyleAlert];
}
break;
default:
@@ -766,6 +768,10 @@
}
}
- (void)xPAnchorPKPanelViewPenaltyCountDownEnd {
self.delegate.getRoomInfo.pkState = AcrossRoomPkStateTypePenaltyEnd;
}
#pragma mark - Event Response
- (void)contributionButtonAction:(UIButton *)sender {
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid];
@@ -1037,6 +1043,22 @@
}
}
- (void)updateAnchorPkInfo:(AcrossRoomPKPanelModel *)acrossPKPanelInfo {
self.delegate.getRoomInfo.roundId = acrossPKPanelInfo.roundId;
self.delegate.getRoomInfo.pkUid = acrossPKPanelInfo.aUid;
self.delegate.getRoomInfo.pkRoomId = acrossPKPanelInfo.aRoomId;
self.delegate.getRoomInfo.pkState = acrossPKPanelInfo.pkState;
self.delegate.getRoomInfo.winUid = acrossPKPanelInfo.winUid;
}
- (void)resetAnchorPkInfo {
self.delegate.getRoomInfo.roundId = nil;
self.delegate.getRoomInfo.pkUid = nil;
self.delegate.getRoomInfo.pkRoomId = nil;
self.delegate.getRoomInfo.pkState = nil;
self.delegate.getRoomInfo.winUid = nil;
}
#pragma mark - XPRoomLittleGameListViewDelegate
- (void)xPRoomLittleGameListView:(XPLittleGameRoomListView *)view didSelectItem:(LittleGameInfoModel *)itemInfo {
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;