修改完成
@@ -160,5 +160,53 @@
|
||||
landmarkType = "7">
|
||||
</BreakpointContent>
|
||||
</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>
|
||||
</Bucket>
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController;
|
||||
// navagationController.interactivePopGestureRecognizer.enabled = NO;
|
||||
if (_miniView) {
|
||||
@@ -233,6 +233,7 @@
|
||||
self.roomVC.isReJoin = isRejoin;
|
||||
self.roomId = roomId;
|
||||
self.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,19 +327,19 @@
|
||||
}
|
||||
}
|
||||
-(void)rtcEngine:(AgoraRtcEngineKit *)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason{
|
||||
NSDictionary *parm = @{
|
||||
@"user_id":[NSNumber numberWithInteger:uid],
|
||||
@"is_online":[NSNumber numberWithBool:NO],
|
||||
};
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
|
||||
// NSDictionary *parm = @{
|
||||
// @"user_id":[NSNumber numberWithInteger:uid],
|
||||
// @"is_online":[NSNumber numberWithBool:NO],
|
||||
// };
|
||||
// [[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
|
||||
}
|
||||
|
||||
-(void)rtcEngine:(AgoraRtcEngineKit *)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed{
|
||||
NSDictionary *parm = @{
|
||||
@"user_id":[NSNumber numberWithInteger:uid],
|
||||
@"is_online":[NSNumber numberWithBool:YES],
|
||||
};
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
|
||||
// NSDictionary *parm = @{
|
||||
// @"user_id":[NSNumber numberWithInteger:uid],
|
||||
// @"is_online":[NSNumber numberWithBool:YES],
|
||||
// };
|
||||
// [[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
|
||||
}
|
||||
/// 说话声音大小
|
||||
-(void)rtcEngine:(AgoraRtcEngineKit *)engine reportAudioVolumeIndicationOfSpeakers:(NSArray<AgoraRtcAudioVolumeInfo *> *)speakers totalVolume:(NSInteger)totalVolume{
|
||||
|
||||
@@ -119,6 +119,11 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXRoomMessageTypeMeetActivityProgressUpdate = 1056,
|
||||
/// 巡乐会盘抽奖结果更新
|
||||
QXRoomMessageTypeMeetActivityDrawGift = 1057,
|
||||
|
||||
/// 离线
|
||||
QXRoomMessageTypeRoomUserOnlineStatus = 1058,
|
||||
/// 清除个人魅力
|
||||
QXRoomMessageTypeRoomClearUserCharm = 1059,
|
||||
}QXRoomMessageType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXRoomMessageManagerDelegate <NSObject>
|
||||
@@ -244,14 +249,19 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)meetActivityProgressIsUpdate:(NSDictionary*)updateDict;
|
||||
/// 巡乐会礼物发生变化
|
||||
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel*)giftInfo;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString*)userId;
|
||||
/// 房间用户在线状态发生变化
|
||||
//-(void)roomUserOnlineStatusDidChanged:(BOOL)isOnline userId:(NSString*)userId;
|
||||
@end
|
||||
@interface QXRoomMessageManager : NSObject
|
||||
@property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate;
|
||||
|
||||
+(instancetype)shared;
|
||||
|
||||
/// 加入房间群组
|
||||
-(void)joinGroupWithRoomId:(NSString*)roomId;
|
||||
|
||||
/// 退出房间群组
|
||||
-(void)quitGroupWithRoomId:(NSString*)roomId;
|
||||
|
||||
-(void)sendChatMessage:(NSString *)message messageType:(QXRoomMessageType)messageType needInsertMessage:(BOOL)needInsertMessage;
|
||||
|
||||
@@ -508,11 +508,13 @@
|
||||
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];
|
||||
}
|
||||
if (model.step.intValue != 3) {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
|
||||
model.messageType = QXRoomChatMessageTypeSystem;
|
||||
[self.delegate didInsertMessge:model];
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QXRoomMessageTypeRoomFriendDelayTime:{
|
||||
NSString *end_time = [NSString stringWithFormat:@"%@",msg.Text[@"end_time"]];
|
||||
@@ -582,6 +584,30 @@
|
||||
}
|
||||
}
|
||||
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:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString *giftLabelId;
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
@property (nonatomic,strong)QXGiftModel *model;
|
||||
@property (nonatomic,copy)void(^selectetGiftBlock)(QXGiftModel *gift);
|
||||
@property (nonatomic,assign)QXSendGiftViewType type;
|
||||
|
||||
-(void)reloadData;
|
||||
@end
|
||||
|
||||
@interface QXSendGiftUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
|
||||
@@ -44,11 +44,13 @@
|
||||
@property (nonatomic,strong)UIView *sendBgView;
|
||||
@property (nonatomic,strong)UIButton *countBtn;
|
||||
@property (nonatomic,strong)UIButton *sendBtn;
|
||||
@property (nonatomic,strong)UIButton *sendAllBtn;
|
||||
|
||||
/// 被选中的礼物
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,strong)NSString *giftCount;
|
||||
|
||||
@property (nonatomic,strong)QXSendGiftCollectionView *bagGiftView;
|
||||
@end
|
||||
|
||||
@implementation QXSendGiftView
|
||||
@@ -86,6 +88,7 @@
|
||||
_type = type;
|
||||
switch (type) {
|
||||
case QXSendGiftViewTypeFind:{
|
||||
self.heartId = @"";
|
||||
if (_pitUserListView) {
|
||||
[_pitUserListView removeFromSuperview];
|
||||
_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);
|
||||
}
|
||||
break;
|
||||
case QXSendGiftViewTypeRoom:
|
||||
case QXSendGiftViewTypeAuction:
|
||||
case QXSendGiftViewTypeRoom:{
|
||||
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:{
|
||||
if (_userListView) {
|
||||
[_userListView removeFromSuperview];
|
||||
@@ -260,6 +297,22 @@
|
||||
make.right.top.bottom.equalTo(self.sendBgView);
|
||||
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{
|
||||
QXBaseWebViewController *vc = [[QXBaseWebViewController alloc] init];
|
||||
@@ -287,6 +340,23 @@
|
||||
self.rechargeBtn.hidden = !QXGlobal.shareGlobal.isOpenRecharge;
|
||||
[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{
|
||||
MJWeakSelf
|
||||
@@ -306,44 +376,62 @@
|
||||
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) {
|
||||
[weakSelf hide];
|
||||
if (type.intValue == 1) {
|
||||
if (weakSelf.roomSendSuccessBlock) {
|
||||
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,@"");
|
||||
}
|
||||
[weakSelf hide];
|
||||
}else{
|
||||
[weakSelf.bagGiftView reloadData];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else if (self.type == QXSendGiftViewTypeAuction) {
|
||||
if (self.giftModel==nil) {
|
||||
showToast(@"请选择礼物");
|
||||
return;
|
||||
}
|
||||
self.heartId = @"";
|
||||
/// 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) {
|
||||
[weakSelf hide];
|
||||
if (type.intValue == 1) {
|
||||
[weakSelf hide];
|
||||
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) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}else if (self.type == QXSendGiftViewTypeFriend) {
|
||||
if (self.giftModel==nil) {
|
||||
showToast(@"请选择礼物");
|
||||
return;
|
||||
}
|
||||
self.auctionId = @"";
|
||||
/// 2为背包
|
||||
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
|
||||
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) {
|
||||
[weakSelf hide];
|
||||
if (type.intValue == 1) {
|
||||
[weakSelf hide];
|
||||
if (weakSelf.roomSendSuccessBlock) {
|
||||
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,weakSelf.heartId);
|
||||
}
|
||||
}else{
|
||||
[weakSelf.bagGiftView reloadData];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else{
|
||||
if (self.giftModel==nil) {
|
||||
showToast(@"请选择礼物");
|
||||
return;
|
||||
}
|
||||
/// 2为背包
|
||||
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
|
||||
[QXDynamicNetwork dynamicGiveGiftWithId:self.dynamicId
|
||||
@@ -394,6 +482,7 @@
|
||||
}
|
||||
-(void)setPitUsers:(NSArray *)pitUsers{
|
||||
_pitUsers = pitUsers;
|
||||
self.giftModel = nil;
|
||||
self.pitUserListView.isSingle = NO;
|
||||
[self.pitUserListView.selectedArray removeAllObjects];
|
||||
self.pitUserListView.users = pitUsers;
|
||||
@@ -402,6 +491,7 @@
|
||||
-(void)setUserModel:(QXRoomPitModel *)userModel{
|
||||
_userModel = userModel;
|
||||
userModel.isSelected = YES;
|
||||
self.giftModel = nil;
|
||||
self.pitUserListView.isSingle = YES;
|
||||
[self.pitUserListView.selectedArray removeAllObjects];
|
||||
[self.pitUserListView.selectedArray addObject:userModel.user_id];
|
||||
@@ -459,6 +549,11 @@
|
||||
// }else{
|
||||
// self.funnyView.hidden = YES;
|
||||
// }
|
||||
if (index == 0) {
|
||||
self.sendAllBtn.hidden = NO;
|
||||
}else{
|
||||
self.sendAllBtn.hidden = YES;
|
||||
}
|
||||
}
|
||||
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
@@ -466,6 +561,9 @@
|
||||
|
||||
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXSendGiftCollectionView *subGiftView = [[QXSendGiftCollectionView alloc] initWithFrame:listContainerView.bounds];
|
||||
if (index == 0) {
|
||||
self.bagGiftView = subGiftView;
|
||||
}
|
||||
QXGiftLabelModel *md = self.titles[index];
|
||||
subGiftView.roomId = self.roomId;
|
||||
subGiftView.giftLabelId = md.id;
|
||||
@@ -576,6 +674,33 @@
|
||||
[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{
|
||||
_giftLabelId = giftLabelId;
|
||||
if ([giftLabelId isEqualToString:@"-10"]) {
|
||||
@@ -587,6 +712,7 @@
|
||||
-(void)getGiftListWithLabel:(NSString*)label{
|
||||
MJWeakSelf
|
||||
self.selectedIndex = -1;
|
||||
self.model = nil;
|
||||
[QXMineNetwork giftListWithLabel:label roomId:self.roomId successBlock:^(NSArray<QXGiftModel *> * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
@@ -597,6 +723,7 @@
|
||||
}
|
||||
-(void)getBagList{
|
||||
self.selectedIndex = -1;
|
||||
self.model = nil;
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getBagListSuccessBlock:^(NSArray * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
@@ -650,6 +777,7 @@
|
||||
return;
|
||||
}
|
||||
self.selectedIndex = indexPath.row;
|
||||
self.model = self.dataArray[indexPath.row];
|
||||
if (self.selectetGiftBlock) {
|
||||
self.selectetGiftBlock(model);
|
||||
}
|
||||
@@ -885,6 +1013,7 @@
|
||||
-(void)setUsers:(NSArray *)users{
|
||||
_users = users;
|
||||
// [self.selectedArray removeAllObjects];
|
||||
self.allBtn.selected = NO;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
|
||||
@@ -278,7 +278,6 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
|
||||
-(void)resetSubviews{
|
||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||
if (self.roomModel.room_info.type_id.intValue != 6) {
|
||||
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]];
|
||||
}else{
|
||||
@@ -774,6 +773,9 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)roomClearCharm{
|
||||
[self.seatContentView clearCharm];
|
||||
}
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
|
||||
[self.seatContentView roomClearUserCharmWithUserId:userId];
|
||||
}
|
||||
/// 收到礼物设置魅力
|
||||
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)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]) {
|
||||
[pitArr addObject:md];
|
||||
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];
|
||||
}
|
||||
}else{
|
||||
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];
|
||||
}
|
||||
}
|
||||
@@ -1224,8 +1226,11 @@ QXRoomUserInfoViewDelegate
|
||||
for (int i = 0; i < self.roomModel.room_info.pit_list.count;i++) {
|
||||
QXRoomPitModel *md = self.roomModel.room_info.pit_list[i];
|
||||
md.isSelected = NO;
|
||||
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[pitArr addObject:md];
|
||||
if ([self.roomModel.room_info.type_id isEqualToString:@"2"]) {
|
||||
/// 拍卖房主持位和拍卖为可能为同一个人
|
||||
if ([md.user_id isEqualToString:self.roomModel.room_auction.auction_user.user_id]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (md.pit_number.intValue == 9) {
|
||||
compereModel = md;
|
||||
@@ -1234,6 +1239,9 @@ QXRoomUserInfoViewDelegate
|
||||
guestModel = md;
|
||||
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];
|
||||
MJWeakSelf
|
||||
_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.continuousView.giftModel = giftModel;
|
||||
weakSelf.continuousView.sendType = sendType;
|
||||
weakSelf.continuousView.userId = userId;
|
||||
@@ -1624,18 +1632,21 @@ QXRoomUserInfoViewDelegate
|
||||
weakSelf.skyView.giftModel = gift;
|
||||
weakSelf.skyView.roomId = weakSelf.roomId;
|
||||
weakSelf.skyView.userIds = userIds;
|
||||
weakSelf.skyView.heartId = weakSelf.sendGiftView.heartId;
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.skyView showInView:weakSelf.view];
|
||||
}else if(gift.gift_bag.intValue == 11) {
|
||||
weakSelf.ageView.giftModel = gift;
|
||||
weakSelf.ageView.roomId = weakSelf.roomId;
|
||||
weakSelf.ageView.userIds = userIds;
|
||||
weakSelf.ageView.heartId = weakSelf.sendGiftView.heartId;
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.ageView showInView:weakSelf.view];
|
||||
}else if(gift.gift_bag.intValue == 12) {
|
||||
weakSelf.timeView.giftModel = gift;
|
||||
weakSelf.timeView.roomId = weakSelf.roomId;
|
||||
weakSelf.timeView.userIds = userIds;
|
||||
weakSelf.timeView.heartId = weakSelf.sendGiftView.heartId;
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.timeView showInView:weakSelf.view];
|
||||
}
|
||||
|
||||
22
QXLive/HomePage(声播)/Model/QXRoomUserCharmModel.h
Normal 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
|
||||
12
QXLive/HomePage(声播)/Model/QXRoomUserCharmModel.m
Normal file
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// QXRoomUserCharmModel.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/9/8.
|
||||
//
|
||||
|
||||
#import "QXRoomUserCharmModel.h"
|
||||
|
||||
@implementation QXRoomUserCharmModel
|
||||
|
||||
@end
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
@property (nonatomic,strong) QXRoomOnlineUserListView *onlineListView;
|
||||
@property (nonatomic,strong) QXRoomNoticeView *noticeView;
|
||||
@property (nonatomic,strong)QXRoomRankView *rankView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -292,7 +293,9 @@
|
||||
}
|
||||
-(void)previewUserInfoWithUserId:(NSString *)userId{
|
||||
[self.onlineListView hide];
|
||||
[self.rankView hide];
|
||||
_onlineListView = nil;
|
||||
_rankView = nil;
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
||||
[self.delegate previewUserInfoWithUserId:userId];
|
||||
}
|
||||
@@ -322,7 +325,13 @@
|
||||
return _noticeView;
|
||||
}
|
||||
|
||||
|
||||
-(QXRoomRankView *)rankView{
|
||||
if (!_rankView) {
|
||||
_rankView = [[QXRoomRankView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
_rankView.delegate = self;
|
||||
}
|
||||
return _rankView;
|
||||
}
|
||||
-(void)noticeAction{
|
||||
// self.noticeView.roomNotice = @"本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传,禁止引战,地域黑,语言攻击等本房间严禁刷屏,禁止非法广告及宣传。";
|
||||
self.noticeView.roomNotice = self.roomModel.room_info.room_intro;
|
||||
@@ -332,9 +341,8 @@
|
||||
}
|
||||
|
||||
-(void)rankAction{
|
||||
QXRoomRankView *rankView = [[QXRoomRankView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
rankView.roomId = self.roomId;
|
||||
[rankView showInView:self.viewController.view];
|
||||
self.rankView.roomId = self.roomId;
|
||||
[self.rankView showInView:self.viewController.view];
|
||||
}
|
||||
|
||||
-(void)followAction:(UIButton*)sender{
|
||||
|
||||
34
QXLive/HomePage(声播)/View/房间/QXRoomUserCharmView.h
Normal 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
|
||||
232
QXLive/HomePage(声播)/View/房间/QXRoomUserCharmView.m
Normal 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
|
||||
@@ -8,11 +8,13 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXRoomModel.h"
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomRankSubView : UIView<JXCategoryListContentViewDelegate>
|
||||
@property (nonatomic,strong)NSString*roomId;
|
||||
@property (nonatomic,strong)NSString*type;
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
@end
|
||||
|
||||
|
||||
@@ -28,5 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,assign)NSInteger number;
|
||||
|
||||
@property (nonatomic,strong)QXRoomOnlineList*md;
|
||||
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#import "QXBlackListCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXRoomRankSubView()<UITableViewDataSource,UITableViewDelegate>
|
||||
@interface QXRoomRankSubView()<UITableViewDataSource,UITableViewDelegate,QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)UIView *topBgView;
|
||||
@property (nonatomic,strong)UIButton *hourBtn;
|
||||
@property (nonatomic,strong)UIButton *dayBtn;
|
||||
@@ -110,15 +110,18 @@
|
||||
|
||||
self.secondView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(18, 50, itemWidth, 135)];
|
||||
self.secondView.number = 2;
|
||||
self.secondView.delegate = self;
|
||||
[self.tableHeaderView addSubview:self.secondView];
|
||||
|
||||
|
||||
self.firstView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.secondView.right, 0, itemWidth, 161)];
|
||||
self.firstView.number = 1;
|
||||
self.firstView.delegate = self;
|
||||
[self.tableHeaderView addSubview:self.firstView];
|
||||
|
||||
self.thirdView = [[QXRoomRankTopThreeView alloc] initWithFrame:CGRectMake(self.firstView.right, 50, itemWidth, 135)];
|
||||
self.thirdView.number = 3;
|
||||
self.thirdView.delegate = self;
|
||||
[self.tableHeaderView addSubview:self.thirdView];
|
||||
[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{
|
||||
self.selectedBtn.selected = !self.selectedBtn.selected;
|
||||
@@ -218,7 +226,12 @@
|
||||
cell.rankModel = self.dataArray[indexPath.row];
|
||||
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{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
@@ -331,6 +344,14 @@
|
||||
[self.headerImageView addRoundedCornersWithRadius:32];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[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) {
|
||||
make.centerX.equalTo(self);
|
||||
make.top.equalTo(self).offset(10);
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomRankView : UIView
|
||||
@property (nonatomic,strong)NSString*roomId;
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -9,11 +9,13 @@
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXRoomRankSubView.h"
|
||||
|
||||
@interface QXRoomRankView()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate,UIGestureRecognizerDelegate>
|
||||
@interface QXRoomRankView()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate,UIGestureRecognizerDelegate,QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)QXRoomRankSubView *moneyView;
|
||||
@property (nonatomic,strong)QXRoomRankSubView *charmView;
|
||||
@end
|
||||
@implementation QXRoomRankView
|
||||
|
||||
@@ -70,7 +72,11 @@
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
|
||||
-(void)setRoomId:(NSString *)roomId{
|
||||
_roomId = roomId;
|
||||
self.charmView.roomId = roomId;
|
||||
self.moneyView.roomId = roomId;
|
||||
}
|
||||
-(void)showInView:(UIView *)view{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
[view addSubview:self];
|
||||
@@ -85,7 +91,11 @@
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)previewUserInfoWithUserId:(NSString *)userId{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
|
||||
[self.delegate previewUserInfoWithUserId:userId];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return 2;
|
||||
@@ -94,10 +104,13 @@
|
||||
|
||||
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXRoomRankSubView *vc = [[QXRoomRankSubView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height-ScaleWidth(144)-44)];
|
||||
vc.delegate = self;
|
||||
if (index == 0) {
|
||||
vc.type = @"1";
|
||||
self.moneyView = vc;
|
||||
}else{
|
||||
vc.type = @"2";
|
||||
self.charmView = vc;
|
||||
}
|
||||
vc.roomId = self.roomId;
|
||||
return vc;
|
||||
|
||||
@@ -15,7 +15,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 拉黑
|
||||
QXRoomUserInfoViewEventTypeBlack = 2,
|
||||
/// 举报
|
||||
QXRoomUserInfoViewEventTypeReport ,
|
||||
QXRoomUserInfoViewEventTypeReport = 3,
|
||||
/// 清除魅力
|
||||
QXRoomUserInfoViewEventTypeClearCharm = 4 ,
|
||||
/// @TA
|
||||
QXRoomUserInfoViewEventTypeAtTA = 301,
|
||||
/// 聊天
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
@property (nonatomic,strong)UIButton *blackBtn;
|
||||
/// 跟随
|
||||
@property (nonatomic,strong)UIButton *followBtn;
|
||||
/// 清除魅力
|
||||
@property (nonatomic,strong)UIButton *clearBtn;
|
||||
/// 更多
|
||||
@property (nonatomic,strong)UIButton *moreBtn;
|
||||
/// iconbgView
|
||||
@@ -173,6 +175,25 @@
|
||||
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 setImage:[UIImage imageNamed:@"room_up_notice_icon"] forState:(UIControlStateNormal)];
|
||||
[self.remindBtn setTitle:QXText(@"转币") forState:(UIControlStateNormal)];
|
||||
@@ -186,12 +207,14 @@
|
||||
[self.bgView addSubview:self.remindBtn];
|
||||
[self.remindBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(22);
|
||||
make.top.mas_equalTo(ScaleWidth(24)+26);
|
||||
make.centerY.equalTo(self.guildLabel);
|
||||
make.height.mas_equalTo(ScaleWidth(20));
|
||||
make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
self.followBtn = [[UIButton alloc] init];
|
||||
self.followBtn.hidden = YES;
|
||||
[self.followBtn setImage:[UIImage imageNamed:@"room_user_follow"] forState:(UIControlStateNormal)];
|
||||
@@ -199,7 +222,7 @@
|
||||
[self.bgView addSubview:self.followBtn];
|
||||
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
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.width.mas_equalTo(ScaleWidth(70));
|
||||
}];
|
||||
@@ -215,7 +238,7 @@
|
||||
[self.bgView addSubview:self.upSeatBtn];
|
||||
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-ScaleWidth(64));
|
||||
make.centerY.equalTo(self.remindBtn);
|
||||
make.centerY.equalTo(self.clearBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(24));
|
||||
make.width.mas_equalTo(ScaleWidth(44));
|
||||
}];
|
||||
@@ -243,7 +266,7 @@
|
||||
[self.bgView addSubview:self.reportBtn];
|
||||
[self.reportBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-ScaleWidth(64));
|
||||
make.centerY.equalTo(self.remindBtn);
|
||||
make.centerY.equalTo(self.upSeatBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(24));
|
||||
make.width.mas_equalTo(ScaleWidth(44));
|
||||
}];
|
||||
@@ -259,7 +282,7 @@
|
||||
[self.bgView addSubview:self.blackBtn];
|
||||
[self.blackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-16);
|
||||
make.centerY.equalTo(self.remindBtn);
|
||||
make.centerY.equalTo(self.upSeatBtn);
|
||||
make.height.mas_equalTo(ScaleWidth(24));
|
||||
make.width.mas_equalTo(ScaleWidth(44));
|
||||
}];
|
||||
@@ -404,6 +427,14 @@
|
||||
}
|
||||
[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{
|
||||
// MJWeakSelf
|
||||
// [QXMineNetwork roomUserRelationWithUserId:self.userId successBlock:^(QXRelationshipList * list) {
|
||||
@@ -454,15 +485,18 @@
|
||||
self.upSeatBtn.hidden = NO;
|
||||
self.reportBtn.hidden = YES;
|
||||
self.blackBtn.hidden = YES;
|
||||
self.clearBtn.hidden = NO;
|
||||
}else if (self.isManager){
|
||||
self.moreBtn.hidden = NO;
|
||||
self.reportBtn.hidden = YES;
|
||||
self.blackBtn.hidden = YES;
|
||||
self.clearBtn.hidden = NO;
|
||||
}else if (self.isOwner){
|
||||
self.moreBtn.hidden = NO;
|
||||
self.upSeatBtn.hidden = NO;
|
||||
self.reportBtn.hidden = YES;
|
||||
self.blackBtn.hidden = YES;
|
||||
self.clearBtn.hidden = NO;
|
||||
}else{
|
||||
// 其他人查看其他人 隐藏更多按钮
|
||||
self.moreBtn.hidden = YES;
|
||||
@@ -479,6 +513,7 @@
|
||||
self.upSeatBtn.hidden = YES;
|
||||
self.bottomView.hidden = NO;
|
||||
}
|
||||
self.clearBtn.hidden = YES;
|
||||
}
|
||||
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
/// 主持自己查看自己 隐藏更多按钮 隐藏底部@TA....
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomModel.h"
|
||||
#import "QXSongListModel.h"
|
||||
#import "QXRoomSeatDelegate.h"
|
||||
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
/// 名称名称在下显示魅力
|
||||
QXRoomSeatContentViewTypeNormal = 0,
|
||||
@@ -32,6 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong) NSString* numberString;
|
||||
|
||||
@property (nonatomic,assign) BOOL isPK;
|
||||
|
||||
@property (nonatomic,weak)id<QXRoomSeatDelegate>delegate;
|
||||
/// 麦位视图类型
|
||||
@property (nonatomic,assign)QXRoomSeatContentViewType type;
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
@property (nonatomic,strong) QXEffectSvgaView *micSvgaView;
|
||||
@property (nonatomic,strong) VAPView *micMp4View;
|
||||
|
||||
@property (nonatomic,strong)UIButton *headerBtn;
|
||||
@end
|
||||
|
||||
@implementation QXRoomSeatContentView
|
||||
@@ -143,7 +145,13 @@
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
MJWeakSelf
|
||||
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 addRoundedCornersWithRadius:ScaleWidth(7.5)];
|
||||
self.charmBgView.hidden = YES;
|
||||
@@ -174,8 +182,20 @@
|
||||
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{
|
||||
NSDictionary *parm = notice.object;
|
||||
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
|
||||
@@ -198,6 +218,7 @@
|
||||
}
|
||||
if ((info.uid == self.pitModel.user_id.longLongValue)) {
|
||||
if (info.volume > 0) {
|
||||
self.offlineImageView.hidden = YES;
|
||||
[self startAudioAnimation];
|
||||
}else{
|
||||
[self stopAudioAnimation];
|
||||
|
||||
@@ -7,12 +7,16 @@
|
||||
|
||||
|
||||
#import "QXRoomModel.h"
|
||||
|
||||
//#import "QXRoomSeatContentView.h"
|
||||
@class QXRoomSeatContentView;
|
||||
@protocol QXRoomSeatDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
//-(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)didHugSeatWithPitNumber:(NSString*)pitNumber;
|
||||
@@ -30,4 +34,7 @@
|
||||
/// 助力
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString*)heartId;
|
||||
|
||||
/// 查看房间内用户魅力
|
||||
-(void)previewRoomUserCharmListWithUserId:(NSString *)userId;
|
||||
|
||||
@end
|
||||
|
||||
@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置麦位锁麦状态
|
||||
|
||||
@@ -297,6 +297,9 @@
|
||||
-(void)clearCharm{
|
||||
[self.leftSeatView clearCharm];
|
||||
}
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
|
||||
[self.leftSeatView roomClearUserCharmWithUserId:userId];
|
||||
}
|
||||
-(void)setSeatIsLock:(NSString *)isLock pitNumber:(NSString *)pitNumber{
|
||||
[self.leftSeatView setSeatIsLock:isLock pitNumber:pitNumber];
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 房间内用户信息发生变化
|
||||
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#import "QXAlertView.h"
|
||||
#import "QXRoomAuctionRankView.h"
|
||||
|
||||
@interface QXRoomSeatTypeAuctionView()
|
||||
@interface QXRoomSeatTypeAuctionView()<QXRoomSeatDelegate>
|
||||
|
||||
@property (nonatomic,strong)UIButton *delayBtn;
|
||||
@property (nonatomic,strong)UIButton *endBtn;
|
||||
@@ -155,6 +155,7 @@
|
||||
self.compereView = [[QXRoomSeatContentView alloc] init];
|
||||
[self.bgView addSubview:self.compereView];
|
||||
self.compereView.tagString = @"主持";
|
||||
self.compereView.number = 9;
|
||||
// self.compereView.isAutionSeat = YES;
|
||||
// self.compereView.type = QXRoomSeatContentViewTypeAuction;
|
||||
[self.compereView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -162,19 +163,7 @@
|
||||
make.left.mas_equalTo(10);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(50), ScaleWidth(50)+5+18));
|
||||
}];
|
||||
[self.compereView addTapBlock:^(id _Nonnull obj) {
|
||||
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);
|
||||
}];
|
||||
}
|
||||
}];
|
||||
self.compereView.delegate = self;
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -239,20 +228,7 @@
|
||||
|
||||
self.auctionView = [[QXRoomSeatContentView alloc] init];
|
||||
[self.auctionBgView addSubview:self.auctionView];
|
||||
[self.auctionView addTapBlock:^(id _Nonnull obj) {
|
||||
|
||||
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.delegate = self;
|
||||
self.auctionView.isAutionSeat = YES;
|
||||
self.auctionView.numberString = @"拍卖位";
|
||||
[self.auctionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -263,6 +239,14 @@
|
||||
//
|
||||
self.auctionCharmView = [[UIView alloc] init];
|
||||
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.auctionCharmView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(73);
|
||||
@@ -348,13 +332,15 @@
|
||||
self.firstSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_first_bg"];
|
||||
self.firstSeatView.rankView.image = [UIImage imageNamed:@"room_auction_first"];
|
||||
self.firstSeatView.seatView.numberString = @"一号麦";
|
||||
[self.firstSeatView.seatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.firstSeatView.seatView.pitModel.user_id.intValue>0) {
|
||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.firstSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
|
||||
[self.firstSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.firstSeatView.seatView.pitModel.user_id.intValue<=0) {
|
||||
return;
|
||||
}
|
||||
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.firstSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
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.rankView.image = [UIImage imageNamed:@"room_auction_second"];
|
||||
self.secondSeatView.seatView.numberString = @"二号麦";
|
||||
[self.secondSeatView.seatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.secondSeatView.seatView.pitModel.user_id.intValue>0) {
|
||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.secondSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
|
||||
[self.secondSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.secondSeatView.seatView.pitModel.user_id.intValue<=0) {
|
||||
return;
|
||||
}
|
||||
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.secondSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.firstSeatView);
|
||||
@@ -386,13 +374,15 @@
|
||||
self.thirdSeatView.bgImageView.image = [UIImage imageNamed:@"room_auction_third_bg"];
|
||||
self.thirdSeatView.rankView.image = [UIImage imageNamed:@"room_auction_third"];
|
||||
self.thirdSeatView.seatView.numberString = @"三号麦";
|
||||
[self.thirdSeatView.seatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.thirdSeatView.seatView.pitModel.user_id.intValue>0) {
|
||||
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[weakSelf.delegate didClickUserHeaderWithPitModel:weakSelf.thirdSeatView.seatView.pitModel userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:YES];
|
||||
[self.thirdSeatView.auctionCharmView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.thirdSeatView.seatView.pitModel.user_id.intValue<=0) {
|
||||
return;
|
||||
}
|
||||
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.thirdSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.firstSeatView);
|
||||
@@ -405,13 +395,14 @@
|
||||
[self.bgView addSubview:self.forthSeatView];
|
||||
// self.forthSeatView.isAutionSeat = YES;
|
||||
self.forthSeatView.numberString = @"4";
|
||||
[self.forthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.forthSeatView.pitModel.user_id.intValue>0) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
}];
|
||||
// [self.forthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
// if (weakSelf.forthSeatView.pitModel.user_id.intValue>0) {
|
||||
// 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];
|
||||
// }
|
||||
// }
|
||||
// }];
|
||||
self.forthSeatView.delegate = self;
|
||||
[self.forthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.thirdSeatView);
|
||||
make.width.mas_equalTo(ScaleWidth(42));
|
||||
@@ -423,13 +414,14 @@
|
||||
[self.bgView addSubview:self.fifthSeatView];
|
||||
// self.fifthSeatView.isAutionSeat = YES;
|
||||
self.fifthSeatView.numberString = @"5";
|
||||
[self.fifthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.fifthSeatView.pitModel.user_id.intValue>0) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
}];
|
||||
// [self.fifthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
// if (weakSelf.fifthSeatView.pitModel.user_id.intValue>0) {
|
||||
// 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];
|
||||
// }
|
||||
// }
|
||||
// }];
|
||||
self.fifthSeatView.delegate = self;
|
||||
[self.fifthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.forthSeatView.mas_right).offset(5);
|
||||
make.width.mas_equalTo(ScaleWidth(42));
|
||||
@@ -441,13 +433,14 @@
|
||||
[self.bgView addSubview:self.sixthSeatView];
|
||||
// self.sixthSeatView.isAutionSeat = YES;
|
||||
self.sixthSeatView.numberString = @"6";
|
||||
[self.sixthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.sixthSeatView.pitModel.user_id.intValue>0) {
|
||||
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];
|
||||
}
|
||||
}
|
||||
}];
|
||||
// [self.sixthSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
// if (weakSelf.sixthSeatView.pitModel.user_id.intValue>0) {
|
||||
// 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];
|
||||
// }
|
||||
// }
|
||||
// }];
|
||||
self.sixthSeatView.delegate = self;
|
||||
[self.sixthSeatView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.fifthSeatView.mas_right).offset(5);
|
||||
make.width.mas_equalTo(ScaleWidth(42));
|
||||
@@ -571,7 +564,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.myPitNumber = roomModel.user_info.pit_number;
|
||||
self.myPitNumber = roomModel.user_info.pit_number.integerValue;
|
||||
if (self.roomModel.room_auction.auction_user) {
|
||||
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
|
||||
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{
|
||||
QXRoomSeatContentView *contentView;
|
||||
if (pit_number == 9) {
|
||||
@@ -853,12 +884,48 @@
|
||||
QXRoomPitModel*model1 = self.compereView.pitModel;
|
||||
model1.charm = @"0";
|
||||
self.compereView.pitModel = model1;
|
||||
[self.compereView hideCharm];
|
||||
|
||||
QXRoomPitModel*model2 = self.auctionView.pitModel;
|
||||
model2.charm = @"0";
|
||||
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{
|
||||
[self reSetPitList];
|
||||
self.roomModel.room_auction.auction_list = list;
|
||||
|
||||
@@ -343,6 +343,9 @@
|
||||
}
|
||||
na.viewControllers = viewControllers;
|
||||
[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 = @"";
|
||||
}else{
|
||||
[[QXGlobal shareGlobal]quitRoomWithRoomId:self.roomModel.room_info.room_id];
|
||||
|
||||
@@ -45,6 +45,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
|
||||
/// 用户信息发生改变
|
||||
|
||||
@@ -101,9 +101,7 @@
|
||||
|
||||
|
||||
self.compereView = [[QXRoomSeatContentView alloc] init];
|
||||
[self.compereView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
self.compereView.delegate = self;
|
||||
self.compereView.tagString = QXText(@"主持");
|
||||
self.compereView.number = 9;
|
||||
[self addSubview:self.compereView];
|
||||
@@ -119,9 +117,7 @@
|
||||
self.guestView = [[QXRoomSeatContentView alloc] init];
|
||||
self.guestView.tagString = QXText(@"嘉宾");
|
||||
self.guestView.number = 10;
|
||||
[self.guestView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
self.guestView.delegate = self;
|
||||
[self addSubview:self.guestView];
|
||||
[self.guestView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self);
|
||||
@@ -493,24 +489,12 @@
|
||||
make.edges.equalTo(self.heartBottomLineImageView);
|
||||
}];
|
||||
|
||||
[self.leftSeatView1.contentView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
[self.leftSeatView2.contentView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
[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.leftSeatView1.contentView.delegate = self;
|
||||
self.leftSeatView2.contentView.delegate = self;
|
||||
self.leftSeatView3.contentView.delegate = self;
|
||||
self.rightSeatView1.contentView.delegate = self;
|
||||
self.rightSeatView2.contentView.delegate = self;
|
||||
self.rightSeatView3.contentView.delegate = self;
|
||||
|
||||
|
||||
[self.allSeatViewArray replaceObjectAtIndex:8 withObject:self.compereView];
|
||||
@@ -529,6 +513,7 @@
|
||||
self.heartTopImageView.hidden = YES;
|
||||
self.heartCenterImageView.hidden = YES;
|
||||
self.heartBottomImageView.hidden = YES;
|
||||
[self bringSubviewToFront:self.tenSecondLabel];
|
||||
}
|
||||
#pragma mark - QXRoomSeatDelegate
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{
|
||||
@@ -536,6 +521,11 @@
|
||||
[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{
|
||||
_roomModel = roomModel;
|
||||
@@ -889,7 +879,7 @@
|
||||
fromSeatView.pitModel = totModel;
|
||||
}
|
||||
}
|
||||
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
|
||||
|
||||
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
|
||||
QXLOG(@"点击了%ld麦位",seatView.number);
|
||||
@@ -1050,6 +1040,7 @@
|
||||
if (step.intValue == 1) {
|
||||
self.roomModel.friend_info.heart_list = @[];
|
||||
self.tenSecondLabel.hidden = YES;
|
||||
[self.cpView removeFromSuperview];
|
||||
}
|
||||
self.roomModel.friend_info.step = [NSString stringWithFormat:@"%@",step];
|
||||
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{
|
||||
for (id object in self.allSeatViewArray) {
|
||||
if ([object isKindOfClass:[QXRoomSeatContentView class]]) {
|
||||
|
||||
@@ -28,6 +28,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number;
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
/// 设置麦位锁麦状态
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#import "QXRoomSeatSettingView.h"
|
||||
|
||||
static NSInteger maxSeat = 8;
|
||||
@interface QXRoomSeatTypeNormalView()
|
||||
@interface QXRoomSeatTypeNormalView()<QXRoomSeatDelegate>
|
||||
/// 主持
|
||||
@property (nonatomic,strong)QXRoomSeatContentView *compereView;
|
||||
/// 嘉宾
|
||||
@@ -35,9 +35,10 @@ static NSInteger maxSeat = 8;
|
||||
-(void)initSubviews{
|
||||
MJWeakSelf
|
||||
self.compereView = [[QXRoomSeatContentView alloc] init];
|
||||
[self.compereView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
// [self.compereView addTapBlock:^(id _Nonnull obj) {
|
||||
// [weakSelf didClickSeatView:obj];
|
||||
// }];
|
||||
self.compereView.delegate = self;
|
||||
self.compereView.tagString = QXText(@"主持");
|
||||
self.compereView.number = 9;
|
||||
[self addSubview:self.compereView];
|
||||
@@ -53,9 +54,10 @@ static NSInteger maxSeat = 8;
|
||||
self.guestView = [[QXRoomSeatContentView alloc] init];
|
||||
self.guestView.tagString = QXText(@"嘉宾");
|
||||
self.guestView.number = 10;
|
||||
[self.guestView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
// [self.guestView addTapBlock:^(id _Nonnull obj) {
|
||||
// [weakSelf didClickSeatView:obj];
|
||||
// }];
|
||||
self.guestView.delegate = self;
|
||||
[self addSubview:self.guestView];
|
||||
[self.guestView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self);
|
||||
@@ -72,9 +74,10 @@ static NSInteger maxSeat = 8;
|
||||
for (int i = 0 ; i < maxSeat ; i++) {
|
||||
QXRoomSeatContentView *contentView = [[QXRoomSeatContentView alloc] init];
|
||||
contentView.number = i+1;
|
||||
[contentView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
// [contentView addTapBlock:^(id _Nonnull obj) {
|
||||
// [weakSelf didClickSeatView:obj];
|
||||
// }];
|
||||
contentView.delegate = self;
|
||||
[self addSubview:contentView];
|
||||
[contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
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{
|
||||
[self.viewController.view endEditing:YES];
|
||||
}
|
||||
|
||||
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{
|
||||
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
|
||||
NSString *pit_number = [NSString stringWithFormat:@"%ld",seatView.number] ;
|
||||
QXLOG(@"点击了%ld麦位",seatView.number);
|
||||
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{
|
||||
if (pit_number > 10) {
|
||||
@@ -316,11 +322,25 @@ static NSInteger maxSeat = 8;
|
||||
QXRoomPitModel *model = seatView.pitModel;
|
||||
model.charm = @"0";
|
||||
seatView.pitModel = model;
|
||||
if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||
[seatView hideCharm];
|
||||
// if (self.isPKMyRoom || self.isPKOtherRoom) {
|
||||
// [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{
|
||||
for (QXRoomSeatContentView *seatView in self.seatArray) {
|
||||
QXRoomPitModel *md = seatView.pitModel;
|
||||
|
||||
@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel *)model;
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
|
||||
@import AgoraLyricsScore;
|
||||
@interface QXRoomSeatTypeSongView()<KaraokeDelegate
|
||||
,UICollectionViewDelegate,UICollectionViewDataSource
|
||||
,UICollectionViewDelegate,UICollectionViewDataSource,
|
||||
QXRoomSeatDelegate
|
||||
>
|
||||
/// 左侧背景
|
||||
@property (nonatomic,strong)UIView *leftBgView;
|
||||
@@ -177,9 +178,7 @@
|
||||
MJWeakSelf
|
||||
self.singerSeatView = [[QXRoomSeatContentView alloc] init];
|
||||
self.singerSeatView.tagString = QXText(@"演唱者");
|
||||
[self.singerSeatView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
self.singerSeatView.delegate = self;
|
||||
[self.leftBgView addSubview:self.singerSeatView];
|
||||
|
||||
[self.leftBgView addSubview:self.originalBtn];
|
||||
@@ -193,9 +192,7 @@
|
||||
|
||||
|
||||
self.compereView = [[QXRoomSeatContentView alloc] init];
|
||||
[self.compereView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
self.compereView.delegate = self;
|
||||
self.compereView.tagString = QXText(@"主持");
|
||||
self.compereView.number = 9;
|
||||
[self addSubview:self.compereView];
|
||||
@@ -204,9 +201,7 @@
|
||||
self.guestView = [[QXRoomSeatContentView alloc] init];
|
||||
self.guestView.tagString = QXText(@"嘉宾");
|
||||
self.guestView.number = 10;
|
||||
[self.guestView addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf didClickSeatView:obj];
|
||||
}];
|
||||
self.guestView.delegate = self;
|
||||
[self addSubview:self.guestView];
|
||||
|
||||
|
||||
@@ -230,7 +225,7 @@
|
||||
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
|
||||
[self.viewController.view endEditing:YES];
|
||||
}
|
||||
-(void)didClickSeatView:(QXRoomSeatContentView*)seatView{
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel seatView:(QXRoomSeatContentView *)seatView{
|
||||
|
||||
NSString *pit_number = [NSString stringWithFormat:@"%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{
|
||||
// if (pit_number==9999) {
|
||||
// for (<#type *object#> in <#collection#>) {
|
||||
@@ -502,7 +502,33 @@
|
||||
}
|
||||
[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{
|
||||
QXRoomPitModel *singerModel = self.singerSeatView.pitModel;
|
||||
if ([singerModel.user_id isEqualToString:model.user_id]) {
|
||||
@@ -577,18 +603,19 @@
|
||||
QXSongSeatCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSongSeatCell" forIndexPath:indexPath];
|
||||
QXRoomPitModel *model = self.dataArray[indexPath.row];
|
||||
cell.seatContentView.pitModel = model;
|
||||
cell.seatContentView.delegate = self;
|
||||
return cell;
|
||||
}
|
||||
-(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.roomId = self.roomModel.room_info.room_id;
|
||||
//// self.userInfoView.pitNumber = [NSString stringWithFormat:@"%ld",seatView.number];
|
||||
// self.userInfoView.userId = model.user_id;
|
||||
// [self.userInfoView showInView:self.viewController.view];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[self.delegate didClickUserHeaderWithPitModel:model userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
|
||||
}
|
||||
// if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
// [self.delegate didClickUserHeaderWithPitModel:model userModel:nil isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
|
||||
// }
|
||||
}
|
||||
|
||||
-(void)nextAction{
|
||||
|
||||
@@ -49,6 +49,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
|
||||
/// 清除魅力
|
||||
-(void)clearCharm;
|
||||
/// 清除个人魅力
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId;
|
||||
/// 设置魅力
|
||||
-(void)setSeatCharmWithUser:(QXUserHomeModel*)model;
|
||||
/// 设置麦位锁麦状态
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#import "QXRoomSeatTypeCabinView.h"
|
||||
#import "QXRoomSeatPKView.h"
|
||||
#import "QXRoomSeatTypeFrientView.h"
|
||||
#import "QXRoomUserCharmView.h"
|
||||
|
||||
@interface QXRoomSeatView()<QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)QXRoomSeatTypeNormalView *normalSeatView;
|
||||
@@ -27,6 +28,8 @@
|
||||
@property (nonatomic,strong)QXRoomSeatPKView *roomPkView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomSeatTypeFrientView *roomFriendView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomUserCharmView *charmListView;
|
||||
@end
|
||||
|
||||
|
||||
@@ -627,6 +630,7 @@
|
||||
return;
|
||||
}
|
||||
if (_songView) {
|
||||
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
_songView.transform = CGAffineTransformIdentity;
|
||||
// 弹性动画
|
||||
[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{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickUserHeaderWithPitModel:userModel:isPkRoom:pkRoomId:isNoTakeOff:)]) {
|
||||
[self.delegate didClickUserHeaderWithPitModel:pitModel userModel:userModel isPkRoom:isPkRoom pkRoomId:pkRoomId isNoTakeOff:isNoTakeOff];
|
||||
@@ -850,6 +860,7 @@
|
||||
[self.songView clearCharm];
|
||||
break;
|
||||
case QXRoomSeatViewTypeAuction:
|
||||
[self.auctionView clearCharm];
|
||||
break;
|
||||
case QXRoomSeatViewTypeCabin:
|
||||
break;
|
||||
@@ -863,6 +874,30 @@
|
||||
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{
|
||||
switch (self.type) {
|
||||
@@ -1227,4 +1262,12 @@
|
||||
}
|
||||
return _roomFriendView;
|
||||
}
|
||||
|
||||
-(QXRoomUserCharmView *)charmListView{
|
||||
if (!_charmListView) {
|
||||
_charmListView = [[QXRoomUserCharmView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
||||
_charmListView.delegate = self;
|
||||
}
|
||||
return _charmListView;
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -61,23 +61,24 @@
|
||||
}
|
||||
|
||||
-(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"]];
|
||||
if (dress.length > 0 && ([dress hasPrefix:@"http"] || [dress hasPrefix:@"https"])) {
|
||||
if ([dress isExist]) {
|
||||
if ([dress hasSuffix:@"svga"]) {
|
||||
if (dressUrl.length > 0 && ([dressUrl hasPrefix:@"http"] || [dressUrl hasPrefix:@"https"])) {
|
||||
if ([dressUrl isExist]) {
|
||||
if ([dressUrl hasSuffix:@"svga"]) {
|
||||
[self.svgaView setHidden:NO];
|
||||
[self.mp4View stopHWDMP4];
|
||||
[self.mp4View setHidden:YES];
|
||||
[self.svgaView destroySvga];
|
||||
[self.svgaView loadSVGAPlayerWith:dress inBundle:NO loop:INTMAX_MAX];
|
||||
}else if ([dress hasSuffix:@"mp4"]){
|
||||
[self.svgaView loadSVGAPlayerWith:dressUrl inBundle:NO loop:INTMAX_MAX];
|
||||
}else if ([dressUrl hasSuffix:@"mp4"]){
|
||||
[self.svgaView setHidden:YES];
|
||||
[self.mp4View setHidden:NO];
|
||||
[self.mp4View stopHWDMP4];
|
||||
MJWeakSelf
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:dress completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
NSString *videoPath = [QXFileManager getGiftVideoPath:dress.lastPathComponent];
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:dressUrl completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
NSString *videoPath = [QXFileManager getGiftVideoPath:dressUrl.lastPathComponent];
|
||||
[weakSelf.mp4View playHWDMP4:videoPath repeatCount:INTMAX_MAX delegate:self];
|
||||
}];
|
||||
}else{
|
||||
|
||||
@@ -203,11 +203,14 @@
|
||||
[[QXRequset shareInstance] downloadVideoPlayerWithUrl:giftModel.play_image completion:^(BOOL result, NSString * _Nonnull fileName) {
|
||||
NSString *videoPath = [QXFileManager getGiftVideoPath:fileName];
|
||||
weakSelf.playerMp4View.hidden = NO;
|
||||
weakSelf.effectView.hidden = YES;
|
||||
[weakSelf.playerMp4View playHWDMP4:videoPath delegate:self];
|
||||
}];
|
||||
}else if ([giftModel.play_image hasSuffix:@"svg"] || [giftModel.play_image hasSuffix:@"svga"]) {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[[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];
|
||||
[weakSelf.effectView loadSVGAPlayerWith:filePath];
|
||||
}];
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXHelpViewController.h"
|
||||
#import "QXInviteViewController.h"
|
||||
#import "QXChatViewController.h"
|
||||
|
||||
@interface QXMineViewController ()<UITableViewDelegate,UITableViewDataSource,QXMineServiceCellDelegate,QXMainHeaderViewDelegate>
|
||||
@property (nonatomic,strong)QXMainHeaderView *tableHeaderView;
|
||||
@@ -207,6 +208,14 @@
|
||||
-(void)gotoService{
|
||||
QXHelpViewController *webvc = [[QXHelpViewController alloc] init];
|
||||
[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];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ static void *WKWebBrowserContext = &WKWebBrowserContext;
|
||||
//自定义配置,一般用于 js调用oc方法(OC拦截URL中的数据做自定义操作)
|
||||
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
|
||||
// 是否支持记忆读取
|
||||
configuration.suppressesIncrementalRendering = YES;
|
||||
configuration.suppressesIncrementalRendering = NO;
|
||||
// 允许用户更改网页的设置
|
||||
[UserContentController addScriptMessageHandler:self name:@"login"];
|
||||
[UserContentController addScriptMessageHandler:self name:@"nativeHandler"];
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#import "QXRechargeListModel.h"
|
||||
#import "QXPayTypeModel.h"
|
||||
#import "QXDayTaskModel.h"
|
||||
#import "QXRoomUserCharmModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -1014,6 +1015,26 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(void)friendRoomQuitWithRoomid:(NSString*)room_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
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
|
||||
|
||||
|
||||
|
||||
@@ -1999,4 +1999,38 @@
|
||||
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
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
self.titleLabel.text = model.remarks;
|
||||
self.timeLabel.text = model.time;
|
||||
[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 {
|
||||
[super awakeFromNib];
|
||||
|
||||
@@ -71,6 +71,18 @@
|
||||
NSString *clientId = [OpenUDID value];
|
||||
[[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{
|
||||
MJWeakSelf
|
||||
|
||||
22
QXLive/Other/Assets.xcassets/home/room/room_user_charm_icon.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
BIN
QXLive/Other/Assets.xcassets/home/room/room_user_charm_icon.imageset/room_user_charm_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
QXLive/Other/Assets.xcassets/home/room/room_user_charm_icon.imageset/room_user_charm_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
@@ -430,4 +430,8 @@ static NSString * QXRoomFriendDelay = @"api/Friend/delay";
|
||||
static NSString * QXRoomFriendCreateRelation = @"api/Friend/create_relation";
|
||||
/// 退出私密房间
|
||||
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 */
|
||||
|
||||
@@ -32,9 +32,13 @@
|
||||
|
||||
-(void)initSubviews{
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"ac_meet_start_pop_bg"]];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleToFill;
|
||||
[self addSubview:self.bgImageView];
|
||||
[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];
|
||||
@@ -68,7 +72,7 @@
|
||||
[QXMeetActivityDriftView shareView].model = [QXMeetActivityDriftView shareView].dataArray.firstObject;
|
||||
[KEYWINDOW addSubview:[QXMeetActivityDriftView shareView]];
|
||||
[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) {
|
||||
[weakSelf performSelector:@selector(dissmissAnimate) afterDelay:5];
|
||||
}];
|
||||
|
||||
@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 抽一次
|
||||
QXSkyDrawBtnTypeOne = 1,
|
||||
/// 抽10次
|
||||
QXSkyDrawBtnTypeTen = 10,
|
||||
QXSkyDrawBtnTypeTen = 6,
|
||||
/// 抽100次
|
||||
QXSkyDrawBtnTypeHundred = 100,
|
||||
QXSkyDrawBtnTypeHundred = 9,
|
||||
}QXSkyDrawBtnType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,strong)QXGiftActivityModel *model;
|
||||
@property (nonatomic,strong)NSString* userIds;
|
||||
@property (nonatomic,strong)NSString* heartId;
|
||||
@property (nonatomic,copy)void(^startBlock)(void);
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *giftCoin;
|
||||
@property (nonatomic,assign)BOOL isDisable;
|
||||
@property (nonatomic,assign)QXSkyDrawBtnType btnType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ static NSInteger toSlowCount = 4;
|
||||
@property (nonatomic,strong)QXSkyPraizeRecordView *recordView;
|
||||
|
||||
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
|
||||
|
||||
@property (nonatomic,assign)double coin;
|
||||
@end
|
||||
|
||||
@implementation QXSkyPraizeView
|
||||
@@ -183,6 +185,7 @@ static NSInteger toSlowCount = 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))];
|
||||
oneBtn.btnType = QXSkyDrawBtnTypeOne;
|
||||
oneBtn.isDisable = YES;
|
||||
self.oneBtn = oneBtn;
|
||||
self.oneBtn.hidden = YES;
|
||||
[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))];
|
||||
tenBtn.btnType = QXSkyDrawBtnTypeTen;
|
||||
tenBtn.isDisable = YES;
|
||||
self.tenBtn = tenBtn;
|
||||
self.tenBtn.hidden = YES;
|
||||
[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))];
|
||||
hundredBtn.btnType = QXSkyDrawBtnTypeHundred;
|
||||
hundredBtn.isDisable = YES;
|
||||
self.hundredBtn = hundredBtn;
|
||||
self.hundredBtn.hidden = YES;
|
||||
[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.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.coin = coin;
|
||||
[weakSelf conifgBtnStatus];
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
|
||||
}];
|
||||
@@ -309,22 +316,50 @@ static NSInteger toSlowCount = 4;
|
||||
subview.giftModel = model.gift_list[i];
|
||||
}
|
||||
[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.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] 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*9] forState:(UIControlStateNormal)];
|
||||
weakSelf.oneBtn.hidden = NO;
|
||||
weakSelf.tenBtn.hidden = NO;
|
||||
weakSelf.hundredBtn.hidden = NO;
|
||||
[weakSelf conifgBtnStatus];
|
||||
} 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{
|
||||
|
||||
NSDictionary *parameters = @{
|
||||
@"gift_bag_id":self.giftModel.gift_bag,
|
||||
@"gift_user_ids":self.userIds,
|
||||
@"room_id":self.roomId,
|
||||
@"num":num
|
||||
@"num":num,
|
||||
@"heart_id":[self.heartId isExist]?self.heartId:@""
|
||||
};
|
||||
self.isDrawing = YES;
|
||||
MJWeakSelf
|
||||
@@ -332,7 +367,7 @@ static NSInteger toSlowCount = 4;
|
||||
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
weakSelf.drawResultModel = model;
|
||||
[weakSelf.targetArrayIndex removeAllObjects];
|
||||
// [weakSelf resetViews];
|
||||
[weakSelf getMyWallet];
|
||||
for (int i = 0; i < model.reslut_list.count; i++) {
|
||||
QXDrawGiftModel *md = model.reslut_list[i];
|
||||
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
|
||||
@@ -392,6 +427,10 @@ static NSInteger toSlowCount = 4;
|
||||
}
|
||||
}
|
||||
-(void)startAction:(QXSkyDrawBtn*)sender{
|
||||
if (sender.isDisable) {
|
||||
showToast(@"金币不足");
|
||||
return;
|
||||
}
|
||||
if (self.isDrawing) {
|
||||
showToast(@"正在抽奖中");
|
||||
return;
|
||||
@@ -790,6 +829,10 @@ static NSInteger toSlowCount = 4;
|
||||
[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{
|
||||
// /// 抽一次
|
||||
// QXSkyDrawBtnTypeOne = 0,
|
||||
@@ -807,13 +850,13 @@ static NSInteger toSlowCount = 4;
|
||||
break;
|
||||
case QXSkyDrawBtnTypeTen:
|
||||
{
|
||||
self.titleLabel.text = @"抽十次";
|
||||
self.titleLabel.text = @"抽六次";
|
||||
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
case QXSkyDrawBtnTypeHundred:
|
||||
{
|
||||
self.titleLabel.text = @"抽百次";
|
||||
self.titleLabel.text = @"抽九次";
|
||||
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
|
||||
BIN
QXLive/活动/天空之境/Resource/sky_touch_dis_bg@2x.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
QXLive/活动/天空之境/Resource/sky_touch_dis_bg@3x.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 抽一次
|
||||
QXAgeDrawBtnTypeOne = 1,
|
||||
/// 抽10次
|
||||
QXAgeDrawBtnTypeTen = 10,
|
||||
QXAgeDrawBtnTypeTen = 6,
|
||||
/// 抽100次
|
||||
QXAgeDrawBtnTypeHundred = 100,
|
||||
QXAgeDrawBtnTypeHundred = 9,
|
||||
}QXAgeDrawBtnType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,strong)QXGiftActivityModel *model;
|
||||
@property (nonatomic,strong)NSString* userIds;
|
||||
@property (nonatomic,strong)NSString* heartId;
|
||||
@property (nonatomic,copy)void(^startBlock)(void);
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *giftCoin;
|
||||
@property (nonatomic,assign)BOOL isDisable;
|
||||
@property (nonatomic,assign)QXAgeDrawBtnType btnType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
|
||||
@property (nonatomic,strong)QXAgePraizeRecordView *recordView;
|
||||
|
||||
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
|
||||
|
||||
@property (nonatomic,assign)double coin;
|
||||
@end
|
||||
|
||||
@implementation QXAgePraizeView
|
||||
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 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))];
|
||||
oneBtn.btnType = QXAgeDrawBtnTypeOne;
|
||||
oneBtn.isDisable = YES;
|
||||
self.oneBtn = oneBtn;
|
||||
self.oneBtn.hidden = YES;
|
||||
[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))];
|
||||
tenBtn.btnType = QXAgeDrawBtnTypeTen;
|
||||
tenBtn.isDisable = YES;
|
||||
self.tenBtn = tenBtn;
|
||||
self.tenBtn.hidden = YES;
|
||||
[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))];
|
||||
hundredBtn.btnType = QXAgeDrawBtnTypeHundred;
|
||||
hundredBtn.isDisable = YES;
|
||||
self.hundredBtn = hundredBtn;
|
||||
self.hundredBtn.hidden = YES;
|
||||
[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.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.coin = coin;
|
||||
[weakSelf configBtnStatus];
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
|
||||
}];
|
||||
@@ -342,22 +349,49 @@ static NSInteger toSlowCount = 4;
|
||||
subview.giftModel = model.gift_list[i];
|
||||
}
|
||||
[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.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] 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*9] forState:(UIControlStateNormal)];
|
||||
weakSelf.oneBtn.hidden = NO;
|
||||
weakSelf.tenBtn.hidden = NO;
|
||||
weakSelf.hundredBtn.hidden = NO;
|
||||
[weakSelf configBtnStatus];
|
||||
} 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{
|
||||
NSDictionary *parameters = @{
|
||||
@"gift_bag_id":self.giftModel.gift_bag,
|
||||
@"gift_user_ids":self.userIds,
|
||||
@"room_id":self.roomId,
|
||||
@"num":num
|
||||
@"num":num,
|
||||
@"heart_id":[self.heartId isExist]?self.heartId:@""
|
||||
};
|
||||
self.isDrawing = YES;
|
||||
MJWeakSelf
|
||||
@@ -365,7 +399,7 @@ static NSInteger toSlowCount = 4;
|
||||
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
weakSelf.drawResultModel = model;
|
||||
[weakSelf.targetArrayIndex removeAllObjects];
|
||||
// [weakSelf resetViews];
|
||||
[weakSelf getMyWallet];
|
||||
for (int i = 0; i < model.reslut_list.count; i++) {
|
||||
QXDrawGiftModel *md = model.reslut_list[i];
|
||||
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
|
||||
@@ -425,6 +459,10 @@ static NSInteger toSlowCount = 4;
|
||||
}
|
||||
}
|
||||
-(void)startAction:(QXAgeDrawBtn*)sender{
|
||||
if (sender.isDisable) {
|
||||
showToast(@"金币不足");
|
||||
return;
|
||||
}
|
||||
if (self.isDrawing) {
|
||||
showToast(@"正在抽奖中");
|
||||
return;
|
||||
@@ -823,6 +861,10 @@ static NSInteger toSlowCount = 4;
|
||||
[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{
|
||||
// /// 抽一次
|
||||
// QXAgeDrawBtnTypeOne = 0,
|
||||
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
|
||||
break;
|
||||
case QXAgeDrawBtnTypeTen:
|
||||
{
|
||||
self.titleLabel.text = @"抽十次";
|
||||
self.titleLabel.text = @"抽六次";
|
||||
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
case QXAgeDrawBtnTypeHundred:
|
||||
{
|
||||
self.titleLabel.text = @"抽百次";
|
||||
self.titleLabel.text = @"抽九次";
|
||||
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
|
||||
BIN
QXLive/活动/岁月之城/Resource/age_touch_dis_bg@2x.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
QXLive/活动/岁月之城/Resource/age_touch_dis_bg@3x.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
@@ -42,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *giftCoin;
|
||||
@property (nonatomic,assign)BOOL isDisable;
|
||||
@property (nonatomic,assign)QXSkyDrawBtnType btnType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#import "QXMeetActivityResultView.h"
|
||||
|
||||
#import "QXMeetLotteryView.h"
|
||||
#import "QXDiamondViewController.h"
|
||||
@interface QXMeetActivityView()<UIGestureRecognizerDelegate,QXMeetLotteryViewDelegate>
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@@ -77,6 +78,8 @@
|
||||
|
||||
|
||||
@property (nonatomic,strong)QXMeetActivityResultView *resultView;
|
||||
|
||||
@property (nonatomic,assign)double coin;
|
||||
@end
|
||||
@implementation QXMeetActivityView
|
||||
|
||||
@@ -258,7 +261,8 @@
|
||||
[self.exchangeBtn setTitle:@"去兑换" forState:(UIControlStateNormal)];
|
||||
[self.exchangeBtn setTitleColor:RGB16(0xF8E837) forState:(UIControlStateNormal)];
|
||||
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];
|
||||
|
||||
|
||||
@@ -283,6 +287,10 @@
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
-(void)exchangeAction{
|
||||
QXDiamondViewController *vc = [[QXDiamondViewController alloc] init];
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)getMyWallet{
|
||||
MJWeakSelf
|
||||
[[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.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.coin = coin;
|
||||
[weakSelf configBtnStatus];
|
||||
} 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{
|
||||
if (self.isDrawing) {
|
||||
showToast(@"正在抽奖中");
|
||||
@@ -328,14 +361,14 @@
|
||||
MJWeakSelf
|
||||
[[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 getMyWallet];
|
||||
if (weakSelf.jumpAnimateBtn.selected) {
|
||||
weakSelf.resultView.resultArray = weakSelf.resultArray;
|
||||
[weakSelf.resultView showInView:weakSelf];
|
||||
weakSelf.isDrawing = NO;
|
||||
}else{
|
||||
NSInteger index = 0;
|
||||
for (int i = 0; i < weakSelf.resultArray.count; i++) {
|
||||
QXDrawGiftModel *md1 = weakSelf.resultArray[i];
|
||||
QXDrawGiftModel *md1 = weakSelf.resultArray.firstObject;
|
||||
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
|
||||
QXDrawGiftModel *md2 = weakSelf.model.gift_list[j];
|
||||
if ([md1.gift_id isEqualToString:md2.gift_id]) {
|
||||
@@ -343,7 +376,6 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.cycleScrollView.finalPrizeIndex = index;
|
||||
[weakSelf.cycleScrollView startLotteryAnimation];
|
||||
}
|
||||
@@ -396,6 +428,7 @@
|
||||
self.oneBtn.hidden = NO;
|
||||
self.tenBtn.hidden = NO;
|
||||
self.hundredBtn.hidden = NO;
|
||||
[self configBtnStatus];
|
||||
|
||||
if (self.model.xlh_user) {
|
||||
[self.userHeader sd_setImageWithURL:[NSURL URLWithString:self.model.xlh_user.avatar]];
|
||||
@@ -693,6 +726,10 @@
|
||||
[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{
|
||||
// /// 抽一次
|
||||
// QXSkyDrawBtnTypeOne = 0,
|
||||
|
||||
BIN
QXLive/活动/巡乐会/Resource/meet_touch_dis_bg@2x.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
QXLive/活动/巡乐会/Resource/meet_touch_dis_bg@3x.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
@@ -11,9 +11,9 @@ typedef NS_ENUM(NSInteger) {
|
||||
/// 抽一次
|
||||
QXTimeDrawBtnTypeOne = 1,
|
||||
/// 抽10次
|
||||
QXTimeDrawBtnTypeTen = 10,
|
||||
QXTimeDrawBtnTypeTen = 6,
|
||||
/// 抽100次
|
||||
QXTimeDrawBtnTypeHundred = 100,
|
||||
QXTimeDrawBtnTypeHundred = 9,
|
||||
}QXTimeDrawBtnType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,strong)QXGiftActivityModel *model;
|
||||
@property (nonatomic,strong)NSString* userIds;
|
||||
@property (nonatomic,strong)NSString* heartId;
|
||||
@property (nonatomic,copy)void(^startBlock)(void);
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@@ -54,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *giftCoin;
|
||||
@property (nonatomic,assign)BOOL isDisable;
|
||||
@property (nonatomic,assign)QXTimeDrawBtnType btnType;
|
||||
@end
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ static NSInteger toSlowCount = 4;
|
||||
@property (nonatomic,strong)QXTimePraizeRecordView *recordView;
|
||||
|
||||
@property (nonatomic,strong)QXDrawGiftCenterView * centerView;
|
||||
|
||||
@property (nonatomic,assign)double coin;
|
||||
@end
|
||||
|
||||
@implementation QXTimePraizeView
|
||||
@@ -215,6 +217,7 @@ static NSInteger toSlowCount = 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))];
|
||||
oneBtn.btnType = QXTimeDrawBtnTypeOne;
|
||||
oneBtn.isDisable = YES;
|
||||
self.oneBtn = oneBtn;
|
||||
self.oneBtn.hidden = YES;
|
||||
[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))];
|
||||
tenBtn.btnType = QXTimeDrawBtnTypeTen;
|
||||
tenBtn.isDisable = YES;
|
||||
self.tenBtn = tenBtn;
|
||||
self.tenBtn.hidden = YES;
|
||||
[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))];
|
||||
hundredBtn.btnType = QXTimeDrawBtnTypeHundred;
|
||||
hundredBtn.isDisable = YES;
|
||||
self.hundredBtn = hundredBtn;
|
||||
self.hundredBtn.hidden = YES;
|
||||
[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.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.coin = coin;
|
||||
[weakSelf configBtnStatus];
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
|
||||
}];
|
||||
@@ -342,22 +349,49 @@ static NSInteger toSlowCount = 4;
|
||||
subview.giftModel = model.gift_list[i];
|
||||
}
|
||||
[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.hundredBtn.giftCoin setTitle:[NSString stringWithFormat:@"%ld币一次",model.box_price.integerValue*100] 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*9] forState:(UIControlStateNormal)];
|
||||
weakSelf.oneBtn.hidden = NO;
|
||||
weakSelf.tenBtn.hidden = NO;
|
||||
weakSelf.hundredBtn.hidden = NO;
|
||||
[weakSelf configBtnStatus];
|
||||
} 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{
|
||||
NSDictionary *parameters = @{
|
||||
@"gift_bag_id":self.giftModel.gift_bag,
|
||||
@"gift_user_ids":self.userIds,
|
||||
@"room_id":self.roomId,
|
||||
@"num":num
|
||||
@"num":num,
|
||||
@"heart_id":[self.heartId isExist]?self.heartId:@""
|
||||
};
|
||||
self.isDrawing = YES;
|
||||
MJWeakSelf
|
||||
@@ -365,7 +399,7 @@ static NSInteger toSlowCount = 4;
|
||||
QXDrawGiftResultModel *model = [QXDrawGiftResultModel yy_modelWithJSON:responseObject[@"data"]];
|
||||
weakSelf.drawResultModel = model;
|
||||
[weakSelf.targetArrayIndex removeAllObjects];
|
||||
// [weakSelf resetViews];
|
||||
[weakSelf getMyWallet];
|
||||
for (int i = 0; i < model.reslut_list.count; i++) {
|
||||
QXDrawGiftModel *md = model.reslut_list[i];
|
||||
for (int j = 0; j < weakSelf.model.gift_list.count; j++) {
|
||||
@@ -425,6 +459,10 @@ static NSInteger toSlowCount = 4;
|
||||
}
|
||||
}
|
||||
-(void)startAction:(QXTimeDrawBtn*)sender{
|
||||
if (sender.isDisable) {
|
||||
showToast(@"金币不足");
|
||||
return;
|
||||
}
|
||||
if (self.isDrawing) {
|
||||
showToast(@"正在抽奖中");
|
||||
return;
|
||||
@@ -823,6 +861,10 @@ static NSInteger toSlowCount = 4;
|
||||
[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{
|
||||
// /// 抽一次
|
||||
// QXTimeDrawBtnTypeOne = 0,
|
||||
@@ -840,13 +882,13 @@ static NSInteger toSlowCount = 4;
|
||||
break;
|
||||
case QXTimeDrawBtnTypeTen:
|
||||
{
|
||||
self.titleLabel.text = @"抽十次";
|
||||
self.titleLabel.text = @"抽六次";
|
||||
[self.giftCoin setTitle:@"100币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
case QXTimeDrawBtnTypeHundred:
|
||||
{
|
||||
self.titleLabel.text = @"抽百次";
|
||||
self.titleLabel.text = @"抽九次";
|
||||
[self.giftCoin setTitle:@"1000币一次" forState:(UIControlStateNormal)];
|
||||
}
|
||||
break;
|
||||
|
||||
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@2x.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
QXLive/活动/时空之巅/Resource/time_touch_dis_bg@3x.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
@@ -271,7 +271,20 @@ static Class<TUIMessageDataProviderDataSource> gDataSourceClass = nil;
|
||||
|
||||
+ (TUIMessageCellData *)getUnsupportedCellData:(V2TIMMessage *)message {
|
||||
TUITextMessageCellData *cellData = [[TUITextMessageCellData alloc] initWithDirection:(message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming)];
|
||||
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;
|
||||
return cellData;
|
||||
}
|
||||
|
||||
@@ -645,19 +645,20 @@
|
||||
switch (type) {
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeInsert:
|
||||
[self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeDelete:
|
||||
[self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeReload:
|
||||
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)dataProviderDataSourceDidChange:(TUIMessageDataProvider *)dataProvider {
|
||||
|
||||