修改完成

This commit is contained in:
启星
2025-09-11 18:25:41 +08:00
parent 349cab1499
commit 35709d4e8e
67 changed files with 1344 additions and 223 deletions

View File

@@ -160,5 +160,53 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "A48DAF7D-E3EC-431D-A45A-33D8F5CCA1D4"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Config/QXAgoraEngine.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "77"
endingLineNumber = "77"
landmarkName = "-rtcEngine:didOccurError:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "C274EA02-3D19-4AD7-830B-E51529B89191"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "TUIKit/TUIChat/UI_Classic/Chat/TUIBaseMessageController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "198"
endingLineNumber = "198"
landmarkName = "-loadMessage"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "5C3514EA-0AF0-426A-9A1F-10C13FE2984B"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "QXLive/Config/QXRoomMessageManager.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "599"
endingLineNumber = "599"
landmarkName = "-onReceiveRESTCustomData:data:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

View File

@@ -193,7 +193,7 @@
[[QXGlobal shareGlobal] logOut]; [[QXGlobal shareGlobal] logOut];
return; return;
} }
[UIApplication sharedApplication].idleTimerDisabled = NO; [UIApplication sharedApplication].idleTimerDisabled = YES;
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController; navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO; // navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) { if (_miniView) {
@@ -233,6 +233,7 @@
self.roomVC.isReJoin = isRejoin; self.roomVC.isReJoin = isRejoin;
self.roomId = roomId; self.roomId = roomId;
self.roomVC.hidesBottomBarWhenPushed = YES; self.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:self.roomVC animated:YES]; [navagationController pushViewController:self.roomVC animated:YES];
} }
} }

View File

@@ -327,19 +327,19 @@
} }
} }
-(void)rtcEngine:(AgoraRtcEngineKit *)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason{ -(void)rtcEngine:(AgoraRtcEngineKit *)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason{
NSDictionary *parm = @{ // NSDictionary *parm = @{
@"user_id":[NSNumber numberWithInteger:uid], // @"user_id":[NSNumber numberWithInteger:uid],
@"is_online":[NSNumber numberWithBool:NO], // @"is_online":[NSNumber numberWithBool:NO],
}; // };
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm]; // [[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
} }
-(void)rtcEngine:(AgoraRtcEngineKit *)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed{ -(void)rtcEngine:(AgoraRtcEngineKit *)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed{
NSDictionary *parm = @{ // NSDictionary *parm = @{
@"user_id":[NSNumber numberWithInteger:uid], // @"user_id":[NSNumber numberWithInteger:uid],
@"is_online":[NSNumber numberWithBool:YES], // @"is_online":[NSNumber numberWithBool:YES],
}; // };
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm]; // [[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
} }
/// ///
-(void)rtcEngine:(AgoraRtcEngineKit *)engine reportAudioVolumeIndicationOfSpeakers:(NSArray<AgoraRtcAudioVolumeInfo *> *)speakers totalVolume:(NSInteger)totalVolume{ -(void)rtcEngine:(AgoraRtcEngineKit *)engine reportAudioVolumeIndicationOfSpeakers:(NSArray<AgoraRtcAudioVolumeInfo *> *)speakers totalVolume:(NSInteger)totalVolume{

View File

@@ -119,6 +119,11 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeMeetActivityProgressUpdate = 1056, QXRoomMessageTypeMeetActivityProgressUpdate = 1056,
/// 巡乐会盘抽奖结果更新 /// 巡乐会盘抽奖结果更新
QXRoomMessageTypeMeetActivityDrawGift = 1057, QXRoomMessageTypeMeetActivityDrawGift = 1057,
/// 离线
QXRoomMessageTypeRoomUserOnlineStatus = 1058,
/// 清除个人魅力
QXRoomMessageTypeRoomClearUserCharm = 1059,
}QXRoomMessageType; }QXRoomMessageType;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@protocol QXRoomMessageManagerDelegate <NSObject> @protocol QXRoomMessageManagerDelegate <NSObject>
@@ -244,14 +249,19 @@ NS_ASSUME_NONNULL_BEGIN
-(void)meetActivityProgressIsUpdate:(NSDictionary*)updateDict; -(void)meetActivityProgressIsUpdate:(NSDictionary*)updateDict;
/// 巡乐会礼物发生变化 /// 巡乐会礼物发生变化
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel*)giftInfo; -(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel*)giftInfo;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString*)userId;
/// 房间用户在线状态发生变化
//-(void)roomUserOnlineStatusDidChanged:(BOOL)isOnline userId:(NSString*)userId;
@end @end
@interface QXRoomMessageManager : NSObject @interface QXRoomMessageManager : NSObject
@property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate; @property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate;
+(instancetype)shared; +(instancetype)shared;
/// 加入房间群组
-(void)joinGroupWithRoomId:(NSString*)roomId; -(void)joinGroupWithRoomId:(NSString*)roomId;
/// 退出房间群组
-(void)quitGroupWithRoomId:(NSString*)roomId; -(void)quitGroupWithRoomId:(NSString*)roomId;
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage; -(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage;

View File

@@ -508,9 +508,11 @@
if (self.delegate && [self.delegate respondsToSelector:@selector(friendPartDidChangedWithType:friend_id:end_time:relationModel:)]) { if (self.delegate && [self.delegate respondsToSelector:@selector(friendPartDidChangedWithType:friend_id:end_time:relationModel:)]) {
[self.delegate friendPartDidChangedWithType:model.step friend_id:model.friend_id end_time:model.end_time relationModel:model.friend_user]; [self.delegate friendPartDidChangedWithType:model.step friend_id:model.friend_id end_time:model.end_time relationModel:model.friend_user];
} }
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) { if (model.step.intValue != 3) {
model.messageType = QXRoomChatMessageTypeSystem; if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
[self.delegate didInsertMessge:model]; model.messageType = QXRoomChatMessageTypeSystem;
[self.delegate didInsertMessge:model];
}
} }
} }
break; break;
@@ -582,6 +584,30 @@
} }
} }
break; break;
case QXRoomMessageTypeRoomClearUserCharm:{
NSString *userId = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
if (self.delegate && [self.delegate respondsToSelector:@selector(roomClearUserCharmWithUserId:)]) {
[self.delegate roomClearUserCharmWithUserId:userId];
}
}
break;
case QXRoomMessageTypeRoomUserOnlineStatus:{
NSString *userId = [NSString stringWithFormat:@"%@",msg.Text[@"user_id"]];
// 1 线 2线
NSInteger type = 1;
type = [msg.Text[@"type"] integerValue];
BOOL isOnline = type == 1?YES:NO;
// if (self.delegate && [self.delegate respondsToSelector:@selector(roomUserOnlineStatusDidChanged:userId:)]) {
// [self.delegate roomUserOnlineStatusDidChanged:YES userId:userId];
// }
NSDictionary *parm = @{
@"user_id":userId,
@"is_online":[NSNumber numberWithBool:isOnline],
};
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
}
break;
default: default:
break; break;
} }

View File

@@ -64,8 +64,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *giftLabelId; @property (nonatomic,strong)NSString *giftLabelId;
@property (nonatomic,strong)NSString *roomId; @property (nonatomic,strong)NSString *roomId;
@property (nonatomic,assign)NSInteger selectedIndex; @property (nonatomic,assign)NSInteger selectedIndex;
@property (nonatomic,strong)QXGiftModel *model;
@property (nonatomic,copy)void(^selectetGiftBlock)(QXGiftModel *gift); @property (nonatomic,copy)void(^selectetGiftBlock)(QXGiftModel *gift);
@property (nonatomic,assign)QXSendGiftViewType type; @property (nonatomic,assign)QXSendGiftViewType type;
-(void)reloadData;
@end @end
@interface QXSendGiftUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource> @interface QXSendGiftUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>

View File

