This commit is contained in:
启星
2025-11-21 16:17:05 +08:00
parent 7ac937ddbf
commit 8913ea6f48
283 changed files with 8474 additions and 800 deletions

View File

@@ -15,24 +15,32 @@
#import "QXReportViewController.h"
#import "QXUserHomePageViewController.h"
#import "QXUserInfoRelationTableCell.h"
#import "QXUserRelationListView.h"
#import "QXUserInfoRelationCardCell.h"
#import "QXDirectSetScaleView.h"
#import "QXSeatHeaderView.h"
#import "CKShimmerLabel.h"
#import "QXUserHomeHeaderView.h"
#import "QXGiftWallViewController.h"
#import "QXUserCpCardView.h"
#import "QXUserCpDressView.h"
#import "QXHeartBeatSpaceViewController.h"
@interface QXRoomUserInfoView()<UIGestureRecognizerDelegate,SDCycleScrollViewDelegate,QXMenuPopViewDelegate,UITableViewDelegate,UITableViewDataSource>
@interface QXRoomUserInfoView()<UIGestureRecognizerDelegate,SDCycleScrollViewDelegate,QXMenuPopViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIImageView *bgImageView;
///
@property (nonatomic,strong)QXSeatHeaderView *headerImageView;
///
@property (nonatomic,strong)UIButton *nameBtn;
@property (nonatomic,strong)CKShimmerLabel *nameLabel;
@property (nonatomic,strong)UIImageView *sexImageView;
/// ID
@property (nonatomic,strong)UILabel *idLabel;
///
///
@property (nonatomic,strong)UILabel *guildLabel;
///
@property (nonatomic,strong)UIButton *remindBtn;
///
@property (nonatomic,strong)UIButton *joinGuildBtn;
///
@property (nonatomic,strong)UIButton *focusBtn;
///
@property (nonatomic,strong)UIButton *upSeatBtn;
///
@@ -46,7 +54,7 @@
///
@property (nonatomic,strong)UIButton *moreBtn;
/// iconbgView
@property (nonatomic,strong)UIView *iconBgView;
@property (nonatomic,strong)UICollectionView *collectionView;
///
@property (nonatomic,strong)UILabel *introduceLabel;
@@ -56,14 +64,7 @@
///
@property (nonatomic,strong)UIButton *moreGiftBtn;
///
//@property (nonatomic,strong)SDCycleScrollView *relationshipScrollview;
@property (nonatomic,strong)UITableView *relationTableView;
///
@property (nonatomic,strong)UIButton *relationshipCardBtn;
///
@property (nonatomic,strong)UIButton *relationshipSeatBtn;
@property (nonatomic,assign)BOOL isRealLove;
@property (nonatomic,strong)QXUserCpCardView *cpContentView;
///
@property (nonatomic,strong)UIView *bottomView;
@@ -75,10 +76,8 @@
@property (nonatomic,strong) QXUserInfoGiftWallView *giftWallView;
@property (nonatomic,strong)UIButton *relationMoreBtn;
///
@property (nonatomic,strong) QXUserRelationListView *relationView;
@property (nonatomic,strong) QXRelationshipList *listModel;
@property (nonatomic,strong) QXUserCpDressView *cpDressView;
@end
@implementation QXRoomUserInfoView
@@ -97,24 +96,30 @@
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, kSafeAreaBottom+ScaleWidth(429+33))];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, kSafeAreaBottom+ScaleWidth(462))];
// self.bgView.backgroundColor = [UIColor whiteColor];
[self addSubview:self.bgView];
self.bgImageView = [[UIImageView alloc] initWithFrame:self.bgView.bounds];
self.bgImageView.image = [UIImage imageNamed:@"room_user_bg"];
self.bgImageView.image = [UIImage imageNamed:@"room_user_n_bg"];
[self.bgView addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(ScaleWidth(24));
make.top.mas_equalTo(0);
make.left.right.bottom.equalTo(self.bgView);
}];
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];
self.headerImageView = [[QXSeatHeaderView alloc] init];
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.bgView addSubview:self.headerImageView];
// [self.headerImageView addRoundedCornersWithRadius:ScaleWidth(33)];
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.equalTo(self.bgView);
make.top.mas_equalTo(38);
make.left.mas_equalTo(21);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(66), ScaleWidth(79)));
}];
@@ -125,25 +130,65 @@
make.bottom.left.right.top.equalTo(self.headerImageView);
}];
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) {
// 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) {
make.top.equalTo(self.headerImageView.mas_bottom).offset(2);
make.height.mas_equalTo(18);
make.centerX.equalTo(self.headerImageView);
make.left.equalTo(self.headerImageView);
make.width.mas_equalTo(100);
}];
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];
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) {
make.top.equalTo(self.nameBtn.mas_bottom).offset(2);
make.top.equalTo(self.nameLabel.mas_bottom).offset(5);
make.height.mas_equalTo(16);
make.centerX.equalTo(self.headerImageView);
make.left.equalTo(self.headerImageView);
make.width.mas_lessThanOrEqualTo(ScaleWidth(180));
}];
self.guildLabel = [[UILabel alloc] init];
@@ -151,82 +196,86 @@
self.guildLabel.textColor = [UIColor whiteColor];
[self.bgView addSubview:self.guildLabel];
[self.guildLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.idLabel.mas_bottom).offset(2);
make.top.equalTo(self.idLabel.mas_bottom).offset(5);
make.height.mas_equalTo(16);
make.centerX.equalTo(self.headerImageView);
make.left.equalTo(self.headerImageView);
make.width.mas_lessThanOrEqualTo(ScaleWidth(180));
}];
self.iconBgView = [[UIView alloc] init];
[self.bgView addSubview:self.iconBgView];
[self.iconBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.guildLabel.mas_bottom).offset(4);
make.size.mas_equalTo(CGSizeMake(42, 16));
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);
}];
self.introduceLabel = [[UILabel alloc] init];
self.introduceLabel.textAlignment = NSTextAlignmentCenter;
self.introduceLabel.textAlignment = NSTextAlignmentLeft;
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) {
make.top.equalTo(self.iconBgView.mas_bottom).offset(8);
make.left.mas_equalTo(40);
make.top.equalTo(self.collectionView.mas_bottom).offset(10);
make.left.equalTo(self.headerImageView);
make.right.mas_equalTo(-40);
make.height.mas_equalTo(40);
}];
self.clearBtn = [[UIButton alloc] init];
[self.clearBtn setTitle:QXText(@"清魅力") forState:(UIControlStateNormal)];
[self.clearBtn setImage:[UIImage imageNamed:@"room_clear_charm"] forState:(UIControlStateNormal)];
self.clearBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.clearBtn.backgroundColor = RGB16A(0xffffff, 0.2);
self.clearBtn.hidden = YES;
[self.clearBtn addRoundedCornersWithRadius:ScaleWidth(10)];
self.clearBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
[self.clearBtn addTarget:self action:@selector(clearCharmAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.clearBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
[self.bgView addSubview:self.clearBtn];
[self.clearBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22);
make.top.mas_equalTo(ScaleWidth(24)+26);
make.height.mas_equalTo(ScaleWidth(20));
make.width.mas_greaterThanOrEqualTo(ScaleWidth(66));
}];
self.remindBtn = [[UIButton alloc] init];
// [self.remindBtn 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.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.followBtn = [[UIButton alloc] init];
self.followBtn.hidden = YES;
[self.followBtn setImage:[UIImage imageNamed:@"room_user_follow"] forState:(UIControlStateNormal)];
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(22);
make.top.equalTo(self.remindBtn.mas_bottom).offset(17);
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(70));
}];
self.upSeatBtn = [[UIButton alloc] init];
[self.upSeatBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
@@ -239,11 +288,41 @@
[self.bgView addSubview:self.upSeatBtn];
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-ScaleWidth(64));
make.centerY.equalTo(self.clearBtn);
make.top.mas_equalTo(13);
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(44));
}];
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(12)];
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.right.equalTo(self.upSeatBtn.mas_left).offset(-10);
make.centerY.equalTo(self.upSeatBtn);
make.height.mas_equalTo(ScaleWidth(24));
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)];
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.clearBtn.mas_left).offset(-10);
make.centerY.equalTo(self.upSeatBtn.mas_bottom);
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)];
@@ -314,71 +393,23 @@
}];
[self.moreGiftBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2];
self.relationshipCardBtn = [[UIButton alloc] init];
self.relationshipCardBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
[self.relationshipCardBtn setTitle:QXText(@"关系卡") forState:(UIControlStateNormal)];
[self.relationshipCardBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.relationshipCardBtn addTarget:self action:@selector(relationSelectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
self.relationshipCardBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self.bgView addSubview:self.relationshipCardBtn];
[self.relationshipCardBtn mas_makeConstraints:^(MASConstraintMaker *make) {
self.cpContentView = [[QXUserCpCardView alloc] init];
MJWeakSelf
[self.cpContentView addTapBlock:^(id _Nonnull obj) {
QXHeartBeatSpaceViewController*vc = [[QXHeartBeatSpaceViewController alloc] init];
vc.userId = weakSelf.userId;
[weakSelf.viewController.navigationController pushViewController:vc animated:YES];
}];
[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.height.mas_equalTo(30);
make.top.equalTo(self.giftTitleLabel.mas_bottom).offset(10);
make.width.mas_equalTo(60);
}];
self.relationshipSeatBtn = [[UIButton alloc] init];
[self.relationshipSeatBtn setTitle:QXText(@"关系位") forState:(UIControlStateNormal)];
[self.relationshipSeatBtn addTarget:self action:@selector(relationSelectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.relationshipSeatBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
self.relationshipSeatBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[self.bgView addSubview:self.relationshipSeatBtn];
[self.relationshipSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.relationshipCardBtn.mas_right).offset(5);
make.height.mas_equalTo(30);
make.top.equalTo(self.giftTitleLabel.mas_bottom).offset(10);
make.width.mas_equalTo(65);
}];
self.relationMoreBtn = [[UIButton alloc] init];
[self.relationMoreBtn setTitle:QXText(@"更多") forState:(UIControlStateNormal)];
[self.relationMoreBtn setImage:[[UIImage imageNamed:@"arrowRight"] imageByTintColor:QXConfig.themeColor] forState:(UIControlStateNormal)];
[self.relationMoreBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
self.relationMoreBtn.titleLabel.font = [UIFont boldSystemFontOfSize:12];
[self.relationMoreBtn addTarget:self action:@selector(relationAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.relationMoreBtn];
[self.relationMoreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgView.mas_right).offset(-16);
make.height.mas_equalTo(30);
make.top.equalTo(self.giftTitleLabel.mas_bottom).offset(10);
make.width.mas_equalTo(65);
}];
[self.relationMoreBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2];
// self.relationshipScrollview = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:[UIImage imageNamed:@"room_relationship_card_bg"]];
// self.relationshipScrollview.backgroundColor = [UIColor clearColor];
// [self.bgView insertSubview:self.relationshipScrollview belowSubview:self.relationshipCardBtn];
// [self.relationshipScrollview mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.equalTo(self.relationshipSeatBtn.mas_top).offset(4);
// make.left.mas_equalTo(6);
// make.right.mas_equalTo(-6);
// make.height.mas_equalTo(ScaleWidth(141));
// }];
self.relationTableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
self.relationTableView.delegate = self;
self.relationTableView.dataSource = self;
self.relationTableView.scrollEnabled = NO;
self.relationTableView.backgroundColor = [UIColor clearColor];
self.relationTableView.rowHeight = ScaleWidth(141);
[self.bgView insertSubview:self.relationTableView belowSubview:self.relationshipCardBtn];
[self.relationTableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.relationshipSeatBtn.mas_top).offset(4);
make.left.mas_equalTo(6);
make.right.mas_equalTo(-6);
make.height.mas_equalTo(ScaleWidth(141));
make.right.mas_equalTo(-16);
}];
self.bottomView = [[UIView alloc] init];
[self.bgView addSubview:self.bottomView];
@@ -386,13 +417,13 @@
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
// make.bottom.mas_equalTo(-(kSafeAreaBottom+10));
make.top.equalTo(self.relationTableView.mas_bottom).offset(20);
make.top.equalTo(self.cpContentView.mas_bottom).offset(25);
make.height.mas_equalTo(35);
}];
self.toolsArray = @[QXText(@"@TA"),QXText(@"聊天"),QXText(@"关注"),QXText(@"送礼物")];
self.toolsArray = @[QXText(@"@TA"),QXText(@"发消息"),QXText(@"送礼物")];
CGFloat margin = 5;
CGFloat btnWidth = (SCREEN_WIDTH-16*2-margin*3)/self.toolsArray.count;
CGFloat btnWidth = (SCREEN_WIDTH-16*2-margin*2)/self.toolsArray.count;
for (int i = 0 ; i < self.toolsArray.count; i++) {
NSString *title = self.toolsArray[i];
UIButton *btn = [[UIButton alloc] init];
@@ -412,22 +443,18 @@
}
}
-(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;
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)relationSelectedAction:(UIButton*)sender{
if (sender == self.relationshipSeatBtn) {
self.relationshipSeatBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.relationshipCardBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
self.isRealLove = YES;
}else{
self.relationshipSeatBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
self.relationshipCardBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.isRealLove = NO;
}
[self.relationTableView reloadData];
}
-(void)clearCharmAction{
[QXMineNetwork roomClearCharmWithRoomId:self.roomId userId:self.userId successBlock:^(NSDictionary * _Nonnull dict) {
@@ -436,21 +463,7 @@
showToast(msg);
}];
}
//-(void)getRelationList{
// MJWeakSelf
// [QXMineNetwork roomUserRelationWithUserId:self.userId successBlock:^(QXRelationshipList * list) {
// weakSelf.listModel = list;
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
//
// }];
//}
-(void)relationAction{
[self hide];
self.relationView.isRealLove = self.isRealLove;
self.relationView.userId = self.userId;
// self.relationView.list = self.listModel;
[self.relationView showInView:self.viewController.view];
}
-(void)followAction{
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.roomId isRejoin:NO navagationController:self.viewController.navigationController];
@@ -482,7 +495,6 @@
//}
-(void)setUserId:(NSString *)userId{
_userId = userId;
[self relationSelectedAction:self.relationshipCardBtn];
if (self.isCompere) {
// @TA...
self.moreBtn.hidden = NO;
@@ -526,8 +538,9 @@
self.bottomView.hidden = YES;
self.reportBtn.hidden = YES;
self.blackBtn.hidden = YES;
// self.remindBtn.hidden = YES;
self.focusBtn.hidden = YES;
}else{
self.focusBtn.hidden = NO;
// self.remindBtn.hidden = NO;
self.bottomView.hidden = NO;
}
@@ -554,28 +567,56 @@
weakSelf.headerImageView.nobilityImageView.image = nil;
}
if ([model.nickname_color isExist]) {
[weakSelf.nameBtn setTitleColor:[UIColor colorWithHexString:model.nickname_color] forState:(UIControlStateNormal)];
weakSelf.nameLabel.shimmerColor = [UIColor colorWithHexString:model.nickname_color] ;
[weakSelf.nameLabel startShimmer];
}else{
[weakSelf.nameBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
[weakSelf.nameLabel stopShimmer];
}
[weakSelf.nameBtn setTitle:model.nickname forState:(UIControlStateNormal)];
[weakSelf.nameBtn setImage:model.sex.intValue==1?[UIImage imageNamed:@"user_sex_boy"]:[UIImage imageNamed:@"user_sex_girl"] forState:(UIControlStateNormal)];
[weakSelf.nameBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:2];
weakSelf.idLabel.text = [NSString stringWithFormat:@"ID:%@",model.user_code];
weakSelf.guildLabel.text = [NSString stringWithFormat:@"%@:%@",QXText(@"所属公会"),model.guild];
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;
}
// 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:@"无"];
weakSelf.joinGuildBtn.hidden = ![model.guild isExist];
[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;
[weakSelf.relationTableView reloadData];
// if (model.red_status.intValue == 1 && ![weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
// weakSelf.remindBtn.hidden = NO;
// }
UIButton *followBtn = [self viewWithTag:303];
if (model.is_follow.intValue == 1) {
[followBtn setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
// [self.focusBtn setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
weakSelf.focusBtn.selected = YES;
}else{
[followBtn setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
// [self.focusBtn setTitle:QXText(@"+ 关注") forState:(UIControlStateNormal)];
weakSelf.focusBtn.selected = NO;
}
if ([weakSelf.userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id] && model.is_in_pit.intValue==1) {
@@ -827,37 +868,44 @@
}];
}else if (sender == self.moreGiftBtn){
// [self.giftWallView showInView:self.viewController.view];
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
[self hide];
QXGiftWallViewController *vc = [[QXGiftWallViewController alloc] init];
NSString *userId = self.userId;
vc.user_id = userId;
vc.isGiftWall = YES;
vc.userId = userId;
// vc.isGiftWall = YES;
[self.viewController.navigationController pushViewController:vc animated:YES];
}else if(sender == self.reportBtn){
[self reprortAction];
}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;
}
}
}
// 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;
// }
// }
// }
}
-(void)btnEventAction:(UIButton*)sender{
if (self.userModel == nil) {
return;
}
// if (sender.tag == 301) {
if (sender.tag == 303) {
if (sender == self.joinGuildBtn) {
QXLOG(@"加入公会");
return;
}
if (sender == self.focusBtn) {
[QXDynamicNetwork followWithUserId:self.userId type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
if ([sender.titleLabel.text isEqualToString:QXText(@"关注")]) {
[sender setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
}else{
[sender setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
}
// if ([sender.titleLabel.text isEqualToString:QXText(@"关注")]) {
// [sender setTitle:QXText(@"已关注") forState:(UIControlStateNormal)];
// }else{
// [sender setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
// }
sender.selected = !sender.selected;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
@@ -869,30 +917,6 @@
}
// }
}
//-(UINib *)customCollectionViewCellNibForCycleScrollView:(SDCycleScrollView *)view{
// UINib *nib = [UINib nibWithNibName:@"QXUserInfoRelationCell" bundle:[NSBundle mainBundle]];
// return nib;
//}
//-(void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view{
// QXUserInfoRelationCell *relationCell = (QXUserInfoRelationCell*)cell;
//
//}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (!self.isRealLove) {
QXUserInfoRelationCardCell *cell = [QXUserInfoRelationCardCell cellWithTableView:tableView];
cell.isList = NO;
cell.model = self.userModel.qinmi;
return cell;
}else{
QXUserInfoRelationTableCell *cell = [QXUserInfoRelationTableCell cellWithTableView:tableView];
cell.isList = NO;
cell.model = self.userModel.zhenai;
return cell;
}
}
-(void)showInView:(UIView *)view{
@@ -923,11 +947,6 @@
return _giftWallView;
}
-(QXUserRelationListView *)relationView{
if (!_relationView) {
_relationView = [[QXUserRelationListView alloc] initWithFrame:UIScreen.mainScreen.bounds];
}
return _relationView;
}
@end