提交
This commit is contained in:
18
QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.h
Normal file
18
QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXIntimateContentView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/21.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "JXPagerView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateContentView : UIView<JXPagerViewListViewDelegate>
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
|
||||
@property (nonatomic,assign)BOOL isTopFloating;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
311
QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m
Normal file
311
QXLive/Mine(音域)/View/亲密关系/QXIntimateContentView.m
Normal file
@@ -0,0 +1,311 @@
|
||||
//
|
||||
// QXIntimateContentView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/21.
|
||||
//
|
||||
|
||||
#import "QXIntimateContentView.h"
|
||||
#import "QXRoomBestFriendModel.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXMoreIntimateViewController.h"
|
||||
#import "QXButton.h"
|
||||
#import "QXIntimateCpCell.h"
|
||||
#import "QXIntimateNoCpCell.h"
|
||||
#import "QXIntimateListCell.h"
|
||||
#import "QXIntimateMoreListCell.h"
|
||||
#import "QXUserCpCardView.h"
|
||||
|
||||
@interface QXIntimateContentView()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UIView *tableHeaderView;
|
||||
@property (nonatomic,strong)UIImageView *topImageView;
|
||||
@property (nonatomic,strong)QXUserCpCardView *cpCardView;
|
||||
@property (nonatomic,strong)UIView *noCpView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,strong)QXRoomBestFriendModel *model;
|
||||
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
||||
@end
|
||||
|
||||
@implementation QXIntimateContentView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.backgroundColor = RGB16(0xF5E8FF);
|
||||
|
||||
self.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, ScaleWidth(188))];
|
||||
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_top_bg"]];
|
||||
self.topImageView.frame = CGRectMake(0, 0, self.width, ScaleWidth(241));
|
||||
[self.tableHeaderView addSubview:self.topImageView];
|
||||
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.right.equalTo(self.tableHeaderView);
|
||||
make.height.mas_equalTo(ScaleWidth(241));
|
||||
}];
|
||||
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_title_bg"]];
|
||||
UILabel *titleLabel = [[UILabel alloc] init];
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
titleLabel.textColor = RGB16(0xffffff);
|
||||
titleLabel.text = @"心动";
|
||||
[self.tableHeaderView addSubview:imageView];
|
||||
[self.tableHeaderView addSubview:titleLabel];
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(132);
|
||||
make.height.mas_equalTo(36);
|
||||
make.centerX.equalTo(self.tableHeaderView);
|
||||
make.top.mas_equalTo(ScaleWidth(152));
|
||||
}];
|
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(imageView);
|
||||
make.centerY.equalTo(imageView).offset(2);
|
||||
}];
|
||||
self.cpCardView = [[QXUserCpCardView alloc] init];
|
||||
self.cpCardView.hidden = YES;
|
||||
[self.tableHeaderView addSubview:self.cpCardView];
|
||||
[self.cpCardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(imageView.mas_bottom).offset(16);
|
||||
make.height.mas_equalTo(ScaleWidth(100));
|
||||
make.left.mas_equalTo(24);
|
||||
make.right.mas_equalTo(-24);
|
||||
}];
|
||||
|
||||
self.noCpView = [[UIView alloc] init];
|
||||
self.noCpView.hidden = YES;
|
||||
[self.tableHeaderView addSubview:self.noCpView];
|
||||
[self.noCpView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(24);
|
||||
make.right.mas_equalTo(-24);
|
||||
make.height.mas_equalTo(36);
|
||||
make.top.equalTo(imageView.mas_bottom).offset(16);
|
||||
}];
|
||||
UIImageView *noCpImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_no_cp_bg"]];
|
||||
[self.noCpView addSubview:noCpImageView];
|
||||
[noCpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.noCpView);
|
||||
}];
|
||||
|
||||
UILabel *noCpLabel = [[UILabel alloc] init];
|
||||
noCpLabel.textAlignment = NSTextAlignmentCenter;
|
||||
noCpLabel.font = [UIFont systemFontOfSize:12];
|
||||
noCpLabel.text = @"暂无关系,前往房间互送特殊礼物达成关系吧";
|
||||
noCpLabel.textColor = RGB16(0x624E79);
|
||||
[self.noCpView addSubview:noCpLabel];
|
||||
[noCpLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.noCpView);
|
||||
}];
|
||||
self.tableView.tableHeaderView = self.tableHeaderView;
|
||||
[self addSubview:self.tableView];
|
||||
}
|
||||
-(void)layoutSubviews{
|
||||
[super layoutSubviews];
|
||||
self.tableView.frame = CGRectMake(0, 0, self.width, self.height);
|
||||
}
|
||||
-(void)setIsTopFloating:(BOOL)isTopFloating{
|
||||
_isTopFloating = isTopFloating;
|
||||
if (isTopFloating) {
|
||||
[self addSubview:self.topImageView];
|
||||
}else{
|
||||
self.tableView.tableHeaderView = self.topImageView;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)setUserId:(NSString *)userId{
|
||||
_userId = userId;
|
||||
self.page = 1;
|
||||
[self getList];
|
||||
}
|
||||
-(void)getList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork userBestFriendsListWithUserId:self.userId page:self.page successBlock:^(QXRoomBestFriendModel * _Nonnull model) {
|
||||
weakSelf.model = model;
|
||||
if (model.cp == nil) {
|
||||
self.noCpView.hidden = NO;
|
||||
self.cpCardView.hidden = YES;
|
||||
self.tableHeaderView.width = SCREEN_WIDTH;
|
||||
self.tableHeaderView.height = ScaleWidth(188)+16+ScaleWidth(36);
|
||||
}else{
|
||||
self.noCpView.hidden = YES;
|
||||
self.cpCardView.hidden = NO;
|
||||
self.tableHeaderView.width = SCREEN_WIDTH;
|
||||
self.tableHeaderView.height = ScaleWidth(188)+16+ScaleWidth(100);
|
||||
self.cpCardView.model = model.cp;
|
||||
}
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:model.no_cp];
|
||||
[weakSelf.tableView reloadData];
|
||||
if (model.no_cp.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)moreAction:(QXButton*)btn{
|
||||
QXRoomBestFriendListModel *md = btn.object;
|
||||
QXMoreIntimateViewController *vc = [[QXMoreIntimateViewController alloc] init];
|
||||
vc.userId = self.userId;
|
||||
vc.relation_id = md.relation_list.firstObject.relation_id;
|
||||
[self.viewController.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return 1;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomBestFriendListModel *md = self.dataArray[indexPath.section];
|
||||
if (md.relation_list.count > 1) {
|
||||
QXIntimateListCell*cell = [QXIntimateListCell cellWithTableView:tableView];
|
||||
QXRoomBestFriendListModel *md = self.dataArray[indexPath.section];
|
||||
cell.model = md;
|
||||
return cell;
|
||||
}else{
|
||||
MJWeakSelf
|
||||
QXIntimateMoreListCell *cell = [QXIntimateMoreListCell cellWithTableView:tableView];
|
||||
cell.model = md.relation_list.firstObject;
|
||||
cell.deleteSuccessBlock = ^(QXRelationshipListModel * _Nonnull model) {
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getList];
|
||||
};
|
||||
return cell;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
||||
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 50)];
|
||||
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_intimate_title_bg"]];
|
||||
UILabel *titleLabel = [[UILabel alloc] init];
|
||||
titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
titleLabel.textColor = RGB16(0xffffff);
|
||||
QXButton *btn = [[QXButton alloc] init];
|
||||
[btn setTitle:@"更多>>" forState:(UIControlStateNormal)];
|
||||
[btn setTitleColor:RGB16(0xE973FC) forState:(UIControlStateNormal)];
|
||||
btn.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
[btn addTarget:self action:@selector(moreAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[header addSubview:btn];
|
||||
[header addSubview:imageView];
|
||||
[header addSubview:titleLabel];
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(132);
|
||||
make.height.mas_equalTo(36);
|
||||
make.centerX.centerY.equalTo(header);
|
||||
}];
|
||||
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(header);
|
||||
make.centerY.equalTo(header).offset(2);
|
||||
}];
|
||||
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-23);
|
||||
make.top.bottom.equalTo(header);
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
QXRoomBestFriendListModel *md = self.dataArray[section];
|
||||
titleLabel.text = md.relation_name;
|
||||
if (md.relation_list.count>1) {
|
||||
btn.hidden = NO;
|
||||
btn.object = md;
|
||||
}else{
|
||||
btn.hidden = YES;
|
||||
}
|
||||
return header;
|
||||
}
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
||||
return 50;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomBestFriendListModel *md = self.dataArray[indexPath.section];
|
||||
if (md.relation_list.count > 1) {
|
||||
return ScaleWidth(92)+18;
|
||||
}else{
|
||||
if (md.relation_list.count == 0) {
|
||||
return 0;
|
||||
}else{
|
||||
return ScaleWidth(125);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
||||
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 15)];
|
||||
return footer;
|
||||
}
|
||||
|
||||
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
||||
return 15;
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
_tableView.sectionHeaderTopPadding = 0;
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
}
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getList];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getList];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (self.scrollCallback != nil) {
|
||||
self.scrollCallback(scrollView);
|
||||
}
|
||||
if (self.listScrollCallback != nil) {
|
||||
self.listScrollCallback(scrollView);
|
||||
}
|
||||
}
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
|
||||
- (UIScrollView *)listScrollView {
|
||||
return self.tableView;
|
||||
}
|
||||
|
||||
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
|
||||
self.scrollCallback = callback;
|
||||
}
|
||||
|
||||
- (UIView *)listView {
|
||||
return self;
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
17
QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h
Normal file
17
QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXIntimateCpCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateCpCell : UITableViewCell
|
||||
@property (nonatomic,strong)QXUserCpInfoModel *model;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
58
QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m
Normal file
58
QXLive/Mine(音域)/View/亲密关系/QXIntimateCpCell.m
Normal file
@@ -0,0 +1,58 @@
|
||||
//
|
||||
// QXIntimateCpCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import "QXIntimateCpCell.h"
|
||||
#import "QXUserCpCardView.h"
|
||||
@interface QXIntimateCpCell()
|
||||
@property (nonatomic,strong)QXUserCpCardView *cardView;
|
||||
@end
|
||||
@implementation QXIntimateCpCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXIntimateCpCell";
|
||||
QXIntimateCpCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXIntimateCpCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setModel:(QXUserCpInfoModel *)model{
|
||||
_model = model;
|
||||
self.cardView.model = model;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.cardView = [[QXUserCpCardView alloc] init];
|
||||
[self.contentView addSubview:self.cardView];
|
||||
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(24);
|
||||
make.right.mas_equalTo(-24);
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
}];
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
17
QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h
Normal file
17
QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXIntimateListCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomBestFriendModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateListCell : UITableViewCell
|
||||
@property (nonatomic,strong)QXRoomBestFriendListModel *model;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
85
QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m
Normal file
85
QXLive/Mine(音域)/View/亲密关系/QXIntimateListCell.m
Normal file
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// QXIntimateListCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import "QXIntimateListCell.h"
|
||||
#import "QXIntimateUserCell.h"
|
||||
|
||||
@interface QXIntimateListCell()<UICollectionViewDataSource,UICollectionViewDelegate>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@implementation QXIntimateListCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXIntimateListCell";
|
||||
QXIntimateListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXIntimateListCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
-(void)initSubviews{
|
||||
NSInteger maxCount = 3;
|
||||
NSInteger margin = 14;
|
||||
CGFloat btnWith = (int)(SCREEN_WIDTH-48-14*2-1)/maxCount;
|
||||
CGFloat btnHeight = ScaleWidth(125);
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake(btnWith, btnHeight);
|
||||
layout.minimumLineSpacing = 0;
|
||||
layout.minimumInteritemSpacing = 14;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
[self.collectionView registerNib:[UINib nibWithNibName:@"QXIntimateUserCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXIntimateUserCell"];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
self.collectionView.showsHorizontalScrollIndicator = NO;
|
||||
self.collectionView.bounces = NO;
|
||||
self.collectionView.backgroundColor = UIColor.clearColor;
|
||||
[self.contentView addSubview:self.collectionView];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.equalTo(self.contentView);
|
||||
make.left.mas_equalTo(24);
|
||||
make.right.mas_equalTo(-24);
|
||||
}];
|
||||
}
|
||||
-(void)setModel:(QXRoomBestFriendListModel *)model{
|
||||
_model = model;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.model.relation_list.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXIntimateUserCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXIntimateUserCell" forIndexPath:indexPath];
|
||||
cell.model = self.model.relation_list[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
26
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h
Normal file
26
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// QXIntimateMoreListCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateMoreListCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *leftHeaderView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *leftSexImageView;
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *rightHeaderView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *rightSexImageView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *leftNameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *rightNameLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
@property (nonatomic,strong)QXRelationshipListModel *model;
|
||||
@property (nonatomic,copy)void(^topSuccessBlock)(QXRelationshipListModel*model);
|
||||
@property (nonatomic,copy)void(^deleteSuccessBlock)(QXRelationshipListModel*model);
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
106
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m
Normal file
106
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.m
Normal file
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// QXIntimateMoreListCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import "QXIntimateMoreListCell.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXCustomAlertView.h"
|
||||
@interface QXIntimateMoreListCell()
|
||||
@property (nonatomic,strong)QXCustomAlertView *alertView;
|
||||
@end
|
||||
@implementation QXIntimateMoreListCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXIntimateMoreListCell";
|
||||
QXIntimateMoreListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
cell.contentView.backgroundColor = [UIColor clearColor];
|
||||
[cell.leftHeaderView addRoundedCornersWithRadius:25];
|
||||
cell.leftHeaderView.layer.borderWidth = 2;
|
||||
cell.leftHeaderView.layer.borderColor = RGB16(0xffffff).CGColor;
|
||||
[cell.timeLabel addRoundedCornersWithRadius:9];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
- (IBAction)deleteAction:(id)sender {
|
||||
MJWeakSelf
|
||||
QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init];
|
||||
alertView.commitBlock = ^{
|
||||
[weakSelf deleteRelation];
|
||||
};
|
||||
[alertView showInView:self.viewController.view title:@"您确定要解除本关系吗" message:[NSString stringWithFormat:@"解除关系需要%@金币",self.model.delete_me_coin] cancleTitle:@"取消" commitTitle:@"确定"];
|
||||
}
|
||||
- (IBAction)topAction:(id)sender {
|
||||
MJWeakSelf
|
||||
QXCustomAlertView *alertView = [[QXCustomAlertView alloc] init];
|
||||
alertView.commitBlock = ^{
|
||||
[weakSelf topRelation];
|
||||
};
|
||||
[alertView showInView:self.viewController.view title:@"您确定要置顶本关系吗" message:@"" cancleTitle:@"取消" commitTitle:@"确定"];
|
||||
}
|
||||
|
||||
|
||||
-(void)deleteRelation{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork deleteRelationWithId:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(@"解除成功");
|
||||
if (weakSelf.deleteSuccessBlock) {
|
||||
weakSelf.deleteSuccessBlock(weakSelf.model);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
-(void)topRelation{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork topRelationWithId:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
showToast(@"置顶成功");
|
||||
if (weakSelf.topSuccessBlock) {
|
||||
weakSelf.topSuccessBlock(weakSelf.model);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
-(void)setModel:(QXRelationshipListModel *)model{
|
||||
_model = model;
|
||||
if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
[self.leftHeaderView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.leftNameLabel.text = model.nickname2;
|
||||
self.leftSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
[self.rightHeaderView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.rightNameLabel.text = model.nickname1;
|
||||
self.rightSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}else{
|
||||
[self.leftHeaderView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.leftNameLabel.text = model.nickname1;
|
||||
self.leftSexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
[self.rightHeaderView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.rightNameLabel.text = model.nickname2;
|
||||
self.rightSexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}
|
||||
NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970];
|
||||
long long milliseconds = (long long)(currentTime);
|
||||
NSInteger time = model.end_time.longLongValue - milliseconds;
|
||||
self.timeLabel.text = [NSString stringWithFormat:@" %@ ",[NSString getTimeWithSecond:time]];
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
163
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib
Normal file
163
QXLive/Mine(音域)/View/亲密关系/QXIntimateMoreListCell.xib
Normal file
@@ -0,0 +1,163 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="124" id="KGk-i7-Jjw" customClass="QXIntimateMoreListCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="471" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="471" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_intimate_more_list_bg" translatesAutoresizingMaskIntoConstraints="NO" id="hci-IM-egS">
|
||||
<rect key="frame" x="24" y="8" width="423" height="108"/>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9uF-c2-o0x">
|
||||
<rect key="frame" x="24" y="8" width="423" height="108"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pS6-S4-a2G" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="38" y="12" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="LoT-bN-kJj"/>
|
||||
<constraint firstAttribute="width" constant="50" id="f4E-eT-Fu8"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="fJj-mx-2yM">
|
||||
<rect key="frame" x="72" y="46" width="16" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="7gA-dt-gle"/>
|
||||
<constraint firstAttribute="width" constant="16" id="RCX-w6-Cz9"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="50s-uU-EKD" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="335" y="12" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="EF7-Lz-yqY"/>
|
||||
<constraint firstAttribute="width" constant="50" id="nBJ-dS-O67"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6nc-bo-ejr">
|
||||
<rect key="frame" x="369" y="46" width="16" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="16" id="TNB-gm-KC7"/>
|
||||
<constraint firstAttribute="height" constant="16" id="chW-7w-4Pp"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="关系天数" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dAK-uZ-bVb">
|
||||
<rect key="frame" x="185.66666666666666" y="24" width="52" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="xMo-2K-KLg"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.71764705882352942" green="0.48627450980392156" blue="0.85490196078431369" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" 99天23小时 " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8wc-ZY-rQa">
|
||||
<rect key="frame" x="166" y="44" width="91" height="18"/>
|
||||
<color key="backgroundColor" red="0.83529411764705885" green="0.59607843137254901" blue="0.97647058823529409" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="18" id="hqK-kl-k7t"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eAs-09-73J">
|
||||
<rect key="frame" x="46.666666666666671" y="66" width="33" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.36078431372549019" green="0.16470588235294117" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tuv-zg-sBW">
|
||||
<rect key="frame" x="343.66666666666669" y="66" width="33" height="16"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.36078431372549019" green="0.16470588235294117" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="50s-uU-EKD" firstAttribute="centerY" secondItem="pS6-S4-a2G" secondAttribute="centerY" id="5g4-vp-EYv"/>
|
||||
<constraint firstItem="8wc-ZY-rQa" firstAttribute="top" secondItem="dAK-uZ-bVb" secondAttribute="bottom" constant="5" id="8rk-dg-kaQ"/>
|
||||
<constraint firstItem="fJj-mx-2yM" firstAttribute="trailing" secondItem="pS6-S4-a2G" secondAttribute="trailing" id="BEj-jg-gAB"/>
|
||||
<constraint firstItem="dAK-uZ-bVb" firstAttribute="top" secondItem="9uF-c2-o0x" secondAttribute="top" constant="24" id="D9p-BA-KBw"/>
|
||||
<constraint firstItem="6nc-bo-ejr" firstAttribute="bottom" secondItem="50s-uU-EKD" secondAttribute="bottom" id="FGe-n1-Wks"/>
|
||||
<constraint firstItem="pS6-S4-a2G" firstAttribute="leading" secondItem="9uF-c2-o0x" secondAttribute="leading" constant="38" id="H5c-Mz-Qma"/>
|
||||
<constraint firstItem="dAK-uZ-bVb" firstAttribute="centerX" secondItem="9uF-c2-o0x" secondAttribute="centerX" id="VG0-8q-Lrq"/>
|
||||
<constraint firstAttribute="trailing" secondItem="50s-uU-EKD" secondAttribute="trailing" constant="38" id="Wh8-QI-j4t"/>
|
||||
<constraint firstItem="pS6-S4-a2G" firstAttribute="top" secondItem="9uF-c2-o0x" secondAttribute="top" constant="12" id="YtX-oa-Z5o"/>
|
||||
<constraint firstItem="fJj-mx-2yM" firstAttribute="bottom" secondItem="pS6-S4-a2G" secondAttribute="bottom" id="a5l-4I-UsC"/>
|
||||
<constraint firstItem="tuv-zg-sBW" firstAttribute="centerX" secondItem="50s-uU-EKD" secondAttribute="centerX" id="eA4-hx-xId"/>
|
||||
<constraint firstItem="eAs-09-73J" firstAttribute="top" secondItem="pS6-S4-a2G" secondAttribute="bottom" constant="4" id="inp-kG-exH"/>
|
||||
<constraint firstItem="6nc-bo-ejr" firstAttribute="trailing" secondItem="50s-uU-EKD" secondAttribute="trailing" id="j7A-eO-KSJ"/>
|
||||
<constraint firstItem="eAs-09-73J" firstAttribute="centerX" secondItem="pS6-S4-a2G" secondAttribute="centerX" id="smC-jH-4iI"/>
|
||||
<constraint firstItem="8wc-ZY-rQa" firstAttribute="centerX" secondItem="9uF-c2-o0x" secondAttribute="centerX" id="uKd-PA-s9w"/>
|
||||
<constraint firstItem="tuv-zg-sBW" firstAttribute="top" secondItem="50s-uU-EKD" secondAttribute="bottom" constant="4" id="yjp-7F-Gwe"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="52j-r4-V3h">
|
||||
<rect key="frame" x="407" y="8" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="DJm-rA-Osg"/>
|
||||
<constraint firstAttribute="width" constant="40" id="ZfL-xo-Y79"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="mine_intimate_delete"/>
|
||||
<connections>
|
||||
<action selector="deleteAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="u9N-6h-ln1"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QZV-rH-5ej">
|
||||
<rect key="frame" x="407" y="76" width="40" height="40"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="40" id="TvY-5A-Fdl"/>
|
||||
<constraint firstAttribute="width" constant="40" id="eNA-hq-dP6"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="mine_intimate_top"/>
|
||||
<connections>
|
||||
<action selector="topAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="HXq-Vs-0Uo"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="hci-IM-egS" firstAttribute="trailing" secondItem="9uF-c2-o0x" secondAttribute="trailing" id="5HX-ef-Aru"/>
|
||||
<constraint firstAttribute="trailing" secondItem="hci-IM-egS" secondAttribute="trailing" constant="24" id="7jP-Cm-6si"/>
|
||||
<constraint firstItem="9uF-c2-o0x" firstAttribute="top" secondItem="hci-IM-egS" secondAttribute="top" id="8mD-1d-i7u"/>
|
||||
<constraint firstItem="9uF-c2-o0x" firstAttribute="bottom" secondItem="hci-IM-egS" secondAttribute="bottom" id="LrA-c5-Zoh"/>
|
||||
<constraint firstItem="52j-r4-V3h" firstAttribute="top" secondItem="hci-IM-egS" secondAttribute="top" id="P3d-an-1db"/>
|
||||
<constraint firstItem="hci-IM-egS" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="24" id="Ymq-yb-K6H"/>
|
||||
<constraint firstAttribute="bottom" secondItem="hci-IM-egS" secondAttribute="bottom" constant="8" id="iC3-iC-x1t"/>
|
||||
<constraint firstItem="9uF-c2-o0x" firstAttribute="leading" secondItem="hci-IM-egS" secondAttribute="leading" id="kpi-KG-o7o"/>
|
||||
<constraint firstItem="QZV-rH-5ej" firstAttribute="trailing" secondItem="hci-IM-egS" secondAttribute="trailing" id="mAY-OL-7IZ"/>
|
||||
<constraint firstItem="hci-IM-egS" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="8" id="yGQ-rj-f2D"/>
|
||||
<constraint firstItem="52j-r4-V3h" firstAttribute="trailing" secondItem="hci-IM-egS" secondAttribute="trailing" id="ylJ-H9-c4E"/>
|
||||
<constraint firstItem="QZV-rH-5ej" firstAttribute="bottom" secondItem="hci-IM-egS" secondAttribute="bottom" id="yny-Nc-k10"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="leftHeaderView" destination="pS6-S4-a2G" id="pIO-eN-du1"/>
|
||||
<outlet property="leftNameLabel" destination="eAs-09-73J" id="3xn-sG-6Nz"/>
|
||||
<outlet property="leftSexImageView" destination="fJj-mx-2yM" id="TSa-Nv-4tO"/>
|
||||
<outlet property="rightHeaderView" destination="50s-uU-EKD" id="39P-NK-IhC"/>
|
||||
<outlet property="rightNameLabel" destination="tuv-zg-sBW" id="unH-ct-gfv"/>
|
||||
<outlet property="rightSexImageView" destination="6nc-bo-ejr" id="Xv0-nC-Nhq"/>
|
||||
<outlet property="timeLabel" destination="8wc-ZY-rQa" id="BIS-Ab-0EB"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="252.67175572519082" y="47.887323943661976"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="mine_intimate_delete" width="20" height="20"/>
|
||||
<image name="mine_intimate_more_list_bg" width="327" height="92"/>
|
||||
<image name="mine_intimate_top" width="20" height="20"/>
|
||||
</resources>
|
||||
</document>
|
||||
16
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.h
Normal file
16
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXIntimateNoCpCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateNoCpCell : UITableViewCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
32
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.m
Normal file
32
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.m
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// QXIntimateNoCpCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import "QXIntimateNoCpCell.h"
|
||||
|
||||
@implementation QXIntimateNoCpCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXIntimateNoCpCell";
|
||||
QXIntimateNoCpCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
cell.contentView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
48
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.xib
Normal file
48
QXLive/Mine(音域)/View/亲密关系/QXIntimateNoCpCell.xib
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="44" id="KGk-i7-Jjw" customClass="QXIntimateNoCpCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="411" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="411" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_intimate_no_cp_bg" translatesAutoresizingMaskIntoConstraints="NO" id="t41-tz-mj8">
|
||||
<rect key="frame" x="24" y="0.0" width="363" height="44"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="暂无关系,前往房间互送特殊礼物达成关系吧" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iye-nq-Z28">
|
||||
<rect key="frame" x="24" y="0.0" width="363" height="44"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" red="0.38431372549019605" green="0.30588235294117649" blue="0.47450980392156861" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="iye-nq-Z28" firstAttribute="leading" secondItem="t41-tz-mj8" secondAttribute="leading" id="0kT-Io-iA2"/>
|
||||
<constraint firstItem="iye-nq-Z28" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="5K8-Fy-YQy"/>
|
||||
<constraint firstItem="iye-nq-Z28" firstAttribute="trailing" secondItem="t41-tz-mj8" secondAttribute="trailing" id="J5K-Sd-cnV"/>
|
||||
<constraint firstAttribute="trailing" secondItem="t41-tz-mj8" secondAttribute="trailing" constant="24" id="NDJ-oT-B5A"/>
|
||||
<constraint firstAttribute="bottom" secondItem="t41-tz-mj8" secondAttribute="bottom" id="Uk6-zs-yKM"/>
|
||||
<constraint firstItem="t41-tz-mj8" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="24" id="hEY-SF-CcT"/>
|
||||
<constraint firstAttribute="bottom" secondItem="iye-nq-Z28" secondAttribute="bottom" id="kmA-fO-sQG"/>
|
||||
<constraint firstItem="t41-tz-mj8" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="vRB-xP-aoe"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<point key="canvasLocation" x="208.3969465648855" y="19.718309859154932"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="mine_intimate_no_cp_bg" width="328" height="36"/>
|
||||
</resources>
|
||||
</document>
|
||||
20
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h
Normal file
20
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// QXIntimateUserCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXRoomFriendRelationModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXIntimateUserCell : UICollectionViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *headerView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
|
||||
@property (nonatomic,strong)QXRelationshipListModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
32
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m
Normal file
32
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.m
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// QXIntimateUserCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/11/20.
|
||||
//
|
||||
|
||||
#import "QXIntimateUserCell.h"
|
||||
|
||||
@implementation QXIntimateUserCell
|
||||
-(void)setModel:(QXRelationshipListModel *)model{
|
||||
_model = model;
|
||||
if ([model.user_id1 isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
[self.headerView setHeadIcon:model.avatar2 dress:@""];
|
||||
self.nameLabel.text = model.nickname2;
|
||||
self.sexImageView.image = [UIImage imageNamed:model.sex2.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}else{
|
||||
[self.headerView setHeadIcon:model.avatar1 dress:@""];
|
||||
self.nameLabel.text = model.nickname1;
|
||||
self.sexImageView.image = [UIImage imageNamed:model.sex1.intValue == 1?@"user_sex_boy":@"user_sex_girl"];
|
||||
}
|
||||
self.timeLabel.text = [NSString getTimeWithSecond:model.end_time.longLongValue];
|
||||
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
@end
|
||||
94
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.xib
Normal file
94
QXLive/Mine(音域)/View/亲密关系/QXIntimateUserCell.xib
Normal file
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="QXIntimateUserCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="125"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_intimate_user_bg" translatesAutoresizingMaskIntoConstraints="NO" id="txM-5U-EHB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="100" height="125"/>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0天" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dho-1D-FyV">
|
||||
<rect key="frame" x="38.666666666666664" y="0.0" width="22.666666666666664" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="gdb-Xo-kaB"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="13"/>
|
||||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_intimate_user_header_bg" translatesAutoresizingMaskIntoConstraints="NO" id="hw4-Xa-702">
|
||||
<rect key="frame" x="18" y="25" width="64" height="64"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="64" id="1pU-lU-na7"/>
|
||||
<constraint firstAttribute="width" constant="64" id="Jdy-UJ-3T8"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="张三" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q6K-WV-PC5">
|
||||
<rect key="frame" x="0.0" y="96" width="100" height="15"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.38431372549019605" green="0.30588235294117649" blue="0.47450980392156861" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qh2-8T-GlR" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="28" y="35" width="44" height="44"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="44" id="NrD-gX-5TA"/>
|
||||
<constraint firstAttribute="height" constant="44" id="pW7-XR-Skb"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_sex_boy" translatesAutoresizingMaskIntoConstraints="NO" id="1bD-2w-qbH">
|
||||
<rect key="frame" x="66" y="25" width="16" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="8wn-Nx-cEd"/>
|
||||
<constraint firstAttribute="width" constant="16" id="dDj-4G-phe"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
</view>
|
||||
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
|
||||
<constraints>
|
||||
<constraint firstItem="hw4-Xa-702" firstAttribute="centerX" secondItem="SEy-5g-ep8" secondAttribute="centerX" id="5i1-sT-3Zj"/>
|
||||
<constraint firstItem="Qh2-8T-GlR" firstAttribute="centerY" secondItem="hw4-Xa-702" secondAttribute="centerY" id="AvG-Nv-TNa"/>
|
||||
<constraint firstItem="Qh2-8T-GlR" firstAttribute="centerX" secondItem="hw4-Xa-702" secondAttribute="centerX" id="JPf-mm-Jc9"/>
|
||||
<constraint firstItem="txM-5U-EHB" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="L4c-PK-Xqp"/>
|
||||
<constraint firstAttribute="bottom" secondItem="txM-5U-EHB" secondAttribute="bottom" id="Pbc-2E-uSt"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Q6K-WV-PC5" secondAttribute="trailing" id="QaU-xI-4sD"/>
|
||||
<constraint firstItem="dho-1D-FyV" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Ubc-jE-65g"/>
|
||||
<constraint firstItem="1bD-2w-qbH" firstAttribute="trailing" secondItem="hw4-Xa-702" secondAttribute="trailing" id="Xat-ix-aRx"/>
|
||||
<constraint firstItem="Q6K-WV-PC5" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="ilF-pE-WHB"/>
|
||||
<constraint firstAttribute="trailing" secondItem="txM-5U-EHB" secondAttribute="trailing" id="q1U-tP-oND"/>
|
||||
<constraint firstItem="hw4-Xa-702" firstAttribute="top" secondItem="dho-1D-FyV" secondAttribute="bottom" constant="5" id="qxe-fx-tf0"/>
|
||||
<constraint firstItem="txM-5U-EHB" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="s2x-GV-Zhe"/>
|
||||
<constraint firstItem="1bD-2w-qbH" firstAttribute="top" secondItem="hw4-Xa-702" secondAttribute="top" id="wix-kL-ORM"/>
|
||||
<constraint firstItem="dho-1D-FyV" firstAttribute="centerX" secondItem="SEy-5g-ep8" secondAttribute="centerX" id="wp9-JV-Kt1"/>
|
||||
<constraint firstItem="Q6K-WV-PC5" firstAttribute="top" secondItem="hw4-Xa-702" secondAttribute="bottom" constant="7" id="xUO-yb-6iS"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="202" height="287"/>
|
||||
<connections>
|
||||
<outlet property="headerView" destination="Qh2-8T-GlR" id="6ll-ny-kbj"/>
|
||||
<outlet property="nameLabel" destination="Q6K-WV-PC5" id="PLa-Qa-VN9"/>
|
||||
<outlet property="sexImageView" destination="1bD-2w-qbH" id="gZq-iz-Pnr"/>
|
||||
<outlet property="timeLabel" destination="dho-1D-FyV" id="Tj1-Re-Cpy"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="254.96183206106869" y="103.16901408450705"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="mine_intimate_user_bg" width="100" height="125"/>
|
||||
<image name="mine_intimate_user_header_bg" width="64" height="64"/>
|
||||
<image name="user_sex_boy" width="32" height="32"/>
|
||||
</resources>
|
||||
</document>
|
||||
Reference in New Issue
Block a user