@@ -44,11 +44,13 @@
@property (nonatomic,strong)UIView *sendBgView; @property (nonatomic,strong)UIView *sendBgView;
@property (nonatomic,strong)UIButton *countBtn; @property (nonatomic,strong)UIButton *countBtn;
@property (nonatomic,strong)UIButton *sendBtn; @property (nonatomic,strong)UIButton *sendBtn;
@property (nonatomic,strong)UIButton *sendAllBtn;
/// ///
@property (nonatomic,strong)QXGiftModel *giftModel; @property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)NSString *giftCount; @property (nonatomic,strong)NSString *giftCount;
@property (nonatomic,strong)QXSendGiftCollectionView *bagGiftView;
@end @end
@implementation QXSendGiftView @implementation QXSendGiftView
@@ -86,6 +88,7 @@
_type = type; _type = type;
switch (type) { switch (type) {
case QXSendGiftViewTypeFind:{ case QXSendGiftViewTypeFind:{
self.heartId = @"";
if (_pitUserListView) { if (_pitUserListView) {
[_pitUserListView removeFromSuperview]; [_pitUserListView removeFromSuperview];
_pitUserListView = nil; _pitUserListView = nil;
@@ -101,8 +104,42 @@
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, self.bgView.height-self.categoryView.bottom-ScaleWidth(63)-kSafeAreaBottom); self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, self.bgView.height-self.categoryView.bottom-ScaleWidth(63)-kSafeAreaBottom);
} }
break; break;
case QXSendGiftViewTypeRoom: case QXSendGiftViewTypeRoom:{
case QXSendGiftViewTypeAuction: self.heartId = @"";
if (_userListView) {
[_userListView removeFromSuperview];
_userListView = nil;
}
self.bgView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom);
self.bgView.backgroundColor = [UIColor clearColor];
self.bgImageView.frame = self.bounds;
self.bgImageView.hidden = NO;
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#FFFFFF"];
self.categoryView.titleColor = [UIColor colorWithHexString:@"#E9E9E9"];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self initPitUserListView];
self.categoryView.frame = CGRectMake(16, ScaleWidth(44)+ScaleWidth(8), SCREEN_WIDTH-32, ScaleWidth(44));
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, self.bgView.height-self.categoryView.bottom-ScaleWidth(63)-kSafeAreaBottom);
}
break;
case QXSendGiftViewTypeAuction:{
self.heartId = @"";
if (_userListView) {
[_userListView removeFromSuperview];
_userListView = nil;
}
self.bgView.frame = CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom);
self.bgView.backgroundColor = [UIColor clearColor];
self.bgImageView.frame = self.bounds;
self.bgImageView.hidden = NO;
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#FFFFFF"];
self.categoryView.titleColor = [UIColor colorWithHexString:@"#E9E9E9"];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self initPitUserListView];
self.categoryView.frame = CGRectMake(16, ScaleWidth(44)+ScaleWidth(8), SCREEN_WIDTH-32, ScaleWidth(44));
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, self.bgView.height-self.categoryView.bottom-ScaleWidth(63)-kSafeAreaBottom);
}
break;
case QXSendGiftViewTypeFriend:{ case QXSendGiftViewTypeFriend:{
if (_userListView) { if (_userListView) {
[_userListView removeFromSuperview]; [_userListView removeFromSuperview];
@@ -260,6 +297,22 @@
make.right.top.bottom.equalTo(self.sendBgView); make.right.top.bottom.equalTo(self.sendBgView);
make.width.equalTo(self.sendBgView.mas_width).multipliedBy(0.5); make.width.equalTo(self.sendBgView.mas_width).multipliedBy(0.5);
}]; }];
self.sendAllBtn = [[UIButton alloc] init];
[self.sendAllBtn setTitle:QXText(@"一键全送") forState:(UIControlStateNormal)];
[self.sendAllBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
self.sendAllBtn.backgroundColor = QXConfig.themeColor;
[self.sendAllBtn addRoundedCornersWithRadius:17.5];
self.sendAllBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.sendAllBtn addTarget:self action:@selector(sendAllAction) forControlEvents:(UIControlEventTouchUpInside)];
self.sendAllBtn.hidden = YES;
[self.bgView addSubview:self.sendAllBtn];
[self.sendAllBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(80);
make.height.mas_equalTo(35);
make.centerY.equalTo(self.sendBgView);
make.right.equalTo(self.sendBgView.mas_left).offset(-5);
}];
} }
-(void)introduceAction{ -(void)introduceAction{
QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init]; QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init];
@@ -287,6 +340,23 @@
self.rechargeBtn.hidden = !QXGlobal.shareGlobal.isOpenRecharge; self.rechargeBtn.hidden = !QXGlobal.shareGlobal.isOpenRecharge;
[self getMyWallet]; [self getMyWallet];
} }
-(void)sendAllAction{
if (self.pitUserListView.selectedArray.count == 0) {
showToast(@"请选择送礼对象");
return;
}
if (self.pitUserListView.selectedArray.count > 1) {
showToast(@"一键全送仅能选择一个用户");
return;
}
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
MJWeakSelf
[QXMineNetwork roomBagGiftClearWithRoomId:self.roomId userId:userId heartId:self.heartId successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
/// ///
-(void)sendAction{ -(void)sendAction{
MJWeakSelf MJWeakSelf
@@ -306,44 +376,62 @@
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","]; NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) { [QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
if (type.intValue == 1) { if (type.intValue == 1) {
if (weakSelf.roomSendSuccessBlock) { if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,@""); weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,@"");
} }
[weakSelf hide];
}else{
[weakSelf.bagGiftView reloadData];
} }
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg) showToast(msg)
}]; }];
}else if (self.type == QXSendGiftViewTypeAuction) { }else if (self.type == QXSendGiftViewTypeAuction) {
if (self.giftModel==nil) {
showToast(@"请选择礼物");
return;
}
self.heartId = @""; self.heartId = @"";
/// 2 /// 2
[QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:[QXGlobal shareGlobal].loginModel.user_id gift_id:self.giftModel.gift_id num:self.giftCount type:type successBlock:^(NSDictionary * _Nonnull dict) { [QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:[QXGlobal shareGlobal].loginModel.user_id gift_id:self.giftModel.gift_id num:self.giftCount type:type successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
if (type.intValue == 1) { if (type.intValue == 1) {
[weakSelf hide];
if (weakSelf.roomSendSuccessBlock) { if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,[QXGlobal shareGlobal].loginModel.user_id,weakSelf.auctionId); weakSelf.roomSendSuccessBlock(weakSelf.type,weakSelf.giftModel,[QXGlobal shareGlobal].loginModel.user_id,weakSelf.auctionId);
} }
}else{
[weakSelf.bagGiftView reloadData];
} }
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg); showToast(msg);
}]; }];
}else if (self.type == QXSendGiftViewTypeFriend) { }else if (self.type == QXSendGiftViewTypeFriend) {
if (self.giftModel==nil) {
showToast(@"请选择礼物");
return;
}
self.auctionId = @""; self.auctionId = @"";
/// 2 /// 2
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","]; NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1"; NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) { [QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
if (type.intValue == 1) { if (type.intValue == 1) {
[weakSelf hide];
if (weakSelf.roomSendSuccessBlock) { if (weakSelf.roomSendSuccessBlock) {
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,weakSelf.heartId); weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,weakSelf.heartId);
} }
}else{
[weakSelf.bagGiftView reloadData];
} }
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg) showToast(msg)
}]; }];
}else{ }else{
if (self.giftModel==nil) {
showToast(@"请选择礼物");
return;
}
/// 2 /// 2
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1"; NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
[QXDynamicNetwork dynamicGiveGiftWithId:self.dynamicId [QXDynamicNetwork dynamicGiveGiftWithId:self.dynamicId
@@ -394,6 +482,7 @@
} }
-(void)setPitUsers:(NSArray *)pitUsers{ -(void)setPitUsers:(NSArray *)pitUsers{
_pitUsers = pitUsers; _pitUsers = pitUsers;
self.giftModel = nil;
self.pitUserListView.isSingle = NO; self.pitUserListView.isSingle = NO;
[self.pitUserListView.selectedArray removeAllObjects]; [self.pitUserListView.selectedArray removeAllObjects];
self.pitUserListView.users = pitUsers; self.pitUserListView.users = pitUsers;
@@ -402,6 +491,7 @@
-(void)setUserModel:(QXRoomPitModel *)userModel{ -(void)setUserModel:(QXRoomPitModel *)userModel{
_userModel = userModel; _userModel = userModel;
userModel.isSelected = YES; userModel.isSelected = YES;
self.giftModel = nil;
self.pitUserListView.isSingle = YES; self.pitUserListView.isSingle = YES;
[self.pitUserListView.selectedArray removeAllObjects]; [self.pitUserListView.selectedArray removeAllObjects];
[self.pitUserListView.selectedArray addObject:userModel.user_id]; [self.pitUserListView.selectedArray addObject:userModel.user_id];
@@ -459,6 +549,11 @@
// }else{ // }else{
// self.funnyView.hidden = YES; // self.funnyView.hidden = YES;
// } // }
if (index == 0) {
self.sendAllBtn.hidden = NO;
}else{
self.sendAllBtn.hidden = YES;
}
} }
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
return self.titles.count; return self.titles.count;
@@ -466,6 +561,9 @@
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
QXSendGiftCollectionView *subGiftView = [[QXSendGiftCollectionView alloc] initWithFrame:listContainerView.bounds]; QXSendGiftCollectionView *subGiftView = [[QXSendGiftCollectionView alloc] initWithFrame:listContainerView.bounds];
if (index == 0) {
self.bagGiftView = subGiftView;
}
QXGiftLabelModel *md = self.titles[index]; QXGiftLabelModel *md = self.titles[index];
subGiftView.roomId = self.roomId; subGiftView.roomId = self.roomId;
subGiftView.giftLabelId = md.id; subGiftView.giftLabelId = md.id;
@@ -576,6 +674,33 @@
[self addSubview:self.collectionView]; [self addSubview:self.collectionView];
} }
-(void)reloadData{
if ([self.giftLabelId isExist]) {
if ([self.giftLabelId isEqualToString:@"-10"]) {
MJWeakSelf
[QXMineNetwork getBagListSuccessBlock:^(NSArray * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
BOOL haveGift = NO;
for (QXGiftModel *model in list) {
if ([weakSelf.model.gift_id isEqualToString:model.gift_id]) {
haveGift = YES;
break;
}
}
if (haveGift == NO) {
weakSelf.selectedIndex = -1;
weakSelf.model = nil;
}
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}else{
[self getGiftListWithLabel:self.giftLabelId];
}
}
}
-(void)setGiftLabelId:(NSString *)giftLabelId{ -(void)setGiftLabelId:(NSString *)giftLabelId{
_giftLabelId = giftLabelId; _giftLabelId = giftLabelId;
if ([giftLabelId isEqualToString:@"-10"]) { if ([giftLabelId isEqualToString:@"-10"]) {
@@ -587,6 +712,7 @@
-(void)getGiftListWithLabel:(NSString*)label{ -(void)getGiftListWithLabel:(NSString*)label{
MJWeakSelf MJWeakSelf
self.selectedIndex = -1; self.selectedIndex = -1;
self.model = nil;
[QXMineNetwork giftListWithLabel:label roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) { [QXMineNetwork giftListWithLabel:label roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
[weakSelf.dataArray removeAllObjects]; [weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list]; [weakSelf.dataArray addObjectsFromArray:list];
@@ -597,6 +723,7 @@
} }
-(void)getBagList{ -(void)getBagList{
self.selectedIndex = -1; self.selectedIndex = -1;
self.model = nil;
MJWeakSelf MJWeakSelf
[QXMineNetwork getBagListSuccessBlock:^(NSArray * _Nonnull list) { [QXMineNetwork getBagListSuccessBlock:^(NSArray * _Nonnull list) {
[weakSelf.dataArray removeAllObjects]; [weakSelf.dataArray removeAllObjects];
@@ -650,6 +777,7 @@
return; return;
} }
self.selectedIndex = indexPath.row; self.selectedIndex = indexPath.row;
self.model = self.dataArray[indexPath.row];
if (self.selectetGiftBlock) { if (self.selectetGiftBlock) {
self.selectetGiftBlock(model); self.selectetGiftBlock(model);
} }
@@ -885,6 +1013,7 @@
-(void)setUsers:(NSArray *)users{ -(void)setUsers:(NSArray *)users{
_users = users; _users = users;
// [self.selectedArray removeAllObjects]; // [self.selectedArray removeAllObjects];
self.allBtn.selected = NO;
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{

View File

@@ -278,7 +278,6 @@ QXRoomUserInfoViewDelegate
} }
-(void)resetSubviews{ -(void)resetSubviews{
[UIApplication sharedApplication].idleTimerDisabled = NO;
if (self.roomModel.room_info.type_id.intValue != 6) { if (self.roomModel.room_info.type_id.intValue != 6) {
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]]; [self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]];
}else{ }else{
@@ -774,6 +773,9 @@ QXRoomUserInfoViewDelegate
-(void)roomClearCharm{ -(void)roomClearCharm{
[self.seatContentView clearCharm]; [self.seatContentView clearCharm];
} }
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
[self.seatContentView roomClearUserCharmWithUserId:userId];
}
/// ///
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{ -(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{
[self.seatContentView setSeatCharmWithUser:userInfo]; [self.seatContentView setSeatCharmWithUser:userInfo];
@@ -1196,12 +1198,12 @@ QXRoomUserInfoViewDelegate
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) { if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
[pitArr addObject:md]; [pitArr addObject:md];
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9]; QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
if (lastMd.user_id.longValue > 0) { if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
[pitArr addObject:lastMd]; [pitArr addObject:lastMd];
} }
}else{ }else{
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9]; QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
if (lastMd.user_id.longValue > 0) { if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
[pitArr addObject:lastMd]; [pitArr addObject:lastMd];
} }
} }
@@ -1224,8 +1226,11 @@ QXRoomUserInfoViewDelegate
for (int i = 0; i < self.roomModel.room_info.pit_list.count;i++) { for (int i = 0; i < self.roomModel.room_info.pit_list.count;i++) {
QXRoomPitModel *md = self.roomModel.room_info.pit_list[i]; QXRoomPitModel *md = self.roomModel.room_info.pit_list[i];
md.isSelected = NO; md.isSelected = NO;
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) { if ([self.roomModel.room_info.type_id isEqualToString:@"2"]) {
[pitArr addObject:md]; ///
if ([md.user_id isEqualToString:self.roomModel.room_auction.auction_user.user_id]) {
continue;
}
} }
if (md.pit_number.intValue == 9) { if (md.pit_number.intValue == 9) {
compereModel = md; compereModel = md;
@@ -1234,6 +1239,9 @@ QXRoomUserInfoViewDelegate
guestModel = md; guestModel = md;
continue; continue;
} }
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
[pitArr addObject:md];
}
} }
} }
@@ -1597,9 +1605,9 @@ QXRoomUserInfoViewDelegate
// [_sendGiftView reloadData]; // [_sendGiftView reloadData];
MJWeakSelf MJWeakSelf
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull userId, NSString * _Nonnull optionId) { _sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
if (self->_continuousView == nil) { // if (self->_continuousView == nil) {
[weakSelf.view addSubview:weakSelf.continuousView]; [weakSelf.view addSubview:weakSelf.continuousView];
} // }
weakSelf.continuousView.giftModel = giftModel; weakSelf.continuousView.giftModel = giftModel;
weakSelf.continuousView.sendType = sendType; weakSelf.continuousView.sendType = sendType;
weakSelf.continuousView.userId = userId; weakSelf.continuousView.userId = userId;
@@ -1624,18 +1632,21 @@ QXRoomUserInfoViewDelegate
weakSelf.skyView.giftModel = gift; weakSelf.skyView.giftModel = gift;
weakSelf.skyView.roomId = weakSelf.roomId; weakSelf.skyView.roomId = weakSelf.roomId;
weakSelf.skyView.userIds = userIds; weakSelf.skyView.userIds = userIds;
weakSelf.skyView.heartId = weakSelf.sendGiftView.heartId;
[weakSelf.sendGiftView hide]; [weakSelf.sendGiftView hide];
[weakSelf.skyView showInView:weakSelf.view]; [weakSelf.skyView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 11) { }else if(gift.gift_bag.intValue == 11) {
weakSelf.ageView.giftModel = gift; weakSelf.ageView.giftModel = gift;
weakSelf.ageView.roomId = weakSelf.roomId; weakSelf.ageView.roomId = weakSelf.roomId;
weakSelf.ageView.userIds = userIds; weakSelf.ageView.userIds = userIds;
weakSelf.ageView.heartId = weakSelf.sendGiftView.heartId;
[weakSelf.sendGiftView hide]; [weakSelf.sendGiftView hide];
[weakSelf.ageView showInView:weakSelf.view]; [weakSelf.ageView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 12) { }else if(gift.gift_bag.intValue == 12) {
weakSelf.timeView.giftModel = gift; weakSelf.timeView.giftModel = gift;
weakSelf.timeView.roomId = weakSelf.roomId; weakSelf.timeView.roomId = weakSelf.roomId;
weakSelf.timeView.userIds = userIds; weakSelf.timeView.userIds = userIds;
weakSelf.timeView.heartId = weakSelf.sendGiftView.heartId;
[weakSelf.sendGiftView hide]; [weakSelf.sendGiftView hide];
[weakSelf.timeView showInView:weakSelf.view]; [weakSelf.timeView showInView:weakSelf.view];
} }

View File

@@ -0,0 +1,22 @@
//
// QXRoomUserCharmModel.h
// QXLive
//
// Created by 启星 on 2025/9/8.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomUserCharmModel : NSObject
@property (nonatomic,strong)NSArray *icon;
@property (nonatomic,strong)NSString *total_price;
@property (nonatomic,strong)NSString *nickname;
@property (nonatomic,strong)NSString *user_id;
@property (nonatomic,strong)NSString *avatar;
@property (nonatomic,strong)NSString *user_code;
@property (nonatomic,strong)NSString *charm;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// QXRoomUserCharmModel.m
// QXLive
//
// Created by on 2025/9/8.
//
#import "QXRoomUserCharmModel.h"
@implementation QXRoomUserCharmModel
@end

View File

@@ -43,6 +43,7 @@
@property (nonatomic,strong) QXRoomOnlineUserListView *onlineListView; @property (nonatomic,strong) QXRoomOnlineUserListView *onlineListView;
@property (nonatomic,strong) QXRoomNoticeView *noticeView; @property (nonatomic,strong) QXRoomNoticeView *noticeView;
@property (nonatomic,strong)QXRoomRankView *rankView;
@end @end
@@ -292,7 +293,9 @@
} }
-(void)previewUserInfoWithUserId:(NSString *)userId{ -(void)previewUserInfoWithUserId:(NSString *)userId{
[self.onlineListView hide]; [self.onlineListView hide];
[self.rankView hide];
_onlineListView = nil; _onlineListView = nil;
_rankView = nil;
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) { if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:userId]; [self.delegate previewUserInfoWithUserId:userId];
} }
@@ -322,7 +325,13 @@
return _noticeView; return _noticeView;
} }
-(QXRoomRankView *)rankView{
if (!_rankView) {
_rankView = [[QXRoomRankView alloc] initWithFrame:[UIScreen mainScreen].bounds];
_rankView.delegate = self;
}
return _rankView;
}
-(void)noticeAction{ -(void)noticeAction{
// self.noticeView.roomNotice = @"本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。"; // self.noticeView.roomNotice = @"本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。";
self.noticeView.roomNotice = self.roomModel.room_info.room_intro; self.noticeView.roomNotice = self.roomModel.room_info.room_intro;
@@ -332,9 +341,8 @@
} }
-(void)rankAction{ -(void)rankAction{
QXRoomRankView *rankView = [[QXRoomRankView alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.rankView.roomId = self.roomId;
rankView.roomId = self.roomId; [self.rankView showInView:self.viewController.view];
[rankView showInView:self.viewController.view];
} }
-(void)followAction:(UIButton*)sender{ -(void)followAction:(UIButton*)sender{

View File

@@ -0,0 +1,34 @@
//
// QXRoomUserCharmView.h
// QXLive
//
// Created by 启星 on 2025/9/8.
//
#import <UIKit/UIKit.h>
#import "QXRoomUserCharmModel.h"
#import "QXUserHomeHeaderView.h"
#import "QXRoomSeatDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomUserCharmView : UIView
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)NSString *userId;
-(void)showInView:(UIView *)view;
-(void)hide;
@end
@interface QXRoomUserCharmCell : UITableViewCell<UICollectionViewDelegate,UICollectionViewDataSource>
+(instancetype)cellWithTableView:(UITableView*)tableView;
@property (nonatomic,strong)UIImageView *headImageView;
@property (nonatomic,strong)UILabel *nameLabel;
@property (nonatomic,strong)UILabel *IdLabel;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)UIImageView *charmIconView;
@property (nonatomic,strong)UILabel* charmLabel;
@property (nonatomic,strong)QXRoomUserCharmModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,232 @@
//
// QXRoomUserCharmView.m
// QXLive
//
// Created by on 2025/9/8.
//
#import "QXRoomUserCharmView.h"
#import "QXMineNetwork.h"
#import "NSString+QX.h"
@interface QXRoomUserCharmView()<UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@end
@implementation QXRoomUserCharmView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
tap.delegate = self;
[self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, ScaleWidth(429)+kSafeAreaBottom)];
self.bgView.backgroundColor = [UIColor whiteColor];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textAlignment = NSTextAlignmentCenter;
self.titleLabel.text = @"魅力值详情";
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self.bgView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(27);
make.left.right.equalTo(self.bgView);
make.height.mas_equalTo(24);
}];
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.rowHeight = 55;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
MJWeakSelf
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
[weakSelf getCharmList];
}];
[self.bgView addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.titleLabel.mas_bottom).offset(12);
make.bottom.equalTo(self.bgView);
make.left.right.equalTo(self.bgView);
}];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
}
-(void)setUserId:(NSString *)userId{
_userId = userId;
[self getCharmList];
}
-(void)getCharmList{
MJWeakSelf
[QXMineNetwork getRoomUserCharmListWithRoomId:self.roomId userId:self.userId successBlock:^(NSArray * _Nonnull list) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:list];
[weakSelf.tableView reloadData];
[weakSelf.tableView.mj_header endRefreshing];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.tableView.mj_header endRefreshing];
}];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
QXRoomUserCharmCell *cell = [QXRoomUserCharmCell cellWithTableView:tableView];
cell.model = self.dataArray[indexPath.row];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXRoomUserCharmModel *model = self.dataArray[indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:model.user_id];
}
}
-(void)showInView:(UIView *)view{
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(429)-kSafeAreaBottom;
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
@end
@implementation QXRoomUserCharmCell
+(instancetype)cellWithTableView:(UITableView*)tableView{
static NSString *cellId = @"QXRoomUserCharmCell";
QXRoomUserCharmCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXRoomUserCharmCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
cell.backgroundColor = [UIColor clearColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXRoomUserCharmModel *)model{
_model = model;
self.nameLabel.text = model.nickname;
self.IdLabel.text= [NSString stringWithFormat:@"ID:%@",model.user_code];
[self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.charmLabel.text = [NSString qx_showHotCountNumDouble:model.charm.longLongValue];
[self.collectionView reloadData];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.model.icon.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXTagImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXTagImageCell" forIndexPath:indexPath];
cell.imageUrl = self.model.icon[indexPath.row];
return cell;
}
-(void)initSubviews{
self.headImageView = [[UIImageView alloc] init];
self.headImageView.contentMode = UIViewContentModeScaleAspectFill;
self.headImageView.clipsToBounds = YES;
[self.headImageView addRoundedCornersWithRadius:ScaleWidth(21.5)];
[self.contentView addSubview:self.headImageView];
[self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.width.height.mas_equalTo(43);
make.centerY.equalTo(self.contentView);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = RGB16(0x333333);
self.nameLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headImageView.mas_right).offset(8);
make.top.equalTo(self.headImageView);
make.height.mas_equalTo(21);
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(42, 16);
layout.minimumLineSpacing = 7;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.backgroundColor = UIColor.clearColor;
[self.collectionView registerClass:[QXTagImageCell class] forCellWithReuseIdentifier:@"QXTagImageCell"];
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.nameLabel.mas_right).offset(8);
make.height.mas_equalTo(21);
make.centerY.equalTo(self.nameLabel);
make.width.mas_equalTo(126);
}];
self.IdLabel = [[UILabel alloc] init];
self.IdLabel.textColor = RGB16(0x999999);
self.IdLabel.font = [UIFont systemFontOfSize:12];
[self.contentView addSubview:self.IdLabel];
[self.IdLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headImageView.mas_right).offset(8);
make.bottom.equalTo(self.headImageView);
make.height.mas_equalTo(18);
}];
self.charmLabel = [[UILabel alloc] init];
self.charmLabel.textColor = RGB16(0x333333);
self.charmLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.charmLabel];
[self.charmLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.centerY.equalTo(self.contentView);
make.height.mas_equalTo(21);
}];
self.charmIconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_user_charm_icon"]];
self.charmIconView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:self.charmIconView];
[self.charmIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.charmLabel.mas_left).offset(-6);
make.width.height.mas_equalTo(18);
make.centerY.equalTo(self.contentView);
}];
}
@end

