Files
featherVoice/QXLive/Room(房间)/View/用户信息/QXRoomUserInfoView.m

1048 lines
47 KiB
Mathematica
Raw Normal View History

2025-08-08 10:49:36 +08:00
//
// QXRoomUserInfoView.m
// QXLive
//
// Created by on 2025/6/10.
//
#import "QXRoomUserInfoView.h"
#import "UIButton+QX.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
#import "QXMineNetwork.h"
#import "QXMenuPopView.h"
#import "QXDynamicNetwork.h"
#import "QXUserInfoGiftWallView.h"
#import "QXReportViewController.h"
#import "QXUserHomePageViewController.h"
#import "QXUserInfoRelationTableCell.h"
#import "QXUserInfoRelationCardCell.h"
#import "QXDirectSetScaleView.h"
2025-11-11 17:19:21 +08:00
#import "QXSeatHeaderView.h"
2025-11-21 16:17:05 +08:00
#import "CKShimmerLabel.h"
#import "QXUserHomeHeaderView.h"
#import "QXGiftWallViewController.h"
#import "QXUserCpCardView.h"
#import "QXUserCpDressView.h"
#import "QXHeartBeatSpaceViewController.h"
2025-08-08 10:49:36 +08:00
2025-11-28 22:43:06 +08:00
@interface QXRoomUserInfoView()<UIGestureRecognizerDelegate,SDCycleScrollViewDelegate,QXMenuPopViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,QXUserCpCardViewDelegate>
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
///
2025-11-11 17:19:21 +08:00
@property (nonatomic,strong)QXSeatHeaderView *headerImageView;
2025-12-01 18:42:49 +08:00
///
@property (nonatomic,strong)UIView *masterView;
///
@property (nonatomic,strong)QXSeatHeaderView *masterHeaderView;
///
@property (nonatomic,strong)UIImageView *masterViewIcon;
///
@property (nonatomic,strong)UIButton *masterViewButton;
2025-08-08 10:49:36 +08:00
///
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong)CKShimmerLabel *nameLabel;
@property (nonatomic,strong)UIImageView *sexImageView;
2025-08-08 10:49:36 +08:00
/// ID
@property (nonatomic,strong)UILabel *idLabel;
2025-11-21 16:17:05 +08:00
///
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong)UILabel *guildLabel;
2025-11-21 16:17:05 +08:00
///
@property (nonatomic,strong)UIButton *joinGuildBtn;
///
@property (nonatomic,strong)UIButton *focusBtn;
2025-08-08 10:49:36 +08:00
///
@property (nonatomic,strong)UIButton *upSeatBtn;
///
@property (nonatomic,strong)UIButton *reportBtn;
///
@property (nonatomic,strong)UIButton *blackBtn;
///
@property (nonatomic,strong)UIButton *followBtn;
2025-10-20 09:43:10 +08:00
///
@property (nonatomic,strong)UIButton *clearBtn;
2025-08-08 10:49:36 +08:00
///
@property (nonatomic,strong)UIButton *moreBtn;
/// iconbgView
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong)UICollectionView *collectionView;
2025-08-08 10:49:36 +08:00
///
@property (nonatomic,strong)UILabel *introduceLabel;
///
@property (nonatomic,strong)UILabel *giftTitleLabel;
///
@property (nonatomic,strong)UIButton *moreGiftBtn;
///
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong)QXUserCpCardView *cpContentView;
2025-08-08 10:49:36 +08:00
///
@property (nonatomic,strong)UIView *bottomView;
@property (nonatomic,strong)NSArray *toolsArray;
@property (nonatomic,strong)QXMenuPopView *popView;
@property (nonatomic,strong) QXRoomUserInfoModel *userModel;
@property (nonatomic,strong) QXUserInfoGiftWallView *giftWallView;
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong) QXUserCpDressView *cpDressView;
2025-08-08 10:49:36 +08:00
@end
@implementation QXRoomUserInfoView
- (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];
2025-11-21 16:17:05 +08:00
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, kSafeAreaBottom+ScaleWidth(462))];
2025-08-08 10:49:36 +08:00
// self.bgView.backgroundColor = [UIColor whiteColor];
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithFrame:self.bgView.bounds];
2025-11-21 16:17:05 +08:00
self.bgImageView.image = [UIImage imageNamed:@"room_user_n_bg"];
2025-08-08 10:49:36 +08:00
[self.bgView addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.top.mas_equalTo(0);
2025-08-08 10:49:36 +08:00
make.left.right.bottom.equalTo(self.bgView);
}];
2025-11-21 16:17:05 +08:00
self.cpDressView = [[QXUserCpDressView alloc] initWithFrame:CGRectMake(self.width-ScaleWidth(20)-ScaleWidth(145), ScaleWidth(20), ScaleWidth(145), ScaleWidth(240))];
self.cpDressView.hidden = YES;
[self.bgView addSubview:self.cpDressView];
2025-11-11 17:19:21 +08:00
self.headerImageView = [[QXSeatHeaderView alloc] init];
2025-08-08 10:49:36 +08:00
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.bgView addSubview:self.headerImageView];
2025-11-11 17:19:21 +08:00
// [self.headerImageView addRoundedCornersWithRadius:ScaleWidth(33)];
2025-08-08 10:49:36 +08:00
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.top.mas_equalTo(38);
make.left.mas_equalTo(21);
2025-11-11 17:19:21 +08:00
make.size.mas_equalTo(CGSizeMake(ScaleWidth(66), ScaleWidth(79)));
2025-08-08 10:49:36 +08:00
}];
2025-12-01 18:42:49 +08:00
self.masterView = [[UIView alloc] init];
self.masterView.hidden = YES;
[self.bgView addSubview:self.masterView];
[self.masterView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.headerImageView);
make.left.equalTo(self.headerImageView.mas_right);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(45), ScaleWidth(45+16)));
}];
self.masterHeaderView = [[QXSeatHeaderView alloc] init];
self.masterHeaderView.contentMode = UIViewContentModeScaleAspectFill;
[self.masterView addSubview:self.masterHeaderView];
//
[self.masterHeaderView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.masterView);
make.height.equalTo(self.masterHeaderView.mas_width);
}];
self.masterViewIcon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_info_master_icon"]];
[self.masterView insertSubview:self.masterViewIcon aboveSubview:self.masterHeaderView];
[self.masterViewIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.masterHeaderView.mas_bottom).offset(-8);
make.centerX.equalTo(self.masterView);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(30), ScaleWidth(16)));
}];
self.masterViewButton = [[UIButton alloc] init];
[self.masterViewButton addTarget:self action:@selector(toMasterUserHome) forControlEvents:(UIControlEventTouchUpInside)];
[self.masterView addSubview:self.masterViewButton];
[self.masterViewButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.masterView);
}];
2025-08-08 10:49:36 +08:00
UIButton *headder = [[UIButton alloc] init];
2025-12-01 18:42:49 +08:00
[headder addTarget:self action:@selector(toUserHome) forControlEvents:(UIControlEventTouchUpInside)];
2025-08-08 10:49:36 +08:00
[self.bgView addSubview:headder];
[headder mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.left.right.top.equalTo(self.headerImageView);
}];
2025-11-21 16:17:05 +08:00
// self.nameBtn = [[UIButton alloc] init];
// self.nameBtn.titleLabel.font = [UIFont systemFontOfSize:14];
// self.nameBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
// [self.nameBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
// [self.bgView addSubview:self.nameBtn];
// [self.nameBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(self.headerImageView.mas_bottom).offset(2);
// make.height.mas_equalTo(18);
// make.centerX.equalTo(self.headerImageView);
// }];
self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(32, ScaleWidth(79)+2, 100, 18)];
self.nameLabel.shimmerWidth = 20;
self.nameLabel.shimmerRadius = 20;
self.nameLabel.durationTime = 1;
self.nameLabel.repeat = YES;
self.nameLabel.textColor = QXConfig.themeColor;
self.nameLabel.font = [UIFont boldSystemFontOfSize:18];
self.nameLabel.text = @"羽声语音";
self.nameLabel.contentLabel.textAlignment = NSTextAlignmentCenter;
[self.bgView addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2025-08-08 10:49:36 +08:00
make.top.equalTo(self.headerImageView.mas_bottom).offset(2);
make.height.mas_equalTo(18);
2025-11-21 16:17:05 +08:00
make.left.equalTo(self.headerImageView);
make.width.mas_equalTo(100);
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
self.focusBtn = [[UIButton alloc] init];
self.focusBtn.titleLabel.font = [UIFont systemFontOfSize:14];
// self.focusBtn.backgroundColor = RGB16A(0xffffff, 0.2);
[self.focusBtn addRoundedCornersWithRadius:12];
self.focusBtn.tag = 400;
[self.focusBtn addTarget:self action:@selector(btnEventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.focusBtn setTitle:@"+ 关注" forState:(UIControlStateNormal)];
[self.focusBtn setTitle:@"已关注" forState:(UIControlStateSelected)];
[self.focusBtn setBackgroundImage:[UIImage imageWithColor:QXConfig.themeColor] forState:(UIControlStateNormal)];
[self.focusBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x999999)] forState:(UIControlStateSelected)];
[self.focusBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.focusBtn setTitleColor:RGB16(0xe3e3e3) forState:(UIControlStateSelected)];
[self.bgView addSubview:self.focusBtn];
[self.focusBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.headerImageView).offset(-15);
make.height.mas_equalTo(24);
make.left.equalTo(self.headerImageView.mas_right).offset(10);
make.width.mas_equalTo(50);
}];
// self.sexImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 17, 17)];
// [self.bgView addSubview:self.sexImageView];
2025-08-08 10:49:36 +08:00
self.idLabel = [[UILabel alloc] init];
self.idLabel.font = [UIFont systemFontOfSize:12];
self.idLabel.textColor = [UIColor whiteColor];
[self.bgView addSubview:self.idLabel];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.nameLabel.mas_bottom).offset(5);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(16);
2025-11-21 16:17:05 +08:00
make.left.equalTo(self.headerImageView);
make.width.mas_lessThanOrEqualTo(ScaleWidth(180));
2025-08-08 10:49:36 +08:00
}];
self.guildLabel = [[UILabel alloc] init];
self.guildLabel.font = [UIFont systemFontOfSize:12];
self.guildLabel.textColor = [UIColor whiteColor];
[self.bgView addSubview:self.guildLabel];
[self.guildLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.idLabel.mas_bottom).offset(5);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(16);
2025-11-21 16:17:05 +08:00
make.left.equalTo(self.headerImageView);
make.width.mas_lessThanOrEqualTo(ScaleWidth(180));
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
self.joinGuildBtn = [[UIButton alloc] init];
[self.joinGuildBtn setTitle:@"立即加入" forState:(UIControlStateNormal)];
self.joinGuildBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.joinGuildBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
[self.joinGuildBtn addTarget:self action:@selector(btnEventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.joinGuildBtn];
[self.joinGuildBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.guildLabel.mas_right);
make.centerY.equalTo(self.guildLabel);
make.height.mas_equalTo(35);
}];
// self.iconBgView = [[UIView alloc] init];
// [self.bgView addSubview:self.iconBgView];
// [self.iconBgView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(self.idLabel.mas_bottom).offset(10);
// make.size.mas_equalTo(CGSizeMake(42, 16));
// }];
// self.iconView = [[UICollectionView alloc] initWithFrame:<#(CGRect)#> collectionViewLayout:<#(nonnull UICollectionViewLayout *)#>];
// [self.bgView addSubview:self.iconView];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(UserIconWidth, UserIconHeight);
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.bgView addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerImageView);
make.height.mas_equalTo(UserIconHeight);
make.top.equalTo(self.guildLabel.mas_bottom).offset(14);
make.width.mas_equalTo(300);
2025-08-08 10:49:36 +08:00
}];
self.introduceLabel = [[UILabel alloc] init];
2025-11-21 16:17:05 +08:00
self.introduceLabel.textAlignment = NSTextAlignmentLeft;
2025-08-08 10:49:36 +08:00
self.introduceLabel.font = [UIFont systemFontOfSize:12];
self.introduceLabel.textColor = RGB16(0x999999);
self.introduceLabel.numberOfLines = 2;
[self.bgView addSubview:self.introduceLabel];
[self.introduceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.collectionView.mas_bottom).offset(10);
make.left.equalTo(self.headerImageView);
2025-08-08 10:49:36 +08:00
make.right.mas_equalTo(-40);
make.height.mas_equalTo(40);
}];
2025-10-20 09:43:10 +08:00
2025-11-21 16:17:05 +08:00
// self.remindBtn = [[UIButton alloc] init];
//// [self.remindBtn setImage:[UIImage imageNamed:@"room_up_notice_icon"] forState:(UIControlStateNormal)];
// [self.remindBtn setTitle:QXText(@"转币") forState:(UIControlStateNormal)];
// self.remindBtn.titleLabel.font = [UIFont systemFontOfSize:12];
// self.remindBtn.backgroundColor = RGB16A(0xffffff, 0.2);
// self.remindBtn.hidden = YES;
// [self.remindBtn addRoundedCornersWithRadius:ScaleWidth(10)];
// self.remindBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
// [self.remindBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
// [self.remindBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
// [self.bgView addSubview:self.remindBtn];
// [self.remindBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.mas_equalTo(22);
// make.centerY.equalTo(self.guildLabel);
// make.height.mas_equalTo(ScaleWidth(20));
// make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
// }];
self.upSeatBtn = [[UIButton alloc] init];
[self.upSeatBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.upSeatBtn setTitle:QXText(@"上麦") forState:(UIControlStateNormal)];
// [self.upSeatBtn setTitle:QXText(@"上麦") forState:(UIControlStateHighlighted)];
[self.upSeatBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
self.upSeatBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.upSeatBtn.backgroundColor = QXConfig.themeColor;
[self.upSeatBtn addRoundedCornersWithRadius:ScaleWidth(12)];
[self.bgView addSubview:self.upSeatBtn];
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-ScaleWidth(64));
make.top.mas_equalTo(13);
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44));
}];
2025-10-20 09:43:10 +08:00
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;
2025-11-21 16:17:05 +08:00
[self.clearBtn addRoundedCornersWithRadius:ScaleWidth(12)];
2025-10-20 09:43:10 +08:00
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) {
2025-11-21 16:17:05 +08:00
make.right.equalTo(self.upSeatBtn.mas_left).offset(-10);
make.centerY.equalTo(self.upSeatBtn);
make.height.mas_equalTo(ScaleWidth(24));
2025-08-08 10:49:36 +08:00
make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
}];
2025-10-20 09:43:10 +08:00
2025-08-08 10:49:36 +08:00
self.followBtn = [[UIButton alloc] init];
self.followBtn.hidden = YES;
[self.followBtn setImage:[UIImage imageNamed:@"room_user_follow"] forState:(UIControlStateNormal)];
2025-10-30 00:45:15 +08:00
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
2025-08-08 10:49:36 +08:00
[self.bgView addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.right.equalTo(self.clearBtn.mas_left).offset(-10);
make.centerY.equalTo(self.upSeatBtn.mas_bottom);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(70));
}];
self.moreBtn = [[UIButton alloc] init];
[self.moreBtn setImage:[UIImage imageNamed:@"room_user_more"] forState:(UIControlStateNormal)];
[self.moreBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.moreBtn];
[self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.centerY.equalTo(self.upSeatBtn);
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44));
}];
self.reportBtn = [[UIButton alloc] init];
[self.reportBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
[self.reportBtn setTitle:[NSString stringWithFormat:@"%@ ",QXText(@"举报")] forState:(UIControlStateNormal)];
[self.reportBtn setImage:[UIImage imageNamed:@"room_user_report"] forState:UIControlStateNormal];
self.reportBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.reportBtn.backgroundColor = RGB16A(0xffffff, 0.2);
[self.reportBtn addRoundedCornersWithRadius:ScaleWidth(12)];
[self.reportBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.reportBtn];
[self.reportBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-ScaleWidth(64));
2025-10-20 09:43:10 +08:00
make.centerY.equalTo(self.upSeatBtn);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44));
}];
self.blackBtn = [[UIButton alloc] init];
[self.blackBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
[self.blackBtn setTitle:[NSString stringWithFormat:@"%@ ",QXText(@"拉黑")] forState:(UIControlStateNormal)];
[self.blackBtn setImage:[UIImage imageNamed:@"room_user_black"] forState:UIControlStateNormal];
self.blackBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.blackBtn.backgroundColor = RGB16A(0xffffff, 0.2);
[self.blackBtn addRoundedCornersWithRadius:ScaleWidth(12)];
[self.blackBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.blackBtn];
[self.blackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
2025-10-20 09:43:10 +08:00
make.centerY.equalTo(self.upSeatBtn);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44));
}];
self.giftTitleLabel = [[UILabel alloc] init];
self.giftTitleLabel.textAlignment = NSTextAlignmentCenter;
self.giftTitleLabel.font = [UIFont systemFontOfSize:14];
self.giftTitleLabel.textColor = RGB16(0xffffff);
self.giftTitleLabel.text = QXText(@"礼物图鉴");
[self.bgView addSubview:self.giftTitleLabel];
[self.giftTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.introduceLabel.mas_bottom).offset(5);
make.left.mas_equalTo(16);
make.height.mas_equalTo(18);
}];
self.moreGiftBtn = [[UIButton alloc] init];
[self.moreGiftBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateNormal)];
[self.moreGiftBtn setTitle:[NSString localizedStringWithFormat:QXText(@"90天内累计收到%@个礼物"),@"0"] forState:(UIControlStateNormal)];
self.moreGiftBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.moreGiftBtn setImage:[[UIImage imageNamed:@"arrowRight"] imageByTintColor:RGB16(0x999999)] forState:(UIControlStateNormal)];
[self.moreGiftBtn addTarget:self action:@selector(eventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.moreGiftBtn];
[self.moreGiftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.height.mas_equalTo(30);
make.centerY.equalTo(self.giftTitleLabel);
}];
[self.moreGiftBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2];
2025-11-21 16:17:05 +08:00
self.cpContentView = [[QXUserCpCardView alloc] init];
2025-11-28 22:43:06 +08:00
self.cpContentView.userId = self.userId;
self.cpContentView.delegate = self;
2025-11-21 16:17:05 +08:00
MJWeakSelf
[self.cpContentView addTapBlock:^(id _Nonnull obj) {
QXHeartBeatSpaceViewController*vc = [[QXHeartBeatSpaceViewController alloc] init];
vc.userId = weakSelf.userId;
[weakSelf.viewController.navigationController pushViewController:vc animated:YES];
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
[self.bgView addSubview:self.cpContentView];
[self.cpContentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.moreGiftBtn.mas_bottom).offset(5);
make.height.mas_equalTo(ScaleWidth(100));
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
2025-08-08 10:49:36 +08:00
self.bottomView = [[UIView alloc] init];
[self.bgView addSubview:self.bottomView];
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
// make.bottom.mas_equalTo(-(kSafeAreaBottom+10));
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.cpContentView.mas_bottom).offset(25);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(35);
}];
2025-11-21 16:17:05 +08:00
self.toolsArray = @[QXText(@"@TA"),QXText(@"发消息"),QXText(@"送礼物")];
2025-08-08 10:49:36 +08:00
CGFloat margin = 5;
2025-11-21 16:17:05 +08:00
CGFloat btnWidth = (SCREEN_WIDTH-16*2-margin*2)/self.toolsArray.count;
2025-08-08 10:49:36 +08:00
for (int i = 0 ; i < self.toolsArray.count; i++) {
NSString *title = self.toolsArray[i];
UIButton *btn = [[UIButton alloc] init];
btn.titleLabel.font = [UIFont systemFontOfSize:14];
btn.backgroundColor = RGB16A(0xffffff, 0.2);
[btn addRoundedCornersWithRadius:4];
btn.tag = 301 + i;
[btn addTarget:self action:@selector(btnEventAction:) forControlEvents:(UIControlEventTouchUpInside)];
[btn setTitle:title forState:(UIControlStateNormal)];
[btn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.bottomView addSubview:btn];
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(i*(btnWidth+margin));
make.width.mas_equalTo(btnWidth);
make.top.bottom.equalTo(self.bottomView);
}];
}
}
2025-11-21 16:17:05 +08:00
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.userModel.icon.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXTagImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXTagImageCell" forIndexPath:indexPath];
cell.imageUrl = self.userModel.icon[indexPath.row];
return cell;
}
2025-08-08 10:49:36 +08:00
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
2025-11-28 22:43:06 +08:00
-(void)didClickHeaderViewUserId:(NSString*)userId{
[self hide];
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
vc.user_id = userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
}
2025-08-08 10:49:36 +08:00
2025-11-28 22:43:06 +08:00
-(void)didClickHeaderCardViewWithUserId:(NSString*)userId{
if (self.userModel.cp_info != nil) {
[self hide];
QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init];
vc.userId = self.userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
}
}
2025-10-20 09:43:10 +08:00
-(void)clearCharmAction{
[QXMineNetwork roomClearCharmWithRoomId:self.roomId userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"清除成功");
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
2025-11-21 16:17:05 +08:00
2025-08-08 10:49:36 +08:00
2025-10-30 00:45:15 +08:00
-(void)followAction{
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.roomId isRejoin:NO navagationController:self.viewController.navigationController];
}
2025-12-01 18:42:49 +08:00
-(void)toMasterUserHome{
[self toHomePageIsMaster:YES];
}
-(void)toUserHome{
[self toHomePageIsMaster:NO];
}
2025-10-30 00:45:15 +08:00
2025-12-01 18:42:49 +08:00
-(void)toHomePageIsMaster:(BOOL)isMaster{
2025-08-08 10:49:36 +08:00
[self hide];
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
NSString *userId = self.userId;
2025-12-01 18:42:49 +08:00
if (isMaster) {
userId = self.userModel.master.user_id;
}else{
userId = self.userId;
}
2025-08-08 10:49:36 +08:00
vc.user_id = userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
}
-(void)setIsPK:(BOOL)isPK{
_isPK = isPK;
self.followBtn.hidden = !isPK;
}
-(void)setIsCompere:(BOOL)isCompere{
_isCompere = isCompere;
}
-(void)setIsOwner:(BOOL)isOwner{
_isOwner = isOwner;
}
-(void)setIsNoTakeOff:(BOOL)isNoTakeOff{
_isNoTakeOff = isNoTakeOff;
}
//-(void)setIsUpSeat:(BOOL)isUpSeat{
// _isUpSeat = isUpSeat;
//
//}
-(void)setUserId:(NSString *)userId{
_userId = userId;
2025-11-28 22:43:06 +08:00
self.cpContentView.userId = self.userId;
2025-08-08 10:49:36 +08:00
if (self.isCompere) {
// @TA...
self.moreBtn.hidden = NO;
self.bottomView.hidden = NO;
self.upSeatBtn.hidden = NO;
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
2025-10-20 09:43:10 +08:00
self.clearBtn.hidden = NO;
2025-08-08 10:49:36 +08:00
}else if (self.isManager){
self.moreBtn.hidden = NO;
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
2025-10-20 09:43:10 +08:00
self.clearBtn.hidden = NO;
2025-08-08 10:49:36 +08:00
}else if (self.isOwner){
self.moreBtn.hidden = NO;
self.upSeatBtn.hidden = NO;
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
2025-10-20 09:43:10 +08:00
self.clearBtn.hidden = NO;
2025-08-08 10:49:36 +08:00
}else{
//
self.moreBtn.hidden = YES;
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
// @Ta... |
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
self.upSeatBtn.hidden = NO;
self.bottomView.hidden = YES;
}else{
// @ta....
self.reportBtn.hidden = NO;
self.blackBtn.hidden = NO;
self.upSeatBtn.hidden = YES;
self.bottomView.hidden = NO;
}
2025-10-20 09:43:10 +08:00
self.clearBtn.hidden = YES;
2025-08-08 10:49:36 +08:00
}
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
/// @TA....
self.moreBtn.hidden = YES;
self.bottomView.hidden = YES;
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
2025-11-21 16:17:05 +08:00
self.focusBtn.hidden = YES;
2025-08-08 10:49:36 +08:00
}else{
2025-11-21 16:17:05 +08:00
self.focusBtn.hidden = NO;
2025-08-08 10:49:36 +08:00
// self.remindBtn.hidden = NO;
self.bottomView.hidden = NO;
}
if (self.isNoTakeOff) {
self.upSeatBtn.hidden = YES;
}
[self getUserInfo];
2025-10-31 09:56:19 +08:00
//
if (self.isPK) {
self.bottomView.hidden = YES;
}
2025-08-08 10:49:36 +08:00
// [self getRelationList];
}
-(void)getUserInfo{
MJWeakSelf
[QXMineNetwork roomUserInfoWithUserId:self.userId roomId:self.roomId successBlock:^(QXRoomUserInfoModel * _Nonnull model) {
weakSelf.userModel = model;
2025-11-11 17:19:21 +08:00
[weakSelf.headerImageView setHeadIcon:model.avatar dress:@""];
if ([model.nobility_image isExist]) {
[weakSelf.headerImageView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
}else{
[weakSelf.headerImageView.nobilityImageView sd_cancelLatestImageLoad];
weakSelf.headerImageView.nobilityImageView.image = nil;
}
if ([model.nickname_color isExist]) {
2025-11-21 16:17:05 +08:00
weakSelf.nameLabel.shimmerColor = [UIColor colorWithHexString:model.nickname_color] ;
[weakSelf.nameLabel startShimmer];
2025-11-11 17:19:21 +08:00
}else{
2025-12-04 14:11:00 +08:00
weakSelf.nameLabel.shimmerColor = UIColor.clearColor;
2025-11-21 16:17:05 +08:00
[weakSelf.nameLabel stopShimmer];
}
2025-12-01 18:42:49 +08:00
if (model.master) {
weakSelf.masterView.hidden = NO;
[weakSelf.masterHeaderView setHeadIcon:model.master.avatar dress:model.master.dress];
}else{
weakSelf.masterView.hidden = YES;
}
2025-11-21 16:17:05 +08:00
weakSelf.nameLabel.text = model.nickname;
[weakSelf.nameLabel.contentLabel sizeToFit];
[weakSelf.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(weakSelf.headerImageView.mas_bottom).offset(2);
make.height.mas_equalTo(18);
make.left.equalTo(weakSelf.headerImageView);
make.width.mas_equalTo(weakSelf.nameLabel.contentLabel.width);
}];
[weakSelf.focusBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(weakSelf.nameLabel);
make.height.mas_equalTo(24);
make.left.equalTo(self.nameLabel.mas_right).offset(10);
make.width.mas_equalTo(55);
}];
if (model.cp_info) {
weakSelf.cpDressView.hidden = NO;
weakSelf.cpDressView.model = model.cp_info;
weakSelf.cpContentView.model = model.cp_info;
2025-11-28 22:43:06 +08:00
}else{
[weakSelf.cpContentView resetView];
2025-11-11 17:19:21 +08:00
}
2025-11-21 16:17:05 +08:00
// weakSelf.sexImageView.image = model.sex.intValue==1?[UIImage imageNamed:@"user_sex_boy"]:[UIImage imageNamed:@"user_sex_girl"];
// [weakSelf.sexImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.width.height.mas_equalTo(17);
// make.left.equalTo(weakSelf.nameLabel.mas_right).offset(2);
// make.centerY.equalTo(weakSelf.nameLabel);
// }];
[weakSelf.collectionView reloadData];
weakSelf.idLabel.text = [NSString stringWithFormat:@"%@ ID:%@",model.sex.intValue==1?@"男":@"女",model.user_code];
weakSelf.guildLabel.text = [NSString stringWithFormat:@"所属公会:%@",[model.guild isExist]?model.guild:@"无"];
2025-12-04 23:35:49 +08:00
if ([model.guild isExist]) {
if ([weakSelf.userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
weakSelf.joinGuildBtn.hidden = YES;
}else{
weakSelf.joinGuildBtn.hidden = NO;
}
2025-11-28 22:43:06 +08:00
}else{
weakSelf.joinGuildBtn.hidden = YES;
}
2025-08-08 10:49:36 +08:00
[weakSelf.upSeatBtn setTitle:model.is_in_pit.intValue==1?QXText(@"下麦"):QXText(@"抱麦") forState:(UIControlStateNormal)];
[weakSelf.moreGiftBtn setTitle:[NSString localizedStringWithFormat:QXText(@"90天内累计收到%@个礼物"),model.gift_num] forState:(UIControlStateNormal)];
[weakSelf.moreGiftBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2];
weakSelf.introduceLabel.text = model.profile;
2025-11-21 16:17:05 +08:00
2025-08-08 10:49:36 +08:00
// if (model.red_status.intValue == 1 && ![weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
// weakSelf.remindBtn.hidden = NO;
// }
2025-11-21 16:17:05 +08:00
2025-08-08 10:49:36 +08:00
if (model.is_follow.intValue == 1) {
2025-11-21 16:17:05 +08:00
// [self.focusBtn setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
weakSelf.focusBtn.selected = YES;
2025-08-08 10:49:36 +08:00
}else{
2025-11-21 16:17:05 +08:00
// [self.focusBtn setTitle:QXText(@"+ 关注") forState:(UIControlStateNormal)];
weakSelf.focusBtn.selected = NO;
2025-08-08 10:49:36 +08:00
}
if ([weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id] && model.is_in_pit.intValue==1) {
/// @TA....
weakSelf.upSeatBtn.hidden = NO;
}else{
if (weakSelf.isCompere || weakSelf.isOwner || weakSelf.isManager) {
weakSelf.upSeatBtn.hidden = NO;
}else{
weakSelf.upSeatBtn.hidden = YES;
}
}
if (weakSelf.isNoTakeOff) {
weakSelf.upSeatBtn.hidden = YES;
}
if (weakSelf.isOwner) {
if (weakSelf.isNoTakeOff) {
///
weakSelf.popView.dataArray = @[
model.is_manager.intValue==0?QXText(@"设为管理"):QXText(@"取消管理"),
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}else{
///
weakSelf.popView.dataArray = @[
model.is_manager.intValue==0?QXText(@"设为管理"):QXText(@"取消管理"),
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
QXText(@"踢出房间"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}
return;
}
if(weakSelf.isManager){
if (model.pohoulong.intValue == 1) {
///
weakSelf.moreBtn.hidden = YES;
weakSelf.reportBtn.hidden = NO;
weakSelf.blackBtn.hidden = NO;
weakSelf.upSeatBtn.hidden = YES;
}else if (model.is_manager.intValue == 1){
weakSelf.reportBtn.hidden = YES;
weakSelf.blackBtn.hidden = YES;
weakSelf.upSeatBtn.hidden = NO;
weakSelf.moreBtn.hidden = NO;
if (weakSelf.isNoTakeOff) {
weakSelf.popView.dataArray = @[
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}else{
weakSelf.popView.dataArray = @[
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
QXText(@"踢出房间"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}
}else{
if (weakSelf.isNoTakeOff) {
///
weakSelf.popView.dataArray = @[
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}else{
///
weakSelf.popView.dataArray = @[
model.is_host.intValue==0?QXText(@"设为主持"):QXText(@"取消主持"),
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
QXText(@"踢出房间"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}
}
if ([weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
/// @TA....
weakSelf.moreBtn.hidden = YES;
weakSelf.bottomView.hidden = YES;
}
return;
}
if(weakSelf.isCompere){
if (model.pohoulong.intValue == 1 || model.is_manager.intValue == 1) {
///
weakSelf.moreBtn.hidden = YES;
weakSelf.reportBtn.hidden = NO;
weakSelf.blackBtn.hidden = NO;
weakSelf.upSeatBtn.hidden = YES;
}else{
weakSelf.moreBtn.hidden = NO;
weakSelf.reportBtn.hidden = YES;
weakSelf.blackBtn.hidden = YES;
if (weakSelf.isNoTakeOff) {
///
weakSelf.popView.dataArray = @[
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
weakSelf.upSeatBtn.hidden = YES;
}else{
weakSelf.upSeatBtn.hidden = NO;
///
weakSelf.popView.dataArray = @[
model.is_mute_pit.intValue == 0?QXText(@"禁麦"):QXText(@"开麦"),
QXText(@"踢出房间"),
model.is_mute.intValue == 0?QXText(@"禁言"):QXText(@"解除禁言"),
QXText(@"举报"),
QXText(@"拉黑")];
}
}
if ([weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
/// @TA....
weakSelf.moreBtn.hidden = YES;
weakSelf.bottomView.hidden = YES;
}
return;
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)didSelectedIndex:(NSInteger)index menuTitle:(NSString *)menuTitle{
MJWeakSelf
if ([menuTitle isEqualToString:QXText(@"设为管理")]) {
[QXMineNetwork roomAddOrDeleteManagerIsAdd:YES type:2 roomId:self.roomId user_id:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
showToast(@"操作成功");
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"取消管理")]) {
[QXMineNetwork roomAddOrDeleteManagerIsAdd:NO type:2 roomId:self.roomId user_id:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"取消主持")]) {
[QXMineNetwork roomAddOrDeleteManagerIsAdd:NO type:1 roomId:self.roomId user_id:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"设为主持")]) {
[QXMineNetwork roomAddOrDeleteManagerIsAdd:YES type:1 roomId:self.roomId user_id:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"禁麦")]) {
[QXMineNetwork roomMuteWithRoomId:self.roomId userId:self.userId is_mute:@"2" successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"开麦")]) {
[QXMineNetwork roomMuteWithRoomId:self.roomId userId:self.userId is_mute:@"4" successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"禁言")]) {
[QXMineNetwork roomMuteWithRoomId:self.roomId userId:self.userId is_mute:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"解除禁言")]) {
[QXMineNetwork roomMuteWithRoomId:self.roomId userId:self.userId is_mute:@"3" successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"拉黑")]) {
[QXMineNetwork addOrRemoveBlackListIsAdd:YES userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"踢出房间")]) {
[QXMineNetwork roomTakeOffWithRoomId:self.roomId userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"操作成功");
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if ([menuTitle isEqualToString:QXText(@"举报")]) {
[self reprortAction];
}
}
-(void)reprortAction{
QXReportViewController *reportVC = [[QXReportViewController alloc] init];
reportVC.reportType = @"1";
reportVC.fromId = self.userId;
[self.navigationController pushViewController:reportVC animated:YES];
}
-(void)eventAction:(UIButton*)sender{
MJWeakSelf
if (sender == self.upSeatBtn) {
if ([self.userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:self.pitNumber isUpSeat:NO successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else{
[QXMineNetwork roomCompereApplyPitWithRoomId:self.roomId pit_number:self.pitNumber user_id:self.userId type:self.userModel.is_in_pit.intValue==1?@"2":@"1" successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}else if(sender == self.moreBtn){
[self.popView showInView:self.viewController.view];
}else if(sender == self.blackBtn){
[QXMineNetwork addOrRemoveBlackListIsAdd:YES userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}else if (sender == self.moreGiftBtn){
// [self.giftWallView showInView:self.viewController.view];
2025-11-21 16:17:05 +08:00
[self hide];
QXGiftWallViewController *vc = [[QXGiftWallViewController alloc] init];
2025-08-08 10:49:36 +08:00
NSString *userId = self.userId;
2025-11-21 16:17:05 +08:00
vc.userId = userId;
// vc.isGiftWall = YES;
2025-08-08 10:49:36 +08:00
[self.viewController.navigationController pushViewController:vc animated:YES];
}else if(sender == self.reportBtn){
[self reprortAction];
}
2025-11-21 16:17:05 +08:00
// else if(sender == self.remindBtn){
// ///
// QXDirectSetScaleView *scaleView = [[QXDirectSetScaleView alloc] init];
// scaleView.userId = self.userId;
// scaleView.isGiveCoin = YES;
// for (UIWindow *w in [UIApplication sharedApplication].windows) {
// if ([w isKeyWindow]) {
// [scaleView showInView:w];
// break;
// }
// }
// }
2025-08-08 10:49:36 +08:00
}
-(void)btnEventAction:(UIButton*)sender{
if (self.userModel == nil) {
return;
}
2025-11-21 16:17:05 +08:00
if (sender == self.joinGuildBtn) {
QXLOG(@"加入公会");
2025-12-01 18:42:49 +08:00
[QXMineNetwork joinGuildWithGuildId:self.userModel.guild successBlock:^(NSDictionary * _Nonnull dict) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
2025-11-21 16:17:05 +08:00
return;
}
if (sender == self.focusBtn) {
2025-08-08 10:49:36 +08:00
[QXDynamicNetwork followWithUserId:self.userId type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
2025-11-21 16:17:05 +08:00
// if ([sender.titleLabel.text isEqualToString:QXText(@"关注")]) {
// [sender setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
// }else{
// [sender setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
// }
sender.selected = !sender.selected;
2025-08-08 10:49:36 +08:00
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
return;
}
[self hide];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickEventType:userModel:pitNumber:)]) {
[self.delegate didClickEventType:sender.tag userModel:self.userModel pitNumber:self.pitNumber];
}
// }
}
-(void)showInView:(UIView *)view{
2025-12-04 14:11:00 +08:00
self.cpDressView.hidden = YES;
[self.cpDressView resetView];
2025-08-08 10:49:36 +08:00
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT- ScaleWidth(429+33)-kSafeAreaBottom;
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(QXMenuPopView *)popView{
if (!_popView) {
_popView = [[QXMenuPopView alloc] initWithPoint:CGPointMake(self.width-22-88/2, SCREEN_HEIGHT-kSafeAreaBottom-ScaleWidth(429+33)+self.moreBtn.bottom) width:88 height:210+13];
_popView.type = QXMenuPopViewTypeArrowTop;
_popView.delegate = self;
}
return _popView;
}
-(QXUserInfoGiftWallView *)giftWallView{
if (!_giftWallView) {
_giftWallView = [[QXUserInfoGiftWallView alloc] initWithFrame:UIScreen.mainScreen.bounds];
}
return _giftWallView;
}
2025-11-21 16:17:05 +08:00
2025-08-08 10:49:36 +08:00
@end