Files
featherVoice/QXLive/Mine(音域)/View/个人主页/QXUserHomeHeaderView.m

498 lines
21 KiB
Mathematica
Raw Normal View History

2025-08-08 10:49:36 +08:00
//
// QXUserHomeHeaderView.m
// QXLive
//
// Created by on 2025/5/20.
//
#import "QXUserHomeHeaderView.h"
#import "QXSeatHeaderView.h"
#import "QXSearchCell.h"
#import "NSDate+BRPickerView.h"
#import "NSString+QX.h"
#import "QXDynamicNetwork.h"
#import "QXChatViewController.h"
2025-11-21 16:17:05 +08:00
#import "CKShimmerLabel.h"
#import "QXUserCpDressView.h"
#import "QXUserCpCardView.h"
#import "QXGiftWallViewController.h"
#import "QXHeartBeatSpaceViewController.h"
2025-11-28 22:43:06 +08:00
#import "QXUserHomePageViewController.h"
#import "QXHeartBeatSpaceViewController.h"
2025-08-08 10:49:36 +08:00
2025-11-28 22:43:06 +08:00
@interface QXUserHomeHeaderView()<UICollectionViewDelegate,UICollectionViewDataSource,QXUserCpCardViewDelegate>
2025-11-21 16:17:05 +08:00
//@property (nonatomic,strong) CKShimmerLabel * tempName;
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong) QXSeatHeaderView* headerView;
@property (nonatomic,strong) UIView * whiteBgView;
@property (nonatomic,strong) UIView * grayBgView;
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong) CKShimmerLabel * nameLabel;
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong) UILabel * idLabel;
2025-11-21 16:17:05 +08:00
//@property (nonatomic,strong) UILabel * ageLabel;
@property (nonatomic,strong) UIImageView * guildBgImageView;
@property (nonatomic,strong) UILabel * guildLabel;
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong) UICollectionView * collectionView;
@property (nonatomic,strong) NSMutableArray * tagArray;
@property (nonatomic,strong) UILabel *introduceLabel;
@property (nonatomic,strong) UICollectionView *inCollectionView;
@property (nonatomic, strong) UIImageView *useCodeImageView;
2025-11-21 16:17:05 +08:00
//@property (nonatomic, strong)UIImageView *sexImageView;
2025-08-08 10:49:36 +08:00
@property (nonatomic,strong) UIButton *followBtn;
@property (nonatomic,strong) UIButton *playBtn;
2025-11-21 16:17:05 +08:00
@property (nonatomic,strong) QXUserCpDressView *cpDressView;
@property (nonatomic,strong) QXUserCpCardView *cpCardView;
@property (nonatomic,strong) UIButton *giftWallBtn;
2025-08-08 10:49:36 +08:00
@end
@implementation QXUserHomeHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor clearColor];
2025-11-21 16:17:05 +08:00
self.headerView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(32, 26, 70, 84)];
2025-08-08 10:49:36 +08:00
[self addSubview:self.headerView];
[self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(32);
2025-11-11 17:19:21 +08:00
make.width.mas_equalTo(70);
make.height.mas_equalTo(84);
2025-08-08 10:49:36 +08:00
make.top.mas_equalTo(26);
}];
2025-11-21 16:17:05 +08:00
self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(32, self.headerView.bottom+4, 200, 24)];
// self.nameLabel.text = @"羽声语音";
self.nameLabel.shimmerWidth = 20;
self.nameLabel.shimmerRadius = 20;
self.nameLabel.durationTime = 1;
self.nameLabel.repeat = YES;
2025-08-08 10:49:36 +08:00
self.nameLabel.textColor = QXConfig.textColor;
2025-11-21 16:17:05 +08:00
// self.nameLabel.shimmerColor = [UIColor yellowColor];
self.nameLabel.font = [UIFont boldSystemFontOfSize:18];
// [self.nameLabel startShimmer];
2025-08-08 10:49:36 +08:00
[self addSubview:self.nameLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerView);
make.height.mas_equalTo(24);
make.top.equalTo(self.headerView.mas_bottom).offset(4);
2025-11-21 16:17:05 +08:00
make.width.mas_greaterThanOrEqualTo(200);
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
self.followBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.playBtn.left-6-91, self.whiteBgView.top+10, 91, 12)];
[self.followBtn setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
[self.followBtn setTitle:QXText(@"已关注") forState:(UIControlStateSelected)];
[self.followBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.followBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateSelected)];
[self.followBtn setBackgroundImage:[UIImage imageWithColor:QXConfig.themeColor] forState:UIControlStateNormal];
[self.followBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xF1F2F3)] forState:UIControlStateSelected];
self.followBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.followBtn addRoundedCornersWithRadius:12];
self.followBtn.hidden = YES;
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.nameLabel.mas_right).offset(10);
make.width.mas_equalTo(55);
make.height.mas_equalTo(24);
2025-11-11 17:19:21 +08:00
make.centerY.equalTo(self.nameLabel);
}];
2025-11-21 16:17:05 +08:00
// self.sexImageView = [[UIImageView alloc] init];
// [self addSubview:self.sexImageView];
// [self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.nameLabel.mas_right).offset(5);
// make.centerY.equalTo(self.nameLabel);
// make.height.width.mas_equalTo(16);
// }];
2025-08-08 10:49:36 +08:00
self.idLabel = [[UILabel alloc] init];
self.idLabel.textColor = RGB16(0x999999);
self.idLabel.font = [UIFont boldSystemFontOfSize:12];
[self addSubview:self.idLabel];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.left.equalTo(self.nameLabel);
make.height.mas_equalTo(18);
make.top.equalTo(self.nameLabel.mas_bottom).offset(5);
2025-08-08 10:49:36 +08:00
}];
self.useCodeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_usercode_isLiang"]];
self.useCodeImageView.hidden = YES;
[self addSubview:self.useCodeImageView];
[self.useCodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.idLabel.mas_right).offset(5);
make.height.mas_equalTo(11);
make.width.mas_equalTo(31);
make.centerY.equalTo(self.idLabel);
}];
2025-11-21 16:17:05 +08:00
// self.ageLabel = [[UILabel alloc] init];
// self.ageLabel.textColor = RGB16(0x999999);
// self.ageLabel.font = [UIFont boldSystemFontOfSize:12];
// [self addSubview:self.ageLabel];
// [self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.headerView);
// make.height.mas_equalTo(18);
// make.top.equalTo(self.nameLabel.mas_bottom).offset(8);
// make.width.mas_greaterThanOrEqualTo(35);
// }];
2025-08-08 10:49:36 +08:00
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
2025-10-20 09:43:10 +08:00
layout.itemSize = CGSizeMake(UserIconWidth, UserIconHeight);
2025-08-08 10:49:36 +08:00
layout.minimumLineSpacing = 7;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
2025-10-20 09:43:10 +08:00
self.collectionView.backgroundColor = UIColor.clearColor;
2025-08-08 10:49:36 +08:00
[self.collectionView registerClass:[QXTagImageCell class] forCellWithReuseIdentifier:@"QXTagImageCell"];
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.left.equalTo(self.nameLabel);
2025-08-08 10:49:36 +08:00
make.height.mas_equalTo(18);
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.idLabel.mas_bottom).offset(5);
make.width.mas_equalTo(ScaleWidth(240));
2025-08-08 10:49:36 +08:00
}];
self.introduceLabel = [[UILabel alloc] init];
self.introduceLabel.textColor = QXConfig.textColor;
self.introduceLabel.font = [UIFont systemFontOfSize:14];
self.introduceLabel.numberOfLines = 0;
[self addSubview:self.introduceLabel];
[self.introduceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerView);
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.collectionView.mas_bottom).offset(6);
2025-08-08 10:49:36 +08:00
make.width.mas_equalTo(SCREEN_WIDTH-64);
2025-11-21 16:17:05 +08:00
make.height.mas_greaterThanOrEqualTo(17);
2025-08-08 10:49:36 +08:00
}];
UICollectionViewFlowLayout *inlayout = [[UICollectionViewFlowLayout alloc] init];
inlayout.itemSize = CGSizeMake(77, 22);
inlayout.minimumLineSpacing = 12;
inlayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.inCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:inlayout];
self.inCollectionView.delegate = self;
self.inCollectionView.dataSource = self;
self.inCollectionView.showsHorizontalScrollIndicator = NO;
2025-10-20 09:43:10 +08:00
self.inCollectionView.backgroundColor = UIColor.clearColor;
2025-08-08 10:49:36 +08:00
[self.inCollectionView registerClass:[QXSearchCell class] forCellWithReuseIdentifier:@"QXSearchCell"];
[self addSubview:self.inCollectionView];
[self.inCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerView);
make.height.mas_equalTo(22);
make.top.equalTo(self.introduceLabel.mas_bottom).offset(4);
2025-11-21 16:17:05 +08:00
make.right.mas_equalTo(-32);
2025-08-08 10:49:36 +08:00
}];
self.whiteBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 46, self.width, 167)];
2025-11-21 16:17:05 +08:00
self.whiteBgView.backgroundColor = RGB16(0xffffff);
2025-08-08 10:49:36 +08:00
[self.whiteBgView addRoundedCornersWithRadius:16];
[self insertSubview:self.whiteBgView belowSubview:self.headerView];
[self.whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.left.mas_equalTo(0);
make.right.mas_equalTo(0);
2025-08-08 10:49:36 +08:00
make.top.equalTo(self.headerView.mas_top).offset(20);
2025-11-21 16:17:05 +08:00
make.bottom.equalTo(self.inCollectionView).offset(10);
}];
self.guildBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_home_guild_bg"]];
[self.whiteBgView addSubview:self.guildBgImageView];
[self.guildBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-8);
make.height.mas_equalTo(31);
make.top.mas_equalTo(6);
make.width.mas_equalTo(94);
}];
self.guildLabel = [[UILabel alloc] init];
self.guildLabel.textColor = RGB16(0xffffff);
self.guildLabel.textAlignment = NSTextAlignmentCenter;
self.guildLabel.lineBreakMode = NSLineBreakByClipping;
self.guildLabel.font = [UIFont boldSystemFontOfSize:10];
[self.whiteBgView addSubview:self.guildLabel];
[self.guildLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.guildBgImageView).offset(6);
make.height.mas_equalTo(14);
make.top.equalTo(self.guildBgImageView).offset(6);
make.right.equalTo(self.guildBgImageView).offset(-28);
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.grayBgView = [[UIView alloc] initWithFrame:CGRectMake(0, self.whiteBgView.top+75, self.width, 92)];
2025-11-21 16:17:05 +08:00
self.grayBgView.backgroundColor = RGB16(0xF3F3F3);
// [self.grayBgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
2025-08-08 10:49:36 +08:00
[self insertSubview:self.grayBgView belowSubview:self.whiteBgView];
[self.grayBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
2025-11-21 16:17:05 +08:00
make.top.equalTo(self.whiteBgView).offset(16);
make.bottom.equalTo(self);
2025-08-08 10:49:36 +08:00
}];
2025-11-21 16:17:05 +08:00
self.playBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.playBtn.left-6-91, self.whiteBgView.top+10, 91, 24)];
2025-10-20 09:43:10 +08:00
// [self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
// [self.playBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
// self.playBtn.backgroundColor = RGB16(0x333333);
2025-08-08 10:49:36 +08:00
self.playBtn.hidden = YES;
self.playBtn.titleLabel.font = [UIFont systemFontOfSize:14];
2025-11-21 16:17:05 +08:00
[self.playBtn addRoundedCornersWithRadius:12];
2025-08-08 10:49:36 +08:00
[self.playBtn addTarget:self action:@selector(playAction) forControlEvents:(UIControlEventTouchUpInside)];
2025-11-21 16:17:05 +08:00
[self.whiteBgView addSubview:self.playBtn];
2025-08-08 10:49:36 +08:00
[self.playBtn mas_makeConstraints:^(MASConstraintMaker *make) {
2025-11-21 16:17:05 +08:00
make.right.equalTo(self.guildBgImageView.mas_left).offset(-6);
make.width.mas_equalTo(59);
make.height.mas_equalTo(24);
make.centerY.equalTo(self.guildBgImageView).offset(-2);
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.nameLabel.text = @"张三";
// self.idLabel.text = @"313213213";
// self.ageLabel.text = @"36岁";
// self.introduceLabel.text = @"个人简介个人简介个人简介个人简个人简介";
[self.inCollectionView reloadData];
2025-11-21 16:17:05 +08:00
self.cpDressView = [[QXUserCpDressView alloc] initWithFrame:CGRectMake(self.width-15-ScaleWidth(120), 0, ScaleWidth(120), ScaleWidth(194))];
self.cpDressView.hidden = YES;
[self.whiteBgView addSubview:self.cpDressView];
self.cpCardView = [[QXUserCpCardView alloc] init];
2025-11-28 22:43:06 +08:00
self.cpCardView.delegate = self;
2025-11-21 16:17:05 +08:00
self.cpCardView.hidden = YES;
MJWeakSelf
[self.cpCardView addTapBlock:^(id _Nonnull obj) {
QXHeartBeatSpaceViewController*vc = [[QXHeartBeatSpaceViewController alloc] init];
vc.userId = weakSelf.userId;
[weakSelf.viewController.navigationController pushViewController:vc animated:YES];
}];
[self addSubview:self.cpCardView];
[self.cpCardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(17);
make.right.mas_equalTo(-17);
make.top.equalTo(self.whiteBgView.mas_bottom).offset(14);
make.height.mas_equalTo(ScaleWidth(100));
}];
self.giftWallBtn = [[UIButton alloc] init];
[self.giftWallBtn addTarget:self action:@selector(giftWallAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.giftWallBtn setBackgroundImage:[UIImage imageNamed:@"user_home_gift_wall"] forState:(UIControlStateNormal)];
[self addSubview:self.giftWallBtn];
[self.giftWallBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(17);
make.right.mas_equalTo(-17);
make.height.mas_equalTo(ScaleWidth(40));
make.top.equalTo(self.cpCardView.mas_bottom).offset(8);
}];
2025-11-28 22:43:06 +08:00
[self.whiteBgView bringSubviewToFront:self.playBtn];
[self bringSubviewToFront:self.followBtn];
}
-(void)headerStartPlay{
[self.headerView playHWDMP4];
[self.cpCardView headerStartPlay];
[self.cpDressView headerStartPlay];
2025-11-21 16:17:05 +08:00
}
-(void)giftWallAction{
QXGiftWallViewController *vc = [[QXGiftWallViewController alloc] init];
vc.userId = self.userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
2025-08-08 10:49:36 +08:00
}
-(void)followAction{
MJWeakSelf
[QXDynamicNetwork followWithUserId:self.model.user_id type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.followBtn.selected = !weakSelf.followBtn.selected;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)playAction{
if (self.model.room_id.intValue > 0) {
//
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.room_id isRejoin:NO navagationController:self.navigationController];
}else{
//
[[QXGlobal shareGlobal] chatWithUserID:self.model.user_id nickname:self.model.nickname avatar:self.model.avatar navagationController:self.navigationController];
}
}
2025-11-28 22:43:06 +08:00
-(void)didClickHeaderViewUserId:(NSString*)userId{
if ([userId isEqualToString:self.userId]) {
return;
}
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
vc.user_id = userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
}
-(void)didClickHeaderCardViewWithUserId:(NSString*)userId{
QXHeartBeatSpaceViewController *vc = [[QXHeartBeatSpaceViewController alloc] init];
vc.userId = userId;
[self.viewController.navigationController pushViewController:vc animated:YES];
}
2025-08-08 10:49:36 +08:00
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
if (collectionView == self.collectionView) {
return self.model.icon.count;
}else{
return self.model.tag_list.count;
}
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
if (collectionView == self.collectionView) {
QXTagImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXTagImageCell" forIndexPath:indexPath];
cell.imageUrl = self.model.icon[indexPath.row];
return cell;
}else{
QXSearchCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSearchCell" forIndexPath:indexPath];
cell.cellType = QXSearchCellTypeIntroduce;
cell.userTag = self.model.tag_list[indexPath.row];
return cell;
}
}
2025-11-28 22:43:06 +08:00
-(void)setUserId:(NSString *)userId{
_userId = userId;
self.cpCardView.userId = self.userId;
}
2025-08-08 10:49:36 +08:00
-(void)setModel:(QXUserHomeModel *)model{
_model = model;
2025-11-21 16:17:05 +08:00
// model.nickname = @"大家好撒客户端撒大厦尽快";
// self.tempName.text = model.nickname;
2025-08-08 10:49:36 +08:00
[self.headerView setHeadIcon:model.avatar dress:model.dress];
2025-11-11 17:19:21 +08:00
[self.headerView.nobilityImageView sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
2025-11-21 16:17:05 +08:00
2025-11-11 17:19:21 +08:00
if ([model.nickname_color isExist]) {
2025-11-21 16:17:05 +08:00
self.nameLabel.shimmerColor = [UIColor colorWithHexString:model.nickname_color];
[self.nameLabel startShimmer];
// self.tempName.shimmerColor = UIColor.redColor;
// [self.tempName startShimmer];
2025-11-11 17:19:21 +08:00
}else{
2025-11-21 16:17:05 +08:00
[self.nameLabel stopShimmer];
2025-11-11 17:19:21 +08:00
}
2025-11-21 16:17:05 +08:00
self.nameLabel.text = model.nickname;
[self.nameLabel.contentLabel sizeToFit];
[self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.headerView);
make.height.mas_equalTo(24);
make.top.equalTo(self.headerView.mas_bottom).offset(4);
make.width.mas_equalTo(self.nameLabel.contentLabel.width);
}];
if (model.cp_info != nil) {
self.cpDressView.hidden = NO;
self.cpCardView.hidden = NO;
self.cpDressView.model = model.cp_info;
self.cpCardView.model = model.cp_info;
[self.giftWallBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(17);
make.right.mas_equalTo(-17);
make.height.mas_equalTo(ScaleWidth(40));
make.top.equalTo(self.cpCardView.mas_bottom).offset(8);
}];
}else{
self.cpDressView.hidden = YES;
self.cpCardView.hidden = YES;
[self.giftWallBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(17);
make.right.mas_equalTo(-17);
make.height.mas_equalTo(ScaleWidth(40));
make.top.equalTo(self.whiteBgView.mas_bottom).offset(8);
}];
}
// self.tempName.text = model.nickname;
// [self.tempName.contentLabel sizeToFit];
// [self.tempName mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.top.left.mas_equalTo(0);
// make.height.mas_equalTo(24);
// make.width.mas_equalTo(self.tempName.contentLabel.width);
// }];
// self.tempName.text = model.nickname;
// self.idLabel.text = [NSString stringWithFormat:@"ID:%@",model.user_code];
self.idLabel.text = [NSString stringWithFormat:@"%@|%ld岁 ID:%@",model.sex.intValue==1?QXText(@"男"):QXText(@"女"),[model.birthday ageWithDateOfBirth],model.user_code];
2025-08-08 10:49:36 +08:00
self.introduceLabel.text = model.profile;
[self.inCollectionView reloadData];
[self.collectionView reloadData];
if ([model.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
self.followBtn.hidden = YES;
self.playBtn.hidden = YES;
}else{
self.followBtn.hidden = NO;
self.playBtn.hidden = NO;
self.followBtn.selected = model.is_follow==0?NO:YES;
if (model.room_id.intValue > 0) {
// [self.playBtn setTitle:QXText(@"跟随") forState:(UIControlStateNormal)];
[self.playBtn setBackgroundImage:[UIImage imageNamed:@"room_user_follow"] forState:(UIControlStateNormal)];
2025-08-08 10:49:36 +08:00
}else{
// [self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
[self.playBtn setBackgroundImage:[UIImage imageNamed:@"expansion_call"] forState:(UIControlStateNormal)];
2025-08-08 10:49:36 +08:00
}
}
if ([model.guild isExist]) {
2025-11-21 16:17:05 +08:00
self.guildLabel.text = model.guild;
}else{
2025-11-21 16:17:05 +08:00
self.guildLabel.text = @"无";
}
2025-08-08 10:49:36 +08:00
if (model.is_use_code.intValue == 1) {
self.useCodeImageView.hidden = NO;
}else{
self.useCodeImageView.hidden = YES;
}
2025-11-21 16:17:05 +08:00
// UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
// self.sexImageView.image = sexImage;
2025-08-08 10:49:36 +08:00
}
-(NSMutableArray *)tagArray{
if (!_tagArray) {
_tagArray = [NSMutableArray array];
}
return _tagArray;
}
@end
@implementation QXTagImageCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setImageUrl:(NSString *)imageUrl{
_imageUrl = imageUrl;
if ([imageUrl hasPrefix:@"http"] || [imageUrl hasPrefix:@"https"]) {
[self.imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:nil];
}else{
if ([imageUrl isEqualToString:@"mine_room_cover_add"]) {
self.imageView.image = [UIImage imageNamed:imageUrl];
}else{
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,imageUrl];
[self.imageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:nil];
}
}
}
-(void)initSubviews{
self.imageView = [[UIImageView alloc] initWithFrame:self.bounds];
[self.contentView addSubview:self.imageView];
self.imageView.contentMode = UIViewContentModeScaleToFill;
self.imageView.clipsToBounds = YES;
// [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.bottom.left.right.equalTo(self.contentView);
// }];
}
@end