View File

@@ -8,11 +8,13 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "JXCategoryView.h" #import "JXCategoryView.h"
#import "QXRoomModel.h" #import "QXRoomModel.h"
#import "QXRoomSeatDelegate.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface QXRoomRankSubView : UIView<JXCategoryListContentViewDelegate> @interface QXRoomRankSubView : UIView<JXCategoryListContentViewDelegate>
@property (nonatomic,strong)NSString*roomId; @property (nonatomic,strong)NSString*roomId;
@property (nonatomic,strong)NSString*type; @property (nonatomic,strong)NSString*type;
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
@end @end
@@ -28,5 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)NSInteger number; @property (nonatomic,assign)NSInteger number;
@property (nonatomic,strong)QXRoomOnlineList*md; @property (nonatomic,strong)QXRoomOnlineList*md;
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -9,7 +9,7 @@
#import "QXBlackListCell.h" #import "QXBlackListCell.h"
#import "QXMineNetwork.h" #import "QXMineNetwork.h"
@interface QXRoomRankSubView()<UITableViewDataSource,UITableViewDelegate> @interface QXRoomRankSubView()<UITableViewDataSource,UITableViewDelegate,QXRoomSeatDelegate>
@property (nonatomic,strong)UIView *topBgView; @property (nonatomic,strong)UIView *topBgView;
@property (nonatomic,strong)UIButton *hourBtn; @property (nonatomic,strong)UIButton *hourBtn;
@property (nonatomic,strong)UIButton *dayBtn; @property (nonatomic,strong)UIButton *dayBtn;
@@ -110,15 +110,18 @@
self.secondView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(18, 50, itemWidth, 135)]; self.secondView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(18, 50, itemWidth, 135)];
self.secondView.number = 2; self.secondView.number = 2;
self.secondView.delegate = self;
[self.tableHeaderView addSubview:self.secondView]; [self.tableHeaderView addSubview:self.secondView];
self.firstView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.secondView.right, 0, itemWidth, 161)]; self.firstView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.secondView.right, 0, itemWidth, 161)];
self.firstView.number = 1; self.firstView.number = 1;
self.firstView.delegate = self;
[self.tableHeaderView addSubview:self.firstView]; [self.tableHeaderView addSubview:self.firstView];
self.thirdView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.firstView.right, 50, itemWidth, 135)]; self.thirdView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.firstView.right, 50, itemWidth, 135)];
self.thirdView.number = 3; self.thirdView.number = 3;
self.thirdView.delegate = self;
[self.tableHeaderView addSubview:self.thirdView]; [self.tableHeaderView addSubview:self.thirdView];
[self addSubview:self.tableHeaderView]; [self addSubview:self.tableHeaderView];
@@ -197,6 +200,11 @@
}]; }];
} }
-(void)previewUserInfoWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:userId];
}
}
-(void)typeAction:(UIButton*)sender{ -(void)typeAction:(UIButton*)sender{
self.selectedBtn.selected = !self.selectedBtn.selected; self.selectedBtn.selected = !self.selectedBtn.selected;
@@ -218,7 +226,12 @@
cell.rankModel = self.dataArray[indexPath.row]; cell.rankModel = self.dataArray[indexPath.row];
return cell; return cell;
} }
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXRoomOnlineList *model = self.dataArray[indexPath.row];
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:model.user_id];
}
}
-(NSMutableArray *)dataArray{ -(NSMutableArray *)dataArray{
if (!_dataArray) { if (!_dataArray) {
_dataArray = [NSMutableArray array]; _dataArray = [NSMutableArray array];
@@ -331,6 +344,14 @@
[self.headerImageView addRoundedCornersWithRadius:32]; [self.headerImageView addRoundedCornersWithRadius:32];
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill; self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self addSubview:self.headerImageView]; [self addSubview:self.headerImageView];
MJWeakSelf
[self.headerImageView addTapBlock:^(id _Nonnull obj) {
if ([weakSelf.md.user_id isExist]) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[weakSelf.delegate previewUserInfoWithUserId:weakSelf.md.user_id];
}
}
}];
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self); make.centerX.equalTo(self);
make.top.equalTo(self).offset(10); make.top.equalTo(self).offset(10);

View File

@@ -6,12 +6,14 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QXRoomSeatDelegate.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface QXRoomRankView : UIView @interface QXRoomRankView : UIView
@property (nonatomic,strong)NSString*roomId; @property (nonatomic,strong)NSString*roomId;
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
-(void)showInView:(UIView *)view; -(void)showInView:(UIView *)view;
-(void)hide;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -9,11 +9,13 @@
#import "JXCategoryView.h" #import "JXCategoryView.h"
#import "QXRoomRankSubView.h" #import "QXRoomRankSubView.h"
@interface QXRoomRankView()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate,UIGestureRecognizerDelegate> @interface QXRoomRankView()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate,UIGestureRecognizerDelegate,QXRoomSeatDelegate>
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UIView *bgView; @property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)JXCategoryTitleView *categoryView; @property (nonatomic,strong)JXCategoryTitleView *categoryView;
@property (nonatomic,strong)JXCategoryListContainerView *containerView; @property (nonatomic,strong)JXCategoryListContainerView *containerView;
@property (nonatomic,strong)QXRoomRankSubView *moneyView;
@property (nonatomic,strong)QXRoomRankSubView *charmView;
@end @end
@implementation QXRoomRankView @implementation QXRoomRankView
@@ -70,7 +72,11 @@
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self; return touch.view == self;
} }
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
self.charmView.roomId = roomId;
self.moneyView.roomId = roomId;
}
-(void)showInView:(UIView *)view{ -(void)showInView:(UIView *)view{
self.bgView.y = SCREEN_HEIGHT; self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self]; [view addSubview:self];
@@ -85,7 +91,11 @@
[self removeFromSuperview]; [self removeFromSuperview];
}]; }];
} }
-(void)previewUserInfoWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:userId];
}
}
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{ - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
return 2; return 2;
@@ -94,10 +104,13 @@
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
QXRoomRankSubView *vc = [[QXRoomRankSubView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height-ScaleWidth(144)-44)]; QXRoomRankSubView *vc = [[QXRoomRankSubView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height-ScaleWidth(144)-44)];
vc.delegate = self;
if (index == 0) { if (index == 0) {
vc.type = @"1"; vc.type = @"1";
self.moneyView = vc;
}else{ }else{
vc.type = @"2"; vc.type = @"2";
self.charmView = vc;
} }
vc.roomId = self.roomId; vc.roomId = self.roomId;
return vc; return vc;

View File

@@ -15,7 +15,9 @@ typedef NS_ENUM(NSInteger) {
/// 拉黑 /// 拉黑
QXRoomUserInfoViewEventTypeBlack = 2, QXRoomUserInfoViewEventTypeBlack = 2,
/// 举报 /// 举报
QXRoomUserInfoViewEventTypeReport , QXRoomUserInfoViewEventTypeReport = 3,
/// 清除魅力
QXRoomUserInfoViewEventTypeClearCharm = 4 ,
/// @TA /// @TA
QXRoomUserInfoViewEventTypeAtTA = 301, QXRoomUserInfoViewEventTypeAtTA = 301,
/// 聊天 /// 聊天

View File

@@ -40,6 +40,8 @@
@property (nonatomic,strong)UIButton *blackBtn; @property (nonatomic,strong)UIButton *blackBtn;
/// ///
@property (nonatomic,strong)UIButton *followBtn; @property (nonatomic,strong)UIButton *followBtn;
///
@property (nonatomic,strong)UIButton *clearBtn;
/// ///
@property (nonatomic,strong)UIButton *moreBtn; @property (nonatomic,strong)UIButton *moreBtn;
/// iconbgView /// iconbgView
@@ -173,6 +175,25 @@
make.height.mas_equalTo(40); make.height.mas_equalTo(40);
}]; }];
self.clearBtn = [[UIButton alloc] init];
[self.clearBtn setTitle:QXText(@"清魅力") forState:(UIControlStateNormal)];
[self.clearBtn setImage:[UIImage imageNamed:@"room_clear_charm"] forState:(UIControlStateNormal)];
self.clearBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.clearBtn.backgroundColor = RGB16A(0xffffff, 0.2);
self.clearBtn.hidden = YES;
[self.clearBtn addRoundedCornersWithRadius:ScaleWidth(10)];
self.clearBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.clearBtn addTarget:self action:@selector(clearCharmAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.clearBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
[self.bgView addSubview:self.clearBtn];
[self.clearBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22);
make.top.mas_equalTo(ScaleWidth(24)+26);
make.height.mas_equalTo(ScaleWidth(20));
make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
}];
self.remindBtn = [[UIButton alloc] init]; self.remindBtn = [[UIButton alloc] init];
// [self.remindBtn setImage:[UIImage imageNamed:@"room_up_notice_icon"] forState:(UIControlStateNormal)]; // [self.remindBtn setImage:[UIImage imageNamed:@"room_up_notice_icon"] forState:(UIControlStateNormal)];
[self.remindBtn setTitle:QXText(@"转币") forState:(UIControlStateNormal)]; [self.remindBtn setTitle:QXText(@"转币") forState:(UIControlStateNormal)];
@@ -186,11 +207,13 @@
[self.bgView addSubview:self.remindBtn]; [self.bgView addSubview:self.remindBtn];
[self.remindBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.remindBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22); make.left.mas_equalTo(22);
make.top.mas_equalTo(ScaleWidth(24)+26); make.centerY.equalTo(self.guildLabel);
make.height.mas_equalTo(ScaleWidth(20)); make.height.mas_equalTo(ScaleWidth(20));
make.width.mas_greaterThanOrEqualTo(ScaleWidth(66)); make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
}]; }];
self.followBtn = [[UIButton alloc] init]; self.followBtn = [[UIButton alloc] init];
self.followBtn.hidden = YES; self.followBtn.hidden = YES;
@@ -199,7 +222,7 @@
[self.bgView addSubview:self.followBtn]; [self.bgView addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22); make.left.mas_equalTo(22);
make.top.equalTo(self.remindBtn.mas_bottom).offset(25); make.top.equalTo(self.remindBtn.mas_bottom).offset(17);
make.height.mas_equalTo(ScaleWidth(24)); make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(70)); make.width.mas_equalTo(ScaleWidth(70));
}]; }];
@@ -215,7 +238,7 @@
[self.bgView addSubview:self.upSeatBtn]; [self.bgView addSubview:self.upSeatBtn];
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-ScaleWidth(64)); make.right.mas_equalTo(-ScaleWidth(64));
make.centerY.equalTo(self.remindBtn); make.centerY.equalTo(self.clearBtn);
make.height.mas_equalTo(ScaleWidth(24)); make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44)); make.width.mas_equalTo(ScaleWidth(44));
}]; }];
@@ -243,7 +266,7 @@
[self.bgView addSubview:self.reportBtn]; [self.bgView addSubview:self.reportBtn];
[self.reportBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.reportBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-ScaleWidth(64)); make.right.mas_equalTo(-ScaleWidth(64));
make.centerY.equalTo(self.remindBtn); make.centerY.equalTo(self.upSeatBtn);
make.height.mas_equalTo(ScaleWidth(24)); make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44)); make.width.mas_equalTo(ScaleWidth(44));
}]; }];
@@ -259,7 +282,7 @@
[self.bgView addSubview:self.blackBtn]; [self.bgView addSubview:self.blackBtn];
[self.blackBtn mas_makeConstraints:^(MASConstraintMaker *make) { [self.blackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16); make.right.mas_equalTo(-16);
make.centerY.equalTo(self.remindBtn); make.centerY.equalTo(self.upSeatBtn);
make.height.mas_equalTo(ScaleWidth(24)); make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44)); make.width.mas_equalTo(ScaleWidth(44));
}]; }];
@@ -404,6 +427,14 @@
} }
[self.relationTableView reloadData]; [self.relationTableView reloadData];
} }
-(void)clearCharmAction{
[QXMineNetwork roomClearCharmWithRoomId:self.roomId userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"清除成功");
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
//-(void)getRelationList{ //-(void)getRelationList{
// MJWeakSelf // MJWeakSelf
// [QXMineNetwork roomUserRelationWithUserId:self.userId successBlock:^(QXRelationshipList * list) { // [QXMineNetwork roomUserRelationWithUserId:self.userId successBlock:^(QXRelationshipList * list) {
@@ -454,15 +485,18 @@
self.upSeatBtn.hidden = NO; self.upSeatBtn.hidden = NO;
self.reportBtn.hidden = YES; self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES; self.blackBtn.hidden = YES;
self.clearBtn.hidden = NO;
}else if (self.isManager){ }else if (self.isManager){
self.moreBtn.hidden = NO; self.moreBtn.hidden = NO;
self.reportBtn.hidden = YES; self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES; self.blackBtn.hidden = YES;
self.clearBtn.hidden = NO;
}else if (self.isOwner){ }else if (self.isOwner){
self.moreBtn.hidden = NO; self.moreBtn.hidden = NO;
self.upSeatBtn.hidden = NO; self.upSeatBtn.hidden = NO;
self.reportBtn.hidden = YES; self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES; self.blackBtn.hidden = YES;
self.clearBtn.hidden = NO;
}else{ }else{
// //
self.moreBtn.hidden = YES; self.moreBtn.hidden = YES;
@@ -479,6 +513,7 @@
self.upSeatBtn.hidden = YES; self.upSeatBtn.hidden = YES;
self.bottomView.hidden = NO; self.bottomView.hidden = NO;
} }
self.clearBtn.hidden = YES;
} }
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) { if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
/// @TA.... /// @TA....

View File

@@ -8,6 +8,8 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QXRoomModel.h" #import "QXRoomModel.h"
#import "QXSongListModel.h" #import "QXSongListModel.h"
#import "QXRoomSeatDelegate.h"
typedef NS_ENUM(NSInteger) { typedef NS_ENUM(NSInteger) {
/// 名称名称在下显示魅力 /// 名称名称在下显示魅力
QXRoomSeatContentViewTypeNormal = 0, QXRoomSeatContentViewTypeNormal = 0,
@@ -32,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong) NSString* numberString; @property (nonatomic,strong) NSString* numberString;
@property (nonatomic,assign) BOOL isPK; @property (nonatomic,assign) BOOL isPK;
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
/// 麦位视图类型 /// 麦位视图类型
@property (nonatomic,assign)QXRoomSeatContentViewType type; @property (nonatomic,assign)QXRoomSeatContentViewType type;

View File

@@ -40,6 +40,8 @@
@property (nonatomic,strong) QXEffectSvgaView *micSvgaView; @property (nonatomic,strong) QXEffectSvgaView *micSvgaView;
@property (nonatomic,strong) VAPView *micMp4View; @property (nonatomic,strong) VAPView *micMp4View;
@property (nonatomic,strong)UIButton *headerBtn;
@end @end
@implementation QXRoomSeatContentView @implementation QXRoomSeatContentView
@@ -143,7 +145,13 @@
make.height.mas_equalTo(18); make.height.mas_equalTo(18);
}]; }];
MJWeakSelf
self.charmBgView = [[UIView alloc] init]; self.charmBgView = [[UIView alloc] init];
[self.charmBgView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.pitModel.user_id];
}
}];
self.charmBgView.backgroundColor = RGB16A(0xffffff, 0.2); self.charmBgView.backgroundColor = RGB16A(0xffffff, 0.2);
[self.charmBgView addRoundedCornersWithRadius:ScaleWidth(7.5)]; [self.charmBgView addRoundedCornersWithRadius:ScaleWidth(7.5)];
self.charmBgView.hidden = YES; self.charmBgView.hidden = YES;
@@ -174,8 +182,20 @@
make.centerX.equalTo(self.charmBgView).offset(7); make.centerX.equalTo(self.charmBgView).offset(7);
}]; }];
self.headerBtn = [[UIButton alloc] init];
[self.headerBtn addTarget:self action:@selector(headerAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.headerBtn];
[self.headerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.noUserImageView);
}];
} }
-(void)headerAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:seatView:)]) {
[self.delegate didClickUserHeaderWithPitModel:self.pitModel seatView:self];
}
}
-(void)onlineStatusDidChanged:(NSNotification*)notice{ -(void)onlineStatusDidChanged:(NSNotification*)notice{
NSDictionary *parm = notice.object; NSDictionary *parm = notice.object;
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]]; NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
@@ -198,6 +218,7 @@
} }
if ((info.uid == self.pitModel.user_id.longLongValue)) { if ((info.uid == self.pitModel.user_id.longLongValue)) {
if (info.volume > 0) { if (info.volume > 0) {
self.offlineImageView.hidden = YES;
[self startAudioAnimation]; [self startAudioAnimation];
}else{ }else{
[self stopAudioAnimation]; [self stopAudioAnimation];

View File

@@ -7,12 +7,16 @@
#import "QXRoomModel.h" #import "QXRoomModel.h"
//#import "QXRoomSeatContentView.h"
@class QXRoomSeatContentView;
@protocol QXRoomSeatDelegate <NSObject> @protocol QXRoomSeatDelegate <NSObject>
@optional @optional
//-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel*)pitModel userModel:(id)userModel; //-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel*)pitModel userModel:(id)userModel;
/// 麦位视图
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel*)pitModel seatView:(QXRoomSeatContentView*)seatView;
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel*)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString*)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff; -(void)didClickUserHeaderWithPitModel:(QXRoomPitModel*)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString*)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff;
-(void)didHugSeatWithPitNumber:(NSString*)pitNumber; -(void)didHugSeatWithPitNumber:(NSString*)pitNumber;
@@ -30,4 +34,7 @@
/// 助力 /// 助力
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString*)heartId; -(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString*)heartId;
/// 查看房间内用户魅力
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId;
@end @end

