房间内PK非管理员点击pk面板的时候弹出报名
This commit is contained in:
@@ -91,8 +91,13 @@
|
|||||||
- (void)setUserInfo:(ArrangeMicUserModel *)userInfo {
|
- (void)setUserInfo:(ArrangeMicUserModel *)userInfo {
|
||||||
_userInfo = userInfo;
|
_userInfo = userInfo;
|
||||||
if (_userInfo) {
|
if (_userInfo) {
|
||||||
self.nameLabel.text= _userInfo.nick;
|
NSString * nick = _userInfo.nick;
|
||||||
|
if (nick.length > 6) {
|
||||||
|
nick = [nick substringToIndex:6];
|
||||||
|
}
|
||||||
|
self.nameLabel.text= nick;
|
||||||
self.avaratImageView.imageUrl = _userInfo.avatar;
|
self.avaratImageView.imageUrl = _userInfo.avatar;
|
||||||
|
self.sexImageView.image = _userInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
|
||||||
self.rankLabel.text = [NSString stringWithFormat:@"%ld", _userInfo.number];
|
self.rankLabel.text = [NSString stringWithFormat:@"%ld", _userInfo.number];
|
||||||
if (self.isManager) {
|
if (self.isManager) {
|
||||||
if (_userInfo.arrangeMicType == ArrangeMicType_Dating) {
|
if (_userInfo.arrangeMicType == ArrangeMicType_Dating) {
|
||||||
@@ -180,4 +185,13 @@
|
|||||||
}
|
}
|
||||||
return _avaratImageView;
|
return _avaratImageView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIImageView *)sexImageView {
|
||||||
|
if (!_sexImageView) {
|
||||||
|
_sexImageView = [[UIImageView alloc] init];
|
||||||
|
_sexImageView.userInteractionEnabled = YES;
|
||||||
|
}
|
||||||
|
return _sexImageView;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -294,7 +294,7 @@
|
|||||||
#pragma mark - 房间PK
|
#pragma mark - 房间PK
|
||||||
- (void)configRoomPKPanelView:(BOOL)isEnter {
|
- (void)configRoomPKPanelView:(BOOL)isEnter {
|
||||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||||
self.roompkPanelView.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
self.roompkPanelView.roomInfo = roomInfo;
|
||||||
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
if (roomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
|
||||||
if (!self.roompkPanelView.superview) {
|
if (!self.roompkPanelView.superview) {
|
||||||
[self addSubview:self.roompkPanelView];
|
[self addSubview:self.roompkPanelView];
|
||||||
@@ -303,12 +303,10 @@
|
|||||||
make.top.mas_equalTo(self).offset(35 + (58 + 5 + 6 + 12) + 38 + (55 + 10 + 12 + 5+16) * 2 + 15 * 2 + kNavigationHeight + 5);
|
make.top.mas_equalTo(self).offset(35 + (58 + 5 + 6 + 12) + 38 + (55 + 10 + 12 + 5+16) * 2 + 15 * 2 + kNavigationHeight + 5);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
|
||||||
if (isEnter) {
|
if (isEnter) {
|
||||||
self.roompkPanelView.roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
|
|
||||||
self.roompkPanelView.roomId = roomId;
|
|
||||||
[self.roompkPanelView enterRoomGetRoomPKDetailInfo];
|
[self.roompkPanelView enterRoomGetRoomPKDetailInfo];
|
||||||
}
|
}
|
||||||
|
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||||
request.roomId = roomId;
|
request.roomId = roomId;
|
||||||
|
@@ -24,7 +24,9 @@
|
|||||||
///数据源
|
///数据源
|
||||||
@property (nonatomic,strong) NSMutableArray<NSMutableArray<RoomPKTimeItemModel *> *> *datasource;
|
@property (nonatomic,strong) NSMutableArray<NSMutableArray<RoomPKTimeItemModel *> *> *datasource;
|
||||||
///0秒钟
|
///0秒钟
|
||||||
@property (nonatomic,strong)RoomPKTimeItemModel *zeroModel;
|
@property (nonatomic,strong) RoomPKTimeItemModel *zeroModel;
|
||||||
|
///30秒钟
|
||||||
|
@property (nonatomic,strong) RoomPKTimeItemModel *thirdModel;
|
||||||
///选择的分钟
|
///选择的分钟
|
||||||
@property (nonatomic,strong) RoomPKTimeItemModel *selectMinModel;
|
@property (nonatomic,strong) RoomPKTimeItemModel *selectMinModel;
|
||||||
///选择的秒钟
|
///选择的秒钟
|
||||||
@@ -63,11 +65,9 @@
|
|||||||
self.selectMinModel = minArray.firstObject;
|
self.selectMinModel = minArray.firstObject;
|
||||||
self.selectSecondModel = self.zeroModel;
|
self.selectSecondModel = self.zeroModel;
|
||||||
NSMutableArray * secondArray = [NSMutableArray array];
|
NSMutableArray * secondArray = [NSMutableArray array];
|
||||||
|
[secondArray addObject:self.thirdModel];
|
||||||
|
|
||||||
RoomPKTimeItemModel * thirdModel = [[RoomPKTimeItemModel alloc] init];
|
self.selectSecondModel = self.thirdModel;
|
||||||
thirdModel.title = @"30秒";
|
|
||||||
thirdModel.time = 30;
|
|
||||||
[secondArray addObject:thirdModel];
|
|
||||||
|
|
||||||
[self.datasource addObject:minArray];
|
[self.datasource addObject:minArray];
|
||||||
[self.datasource addObject:secondArray];
|
[self.datasource addObject:secondArray];
|
||||||
@@ -123,23 +123,40 @@
|
|||||||
if (component == 0) {
|
if (component == 0) {
|
||||||
RoomPKTimeItemModel * model = [[self.datasource objectAtIndex:component] objectAtIndex:row];
|
RoomPKTimeItemModel * model = [[self.datasource objectAtIndex:component] objectAtIndex:row];
|
||||||
self.selectMinModel = model;
|
self.selectMinModel = model;
|
||||||
|
self.selectSecondModel = self.zeroModel;
|
||||||
if ([model.title isEqualToString:@"0分钟"]) {
|
if ([model.title isEqualToString:@"0分钟"]) {
|
||||||
NSMutableArray * array = [self.datasource objectAtIndex:1];
|
NSMutableArray * array = [self.datasource objectAtIndex:1];
|
||||||
if ([array containsObject:self.zeroModel]) {
|
if ([array containsObject:self.zeroModel]) {
|
||||||
[array removeObject:self.zeroModel];
|
[array removeObject:self.zeroModel];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
if (![array containsObject:self.thirdModel]) {
|
||||||
|
[array addObject:self.thirdModel];
|
||||||
|
}
|
||||||
|
}else if ([model.title isEqualToString:@"30分钟"]) {
|
||||||
|
NSMutableArray * array = [self.datasource objectAtIndex:1];
|
||||||
|
if ([array containsObject:self.thirdModel]) {
|
||||||
|
[array removeObject:self.thirdModel];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![array containsObject:self.zeroModel]) {
|
||||||
|
[array insertObject:self.zeroModel atIndex:0];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
NSMutableArray * array = [self.datasource objectAtIndex:1];
|
NSMutableArray * array = [self.datasource objectAtIndex:1];
|
||||||
if (![array containsObject:self.zeroModel]) {
|
if (![array containsObject:self.zeroModel]) {
|
||||||
[array insertObject:self.zeroModel atIndex:0];
|
[array insertObject:self.zeroModel atIndex:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (![array containsObject:self.thirdModel]) {
|
||||||
|
[array addObject:self.thirdModel];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[pickerView reloadComponent:1];
|
[pickerView reloadComponent:1];
|
||||||
} else {
|
} else {
|
||||||
RoomPKTimeItemModel * model = [[self.datasource objectAtIndex:component] objectAtIndex:row];
|
RoomPKTimeItemModel * model = [[self.datasource objectAtIndex:component] objectAtIndex:row];
|
||||||
self.selectSecondModel = model;
|
self.selectSecondModel = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Event Response
|
#pragma mark - Event Response
|
||||||
@@ -212,11 +229,18 @@
|
|||||||
return _zeroModel;
|
return _zeroModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (RoomPKTimeItemModel *)thirdModel {
|
||||||
|
if (!_thirdModel) {
|
||||||
|
_thirdModel = [[RoomPKTimeItemModel alloc] init];
|
||||||
|
_thirdModel.title = @"30秒";
|
||||||
|
_thirdModel.time = 30;
|
||||||
|
}
|
||||||
|
return _thirdModel;
|
||||||
|
}
|
||||||
|
|
||||||
- (RoomPKTimeItemModel *)selectModel {
|
- (RoomPKTimeItemModel *)selectModel {
|
||||||
if (!_selectModel) {
|
if (!_selectModel) {
|
||||||
_selectModel = [[RoomPKTimeItemModel alloc] init];
|
_selectModel = [[RoomPKTimeItemModel alloc] init];
|
||||||
_selectModel.title = @"30秒";
|
|
||||||
_selectModel.time = 30;
|
|
||||||
}
|
}
|
||||||
return _selectModel;
|
return _selectModel;
|
||||||
}
|
}
|
||||||
|
@@ -8,14 +8,12 @@
|
|||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
@class RoomPKDetailInfoModel, MicroQueueModel, AttachmentModel;
|
@class RoomPKDetailInfoModel, MicroQueueModel, AttachmentModel, RoomInfoModel;
|
||||||
@interface XPRoomPKProgressView : UIView
|
@interface XPRoomPKProgressView : UIView
|
||||||
///房主的uid
|
|
||||||
@property (nonatomic,copy) NSString *roomUid;
|
|
||||||
///群聊的id
|
|
||||||
@property (nonatomic,copy) NSString *roomId;
|
|
||||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MicroQueueModel *> *micQueue;
|
@property (nonatomic, strong) NSMutableDictionary<NSString *, MicroQueueModel *> *micQueue;
|
||||||
@property (nonatomic,strong) RoomPKDetailInfoModel *pkDetailInfo;
|
@property (nonatomic,strong) RoomPKDetailInfoModel *pkDetailInfo;
|
||||||
|
///房间信息
|
||||||
|
@property (nonatomic,strong) RoomInfoModel *roomInfo;
|
||||||
///是否是管理员
|
///是否是管理员
|
||||||
@property (nonatomic,assign) BOOL isManager;
|
@property (nonatomic,assign) BOOL isManager;
|
||||||
///收到礼物
|
///收到礼物
|
||||||
|
@@ -19,6 +19,7 @@
|
|||||||
#import "XPGiftStorage.h"
|
#import "XPGiftStorage.h"
|
||||||
#import "GiftReceiveInfoModel.h"
|
#import "GiftReceiveInfoModel.h"
|
||||||
#import "GiftInfoModel.h"
|
#import "GiftInfoModel.h"
|
||||||
|
#import "XCCurrentVCStackManager.h"
|
||||||
///Model
|
///Model
|
||||||
#import "RoomPKDetailInfoModel.h"
|
#import "RoomPKDetailInfoModel.h"
|
||||||
#import "MicroQueueModel.h"
|
#import "MicroQueueModel.h"
|
||||||
@@ -26,12 +27,15 @@
|
|||||||
#import "RoomPKChooseUserModel.h"
|
#import "RoomPKChooseUserModel.h"
|
||||||
#import "AttachmentModel.h"
|
#import "AttachmentModel.h"
|
||||||
#import "MicroExtModel.h"
|
#import "MicroExtModel.h"
|
||||||
|
#import "XPArrangeMicInfoModel.h"
|
||||||
|
#import "RoomInfoModel.h"
|
||||||
///View
|
///View
|
||||||
#import "XPRoomPKPanelUserView.h"
|
#import "XPRoomPKPanelUserView.h"
|
||||||
#import "XPRoomPKSelectUserView.h"
|
#import "XPRoomPKSelectUserView.h"
|
||||||
#import "XPRoomPKPlayingView.h"
|
#import "XPRoomPKPlayingView.h"
|
||||||
#import "XPRoomPKPlayingView.h"
|
#import "XPRoomPKPlayingView.h"
|
||||||
#import "XPRoomPKResultView.h"
|
#import "XPRoomPKResultView.h"
|
||||||
|
#import "XPArrangeMicViewController.h"
|
||||||
|
|
||||||
@interface XPRoomPKProgressView ()<XPRoomPKPanelUserViewDelegate, XPRoomPKSelectUserViewDelegate, XPRoomPKPlayingViewDelegate>
|
@interface XPRoomPKProgressView ()<XPRoomPKPanelUserViewDelegate, XPRoomPKSelectUserViewDelegate, XPRoomPKPlayingViewDelegate>
|
||||||
///背景
|
///背景
|
||||||
@@ -200,6 +204,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)enterRoomGetRoomPKDetailInfo {
|
- (void)enterRoomGetRoomPKDetailInfo {
|
||||||
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
[Api getRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
[Api getRoomPKDetail:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
RoomPKDetailInfoModel * pkDetailInfo = [RoomPKDetailInfoModel modelWithDictionary:data.data];
|
RoomPKDetailInfoModel * pkDetailInfo = [RoomPKDetailInfoModel modelWithDictionary:data.data];
|
||||||
@@ -270,7 +275,7 @@
|
|||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} roomUid:self.roomUid];
|
} roomUid:roomUid];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -357,6 +362,7 @@
|
|||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
if (!self.isReceivePKResult) {
|
if (!self.isReceivePKResult) {
|
||||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||||
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
if (self.pkDetailInfo.roomPK.pkId.length > 0) {
|
if (self.pkDetailInfo.roomPK.pkId.length > 0) {
|
||||||
NSString * pkId = self.pkDetailInfo.roomPK.pkId;
|
NSString * pkId = self.pkDetailInfo.roomPK.pkId;
|
||||||
[Api checkRoomPKResult:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
[Api checkRoomPKResult:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
@@ -367,7 +373,7 @@
|
|||||||
self.checkResultNum++;
|
self.checkResultNum++;
|
||||||
[self checkRoomPKResult];
|
[self checkRoomPKResult];
|
||||||
}
|
}
|
||||||
} roomUid:self.roomUid operUid:uid pkId:pkId];
|
} roomUid:roomUid operUid:uid pkId:pkId];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -597,7 +603,8 @@
|
|||||||
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
|
NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init];
|
||||||
request.key = [NSString stringWithFormat:@"%d", micModel.microState.position];
|
request.key = [NSString stringWithFormat:@"%d", micModel.microState.position];
|
||||||
request.value = [[self userInfoToQueueExt:micModel.userInfo] toJSONString];
|
request.value = [[self userInfoToQueueExt:micModel.userInfo] toJSONString];
|
||||||
request.roomId = self.roomId;
|
NSString * roomId = [NSString stringWithFormat:@"%ld", self.roomInfo.roomId];
|
||||||
|
request.roomId = roomId;
|
||||||
request.transient = YES;
|
request.transient = YES;
|
||||||
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
[[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) {
|
||||||
}];
|
}];
|
||||||
@@ -662,6 +669,18 @@
|
|||||||
chooseUserView.groupType = type;
|
chooseUserView.groupType = type;
|
||||||
chooseUserView.microQueueArray = self.micQueue.allValues;
|
chooseUserView.microQueueArray = self.micQueue.allValues;
|
||||||
[TTPopup popupView:chooseUserView style:TTPopupStyleAlert];
|
[TTPopup popupView:chooseUserView style:TTPopupStyleAlert];
|
||||||
|
} else {
|
||||||
|
XPArrangeMicInfoModel * info = [[XPArrangeMicInfoModel alloc] init];
|
||||||
|
info.roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
|
info.roomId = [NSString stringWithFormat:@"%ld", self.roomInfo.roomId];
|
||||||
|
info.nick = self.roomInfo.nick;
|
||||||
|
info.roomAvatar = self.roomInfo.avatar;
|
||||||
|
info.roomTitle = self.roomInfo.title;
|
||||||
|
info.micQueue = self.micQueue;
|
||||||
|
info.isManager = self.isManager;
|
||||||
|
info.type = ArrangeMicType_Room_PK;
|
||||||
|
XPArrangeMicViewController * arrangeMicVC = [[XPArrangeMicViewController alloc] initWithInfo:info];
|
||||||
|
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController presentViewController:arrangeMicVC animated:YES completion:nil];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -708,7 +727,8 @@
|
|||||||
attachment.first = CustomMessageType_Room_PK;
|
attachment.first = CustomMessageType_Room_PK;
|
||||||
attachment.second = Custom_Message_Sub_Room_PK_Manager_Up_Mic;
|
attachment.second = Custom_Message_Sub_Room_PK_Manager_Up_Mic;
|
||||||
attachment.data = dic;
|
attachment.data = dic;
|
||||||
NSString *sessionID = self.roomId;
|
NSString * roomId = [NSString stringWithFormat:@"%ld", self.roomInfo.roomId];
|
||||||
|
NSString *sessionID = roomId;
|
||||||
NIMMessage *message = [[NIMMessage alloc]init];
|
NIMMessage *message = [[NIMMessage alloc]init];
|
||||||
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||||
object.attachment = attachment;
|
object.attachment = attachment;
|
||||||
@@ -725,6 +745,7 @@
|
|||||||
[TTPopup dismiss];
|
[TTPopup dismiss];
|
||||||
[TTPopup alertWithMessage:@"重新开始将会提前结束本次PK\n确认重新开始吗?" confirmHandler:^{
|
[TTPopup alertWithMessage:@"重新开始将会提前结束本次PK\n确认重新开始吗?" confirmHandler:^{
|
||||||
RoomPKInfoModel * roompkInfo = self.pkDetailInfo.roomPK;
|
RoomPKInfoModel * roompkInfo = self.pkDetailInfo.roomPK;
|
||||||
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
[Api createRoomPK:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
[Api createRoomPK:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
RoomPKInfoModel * newRoomPKInfo = [RoomPKInfoModel modelWithDictionary:data.data];
|
RoomPKInfoModel * newRoomPKInfo = [RoomPKInfoModel modelWithDictionary:data.data];
|
||||||
@@ -737,11 +758,11 @@
|
|||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} roomUid:self.roomUid pkId:newRoomPKInfo.pkId joinUsers:teamJsonStr];
|
} roomUid:roomUid pkId:newRoomPKInfo.pkId joinUsers:teamJsonStr];
|
||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} pkMode:[NSString stringWithFormat:@"%ld", roompkInfo.pkMode] voteMode:[NSString stringWithFormat:@"%ld", roompkInfo.voteMode] duration:[NSString stringWithFormat:@"%0.f", roompkInfo.duration] roomUid:self.roomUid operUid:[AccountInfoStorage instance].getUid];
|
} pkMode:[NSString stringWithFormat:@"%ld", roompkInfo.pkMode] voteMode:[NSString stringWithFormat:@"%ld", roompkInfo.voteMode] duration:[NSString stringWithFormat:@"%0.f", roompkInfo.duration] roomUid:roomUid operUid:[AccountInfoStorage instance].getUid];
|
||||||
} cancelHandler:^{
|
} cancelHandler:^{
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
if (self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_Playing) {
|
if (self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_Playing) {
|
||||||
@@ -759,6 +780,7 @@
|
|||||||
- (void)beginButtonAction:(UIButton *)sender {
|
- (void)beginButtonAction:(UIButton *)sender {
|
||||||
if (self.pkDetailInfo) {
|
if (self.pkDetailInfo) {
|
||||||
RoomPKInfoModel * roompkInfo = self.pkDetailInfo.roomPK;
|
RoomPKInfoModel * roompkInfo = self.pkDetailInfo.roomPK;
|
||||||
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.roomInfo.uid];
|
||||||
if (self.redChooseArray.count > 0 && self.blueChooseArray.count > 0) {
|
if (self.redChooseArray.count > 0 && self.blueChooseArray.count > 0) {
|
||||||
if (self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_End || self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_ReStart) {
|
if (self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_End || self.pkDetailInfo.roomPK.pkStatus == RoomPKStatusType_ReStart) {
|
||||||
[TTPopup alertWithMessage:@"是否再次开始PK?" confirmHandler:^{
|
[TTPopup alertWithMessage:@"是否再次开始PK?" confirmHandler:^{
|
||||||
@@ -774,11 +796,11 @@
|
|||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} roomUid:self.roomUid pkId:newRoomPKInfo.pkId joinUsers:teamJsonStr];
|
} roomUid:roomUid pkId:newRoomPKInfo.pkId joinUsers:teamJsonStr];
|
||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} pkMode:[NSString stringWithFormat:@"%ld", roompkInfo.pkMode] voteMode:[NSString stringWithFormat:@"%ld", roompkInfo.voteMode] duration:[NSString stringWithFormat:@"%0.f", roompkInfo.duration] roomUid:self.roomUid operUid:[AccountInfoStorage instance].getUid];
|
} pkMode:[NSString stringWithFormat:@"%ld", roompkInfo.pkMode] voteMode:[NSString stringWithFormat:@"%ld", roompkInfo.voteMode] duration:[NSString stringWithFormat:@"%0.f", roompkInfo.duration] roomUid:roomUid operUid:[AccountInfoStorage instance].getUid];
|
||||||
} cancelHandler:^{
|
} cancelHandler:^{
|
||||||
|
|
||||||
}];
|
}];
|
||||||
@@ -795,7 +817,7 @@
|
|||||||
} else {
|
} else {
|
||||||
[XCHUDTool showErrorWithMessage:msg];
|
[XCHUDTool showErrorWithMessage:msg];
|
||||||
}
|
}
|
||||||
} roomUid:self.roomUid pkId:self.pkDetailInfo.roomPK.pkId joinUsers:teamJsonStr];
|
} roomUid:roomUid pkId:self.pkDetailInfo.roomPK.pkId joinUsers:teamJsonStr];
|
||||||
} cancelHandler:^{
|
} cancelHandler:^{
|
||||||
|
|
||||||
}];
|
}];
|
||||||
|
@@ -295,6 +295,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)createRoomPKSuccess:(RoomPKInfoModel *)roompkInfo {
|
- (void)createRoomPKSuccess:(RoomPKInfoModel *)roompkInfo {
|
||||||
|
[self showSuccessToast:@"创建成功"];
|
||||||
if (self.redUserArray.count > 0 || self.blueUserArray.count > 0) {
|
if (self.redUserArray.count > 0 || self.blueUserArray.count > 0) {
|
||||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||||
for (int i = 0 ; i< self.redUserArray.count; i++) {
|
for (int i = 0 ; i< self.redUserArray.count; i++) {
|
||||||
@@ -355,8 +356,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)onceAgainPKButtonAction:(UIButton *)sender {
|
- (void)onceAgainPKButtonAction:(UIButton *)sender {
|
||||||
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
NSString * title = @"创建此PK,会覆盖现在进行的PK,\n 确定覆盖当前PK吗?";
|
||||||
[self.presenter createRoomPKMode:2 voteMode:self.voteType duration:self.duraTime roomUid:roomUid];
|
[TTPopup alertWithMessage:title confirmHandler:^{
|
||||||
|
NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
||||||
|
[self.presenter createRoomPKMode:2 voteMode:self.voteType duration:self.duraTime roomUid:roomUid];
|
||||||
|
} cancelHandler:^{
|
||||||
|
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)rightNavAction:(UIButton *)sender {
|
- (void)rightNavAction:(UIButton *)sender {
|
||||||
|
Reference in New Issue
Block a user