View File

@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number; -(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 设置魅力 /// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model; -(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
/// 设置麦位锁麦状态 /// 设置麦位锁麦状态

View File

@@ -297,6 +297,9 @@
-(void)clearCharm{ -(void)clearCharm{
[self.leftSeatView clearCharm]; [self.leftSeatView clearCharm];
} }
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
[self.leftSeatView roomClearUserCharmWithUserId:userId];
}
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{ -(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
[self.leftSeatView setSeatIsLock:isLock pitNumber:pitNumber]; [self.leftSeatView setSeatIsLock:isLock pitNumber:pitNumber];
} }

View File

@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model; -(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 房间内用户信息发生变化 /// 房间内用户信息发生变化
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user; -(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;

View File

@@ -15,7 +15,7 @@
#import "QXAlertView.h" #import "QXAlertView.h"
#import "QXRoomAuctionRankView.h" #import "QXRoomAuctionRankView.h"
@interface QXRoomSeatTypeAuctionView() @interface QXRoomSeatTypeAuctionView()<QXRoomSeatDelegate>
@property (nonatomic,strong)UIButton *delayBtn; @property (nonatomic,strong)UIButton *delayBtn;
@property (nonatomic,strong)UIButton *endBtn; @property (nonatomic,strong)UIButton *endBtn;
@@ -155,6 +155,7 @@
self.compereView = [[QXRoomSeatContentView alloc] init]; self.compereView = [[QXRoomSeatContentView alloc] init];
[self.bgView addSubview:self.compereView]; [self.bgView addSubview:self.compereView];
self.compereView.tagString = @"主持"; self.compereView.tagString = @"主持";
self.compereView.number = 9;
// self.compereView.isAutionSeat = YES; // self.compereView.isAutionSeat = YES;
// self.compereView.type = QXRoomSeatContentViewTypeAuction; // self.compereView.type = QXRoomSeatContentViewTypeAuction;
[self.compereView mas_makeConstraints:^(MASConstraintMaker *make) { [self.compereView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -162,19 +163,7 @@
make.left.mas_equalTo(10); make.left.mas_equalTo(10);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(50), ScaleWidth(50)+5+18)); make.size.mas_equalTo(CGSizeMake(ScaleWidth(50), ScaleWidth(50)+5+18));
}]; }];
[self.compereView addTapBlock:^(id _Nonnull obj) { self.compereView.delegate = self;
if (self.compereView.pitModel.user_id.intValue > 0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.compereView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
}
}else{
[QXMineNetwork roomUpSeatWithRoomId:weakSelf.roomModel.room_info.room_id pit_number:@"9" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}];
// //
// //
// //
@@ -239,20 +228,7 @@
self.auctionView = [[QXRoomSeatContentView alloc] init]; self.auctionView = [[QXRoomSeatContentView alloc] init];
[self.auctionBgView addSubview:self.auctionView]; [self.auctionBgView addSubview:self.auctionView];
[self.auctionView addTapBlock:^(id _Nonnull obj) { self.auctionView.delegate = self;
if (weakSelf.auctionView.pitModel == nil || weakSelf.auctionView.pitModel.user_id.intValue <= 0) {
if (weakSelf.myPitNumber == 9 || weakSelf.roomModel.user_info.is_room_owner.intValue == 1 || weakSelf.roomModel.user_info.is_host.intValue == 1 || weakSelf.roomModel.user_info.is_management.intValue == 1) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
[weakSelf.delegate didHugSeatWithPitNumber:@"888"];
}
}
}else{
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.auctionView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
}
}
}];
self.auctionView.isAutionSeat = YES; self.auctionView.isAutionSeat = YES;
self.auctionView.numberString = @"拍卖位"; self.auctionView.numberString = @"拍卖位";
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) { [self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -263,6 +239,14 @@
// //
self.auctionCharmView = [[UIView alloc] init]; self.auctionCharmView = [[UIView alloc] init];
self.auctionCharmView.hidden = YES; self.auctionCharmView.hidden = YES;
[self.auctionCharmView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.auctionView.pitModel.user_id.longLongValue <= 0) {
return;
}
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.auctionView.pitModel.user_id];
}
}];
[self.auctionBgView addSubview:self.auctionCharmView]; [self.auctionBgView addSubview:self.auctionCharmView];
[self.auctionCharmView mas_makeConstraints:^(MASConstraintMaker *make) { [self.auctionCharmView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(73); make.width.mas_equalTo(73);
@@ -348,13 +332,15 @@
self.firstSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_first_bg"]; self.firstSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_first_bg"];
self.firstSeatView.rankView.image = [UIImage imageNamed:@"room_auction_first"]; self.firstSeatView.rankView.image = [UIImage imageNamed:@"room_auction_first"];
self.firstSeatView.seatView.numberString = @"一号麦"; self.firstSeatView.seatView.numberString = @"一号麦";
[self.firstSeatView.seatView addTapBlock:^(id _Nonnull obj) { [self.firstSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.firstSeatView.seatView.pitModel.user_id.intValue>0) { if (weakSelf.firstSeatView.seatView.pitModel.user_id.intValue<=0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { return;
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.firstSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; }
} if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.firstSeatView.seatView.pitModel.user_id];
} }
}]; }];
self.firstSeatView.seatView.delegate = self;
[self.bgView addSubview:self.firstSeatView]; [self.bgView addSubview:self.firstSeatView];
[self.firstSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.firstSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.auctionBgView.mas_right).offset(6); make.left.equalTo(self.auctionBgView.mas_right).offset(6);
@@ -367,13 +353,15 @@
self.secondSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_second_bg"]; self.secondSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_second_bg"];
self.secondSeatView.rankView.image = [UIImage imageNamed:@"room_auction_second"]; self.secondSeatView.rankView.image = [UIImage imageNamed:@"room_auction_second"];
self.secondSeatView.seatView.numberString = @"二号麦"; self.secondSeatView.seatView.numberString = @"二号麦";
[self.secondSeatView.seatView addTapBlock:^(id _Nonnull obj) { [self.secondSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.secondSeatView.seatView.pitModel.user_id.intValue>0) { if (weakSelf.secondSeatView.seatView.pitModel.user_id.intValue<=0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { return;
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.secondSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; }
} if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.secondSeatView.seatView.pitModel.user_id];
} }
}]; }];
self.secondSeatView.seatView.delegate = self;
[self.bgView addSubview:self.secondSeatView]; [self.bgView addSubview:self.secondSeatView];
[self.secondSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.secondSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.firstSeatView); make.left.equalTo(self.firstSeatView);
@@ -386,13 +374,15 @@
self.thirdSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_third_bg"]; self.thirdSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_third_bg"];
self.thirdSeatView.rankView.image = [UIImage imageNamed:@"room_auction_third"]; self.thirdSeatView.rankView.image = [UIImage imageNamed:@"room_auction_third"];
self.thirdSeatView.seatView.numberString = @"三号麦"; self.thirdSeatView.seatView.numberString = @"三号麦";
[self.thirdSeatView.seatView addTapBlock:^(id _Nonnull obj) { [self.thirdSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.thirdSeatView.seatView.pitModel.user_id.intValue>0) { if (weakSelf.thirdSeatView.seatView.pitModel.user_id.intValue<=0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { return;
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.thirdSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; }
} if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[weakSelf.delegate previewRoomUserCharmListWithUserId:weakSelf.thirdSeatView.seatView.pitModel.user_id];
} }
}]; }];
self.thirdSeatView.seatView.delegate = self;
[self.bgView addSubview:self.thirdSeatView]; [self.bgView addSubview:self.thirdSeatView];
[self.thirdSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.thirdSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.firstSeatView); make.left.equalTo(self.firstSeatView);
@@ -405,13 +395,14 @@
[self.bgView addSubview:self.forthSeatView]; [self.bgView addSubview:self.forthSeatView];
// self.forthSeatView.isAutionSeat = YES; // self.forthSeatView.isAutionSeat = YES;
self.forthSeatView.numberString = @"4"; self.forthSeatView.numberString = @"4";
[self.forthSeatView addTapBlock:^(id _Nonnull obj) { // [self.forthSeatView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.forthSeatView.pitModel.user_id.intValue>0) { // if (weakSelf.forthSeatView.pitModel.user_id.intValue>0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { // if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.forthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; // [weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.forthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
} // }
} // }
}]; // }];
self.forthSeatView.delegate = self;
[self.forthSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.forthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.thirdSeatView); make.left.equalTo(self.thirdSeatView);
make.width.mas_equalTo(ScaleWidth(42)); make.width.mas_equalTo(ScaleWidth(42));
@@ -423,13 +414,14 @@
[self.bgView addSubview:self.fifthSeatView]; [self.bgView addSubview:self.fifthSeatView];
// self.fifthSeatView.isAutionSeat = YES; // self.fifthSeatView.isAutionSeat = YES;
self.fifthSeatView.numberString = @"5"; self.fifthSeatView.numberString = @"5";
[self.fifthSeatView addTapBlock:^(id _Nonnull obj) { // [self.fifthSeatView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.fifthSeatView.pitModel.user_id.intValue>0) { // if (weakSelf.fifthSeatView.pitModel.user_id.intValue>0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { // if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.fifthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; // [weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.fifthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
} // }
} // }
}]; // }];
self.fifthSeatView.delegate = self;
[self.fifthSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.fifthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.forthSeatView.mas_right).offset(5); make.left.equalTo(self.forthSeatView.mas_right).offset(5);
make.width.mas_equalTo(ScaleWidth(42)); make.width.mas_equalTo(ScaleWidth(42));
@@ -441,13 +433,14 @@
[self.bgView addSubview:self.sixthSeatView]; [self.bgView addSubview:self.sixthSeatView];
// self.sixthSeatView.isAutionSeat = YES; // self.sixthSeatView.isAutionSeat = YES;
self.sixthSeatView.numberString = @"6"; self.sixthSeatView.numberString = @"6";
[self.sixthSeatView addTapBlock:^(id _Nonnull obj) { // [self.sixthSeatView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.sixthSeatView.pitModel.user_id.intValue>0) { // if (weakSelf.sixthSeatView.pitModel.user_id.intValue>0) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { // if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.sixthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES]; // [weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.sixthSeatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
} // }
} // }
}]; // }];
self.sixthSeatView.delegate = self;
[self.sixthSeatView mas_makeConstraints:^(MASConstraintMaker *make) { [self.sixthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.fifthSeatView.mas_right).offset(5); make.left.equalTo(self.fifthSeatView.mas_right).offset(5);
make.width.mas_equalTo(ScaleWidth(42)); make.width.mas_equalTo(ScaleWidth(42));
@@ -571,7 +564,7 @@
break; break;
} }
} }
self.myPitNumber = roomModel.user_info.pit_number; self.myPitNumber = roomModel.user_info.pit_number.integerValue;
if (self.roomModel.room_auction.auction_user) { if (self.roomModel.room_auction.auction_user) {
QXRoomPitModel *model = [[QXRoomPitModel alloc] init]; QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
model.user_id = self.roomModel.room_auction.auction_user.user_id; model.user_id = self.roomModel.room_auction.auction_user.user_id;
@@ -649,7 +642,45 @@
} }
} }
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
if (seatView.number == 9) {
if (self.compereView.pitModel.user_id.intValue > 0) {
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[self.delegate didClickUserHeaderWithPitModel:self.compereView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
}
}else{
[QXMineNetwork roomUpSeatWithRoomId:self.roomModel.room_info.room_id pit_number:@"9" isUpSeat:YES successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
return;
}
if (seatView.isAutionSeat) {
///
if (self.auctionView.pitModel == nil || self.auctionView.pitModel.user_id.intValue <= 0) {
if (self.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1 || self.roomModel.user_info.is_host.intValue == 1 || self.roomModel.user_info.is_management.intValue == 1) {
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithPitNumber:)]) {
[self.delegate didHugSeatWithPitNumber:@"888"];
}
}
}else{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[self.delegate didClickUserHeaderWithPitModel:self.auctionView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
}
}
return;
}
if (seatView.pitModel.user_id <= 0) {
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[self.delegate didClickUserHeaderWithPitModel:seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
}
}
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{ -(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
QXRoomSeatContentView *contentView; QXRoomSeatContentView *contentView;
if (pit_number == 9) { if (pit_number == 9) {
@@ -853,12 +884,48 @@
QXRoomPitModel*model1 = self.compereView.pitModel; QXRoomPitModel*model1 = self.compereView.pitModel;
model1.charm = @"0"; model1.charm = @"0";
self.compereView.pitModel = model1; self.compereView.pitModel = model1;
[self.compereView hideCharm];
QXRoomPitModel*model2 = self.auctionView.pitModel; QXRoomPitModel*model2 = self.auctionView.pitModel;
model2.charm = @"0"; model2.charm = @"0";
self.auctionView.pitModel = model2; self.auctionView.pitModel = model2;
[self.auctionView hideCharm];
self.charmLabel.text = @"0";
self.firstSeatView.charmLabel.text = @"0";
self.secondSeatView.charmLabel.text = @"0";
self.thirdSeatView.charmLabel.text = @"0";
}
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
for (int i = 0; i < self.roomModel.room_auction.auction_list.count; i++) {
if (i < 6) {
QXRoomPitModel*pitModel = self.roomModel.room_auction.auction_list[i];
if ([pitModel.user_id isEqualToString:userId]) {
pitModel.charm = @"0";
UIView *contentView = self.seatArray[i];
if ([contentView isKindOfClass:[QXRoomAuctionSeatView class]]) {
QXRoomAuctionSeatView *seatView = (QXRoomAuctionSeatView *)contentView;
seatView.pitModel = pitModel;
}
break;
}
}
}
QXRoomPitModel*model1 = self.compereView.pitModel;
if ([model1.user_id isEqualToString:userId]) {
model1.charm = @"0";
self.compereView.pitModel = model1;
[self.compereView hideCharm];
}
QXRoomPitModel*model2 = self.auctionView.pitModel;
if ([model2.user_id isEqualToString:userId]) {
model2.charm = @"0";
self.auctionView.pitModel = model2;
[self.auctionView hideCharm];
self.charmLabel.text = @"0";
}
} }
-(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)list{ -(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)list{
[self reSetPitList]; [self reSetPitList];
self.roomModel.room_auction.auction_list = list; self.roomModel.room_auction.auction_list = list;

View File

@@ -343,6 +343,9 @@
} }
na.viewControllers = viewControllers; na.viewControllers = viewControllers;
[na popViewControllerAnimated:YES]; [na popViewControllerAnimated:YES];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIApplication sharedApplication].idleTimerDisabled = YES;
});
QXGlobal.shareGlobal.superRoomId = @""; QXGlobal.shareGlobal.superRoomId = @"";
}else{ }else{
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id]; [[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id];

View File

@@ -45,6 +45,8 @@ typedef NS_ENUM(NSInteger) {
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 设置魅力 /// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model; -(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
/// 用户信息发生改变 /// 用户信息发生改变

View File

@@ -101,9 +101,7 @@
self.compereView = [[QXRoomSeatContentView alloc] init]; self.compereView = [[QXRoomSeatContentView alloc] init];
[self.compereView addTapBlock:^(id _Nonnull obj) { self.compereView.delegate = self;
[weakSelf didClickSeatView:obj];
}];
self.compereView.tagString = QXText(@"主持"); self.compereView.tagString = QXText(@"主持");
self.compereView.number = 9; self.compereView.number = 9;
[self addSubview:self.compereView]; [self addSubview:self.compereView];
@@ -119,9 +117,7 @@
self.guestView = [[QXRoomSeatContentView alloc] init]; self.guestView = [[QXRoomSeatContentView alloc] init];
self.guestView.tagString = QXText(@"嘉宾"); self.guestView.tagString = QXText(@"嘉宾");
self.guestView.number = 10; self.guestView.number = 10;
[self.guestView addTapBlock:^(id _Nonnull obj) { self.guestView.delegate = self;
[weakSelf didClickSeatView:obj];
}];
[self addSubview:self.guestView]; [self addSubview:self.guestView];
[self.guestView mas_makeConstraints:^(MASConstraintMaker *make) { [self.guestView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self); make.top.equalTo(self);
@@ -493,24 +489,12 @@
make.edges.equalTo(self.heartBottomLineImageView); make.edges.equalTo(self.heartBottomLineImageView);
}]; }];
[self.leftSeatView1.contentView addTapBlock:^(id _Nonnull obj) { self.leftSeatView1.contentView.delegate = self;
[weakSelf didClickSeatView:obj]; self.leftSeatView2.contentView.delegate = self;
}]; self.leftSeatView3.contentView.delegate = self;
[self.leftSeatView2.contentView addTapBlock:^(id _Nonnull obj) { self.rightSeatView1.contentView.delegate = self;
[weakSelf didClickSeatView:obj]; self.rightSeatView2.contentView.delegate = self;
}]; self.rightSeatView3.contentView.delegate = self;
[self.leftSeatView3.contentView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj];
}];
[self.rightSeatView1.contentView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj];
}];
[self.rightSeatView2.contentView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj];
}];
[self.rightSeatView3.contentView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj];
}];
[self.allSeatViewArray replaceObjectAtIndex:8 withObject:self.compereView]; [self.allSeatViewArray replaceObjectAtIndex:8 withObject:self.compereView];
@@ -529,6 +513,7 @@
self.heartTopImageView.hidden = YES; self.heartTopImageView.hidden = YES;
self.heartCenterImageView.hidden = YES; self.heartCenterImageView.hidden = YES;
self.heartBottomImageView.hidden = YES; self.heartBottomImageView.hidden = YES;
[self bringSubviewToFront:self.tenSecondLabel];
} }
#pragma mark - QXRoomSeatDelegate #pragma mark - QXRoomSeatDelegate
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{ -(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{
@@ -536,6 +521,11 @@
[self.delegate friendPowerSendGiftWithUser:user heartId:heartId]; [self.delegate friendPowerSendGiftWithUser:user heartId:heartId];
} }
} }
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[self.delegate previewRoomUserCharmListWithUserId:userId];
}
}
-(void)setRoomModel:(QXRoomModel *)roomModel{ -(void)setRoomModel:(QXRoomModel *)roomModel{
_roomModel = roomModel; _roomModel = roomModel;
@@ -889,7 +879,7 @@
fromSeatView.pitModel = totModel; fromSeatView.pitModel = totModel;
} }
} }
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{ -(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ; NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
QXLOG(@"点击了%ld麦位",seatView.number); QXLOG(@"点击了%ld麦位",seatView.number);
@@ -1050,6 +1040,7 @@
if (step.intValue == 1) { if (step.intValue == 1) {
self.roomModel.friend_info.heart_list = @[]; self.roomModel.friend_info.heart_list = @[];
self.tenSecondLabel.hidden = YES; self.tenSecondLabel.hidden = YES;
[self.cpView removeFromSuperview];
} }
self.roomModel.friend_info.step = [NSString stringWithFormat:@"%@",step]; self.roomModel.friend_info.step = [NSString stringWithFormat:@"%@",step];
self.roomModel.friend_info.friend_id = friend_id; self.roomModel.friend_info.friend_id = friend_id;
@@ -1097,6 +1088,20 @@
} }
} }
} }
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
for (id object in self.allSeatViewArray) {
if ([object isKindOfClass:[QXRoomSeatContentView class]]) {
QXRoomSeatContentView *contentView = (QXRoomSeatContentView *)object;
QXRoomPitModel *model = contentView.pitModel;
if ([model.user_id isEqualToString:userId]) {
model.charm = @"0";
contentView.pitModel = model;
break;
}
}
}
}
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{ -(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
for (id object in self.allSeatViewArray) { for (id object in self.allSeatViewArray) {
if ([object isKindOfClass:[QXRoomSeatContentView class]]) { if ([object isKindOfClass:[QXRoomSeatContentView class]]) {

View File

@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number; -(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 设置魅力 /// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model; -(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
/// 设置麦位锁麦状态 /// 设置麦位锁麦状态

View File

@@ -11,7 +11,7 @@
#import "QXRoomSeatSettingView.h" #import "QXRoomSeatSettingView.h"
static NSInteger maxSeat = 8; static NSInteger maxSeat = 8;
@interface QXRoomSeatTypeNormalView() @interface QXRoomSeatTypeNormalView()<QXRoomSeatDelegate>
/// ///
@property (nonatomic,strong)QXRoomSeatContentView *compereView; @property (nonatomic,strong)QXRoomSeatContentView *compereView;
/// ///
@@ -35,9 +35,10 @@ static NSInteger maxSeat = 8;
-(void)initSubviews{ -(void)initSubviews{
MJWeakSelf MJWeakSelf
self.compereView = [[QXRoomSeatContentView alloc] init]; self.compereView = [[QXRoomSeatContentView alloc] init];
[self.compereView addTapBlock:^(id _Nonnull obj) { // [self.compereView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj]; // [weakSelf didClickSeatView:obj];
}]; // }];
self.compereView.delegate = self;
self.compereView.tagString = QXText(@"主持"); self.compereView.tagString = QXText(@"主持");
self.compereView.number = 9; self.compereView.number = 9;
[self addSubview:self.compereView]; [self addSubview:self.compereView];
@@ -53,9 +54,10 @@ static NSInteger maxSeat = 8;
self.guestView = [[QXRoomSeatContentView alloc] init]; self.guestView = [[QXRoomSeatContentView alloc] init];
self.guestView.tagString = QXText(@"嘉宾"); self.guestView.tagString = QXText(@"嘉宾");
self.guestView.number = 10; self.guestView.number = 10;
[self.guestView addTapBlock:^(id _Nonnull obj) { // [self.guestView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj]; // [weakSelf didClickSeatView:obj];
}]; // }];
self.guestView.delegate = self;
[self addSubview:self.guestView]; [self addSubview:self.guestView];
[self.guestView mas_makeConstraints:^(MASConstraintMaker *make) { [self.guestView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self); make.top.equalTo(self);
@@ -72,9 +74,10 @@ static NSInteger maxSeat = 8;
for (int i = 0 ; i < maxSeat ; i++) { for (int i = 0 ; i < maxSeat ; i++) {
QXRoomSeatContentView *contentView = [[QXRoomSeatContentView alloc] init]; QXRoomSeatContentView *contentView = [[QXRoomSeatContentView alloc] init];
contentView.number = i+1; contentView.number = i+1;
[contentView addTapBlock:^(id _Nonnull obj) { // [contentView addTapBlock:^(id _Nonnull obj) {
[weakSelf didClickSeatView:obj]; // [weakSelf didClickSeatView:obj];
}]; // }];
contentView.delegate = self;
[self addSubview:contentView]; [self addSubview:contentView];
[contentView mas_makeConstraints:^(MASConstraintMaker *make) { [contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.compereView.mas_bottom).offset(1+(seatHeight+topSpace)*(i/4)); make.top.equalTo(self.compereView.mas_bottom).offset(1+(seatHeight+topSpace)*(i/4));
@@ -90,9 +93,7 @@ static NSInteger maxSeat = 8;
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.viewController.view endEditing:YES]; [self.viewController.view endEditing:YES];
} }
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ; NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
QXLOG(@"点击了%ld麦位",seatView.number); QXLOG(@"点击了%ld麦位",seatView.number);
if (seatView.pitModel.user_id.longLongValue > 0) { if (seatView.pitModel.user_id.longLongValue > 0) {
@@ -180,6 +181,11 @@ static NSInteger maxSeat = 8;
} }
} }
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[self.delegate previewRoomUserCharmListWithUserId:userId];
}
}
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{ -(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
if (pit_number > 10) { if (pit_number > 10) {
@@ -316,11 +322,25 @@ static NSInteger maxSeat = 8;
QXRoomPitModel *model = seatView.pitModel; QXRoomPitModel *model = seatView.pitModel;
model.charm = @"0"; model.charm = @"0";
seatView.pitModel = model; seatView.pitModel = model;
if (self.isPKMyRoom || self.isPKOtherRoom) { // if (self.isPKMyRoom || self.isPKOtherRoom) {
[seatView hideCharm]; // [seatView hideCharm];
} // }
} }
} }
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
for (QXRoomSeatContentView *seatView in self.seatArray) {
QXRoomPitModel *model = seatView.pitModel;
if ([model.user_id isEqualToString:userId]) {
model.charm = @"0";
seatView.pitModel = model;
break;
}
// if (self.isPKMyRoom || self.isPKOtherRoom) {
// [seatView hideCharm];
// }
}
}
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{ -(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
for (QXRoomSeatContentView *seatView in self.seatArray) { for (QXRoomSeatContentView *seatView in self.seatArray) {
QXRoomPitModel *md = seatView.pitModel; QXRoomPitModel *md = seatView.pitModel;

View File

@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 设置魅力 /// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model; -(void)setSeatCharmWithUser:(QXUserHomeModel *)model;

View File

@@ -18,7 +18,8 @@
@import AgoraLyricsScore; @import AgoraLyricsScore;
@interface QXRoomSeatTypeSongView()<KaraokeDelegate @interface QXRoomSeatTypeSongView()<KaraokeDelegate
,UICollectionViewDelegate,UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDataSource,
QXRoomSeatDelegate
> >
/// ///
@property (nonatomic,strong)UIView *leftBgView; @property (nonatomic,strong)UIView *leftBgView;
@@ -177,9 +178,7 @@
MJWeakSelf MJWeakSelf
self.singerSeatView = [[QXRoomSeatContentView alloc] init]; self.singerSeatView = [[QXRoomSeatContentView alloc] init];
self.singerSeatView.tagString = QXText(@"演唱者"); self.singerSeatView.tagString = QXText(@"演唱者");
[self.singerSeatView addTapBlock:^(id _Nonnull obj) { self.singerSeatView.delegate = self;
[weakSelf didClickSeatView:obj];
}];
[self.leftBgView addSubview:self.singerSeatView]; [self.leftBgView addSubview:self.singerSeatView];
[self.leftBgView addSubview:self.originalBtn]; [self.leftBgView addSubview:self.originalBtn];
@@ -193,9 +192,7 @@
self.compereView = [[QXRoomSeatContentView alloc] init]; self.compereView = [[QXRoomSeatContentView alloc] init];
[self.compereView addTapBlock:^(id _Nonnull obj) { self.compereView.delegate = self;
[weakSelf didClickSeatView:obj];
}];
self.compereView.tagString = QXText(@"主持"); self.compereView.tagString = QXText(@"主持");
self.compereView.number = 9; self.compereView.number = 9;
[self addSubview:self.compereView]; [self addSubview:self.compereView];
@@ -204,9 +201,7 @@
self.guestView = [[QXRoomSeatContentView alloc] init]; self.guestView = [[QXRoomSeatContentView alloc] init];
self.guestView.tagString = QXText(@"嘉宾"); self.guestView.tagString = QXText(@"嘉宾");
self.guestView.number = 10; self.guestView.number = 10;
[self.guestView addTapBlock:^(id _Nonnull obj) { self.guestView.delegate = self;
[weakSelf didClickSeatView:obj];
}];
[self addSubview:self.guestView]; [self addSubview:self.guestView];
@@ -230,7 +225,7 @@
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ -(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.viewController.view endEditing:YES]; [self.viewController.view endEditing:YES];
} }
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{ -(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ; NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
QXLOG(@"点击了%ld麦位",seatView.number); QXLOG(@"点击了%ld麦位",seatView.number);
@@ -267,6 +262,11 @@
} }
} }
} }
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewRoomUserCharmListWithUserId:)]) {
[self.delegate previewRoomUserCharmListWithUserId:userId];
}
}
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{ -(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
// if (pit_number==9999) { // if (pit_number==9999) {
// for (<#type *object#> in <#collection#>) { // for (<#type *object#> in <#collection#>) {
@@ -502,7 +502,33 @@
} }
[self.collectionView reloadData]; [self.collectionView reloadData];
} }
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
QXRoomPitModel *singerModel = self.singerSeatView.pitModel;
if ([singerModel.user_id isEqualToString:userId]) {
singerModel.charm = @"0";
self.singerSeatView.pitModel = singerModel;
}
QXRoomPitModel *compereModel = self.compereView.pitModel;
if ([compereModel.user_id isEqualToString:userId]) {
compereModel.charm = @"0";
self.compereView.pitModel = compereModel;
}
QXRoomPitModel *guestModel = self.guestView.pitModel;
if ([guestModel.user_id isEqualToString:userId]) {
guestModel.charm = @"0";
self.guestView.pitModel = guestModel;
}
for (QXRoomPitModel *md in self.dataArray) {
if ([userId isEqualToString:md.user_id]) {
md.charm = @"0";
break;
}
}
[self.collectionView reloadData];
}
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model{ -(void)setSeatCharmWithUser:(QXUserHomeModel *)model{
QXRoomPitModel *singerModel = self.singerSeatView.pitModel; QXRoomPitModel *singerModel = self.singerSeatView.pitModel;
if ([singerModel.user_id isEqualToString:model.user_id]) { if ([singerModel.user_id isEqualToString:model.user_id]) {
@@ -577,18 +603,19 @@
QXSongSeatCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSongSeatCell" forIndexPath:indexPath]; QXSongSeatCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSongSeatCell" forIndexPath:indexPath];
QXRoomPitModel *model = self.dataArray[indexPath.row]; QXRoomPitModel *model = self.dataArray[indexPath.row];
cell.seatContentView.pitModel = model; cell.seatContentView.pitModel = model;
cell.seatContentView.delegate = self;
return cell; return cell;
} }
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
QXRoomPitModel *model = self.dataArray[indexPath.row]; // QXRoomPitModel *model = self.dataArray[indexPath.row];
// self.userInfoView.isUpSeat = YES; // self.userInfoView.isUpSeat = YES;
// self.userInfoView.roomId = self.roomModel.room_info.room_id; // self.userInfoView.roomId = self.roomModel.room_info.room_id;
//// self.userInfoView.pitNumber = [NSString stringWithFormat:@"%ld",seatView.number]; //// self.userInfoView.pitNumber = [NSString stringWithFormat:@"%ld",seatView.number];
// self.userInfoView.userId = model.user_id; // self.userInfoView.userId = model.user_id;
// [self.userInfoView showInView:self.viewController.view]; // [self.userInfoView showInView:self.viewController.view];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { // if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[self.delegate didClickUserHeaderWithPitModel:model userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO]; // [self.delegate didClickUserHeaderWithPitModel:model userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
} // }
} }
-(void)nextAction{ -(void)nextAction{

View File

@@ -49,6 +49,8 @@ typedef NS_ENUM(NSInteger) {
/// 清除魅力 /// 清除魅力
-(void)clearCharm; -(void)clearCharm;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
/// 设置魅力 /// 设置魅力
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model; -(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
/// 设置麦位锁麦状态 /// 设置麦位锁麦状态

View File

@@ -13,6 +13,7 @@
#import "QXRoomSeatTypeCabinView.h" #import "QXRoomSeatTypeCabinView.h"
#import "QXRoomSeatPKView.h" #import "QXRoomSeatPKView.h"
#import "QXRoomSeatTypeFrientView.h" #import "QXRoomSeatTypeFrientView.h"
#import "QXRoomUserCharmView.h"
@interface QXRoomSeatView()<QXRoomSeatDelegate> @interface QXRoomSeatView()<QXRoomSeatDelegate>
@property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView; @property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView;
@@ -27,6 +28,8 @@
@property (nonatomic,strong)QXRoomSeatPKView *roomPkView; @property (nonatomic,strong)QXRoomSeatPKView *roomPkView;
@property (nonatomic,strong)QXRoomSeatTypeFrientView *roomFriendView; @property (nonatomic,strong)QXRoomSeatTypeFrientView *roomFriendView;
@property (nonatomic,strong)QXRoomUserCharmView *charmListView;
@end @end
@@ -627,6 +630,7 @@
return; return;
} }
if (_songView) { if (_songView) {
[[QXAgoraEngine sharedEngine] ktv_EndSing];
_songView.transform = CGAffineTransformIdentity; _songView.transform = CGAffineTransformIdentity;
// //
[UIView animateWithDuration:0.5 [UIView animateWithDuration:0.5
@@ -813,6 +817,12 @@
} }
} }
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId{
self.charmListView.roomId = self.roomModel.room_info.room_id;
self.charmListView.userId = userId;
[self.charmListView showInView:self.viewController.view];
}
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{ -(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) { if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
[self.delegate didClickUserHeaderWithPitModel:pitModel userModel:userModel isPkRoom:isPkRoom pkRoomId:pkRoomId isNoTakeOff:isNoTakeOff]; [self.delegate didClickUserHeaderWithPitModel:pitModel userModel:userModel isPkRoom:isPkRoom pkRoomId:pkRoomId isNoTakeOff:isNoTakeOff];
@@ -850,6 +860,7 @@
[self.songView clearCharm]; [self.songView clearCharm];
break; break;
case QXRoomSeatViewTypeAuction: case QXRoomSeatViewTypeAuction:
[self.auctionView clearCharm];
break; break;
case QXRoomSeatViewTypeCabin: case QXRoomSeatViewTypeCabin:
break; break;
@@ -863,6 +874,30 @@
break; break;
} }
} }
///
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
switch (self.type) {
case QXRoomSeatViewTypeNormal:
[self.normalSeatView roomClearUserCharmWithUserId:userId];
break;
case QXRoomSeatViewTypeSing:
[self.songView roomClearUserCharmWithUserId:userId];
break;
case QXRoomSeatViewTypeAuction:
[self.auctionView roomClearUserCharmWithUserId:userId];
break;
case QXRoomSeatViewTypeCabin:
break;
case QXRoomSeatViewTypePK:
[self.roomPkView roomClearUserCharmWithUserId:userId];
break;
case QXRoomSeatViewTypeFriend:
[self.roomFriendView roomClearUserCharmWithUserId:userId];
break;
default:
break;
}
}
/// ///
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{ -(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber{
switch (self.type) { switch (self.type) {
@@ -1227,4 +1262,12 @@
} }
return _roomFriendView; return _roomFriendView;
} }
-(QXRoomUserCharmView *)charmListView{
if (!_charmListView) {
_charmListView = [[QXRoomUserCharmView alloc] initWithFrame:[UIScreen mainScreen].bounds];
_charmListView.delegate = self;
}
return _charmListView;
}
@end @end

View File

@@ -61,23 +61,24 @@
} }
-(void)setHeadIcon:(NSString *)headerIcon -(void)setHeadIcon:(NSString *)headerIcon
dress:(NSString *)dress{ dress:(nonnull NSString *)dress{
NSString *dressUrl = [dress stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
[self.headImageView sd_setImageWithURL:[NSURL URLWithString:headerIcon] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]]; [self.headImageView sd_setImageWithURL:[NSURL URLWithString:headerIcon] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
if (dress.length > 0 && ([dress hasPrefix:@"http"] || [dress hasPrefix:@"https"])) { if (dressUrl.length > 0 && ([dressUrl hasPrefix:@"http"] || [dressUrl hasPrefix:@"https"])) {
if ([dress isExist]) { if ([dressUrl isExist]) {
if ([dress hasSuffix:@"svga"]) { if ([dressUrl hasSuffix:@"svga"]) {
[self.svgaView setHidden:NO]; [self.svgaView setHidden:NO];
[self.mp4View stopHWDMP4]; [self.mp4View stopHWDMP4];
[self.mp4View setHidden:YES]; [self.mp4View setHidden:YES];
[self.svgaView destroySvga]; [self.svgaView destroySvga];
[self.svgaView loadSVGAPlayerWith:dress inBundle:NO loop:INTMAX_MAX]; [self.svgaView loadSVGAPlayerWith:dressUrl inBundle:NO loop:INTMAX_MAX];
}else if ([dress hasSuffix:@"mp4"]){ }else if ([dressUrl hasSuffix:@"mp4"]){
[self.svgaView setHidden:YES]; [self.svgaView setHidden:YES];
[self.mp4View setHidden:NO]; [self.mp4View setHidden:NO];
[self.mp4View stopHWDMP4]; [self.mp4View stopHWDMP4];
MJWeakSelf MJWeakSelf
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:dress completion:^(BOOL result, NSString * _Nonnull fileName) { [[QXRequset shareInstance] downloadVideoPlayerWithUrl:dressUrl completion:^(BOOL result, NSString * _Nonnull fileName) {
NSString *videoPath = [QXFileManager getGiftVideoPath:dress.lastPathComponent]; NSString *videoPath = [QXFileManager getGiftVideoPath:dressUrl.lastPathComponent];
[weakSelf.mp4View playHWDMP4:videoPath repeatCount:INTMAX_MAX delegate:self]; [weakSelf.mp4View playHWDMP4:videoPath repeatCount:INTMAX_MAX delegate:self];
}]; }];
}else{ }else{

View File

@@ -203,11 +203,14 @@
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) { [[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
NSString *videoPath = [QXFileManager getGiftVideoPath:fileName]; NSString *videoPath = [QXFileManager getGiftVideoPath:fileName];
weakSelf.playerMp4View.hidden = NO; weakSelf.playerMp4View.hidden = NO;
weakSelf.effectView.hidden = YES;
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self]; [weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
}]; }];
}else if ([giftModel.play_image hasSuffix:@"svg"] || [giftModel.play_image hasSuffix:@"svga"]) { }else if ([giftModel.play_image hasSuffix:@"svg"] || [giftModel.play_image hasSuffix:@"svga"]) {
__weak typeof(self)weakSelf = self; __weak typeof(self)weakSelf = self;
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) { [[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
weakSelf.playerMp4View.hidden = YES;
weakSelf.effectView.hidden = NO;
NSString *filePath = [QXFileManager getGiftVideoPath:fileName]; NSString *filePath = [QXFileManager getGiftVideoPath:fileName];
[weakSelf.effectView loadSVGAPlayerWith:filePath]; [weakSelf.effectView loadSVGAPlayerWith:filePath];
}]; }];

View File

@@ -27,6 +27,7 @@
#import "QXMineNetwork.h" #import "QXMineNetwork.h"
#import "QXHelpViewController.h" #import "QXHelpViewController.h"
#import "QXInviteViewController.h" #import "QXInviteViewController.h"
#import "QXChatViewController.h"
@interface QXMineViewController ()<UITableViewDelegate,UITableViewDataSource,QXMineServiceCellDelegate,QXMainHeaderViewDelegate> @interface QXMineViewController ()<UITableViewDelegate,UITableViewDataSource,QXMineServiceCellDelegate,QXMainHeaderViewDelegate>
@property (nonatomic,strong)QXMainHeaderView *tableHeaderView; @property (nonatomic,strong)QXMainHeaderView *tableHeaderView;
@@ -207,6 +208,14 @@
-(void)gotoService{ -(void)gotoService{
QXHelpViewController *webvc = [[QXHelpViewController alloc] init]; QXHelpViewController *webvc = [[QXHelpViewController alloc] init];
[self.navigationController pushViewController:webvc animated:YES]; [self.navigationController pushViewController:webvc animated:YES];
// QXChatViewController *vc = [[QXChatViewController alloc] init];
// TUIChatConversationModel *data = [[TUIChatConversationModel alloc] init];
// data.userID = @"@RBT#u88";
// data.title = @"小秘机器人";
// data.faceUrl = @"http://md.qxmier.com/data/avatar/head_pic.png";
// vc.data = data;
// [self.navigationController pushViewController:vc animated:YES];
} }

View File

@@ -174,7 +174,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext;
//, jsoc(OCURL) //, jsoc(OCURL)
WKUserContentController * UserContentController = [[WKUserContentController alloc]init]; WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
// //
configuration.suppressesIncrementalRendering = YES; configuration.suppressesIncrementalRendering = NO;
// //
[UserContentController addScriptMessageHandler:self name:@"login"]; [UserContentController addScriptMessageHandler:self name:@"login"];
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"]; [UserContentController addScriptMessageHandler:self name:@"nativeHandler"];

View File

@@ -21,6 +21,7 @@
#import "QXRechargeListModel.h" #import "QXRechargeListModel.h"
#import "QXPayTypeModel.h" #import "QXPayTypeModel.h"
#import "QXDayTaskModel.h" #import "QXDayTaskModel.h"
#import "QXRoomUserCharmModel.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -1014,6 +1015,26 @@ NS_ASSUME_NONNULL_BEGIN
+(void)friendRoomQuitWithRoomid:(NSString*)room_id +(void)friendRoomQuitWithRoomid:(NSString*)room_id
successBlock:(void (^)(NSDictionary* dict))successBlock successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock; failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
获取房间用户魅力列表
*/
+(void)getRoomUserCharmListWithRoomId:(NSString*)roomId
userId:(NSString*)userId
successBlock:(void (^)(NSArray * list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
背包一键全清
*/
+(void)roomBagGiftClearWithRoomId:(NSString*)roomId
userId:(NSString*)userId
heartId:(NSString*)heartId
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end @end

View File

@@ -1999,4 +1999,38 @@
failBlock(error,msg); failBlock(error,msg);
}]; }];
} }
+(void)getRoomUserCharmListWithRoomId:(NSString*)roomId
userId:(NSString*)userId
successBlock:(void (^)(NSArray * list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock
{
NSDictionary *parameters =@{
@"room_id":roomId?roomId:@"",
@"user_id":userId?userId:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomUserCharmList parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray*list = [NSArray yy_modelArrayWithClass:[QXRoomUserCharmModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
+(void)roomBagGiftClearWithRoomId:(NSString *)roomId userId:(NSString *)userId heartId:(NSString*)heartId successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"room_id":roomId?roomId:@"",
@"to_uid":userId?userId:@"",
@"heart_id":heartId?heartId:@""
};
[[QXRequset shareInstance] postWithUrl:QXRoomGiftBagClear parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end @end

View File

@@ -13,7 +13,8 @@
self.titleLabel.text = model.remarks; self.titleLabel.text = model.remarks;
self.timeLabel.text = model.time; self.timeLabel.text = model.time;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.gift_image]]; [self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.gift_image]];
self.recordLabel.text = [NSString stringWithFormat:@"X%@%@",model.gift_num,model.gift_name]; // self.recordLabel.text = [NSString stringWithFormat:@"X%@%@",model.gift_num,model.gift_name];
self.recordLabel.text = [NSString stringWithFormat:@"%@",model.gift_name];
} }
- (void)awakeFromNib { - (void)awakeFromNib {
[super awakeFromNib]; [super awakeFromNib];

View File

@@ -71,6 +71,18 @@
NSString *clientId = [OpenUDID value]; NSString *clientId = [OpenUDID value];
[[QXManagerMqtt sharedInstance] bindWithUserName:@"public" password:@"" cliendId:clientId isSSL:NO]; [[QXManagerMqtt sharedInstance] bindWithUserName:@"public" password:@"" cliendId:clientId isSSL:NO];
} }
-(void)onConnectSuccess{
// showToast(@"腾讯重连服务器成功");
// NSLog(@"腾讯重连服务器成功");
}
-(void)onConnecting{
// NSLog(@"腾讯重连服务器中");
// showToast(@"腾讯重连服务器中");
}
-(void)onConnectFailed:(int)code err:(NSString *)err{
// showToast(err);
// NSLog(@"腾讯连接服务器失败code----%d---err%@",code,err);
}
-(void)onKickedOffline{ -(void)onKickedOffline{
MJWeakSelf MJWeakSelf

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_user_charm_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_user_charm_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -430,4 +430,8 @@ static NSString * QXRoomFriendDelay = @"api/Friend/delay";
static NSString * QXRoomFriendCreateRelation = @"api/Friend/create_relation"; static NSString * QXRoomFriendCreateRelation = @"api/Friend/create_relation";
/// 退出私密房间 /// 退出私密房间
static NSString * QXRoomFriendRoomQuit = @"api/Friend/out_room"; static NSString * QXRoomFriendRoomQuit = @"api/Friend/out_room";
/// 退出私密房间
static NSString * QXRoomUserCharmList = @"api/Room/room_user_charm_list";
/// 背包一键全清
static NSString * QXRoomGiftBagClear = @"api/Room/room_gift_all_clear";
#endif /* Api_h */ #endif /* Api_h */

View File

@@ -32,9 +32,13 @@
-(void)initSubviews{ -(void)initSubviews{
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_start_pop_bg"]]; self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_start_pop_bg"]];
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self); make.width.mas_equalTo(ScaleWidth(358));
make.height.mas_equalTo(ScaleWidth(136));
make.centerX.equalTo(self);
make.top.equalTo(self);
}]; }];
self.titleLabel = [[UILabel alloc] init]; self.titleLabel = [[UILabel alloc] init];
@@ -68,7 +72,7 @@
[QXMeetActivityDriftView shareView].model = [QXMeetActivityDriftView shareView].dataArray.firstObject; [QXMeetActivityDriftView shareView].model = [QXMeetActivityDriftView shareView].dataArray.firstObject;
[KEYWINDOW addSubview:[QXMeetActivityDriftView shareView]]; [KEYWINDOW addSubview:[QXMeetActivityDriftView shareView]];
[UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ [UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
[QXMeetActivityDriftView shareView].x = (SCREEN_WIDTH-ScaleWidth(316))/2; [QXMeetActivityDriftView shareView].x = (SCREEN_WIDTH-ScaleWidth(358))/2;
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
[weakSelf performSelector:@selector(dissmissAnimate) afterDelay:5]; [weakSelf performSelector:@selector(dissmissAnimate) afterDelay:5];
}]; }];

View File

@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次 /// 抽一次
QXSkyDrawBtnTypeOne = 1, QXSkyDrawBtnTypeOne = 1,
/// 抽10次 /// 抽10次
QXSkyDrawBtnTypeTen = 10, QXSkyDrawBtnTypeTen = 6,
/// 抽100次 /// 抽100次
QXSkyDrawBtnTypeHundred = 100, QXSkyDrawBtnTypeHundred = 9,
}QXSkyDrawBtnType; }QXSkyDrawBtnType;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXGiftModel *giftModel; @property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)QXGiftActivityModel *model; @property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,strong)NSString* userIds; @property (nonatomic,strong)NSString* userIds;
@property (nonatomic,strong)NSString* heartId;
@property (nonatomic,copy)void(^startBlock)(void); @property (nonatomic,copy)void(^startBlock)(void);
-(void)showInView:(UIView *)view; -(void)showInView:(UIView *)view;
-(void)hide; -(void)hide;
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin; @property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isDisable;
@property (nonatomic,assign)QXSkyDrawBtnType btnType; @property (nonatomic,assign)QXSkyDrawBtnType btnType;
@end @end

View File

@@ -83,6 +83,8 @@ static NSInteger toSlowCount = 4;
@property (nonatomic,strong)QXSkyPraizeRecordView *recordView; @property (nonatomic,strong)QXSkyPraizeRecordView *recordView;
@property (nonatomic,strong)QXDrawGiftCenterView * centerView; @property (nonatomic,strong)QXDrawGiftCenterView * centerView;
@property (nonatomic,assign)double coin;
@end @end
@implementation QXSkyPraizeView @implementation QXSkyPraizeView
@@ -183,6 +185,7 @@ static NSInteger toSlowCount = 4;
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4; CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXSkyDrawBtn *oneBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))]; QXSkyDrawBtn *oneBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXSkyDrawBtnTypeOne; oneBtn.btnType = QXSkyDrawBtnTypeOne;
oneBtn.isDisable = YES;
self.oneBtn = oneBtn; self.oneBtn = oneBtn;
self.oneBtn.hidden = YES; self.oneBtn.hidden = YES;
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -190,6 +193,7 @@ static NSInteger toSlowCount = 4;
QXSkyDrawBtn *tenBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXSkyDrawBtn *tenBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXSkyDrawBtnTypeTen; tenBtn.btnType = QXSkyDrawBtnTypeTen;
tenBtn.isDisable = YES;
self.tenBtn = tenBtn; self.tenBtn = tenBtn;
self.tenBtn.hidden = YES; self.tenBtn.hidden = YES;
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -197,6 +201,7 @@ static NSInteger toSlowCount = 4;
QXSkyDrawBtn *hundredBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXSkyDrawBtn *hundredBtn = [[QXSkyDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXSkyDrawBtnTypeHundred; hundredBtn.btnType = QXSkyDrawBtnTypeHundred;
hundredBtn.isDisable = YES;
self.hundredBtn = hundredBtn; self.hundredBtn = hundredBtn;
self.hundredBtn.hidden = YES; self.hundredBtn.hidden = YES;
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -274,6 +279,8 @@ static NSInteger toSlowCount = 4;
weakSelf.coinView.x = (self.bgView.width-allWidth)/2; weakSelf.coinView.x = (self.bgView.width-allWidth)/2;
weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height); weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height);
weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height); weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height);
weakSelf.coin = coin;
[weakSelf conifgBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
@@ -309,22 +316,50 @@ static NSInteger toSlowCount = 4;
subview.giftModel = model.gift_list[i]; subview.giftModel = model.gift_list[i];
} }
[weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)]; [weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)];
[weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*10] forState:(UIControlStateNormal)]; [weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*6] forState:(UIControlStateNormal)];
[weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] forState:(UIControlStateNormal)]; [weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*9] forState:(UIControlStateNormal)];
weakSelf.oneBtn.hidden = NO; weakSelf.oneBtn.hidden = NO;
weakSelf.tenBtn.hidden = NO; weakSelf.tenBtn.hidden = NO;
weakSelf.hundredBtn.hidden = NO; weakSelf.hundredBtn.hidden = NO;
[weakSelf conifgBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
} }
-(void)conifgBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
}
}else{
self.oneBtn.isDisable = YES;
self.tenBtn.isDisable = YES;
self.hundredBtn.isDisable = YES;
}
}
-(void)setHeartId:(NSString *)heartId{
_heartId = heartId;
}
-(void)drawGiftWithNum:(NSString*)num{ -(void)drawGiftWithNum:(NSString*)num{
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag, @"gift_bag_id":self.giftModel.gift_bag,
@"gift_user_ids":self.userIds, @"gift_user_ids":self.userIds,
@"room_id":self.roomId, @"room_id":self.roomId,
@"num":num @"num":num,
@"heart_id":[self.heartId isExist]?self.heartId:@""
}; };
self.isDrawing = YES; self.isDrawing = YES;
MJWeakSelf MJWeakSelf
@@ -332,7 +367,7 @@ static NSInteger toSlowCount = 4;
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.drawResultModel = model; weakSelf.drawResultModel = model;
[weakSelf.targetArrayIndex removeAllObjects]; [weakSelf.targetArrayIndex removeAllObjects];
// [weakSelf resetViews]; [weakSelf getMyWallet];
for (int i = 0; i < model.reslut_list.count; i++) { for (int i = 0; i < model.reslut_list.count; i++) {
QXDrawGiftModel *md = model.reslut_list[i]; QXDrawGiftModel *md = model.reslut_list[i];
for (int j = 0; j < weakSelf.model.gift_list.count; j++) { for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
@@ -392,6 +427,10 @@ static NSInteger toSlowCount = 4;
} }
} }
-(void)startAction:(QXSkyDrawBtn*)sender{ -(void)startAction:(QXSkyDrawBtn*)sender{
if (sender.isDisable) {
showToast(@"金币不足");
return;
}
if (self.isDrawing) { if (self.isDrawing) {
showToast(@"正在抽奖中"); showToast(@"正在抽奖中");
return; return;
@@ -790,6 +829,10 @@ static NSInteger toSlowCount = 4;
[self addSubview:self.giftCoin]; [self addSubview:self.giftCoin];
} }
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"sky_touch_dis_bg":@"sky_touch_bg"];
}
-(void)setBtnType:(QXSkyDrawBtnType)btnType{ -(void)setBtnType:(QXSkyDrawBtnType)btnType{
// /// // ///
// QXSkyDrawBtnTypeOne = 0, // QXSkyDrawBtnTypeOne = 0,
@@ -807,13 +850,13 @@ static NSInteger toSlowCount = 4;
break; break;
case QXSkyDrawBtnTypeTen: case QXSkyDrawBtnTypeTen:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
} }
break; break;
case QXSkyDrawBtnTypeHundred: case QXSkyDrawBtnTypeHundred:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
} }
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次 /// 抽一次
QXAgeDrawBtnTypeOne = 1, QXAgeDrawBtnTypeOne = 1,
/// 抽10次 /// 抽10次
QXAgeDrawBtnTypeTen = 10, QXAgeDrawBtnTypeTen = 6,
/// 抽100次 /// 抽100次
QXAgeDrawBtnTypeHundred = 100, QXAgeDrawBtnTypeHundred = 9,
}QXAgeDrawBtnType; }QXAgeDrawBtnType;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXGiftModel *giftModel; @property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)QXGiftActivityModel *model; @property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,strong)NSString* userIds; @property (nonatomic,strong)NSString* userIds;
@property (nonatomic,strong)NSString* heartId;
@property (nonatomic,copy)void(^startBlock)(void); @property (nonatomic,copy)void(^startBlock)(void);
-(void)showInView:(UIView *)view; -(void)showInView:(UIView *)view;
-(void)hide; -(void)hide;
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin; @property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isDisable;
@property (nonatomic,assign)QXAgeDrawBtnType btnType; @property (nonatomic,assign)QXAgeDrawBtnType btnType;
@end @end

View File

@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
@property (nonatomic,strong)QXAgePraizeRecordView *recordView; @property (nonatomic,strong)QXAgePraizeRecordView *recordView;
@property (nonatomic,strong)QXDrawGiftCenterView * centerView; @property (nonatomic,strong)QXDrawGiftCenterView * centerView;
@property (nonatomic,assign)double coin;
@end @end
@implementation QXAgePraizeView @implementation QXAgePraizeView
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 4;
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4; CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXAgeDrawBtn *oneBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))]; QXAgeDrawBtn *oneBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXAgeDrawBtnTypeOne; oneBtn.btnType = QXAgeDrawBtnTypeOne;
oneBtn.isDisable = YES;
self.oneBtn = oneBtn; self.oneBtn = oneBtn;
self.oneBtn.hidden = YES; self.oneBtn.hidden = YES;
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -222,6 +225,7 @@ static NSInteger toSlowCount = 4;
QXAgeDrawBtn *tenBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXAgeDrawBtn *tenBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXAgeDrawBtnTypeTen; tenBtn.btnType = QXAgeDrawBtnTypeTen;
tenBtn.isDisable = YES;
self.tenBtn = tenBtn; self.tenBtn = tenBtn;
self.tenBtn.hidden = YES; self.tenBtn.hidden = YES;
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -229,6 +233,7 @@ static NSInteger toSlowCount = 4;
QXAgeDrawBtn *hundredBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXAgeDrawBtn *hundredBtn = [[QXAgeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXAgeDrawBtnTypeHundred; hundredBtn.btnType = QXAgeDrawBtnTypeHundred;
hundredBtn.isDisable = YES;
self.hundredBtn = hundredBtn; self.hundredBtn = hundredBtn;
self.hundredBtn.hidden = YES; self.hundredBtn.hidden = YES;
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -307,6 +312,8 @@ static NSInteger toSlowCount = 4;
weakSelf.coinView.x = (self.bgView.width-allWidth)/2; weakSelf.coinView.x = (self.bgView.width-allWidth)/2;
weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height); weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height);
weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height); weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height);
weakSelf.coin = coin;
[weakSelf configBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
@@ -342,22 +349,49 @@ static NSInteger toSlowCount = 4;
subview.giftModel = model.gift_list[i]; subview.giftModel = model.gift_list[i];
} }
[weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)]; [weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)];
[weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*10] forState:(UIControlStateNormal)]; [weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*6] forState:(UIControlStateNormal)];
[weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] forState:(UIControlStateNormal)]; [weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*9] forState:(UIControlStateNormal)];
weakSelf.oneBtn.hidden = NO; weakSelf.oneBtn.hidden = NO;
weakSelf.tenBtn.hidden = NO; weakSelf.tenBtn.hidden = NO;
weakSelf.hundredBtn.hidden = NO; weakSelf.hundredBtn.hidden = NO;
[weakSelf configBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
} }
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
}
}else{
self.oneBtn.isDisable = YES;
self.tenBtn.isDisable = YES;
self.hundredBtn.isDisable = YES;
}
}
-(void)setHeartId:(NSString *)heartId{
_heartId = heartId;
}
-(void)drawGiftWithNum:(NSString*)num{ -(void)drawGiftWithNum:(NSString*)num{
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag, @"gift_bag_id":self.giftModel.gift_bag,
@"gift_user_ids":self.userIds, @"gift_user_ids":self.userIds,
@"room_id":self.roomId, @"room_id":self.roomId,
@"num":num @"num":num,
@"heart_id":[self.heartId isExist]?self.heartId:@""
}; };
self.isDrawing = YES; self.isDrawing = YES;
MJWeakSelf MJWeakSelf
@@ -365,7 +399,7 @@ static NSInteger toSlowCount = 4;
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.drawResultModel = model; weakSelf.drawResultModel = model;
[weakSelf.targetArrayIndex removeAllObjects]; [weakSelf.targetArrayIndex removeAllObjects];
// [weakSelf resetViews]; [weakSelf getMyWallet];
for (int i = 0; i < model.reslut_list.count; i++) { for (int i = 0; i < model.reslut_list.count; i++) {
QXDrawGiftModel *md = model.reslut_list[i]; QXDrawGiftModel *md = model.reslut_list[i];
for (int j = 0; j < weakSelf.model.gift_list.count; j++) { for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
@@ -425,6 +459,10 @@ static NSInteger toSlowCount = 4;
} }
} }
-(void)startAction:(QXAgeDrawBtn*)sender{ -(void)startAction:(QXAgeDrawBtn*)sender{
if (sender.isDisable) {
showToast(@"金币不足");
return;
}
if (self.isDrawing) { if (self.isDrawing) {
showToast(@"正在抽奖中"); showToast(@"正在抽奖中");
return; return;
@@ -823,6 +861,10 @@ static NSInteger toSlowCount = 4;
[self addSubview:self.giftCoin]; [self addSubview:self.giftCoin];
} }
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"age_touch_dis_bg":@"age_touch_bg"];
}
-(void)setBtnType:(QXAgeDrawBtnType)btnType{ -(void)setBtnType:(QXAgeDrawBtnType)btnType{
// /// // ///
// QXAgeDrawBtnTypeOne = 0, // QXAgeDrawBtnTypeOne = 0,
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
break; break;
case QXAgeDrawBtnTypeTen: case QXAgeDrawBtnTypeTen:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
} }
break; break;
case QXAgeDrawBtnTypeHundred: case QXAgeDrawBtnTypeHundred:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
} }
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -42,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin; @property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isDisable;
@property (nonatomic,assign)QXSkyDrawBtnType btnType; @property (nonatomic,assign)QXSkyDrawBtnType btnType;
@end @end

View File

@@ -13,6 +13,7 @@
#import "QXMeetActivityResultView.h" #import "QXMeetActivityResultView.h"
#import "QXMeetLotteryView.h" #import "QXMeetLotteryView.h"
#import "QXDiamondViewController.h"
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate> @interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate>
@property (nonatomic,strong)UIView *bgView; @property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@@ -77,6 +78,8 @@
@property (nonatomic,strong)QXMeetActivityResultView *resultView; @property (nonatomic,strong)QXMeetActivityResultView *resultView;
@property (nonatomic,assign)double coin;
@end @end
@implementation QXMeetActivityView @implementation QXMeetActivityView
@@ -258,7 +261,8 @@
[self.exchangeBtn setTitle:@"去兑换" forState:(UIControlStateNormal)]; [self.exchangeBtn setTitle:@"去兑换" forState:(UIControlStateNormal)];
[self.exchangeBtn setTitleColor:RGB16(0xF8E837) forState:(UIControlStateNormal)]; [self.exchangeBtn setTitleColor:RGB16(0xF8E837) forState:(UIControlStateNormal)];
self.exchangeBtn.titleLabel.font = [UIFont systemFontOfSize:10]; self.exchangeBtn.titleLabel.font = [UIFont systemFontOfSize:10];
self.exchangeBtn.userInteractionEnabled = NO; self.exchangeBtn.userInteractionEnabled = YES;
[self.exchangeBtn addTarget:self action:@selector(exchangeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.coinView addSubview:self.exchangeBtn]; [self.coinView addSubview:self.exchangeBtn];
@@ -283,6 +287,10 @@
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self; return touch.view == self;
} }
-(void)exchangeAction{
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
[self.viewController.navigationController pushViewController:vc animated:YES];
}
-(void)getMyWallet{ -(void)getMyWallet{
MJWeakSelf MJWeakSelf
[[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) { [[QXRequset shareInstance] getWithUrl:QXWallet parameters:@{@"token":[QXGlobal shareGlobal].loginModel.token?[QXGlobal shareGlobal].loginModel.token:@""} needCache:NO success:^(id responseObject) {
@@ -295,6 +303,8 @@
weakSelf.coinView.x = (self.bgView.width-allWidth)/2; weakSelf.coinView.x = (self.bgView.width-allWidth)/2;
weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height); weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height);
weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height); weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height);
weakSelf.coin = coin;
[weakSelf configBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
@@ -312,6 +322,29 @@
}]; }];
} }
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*10)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*100)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
}
}else{
self.oneBtn.isDisable = YES;
self.tenBtn.isDisable = YES;
self.hundredBtn.isDisable = YES;
}
}
-(void)drawGiftWithNum:(NSString*)num{ -(void)drawGiftWithNum:(NSString*)num{
if (self.isDrawing) { if (self.isDrawing) {
showToast(@"正在抽奖中"); showToast(@"正在抽奖中");
@@ -328,20 +361,19 @@
MJWeakSelf MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/xlh_draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) { [[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/xlh_draw_gift"] parameters:parameters needCache:NO success:^(id responseObject) {
weakSelf.resultArray = [NSArray yy_modelArrayWithClass:[QXDrawGiftModel class] json:responseObject[@"data"]]; weakSelf.resultArray = [NSArray yy_modelArrayWithClass:[QXDrawGiftModel class] json:responseObject[@"data"]];
[weakSelf getMyWallet];
if (weakSelf.jumpAnimateBtn.selected) { if (weakSelf.jumpAnimateBtn.selected) {
weakSelf.resultView.resultArray = weakSelf.resultArray; weakSelf.resultView.resultArray = weakSelf.resultArray;
[weakSelf.resultView showInView:weakSelf]; [weakSelf.resultView showInView:weakSelf];
weakSelf.isDrawing = NO; weakSelf.isDrawing = NO;
}else{ }else{
NSInteger index = 0; NSInteger index = 0;
for (int i = 0; i < weakSelf.resultArray.count; i++) { QXDrawGiftModel *md1 = weakSelf.resultArray.firstObject;
QXDrawGiftModel *md1 = weakSelf.resultArray[i]; for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
for (int j = 0; j < weakSelf.model.gift_list.count; j++) { QXDrawGiftModel *md2 = weakSelf.model.gift_list[j];
QXDrawGiftModel *md2 = weakSelf.model.gift_list[j]; if ([md1.gift_id isEqualToString:md2.gift_id]) {
if ([md1.gift_id isEqualToString:md2.gift_id]) { index = j;
index = j; break;
break;
}
} }
} }
weakSelf.cycleScrollView.finalPrizeIndex = index; weakSelf.cycleScrollView.finalPrizeIndex = index;
@@ -396,6 +428,7 @@
self.oneBtn.hidden = NO; self.oneBtn.hidden = NO;
self.tenBtn.hidden = NO; self.tenBtn.hidden = NO;
self.hundredBtn.hidden = NO; self.hundredBtn.hidden = NO;
[self configBtnStatus];
if (self.model.xlh_user) { if (self.model.xlh_user) {
[self.userHeader sd_setImageWithURL:[NSURL URLWithString:self.model.xlh_user.avatar]]; [self.userHeader sd_setImageWithURL:[NSURL URLWithString:self.model.xlh_user.avatar]];
@@ -693,6 +726,10 @@
[self addSubview:self.giftCoin]; [self addSubview:self.giftCoin];
} }
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"meet_touch_dis_bg":@"meet_touch_bg"];
}
-(void)setBtnType:(QXSkyDrawBtnType)btnType{ -(void)setBtnType:(QXSkyDrawBtnType)btnType{
// /// // ///
// QXSkyDrawBtnTypeOne = 0, // QXSkyDrawBtnTypeOne = 0,

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次 /// 抽一次
QXTimeDrawBtnTypeOne = 1, QXTimeDrawBtnTypeOne = 1,
/// 抽10次 /// 抽10次
QXTimeDrawBtnTypeTen = 10, QXTimeDrawBtnTypeTen = 6,
/// 抽100次 /// 抽100次
QXTimeDrawBtnTypeHundred = 100, QXTimeDrawBtnTypeHundred = 9,
}QXTimeDrawBtnType; }QXTimeDrawBtnType;
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXGiftModel *giftModel; @property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)QXGiftActivityModel *model; @property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,strong)NSString* userIds; @property (nonatomic,strong)NSString* userIds;
@property (nonatomic,strong)NSString* heartId;
@property (nonatomic,copy)void(^startBlock)(void); @property (nonatomic,copy)void(^startBlock)(void);
-(void)showInView:(UIView *)view; -(void)showInView:(UIView *)view;
-(void)hide; -(void)hide;
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *giftCoin; @property (nonatomic,strong)UIButton *giftCoin;
@property (nonatomic,assign)BOOL isDisable;
@property (nonatomic,assign)QXTimeDrawBtnType btnType; @property (nonatomic,assign)QXTimeDrawBtnType btnType;
@end @end

View File

@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
@property (nonatomic,strong)QXTimePraizeRecordView *recordView; @property (nonatomic,strong)QXTimePraizeRecordView *recordView;
@property (nonatomic,strong)QXDrawGiftCenterView * centerView; @property (nonatomic,strong)QXDrawGiftCenterView * centerView;
@property (nonatomic,assign)double coin;
@end @end
@implementation QXTimePraizeView @implementation QXTimePraizeView
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 4;
CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4; CGFloat btnMargin = (SCREEN_WIDTH- ScaleWidth(109)*3)/4;
QXTimeDrawBtn *oneBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))]; QXTimeDrawBtn *oneBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(btnMargin, self.bgView.height-ScaleWidth(34)-20, btnWidth, ScaleWidth(34))];
oneBtn.btnType = QXTimeDrawBtnTypeOne; oneBtn.btnType = QXTimeDrawBtnTypeOne;
oneBtn.isDisable = YES;
self.oneBtn = oneBtn; self.oneBtn = oneBtn;
self.oneBtn.hidden = YES; self.oneBtn.hidden = YES;
[oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [oneBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -222,6 +225,7 @@ static NSInteger toSlowCount = 4;
QXTimeDrawBtn *tenBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXTimeDrawBtn *tenBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(self.oneBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
tenBtn.btnType = QXTimeDrawBtnTypeTen; tenBtn.btnType = QXTimeDrawBtnTypeTen;
tenBtn.isDisable = YES;
self.tenBtn = tenBtn; self.tenBtn = tenBtn;
self.tenBtn.hidden = YES; self.tenBtn.hidden = YES;
[tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [tenBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -229,6 +233,7 @@ static NSInteger toSlowCount = 4;
QXTimeDrawBtn *hundredBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))]; QXTimeDrawBtn *hundredBtn = [[QXTimeDrawBtn alloc] initWithFrame:CGRectMake(tenBtn.right+btnMargin, self.oneBtn.top, btnWidth, ScaleWidth(34))];
hundredBtn.btnType = QXTimeDrawBtnTypeHundred; hundredBtn.btnType = QXTimeDrawBtnTypeHundred;
hundredBtn.isDisable = YES;
self.hundredBtn = hundredBtn; self.hundredBtn = hundredBtn;
self.hundredBtn.hidden = YES; self.hundredBtn.hidden = YES;
[hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)]; [hundredBtn addTarget:self action:@selector(startAction:) forControlEvents:(UIControlEventTouchUpInside)];
@@ -307,6 +312,8 @@ static NSInteger toSlowCount = 4;
weakSelf.coinView.x = (weakSelf.bgView.width-allWidth)/2; weakSelf.coinView.x = (weakSelf.bgView.width-allWidth)/2;
weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height); weakSelf.coinBtn.frame = CGRectMake(10, 0, weakSelf.coinBtn.width, weakSelf.coinView.height);
weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height); weakSelf.exchangeBtn.frame = CGRectMake(allWidth-weakSelf.exchangeBtn.width, 0, weakSelf.exchangeBtn.width, weakSelf.coinView.height);
weakSelf.coin = coin;
[weakSelf configBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
@@ -342,22 +349,49 @@ static NSInteger toSlowCount = 4;
subview.giftModel = model.gift_list[i]; subview.giftModel = model.gift_list[i];
} }
[weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)]; [weakSelf.oneBtn.giftCoin setTitle:[NSString stringWithFormat:@"%@币一次",model.box_price] forState:(UIControlStateNormal)];
[weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*10] forState:(UIControlStateNormal)]; [weakSelf.tenBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*6] forState:(UIControlStateNormal)];
[weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] forState:(UIControlStateNormal)]; [weakSelf.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*9] forState:(UIControlStateNormal)];
weakSelf.oneBtn.hidden = NO; weakSelf.oneBtn.hidden = NO;
weakSelf.tenBtn.hidden = NO; weakSelf.tenBtn.hidden = NO;
weakSelf.hundredBtn.hidden = NO; weakSelf.hundredBtn.hidden = NO;
[weakSelf configBtnStatus];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) { } fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}]; }];
} }
-(void)configBtnStatus{
if (self.coin > 0 && self.model.box_price.integerValue > 0) {
if (self.coin>self.model.box_price.integerValue) {
self.oneBtn.isDisable = NO;
}else{
self.oneBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*6)) {
self.tenBtn.isDisable = NO;
}else{
self.tenBtn.isDisable = YES;
}
if (self.coin>(self.model.box_price.integerValue*9)) {
self.hundredBtn.isDisable = NO;
}else{
self.hundredBtn.isDisable = YES;
}
}else{
self.oneBtn.isDisable = YES;
self.tenBtn.isDisable = YES;
self.hundredBtn.isDisable = YES;
}
}
-(void)setHeartId:(NSString *)heartId{
_heartId = heartId;
}
-(void)drawGiftWithNum:(NSString*)num{ -(void)drawGiftWithNum:(NSString*)num{
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag, @"gift_bag_id":self.giftModel.gift_bag,
@"gift_user_ids":self.userIds, @"gift_user_ids":self.userIds,
@"room_id":self.roomId, @"room_id":self.roomId,
@"num":num @"num":num,
@"heart_id":[self.heartId isExist]?self.heartId:@""
}; };
self.isDrawing = YES; self.isDrawing = YES;
MJWeakSelf MJWeakSelf
@@ -365,7 +399,7 @@ static NSInteger toSlowCount = 4;
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]]; QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.drawResultModel = model; weakSelf.drawResultModel = model;
[weakSelf.targetArrayIndex removeAllObjects]; [weakSelf.targetArrayIndex removeAllObjects];
// [weakSelf resetViews]; [weakSelf getMyWallet];
for (int i = 0; i < model.reslut_list.count; i++) { for (int i = 0; i < model.reslut_list.count; i++) {
QXDrawGiftModel *md = model.reslut_list[i]; QXDrawGiftModel *md = model.reslut_list[i];
for (int j = 0; j < weakSelf.model.gift_list.count; j++) { for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
@@ -425,6 +459,10 @@ static NSInteger toSlowCount = 4;
} }
} }
-(void)startAction:(QXTimeDrawBtn*)sender{ -(void)startAction:(QXTimeDrawBtn*)sender{
if (sender.isDisable) {
showToast(@"金币不足");
return;
}
if (self.isDrawing) { if (self.isDrawing) {
showToast(@"正在抽奖中"); showToast(@"正在抽奖中");
return; return;
@@ -823,6 +861,10 @@ static NSInteger toSlowCount = 4;
[self addSubview:self.giftCoin]; [self addSubview:self.giftCoin];
} }
-(void)setIsDisable:(BOOL)isDisable{
_isDisable = isDisable;
self.bgImageView.image = [UIImage imageNamed:isDisable?@"time_touch_dis_bg":@"time_touch_bg"];
}
-(void)setBtnType:(QXTimeDrawBtnType)btnType{ -(void)setBtnType:(QXTimeDrawBtnType)btnType{
// /// // ///
// QXTimeDrawBtnTypeOne = 0, // QXTimeDrawBtnTypeOne = 0,
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
break; break;
case QXTimeDrawBtnTypeTen: case QXTimeDrawBtnTypeTen:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
} }
break; break;
case QXTimeDrawBtnTypeHundred: case QXTimeDrawBtnTypeHundred:
{ {
self.titleLabel.text = @"抽次"; self.titleLabel.text = @"抽次";
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)]; [self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
} }
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@@ -271,7 +271,20 @@ static Class<TUIMessageDataProviderDataSource> gDataSourceClass = nil;
+ (TUIMessageCellData *)getUnsupportedCellData:(V2TIMMessage *)message { + (TUIMessageCellData *)getUnsupportedCellData:(V2TIMMessage *)message {
TUITextMessageCellData *cellData = [[TUITextMessageCellData alloc] initWithDirection:(message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming)]; TUITextMessageCellData *cellData = [[TUITextMessageCellData alloc] initWithDirection:(message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming)];
cellData.content = TIMCommonLocalizableString(TUIKitNotSupportThisMessage); if ([message.userID isEqualToString:@"@RBT#u88"]) {
V2TIMCustomElem *el = message.customElem;
NSError *error = nil;
// JSON
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:el.data options:kNilOptions error:&error];
NSArray *arr = dictionary[@"chunks"];
NSString*str = @"";
for (NSString*s in arr) {
str = [str stringByAppendingFormat:@"%@",s];
}
cellData.content = str;
}else{
cellData.content = TIMCommonLocalizableString(TUIKitNotSupportThisMessage);
}
cellData.reuseId = TTextMessageCell_ReuseId; cellData.reuseId = TTextMessageCell_ReuseId;
return cellData; return cellData;
} }

View File

@@ -645,19 +645,20 @@
switch (type) { switch (type) {
case TUIMessageBaseDataProviderDataSourceChangeTypeInsert: case TUIMessageBaseDataProviderDataSourceChangeTypeInsert:
[self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ] [self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone]; withRowAnimation:UITableViewRowAnimationNone];
break; break;
case TUIMessageBaseDataProviderDataSourceChangeTypeDelete: case TUIMessageBaseDataProviderDataSourceChangeTypeDelete:
[self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ] [self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone]; withRowAnimation:UITableViewRowAnimationNone];
break; break;
case TUIMessageBaseDataProviderDataSourceChangeTypeReload: case TUIMessageBaseDataProviderDataSourceChangeTypeReload:
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ] [self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone]; withRowAnimation:UITableViewRowAnimationNone];
break; break;
default: default:
break; break;
} }
} }
- (void)dataProviderDataSourceDidChange:(TUIMessageDataProvider *)dataProvider { - (void)dataProviderDataSourceDidChange:(TUIMessageDataProvider *)dataProvider {