增加换肤功能

This commit is contained in:
启星
2025-08-14 10:07:49 +08:00
parent f6964c1e89
commit 4f9318d98e
8789 changed files with 978530 additions and 2 deletions

View File

@@ -0,0 +1,55 @@
//
// QXMainHeaderView.h
// QXLive
//
// Created by 启星 on 2025/5/9.
//
#import <UIKit/UIKit.h>
#import "QXUserModel.h"
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger) {
/// 个人主页
QXMainHeaderOptionTypeGotoHome = 0,
/// 实名认证
QXMainHeaderOptionTypeRealName = 1,
/// 主播中心
QXMainHeaderOptionTypeAnchorCenter = 2,
/// 开启直播
QXMainHeaderOptionTypeStartLive = 3,
/// 编辑
QXMainHeaderOptionTypeGotoEdit = 4,
/// 房间
QXMainHeaderOptionTypeRoom = 5,
/// 关注
QXMainHeaderOptionTypeFocus = 20,
/// 粉丝
QXMainHeaderOptionTypeFans = 21,
/// 访客
QXMainHeaderOptionTypeVisitor = 22,
/// 好友
QXMainHeaderOptionTypeFriend = 23,
}QXMainHeaderOptionType;
@protocol QXMainHeaderViewDelegate <NSObject>
@optional
-(void)didClickOptionType:(QXMainHeaderOptionType)type;
@end
@interface QXMainHeaderView : UIView
@property (nonatomic,weak)id<QXMainHeaderViewDelegate>delegate;
@property (nonatomic,strong)QXUserModel *userModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,242 @@
//
// QXMainHeaderView.m
// QXLive
//
// Created by on 2025/5/9.
//
#import "QXMainHeaderView.h"
#import "QXSeatHeaderView.h"
#import "CKShimmerLabel.h"
@interface QXMainHeaderView()
@property (nonatomic, strong) QXSeatHeaderView *userHeaderView;
@property (nonatomic, strong) UIImageView *sexImageView;
//@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) CKShimmerLabel *nameLabel;
@property (nonatomic, strong) UILabel *idLabel;
@property (nonatomic, strong) UIButton *idCopyBtn;
@property (nonatomic, strong) UIView *userTagView;
@property (nonatomic, strong) UIView *userHomeView;
@property (nonatomic, strong) UILabel *userHomeTitleLabel;
@property (nonatomic, strong) UIImageView *userHomeImageView;
@property (nonatomic, strong) UIButton *userHomeBtn;
@property (nonatomic, strong) UIImageView *useCodeImageView;
//@property (nonatomic, strong) UIButton *leftBtn;
//@property (nonatomic, strong) UIButton *rightBtn;
@property (nonatomic, strong) UIButton *roomBtn;
///
@property (nonatomic, strong) NSMutableArray *iconArray;
@end
@implementation QXMainHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
MJWeakSelf
self.userHeaderView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(16, 40, 68, 68)];
[self.userHeaderView addTapBlock:^(id _Nonnull obj) {
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[weakSelf.delegate didClickOptionType:QXMainHeaderOptionTypeGotoHome];
}
}];
[self addSubview:self.userHeaderView];
self.sexImageView = [[UIImageView alloc] init];
[self addSubview:self.sexImageView];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.bottom.equalTo(self.userHeaderView);
make.height.width.mas_equalTo(16);
}];
// self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.userHeaderView.right+6, self.userHeaderView.top, self.width-self.userHeaderView.right-16-6, 23)];
self.nameLabel = [[CKShimmerLabel alloc] initWithFrame:CGRectMake(self.userHeaderView.right+6, self.userHeaderView.top, self.width-self.userHeaderView.right-16-6, 23)];
self.nameLabel.shimmerWidth = 20;
self.nameLabel.shimmerRadius = 20;
self.nameLabel.shimmerColor = [UIColor yellowColor];
self.nameLabel.repeat = YES;
self.nameLabel.textColor = QXConfig.textColor;
self.nameLabel.font = [UIFont boldSystemFontOfSize:18];
// [self.nameLabel startShimmer];
[self addSubview:self.nameLabel];
self.idLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.userHeaderView.right+6, self.nameLabel.bottom+5, 80, 17)];
self.idLabel.textColor = RGB16(0x666666);
self.idLabel.font = [UIFont systemFontOfSize:12];
self.idLabel.text = @"ID:";
[self addSubview:self.idLabel];
self.useCodeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_usercode_isLiang"]];
self.useCodeImageView.frame = CGRectMake(0, 0, 32, 13);
self.useCodeImageView.hidden = YES;
[self addSubview:self.useCodeImageView];
self.idCopyBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.idLabel.right, 0, 25, 25)];
self.idCopyBtn.centerY = self.idLabel.centerY;
[self.idCopyBtn setImage:[UIImage imageNamed:@"id_copy"] forState:(UIControlStateNormal)];
[self.idCopyBtn addTarget:self action:@selector(idCopyClick) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.idCopyBtn];
self.userHomeView = [[UIView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-60-16, 0, 60, 23)];
self.userHomeView.layer.cornerRadius = self.userHomeView.height/2.0;
self.userHomeView.layer.shadowColor = [UIColor grayColor].CGColor;
self.userHomeView.layer.shadowOpacity = 0.3;
self.userHomeView.layer.shadowOffset = CGSizeMake(0, 2);
self.userHomeView.layer.shadowRadius = 2;
self.userHomeView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.userHomeView.bounds cornerRadius:self.userHomeView.layer.cornerRadius].CGPath;
self.userHomeView.layer.masksToBounds = NO;
self.userHomeView.centerY = self.userHeaderView.centerY;
self.userHomeView.backgroundColor = [UIColor whiteColor];
[self addSubview:self.userHomeView];
self.userHomeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrowRight"]];
self.userHomeImageView.frame = CGRectMake(self.userHomeView.width-10-16, (23-16)/2.0, 16, 16);
[self.userHomeView addSubview:self.userHomeImageView];
self.userHomeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 20, 20)];
self.userHomeTitleLabel.text = QXText(@"编辑");
self.userHomeTitleLabel.font = [UIFont systemFontOfSize:12];
self.userHomeTitleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
[self.userHomeTitleLabel sizeToFit];
self.userHomeTitleLabel.x = 10;
self.userHomeTitleLabel.y =( self.userHomeView.height - self.userHomeTitleLabel.height)/2.0;
[self.userHomeView addSubview:self.userHomeTitleLabel];
self.userHomeBtn = [[UIButton alloc] initWithFrame:self.userHomeView.bounds];
[self.userHomeBtn addTarget:self action:@selector(gotoUserHomePageClick) forControlEvents:(UIControlEventTouchUpInside)];
[self.userHomeView addSubview:self.userHomeBtn];
// NSArray* nameArr = @[
// QXText(@"关注"), QXText(@"粉丝"), QXText(@"好友"), QXText(@"访客")
// ];
NSArray* nameArr = @[
QXText(@"关注"), QXText(@"粉丝"),QXText(@"访客")
];
CGFloat width = (SCREEN_WIDTH-32)/4;
for (int i = 0; i < nameArr.count; i ++) {
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16+width*i, self.userHeaderView.bottom+19, width, 22)];
titleLabel.textColor = RGB16(0x666666);
titleLabel.font = [UIFont systemFontOfSize:12];
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.text = nameArr[i];
[titleLabel sizeToFit];
titleLabel.x = 16+width*i;
titleLabel.y = self.userHeaderView.bottom+16;
titleLabel.height = 22;
[self addSubview:titleLabel];
UILabel *countLabel = [[UILabel alloc] initWithFrame:CGRectMake(titleLabel.right+5, titleLabel.top, width-10-titleLabel.width, 22)];
countLabel.textAlignment = NSTextAlignmentCenter;
countLabel.textColor = QXConfig.textColor;
countLabel.tag = 10 + i;
countLabel.font = [UIFont boldSystemFontOfSize:16];
countLabel.text = @"0";
countLabel.centerY = titleLabel.centerY;
[self addSubview:countLabel];
UIControl *c = [[UIControl alloc] initWithFrame:CGRectMake(titleLabel.left, titleLabel.top-10, width, titleLabel.height+20)];
c.tag = 20 + i;
[c addTarget:self action:@selector(viewClick:) forControlEvents:UIControlEventTouchUpInside];
[self addSubview:c];
}
// self.leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(16, self.userHeaderView.bottom+54, width*2-7.5, 67)];
// [self.leftBtn setBackgroundImage:[UIImage imageNamed:@"start_live"] forState:(UIControlStateNormal)];
// [self.leftBtn addTarget:self action:@selector(leftAction) forControlEvents:(UIControlEventTouchUpInside)];
// [self addSubview:self.leftBtn];
//
// self.rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.leftBtn.right+7.5, self.userHeaderView.bottom+54, self.leftBtn.width, 67)];
// [self.rightBtn setBackgroundImage:[UIImage imageNamed:@"become_anchor"] forState:(UIControlStateNormal)];
// [self.rightBtn addTarget:self action:@selector(rightAction) forControlEvents:(UIControlEventTouchUpInside)];
// [self addSubview:self.rightBtn];
self.roomBtn = [[UIButton alloc] initWithFrame:CGRectMake(16, self.userHeaderView.bottom+54, self.width-32, ScaleWidth(67))];
[self.roomBtn setBackgroundImage:[UIImage imageNamed:@"mine_header_room"] forState:(UIControlStateNormal)];
[self.roomBtn addTarget:self action:@selector(roomAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.roomBtn];
}
-(void)viewClick:(UIControl*)sender{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[self.delegate didClickOptionType:sender.tag];
}
}
-(void)roomAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[self.delegate didClickOptionType:QXMainHeaderOptionTypeRoom];
}
}
-(void)leftAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[self.delegate didClickOptionType:QXMainHeaderOptionTypeStartLive];
}
}
-(void)rightAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[self.delegate didClickOptionType:QXMainHeaderOptionTypeRealName];
}
}
-(void)gotoUserHomePageClick{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickOptionType:)]) {
[self.delegate didClickOptionType:QXMainHeaderOptionTypeGotoEdit];
}
}
-(void)setUserModel:(QXUserModel *)userModel{
_userModel = userModel;
[self.userHeaderView setHeadIcon:userModel.avatar dress:userModel.dress];
self.nameLabel.text = userModel.nickname;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@",userModel.user_code];
UILabel *followLabel = [self viewWithTag:10];
UILabel *fansLabel = [self viewWithTag:11];
UILabel *lookLabel = [self viewWithTag:12];
followLabel.text = userModel.follow_num;
fansLabel.text = userModel.fans_num;
lookLabel.text = userModel.look_me_num;
for (UIView*v in self.iconArray) {
[v removeFromSuperview];
}
for (int i = 0;i<userModel.icon.count;i++) {
NSString*icon = userModel.icon[i];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.nameLabel.left+i*ScaleWidth(42), self.idLabel.bottom+5, ScaleWidth(42), ScaleWidth(16))];
[imageView sd_setImageWithURL:[NSURL URLWithString:icon]];
[self addSubview:imageView];
[self.iconArray addObject:imageView];
}
[self.idLabel sizeToFit];
if (userModel.is_use_code.intValue == 1) {
self.useCodeImageView.hidden = NO;
self.useCodeImageView.x = self.idLabel.right+5;
self.idCopyBtn.x = self.useCodeImageView.right;
self.useCodeImageView.centerY = self.idLabel.centerY;
}else{
self.useCodeImageView.hidden = YES;
self.idCopyBtn.x = self.idLabel.right;
}
UIImage *sexImage = [UIImage imageNamed:userModel.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
self.sexImageView.image = sexImage;
}
-(void)idCopyClick{
UIPasteboard *p = [UIPasteboard generalPasteboard];
p.string = [NSString stringWithFormat:@"%@", self.userModel.user_code];
showToast(@"已复制");
}
-(NSMutableArray *)iconArray{
if (!_iconArray) {
_iconArray = [NSMutableArray array];
}
return _iconArray;
}
@end

View File

@@ -0,0 +1,22 @@
//
// QXMineServiceCell.h
// QXLive
//
// Created by 启星 on 2025/5/9.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXMineServiceCellDelegate <NSObject>
@optional
-(void)didClickServiceWithBtn:(UIButton*)button title:(NSString*)title;
@end
@interface QXMineServiceCell : UITableViewCell
@property (nonatomic,weak)id<QXMineServiceCellDelegate>delegate;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,137 @@
//
// QXMineServiceCell.m
// QXLive
//
// Created by on 2025/5/9.
//
#import "QXMineServiceCell.h"
@interface QXMineServiceCell()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)NSArray *serviceArray;
@property (nonatomic,strong)NSArray *serviceImageArray;
@end
@implementation QXMineServiceCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXMineServiceCell";
QXMineServiceCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXMineServiceCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
}
return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = [UIColor clearColor];
[self createViews];
}
return self;
}
-(void)createViews{
self.bgView = [[UIView alloc] init];
self.bgView.backgroundColor = [UIColor whiteColor];
[self.bgView addRoundedCornersWithRadius:10];
[self.contentView addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.bottom.equalTo(self);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.text = QXText(@"更多服务");
[self.bgView addSubview:self.titleLabel];;
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(12);
make.right.mas_equalTo(-12);
make.height.mas_equalTo(24);
}];
NSInteger maxCount = 4;
CGFloat btnWith = (SCREEN_WIDTH-32)/maxCount;
CGFloat btnHeight = 44;
for (int i = 0; i < self.serviceArray.count; i++) {
NSInteger col = i / maxCount;
NSInteger line = i % maxCount;
UIButton *btn = [[UIButton alloc] init];
[self.bgView addSubview:btn];
[btn setTitle:self.serviceArray[i] forState:(UIControlStateNormal)];
[btn setTitleColor:[UIColor clearColor] forState:(UIControlStateNormal)];
[btn addTarget:self action:@selector(serviceClick:) forControlEvents:(UIControlEventTouchUpInside)];
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(line*btnWith);
make.top.equalTo(self.titleLabel.mas_bottom).offset(13+col*(btnHeight+13));
make.height.mas_equalTo(btnHeight);
make.width.mas_equalTo(btnWith);
}];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:self.serviceImageArray[i]]];
[self.bgView addSubview:imageView];
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.equalTo(btn);
make.height.width.mas_equalTo(18);
}];
UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.textColor = QXConfig.textColor;
titleLabel.text = self.serviceArray[i];
titleLabel.font = [UIFont systemFontOfSize:12];
[self.bgView addSubview:titleLabel];
[titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(imageView.mas_bottom).offset(3);
make.centerX.equalTo(btn);
make.height.mas_equalTo(17);
}];
}
}
-(void)serviceClick:(UIButton*)sender{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickServiceWithBtn:title:)]) {
[self.delegate didClickServiceWithBtn:sender title:sender.titleLabel.text];
}
}
-(NSArray *)serviceArray{
if (!_serviceArray) {
_serviceArray = @[
QXText(@"钱包"),
QXText(@"段位"),
QXText(@"公会中心"),
QXText(@"个性装扮"),
QXText(@"道具商城"),
QXText(@"我的背包"),
QXText(@"每日任务"),
];
}
return _serviceArray;
}
-(NSArray *)serviceImageArray{
if (!_serviceImageArray) {
_serviceImageArray = @[
@"service_wallet",
@"service_level",
@"service_guild",
@"service_dress",
@"service_shop",
@"service_bag",
@"service_task",
];
}
return _serviceImageArray;
}
- (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

View File

@@ -0,0 +1,22 @@
//
// QXMyHistoryHeaderView.h
// IsLandVoice
//
// Created by 启星 on 2025/4/12.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXMyHistoryHeaderViewDelegate <NSObject>
@optional
-(void)didClickClearBtn;
@end
@interface QXMyHistoryHeaderView : UIView
@property(nonatomic,weak)id<QXMyHistoryHeaderViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,45 @@
//
// QXMyHistoryHeaderView.m
// IsLandVoice
//
// Created by on 2025/4/12.
//
#import "QXMyHistoryHeaderView.h"
@implementation QXMyHistoryHeaderView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, 46);
[self createViews];
}
return self;
}
-(void)createViews{
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"history_icon"]];
imageView.frame = CGRectMake(16, 0, 13, 13);
imageView.centerY = self.centerY;
[self addSubview:imageView];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(imageView.right+6, 0, 150, 24)];
titleLabel.centerY = self.centerY;
titleLabel.text = @"历史足迹";
titleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self addSubview:titleLabel];
UIButton *clearBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-self.height, 0, self.height, self.height)];
[clearBtn addTarget:self action:@selector(clearAction) forControlEvents:(UIControlEventTouchUpInside)];
[clearBtn setImage:[UIImage imageNamed:@"room_history_delete"] forState:(UIControlStateNormal)];
[self addSubview:clearBtn];
}
-(void)clearAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickClearBtn)]) {
[self.delegate didClickClearBtn];
}
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXUserHeaderView.h
// QXLive
//
// Created by 启星 on 2025/5/9.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXUserHeaderView : UIView
@property (nonatomic,strong)NSString *avatar;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,35 @@
//
// QXUserHeaderView.m
// QXLive
//
// Created by on 2025/5/9.
//
#import "QXUserHeaderView.h"
@interface QXUserHeaderView()
@property (nonatomic, strong) UIImageView *userHeaderImageView;
@end
@implementation QXUserHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.userHeaderImageView = [[UIImageView alloc] init];
self.userHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.userHeaderImageView addRoundedCornersWithRadius:self.height/2.0];
[self addSubview:self.userHeaderImageView];
[self.userHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self);
}];
}
-(void)setAvatar:(NSString *)avatar{
_avatar = avatar;
[self.userHeaderImageView sd_setImageWithURL:[NSURL URLWithString:avatar]];
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXDayTaskRuleView.h
// QXLive
//
// Created by 启星 on 2025/6/6.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXDayTaskRuleView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,138 @@
//
// QXDayTaskRuleView.m
// QXLive
//
// Created by on 2025/6/6.
//
#import "QXDayTaskRuleView.h"
#import <WebKit/WebKit.h>
static void *WKWebBrowserContext = &WKWebBrowserContext;
@interface QXDayTaskRuleView()<WKNavigationDelegate,WKUIDelegate>
@property(nonatomic,strong)WKWebView *contentWebView;
@property(nonatomic,strong)UIProgressView *progressView;
@property(nonatomic,strong)UIButton* closeBtn;
@end
@implementation QXDayTaskRuleView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
[self addSubview:self.contentWebView];
[self addSubview:self.progressView];
[self loadData];
self.closeBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-30)/2, self.contentWebView.bottom+10, 30, 30)];
[self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)];
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.closeBtn];
}
-(void)closeAction{
[self removeFromSuperview];
}
- (void)loadData {
NSString *urlStr = [NSString stringWithFormat:@"%@web/index.html#/pages/other/taskDesc",H5ServerUrl];
NSURL* url=[NSURL URLWithString:urlStr];
NSURLRequest *request =[NSURLRequest requestWithURL:url];
[self.contentWebView loadRequest:request];
}
//
- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
}
//KVO
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([keyPath isEqualToString:NSStringFromSelector(@selector(estimatedProgress))] && object == self.contentWebView) {
[self.progressView setAlpha:1.0f];
BOOL animated = self.contentWebView.estimatedProgress > self.progressView.progress;
[self.progressView setProgress:self.contentWebView.estimatedProgress animated:animated];
// Once complete, fade out UIProgressView
if(self.contentWebView.estimatedProgress >= 1.0f) {
[UIView animateWithDuration:0.3f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
[self.progressView setAlpha:0.0f];
} completion:^(BOOL finished) {
[self.progressView setProgress:0.0f animated:NO];
}];
}
}
else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
#pragma mark - getters and setters
- (WKWebView *)contentWebView {
if (!_contentWebView) {
//
WKWebViewConfiguration * configuration = [[WKWebViewConfiguration alloc]init];
//
configuration.selectionGranularity = YES;
// webpr
configuration.processPool = [[WKProcessPool alloc] init];
//, jsoc(OCURL)
WKUserContentController * UserContentController = [[WKUserContentController alloc]init];
//
configuration.suppressesIncrementalRendering = NO;
//
configuration.preferences.javaScriptEnabled = YES;
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
configuration.userContentController = UserContentController;
// iOS9iOS8
if ([[UIDevice currentDevice].systemVersion floatValue] >= 9.0) {
//
configuration.allowsAirPlayForMediaPlayback = YES;
// 线
configuration.allowsInlineMediaPlayback = YES;
// NOios8
_contentWebView.allowsBackForwardNavigationGestures = YES;
}
_contentWebView = [[WKWebView alloc] initWithFrame:CGRectMake(25, NavContentHeight+40, self.width-25*2, self.height-(NavContentHeight+40)*2-30) configuration:configuration];
_contentWebView.backgroundColor = [UIColor clearColor];
[_contentWebView addRoundedCornersWithRadius:16];
_contentWebView.opaque = NO;
//
[_contentWebView sizeToFit];
_contentWebView.scrollView.showsVerticalScrollIndicator = NO;
_contentWebView.scrollView.backgroundColor = [UIColor clearColor];
_contentWebView.scrollView.bounces = NO;
//
_contentWebView.navigationDelegate = self;
//kvo
[_contentWebView addObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress)) options:0 context:WKWebBrowserContext];
}
return _contentWebView;
}
- (UIProgressView *)progressView {
if (!_progressView) {
_progressView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
_progressView.frame = CGRectMake(self.contentWebView.left+16, self.contentWebView.top, self.contentWebView.width-32, 2);
[_progressView setTrackTintColor:[UIColor colorWithRed:240.0/255 green:240.0/255 blue:240.0/255 alpha:1.0]];
_progressView.progressTintColor = QXConfig.themeColor;
}
return _progressView;
}
-(void)setProgressColor:(UIColor *)progressColor{
_progressView.progressTintColor = progressColor;
}
// dealloc
- (void)dealloc {
if (self) {
[self.contentWebView removeObserver:self forKeyPath:NSStringFromSelector(@selector(estimatedProgress))];
}
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXUserDynamicView.h
// QXLive
//
// Created by 启星 on 2025/5/21.
//
#import <UIKit/UIKit.h>
#import "JXPagerView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXUserDynamicView : UIView<JXPagerViewListViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic,strong)NSString *user_id;
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
- (instancetype)initWithOffsetY:(CGFloat)offsety;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,138 @@
//
// QXUserDynamicView.m
// QXLive
//
// Created by on 2025/5/21.
//
#import "QXUserDynamicView.h"
#import "QXDynamicListCell.h"
#import "QXMineNetwork.h"
#import "QXDynamicDetailViewController.h"
@interface QXUserDynamicView() <UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, strong) NSMutableArray* dataArray;
@end
@implementation QXUserDynamicView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.page = 1;
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height) style:UITableViewStylePlain];
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.tableFooterView = [UIView new];
self.tableView.dataSource = self;
self.tableView.delegate = self;
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.tableView registerNib:[UINib nibWithNibName:@"QXDynamicListCell" bundle:nil] forCellReuseIdentifier:@"QXDynamicListCell"];
self.tableView.rowHeight = UITableViewAutomaticDimension;
// self.tableView.estimatedRowHeight = 152;
[self addSubview:self.tableView];
MJWeakSelf
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 1;
[weakSelf getList];
}];
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getList];
}];
}
return self;
}
- (instancetype)initWithOffsetY:(CGFloat)offsety {
self = [self initWithFrame:CGRectZero];
self.tableView.contentOffset = CGPointMake(0, offsety);
return self;
}
-(void)setUser_id:(NSString *)user_id{
_user_id = user_id;
[self getList];
}
-(void)getList{
MJWeakSelf
[QXMineNetwork userDynamicWithUserId:self.user_id
page:self.page successBlock:^(NSArray<QXDynamicModel *> * _Nonnull hotos) {
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:hotos];
[weakSelf.tableView.mj_header endRefreshing];
if (hotos.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
}
[weakSelf.tableView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.tableView.mj_header endRefreshing];
[weakSelf.tableView.mj_footer endRefreshing];
}];
}
- (void)layoutSubviews {
[super layoutSubviews];
self.tableView.frame = self.bounds;
}
#pragma mark - UITableViewDataSource, UITableViewDelegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
QXDynamicListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QXDynamicListCell" forIndexPath:indexPath];
cell.selectionStyle = NO;
cell.cellType = QXDynamicListCellHomePage;
cell.model = self.dataArray[indexPath.row];
// cell.imgs = @[@"user_header_placehoulder",@"user_header_placehoulder"];
// SPTrendListModel *model = self.dataArray[indexPath.row];
// cell.model = model;
// WEAK_SELF
// cell.onDeleteBlock = ^{
// [weakSelf onDeleteWith:indexPath.row];
// };
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
QXDynamicDetailViewController *vc = [[QXDynamicDetailViewController alloc] init];
vc.model = self.dataArray[indexPath.row];
[self.navigationController pushViewController:vc animated:YES];
}
- (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

View File

@@ -0,0 +1,18 @@
//
// QXUserGiftWallView.h
// QXLive
//
// Created by 启星 on 2025/5/21.
//
#import <UIKit/UIKit.h>
#import "JXPagerView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXUserGiftWallView : UIView<JXPagerViewListViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
@property (nonatomic,strong)NSString *user_id;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,112 @@
//
// QXUserGiftWallView.m
// QXLive
//
// Created by on 2025/5/21.
//
#import "QXUserGiftWallView.h"
#import "QXGiftCell.h"
#import "QXMineNetwork.h"
@interface QXUserGiftWallView()<UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property (nonatomic, strong) NSMutableArray* dataArray;
@end
@implementation QXUserGiftWallView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-12*3)/4, ScaleWidth(119));
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[self.collectionView registerNib:[UINib nibWithNibName:@"QXGiftCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXGiftCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.bounces = NO;
self.collectionView.pagingEnabled = NO;
self.collectionView.backgroundColor = RGB16(0xf6f6f6);
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(12);
make.top.mas_equalTo(12);
make.height.mas_equalTo(ScaleWidth(76));
make.right.mas_equalTo(-12);
}];
}
return self;
}
- (instancetype)initWithOffsetY:(CGFloat)offsety {
self = [self initWithFrame:CGRectZero];
self.collectionView.contentOffset = CGPointMake(0, offsety);
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.collectionView.frame = self.bounds;
}
-(void)setUser_id:(NSString *)user_id{
_user_id = user_id;
[self getGiftWall];
}
-(void)getGiftWall{
MJWeakSelf
[QXMineNetwork userGiftWallithUserId:self.user_id successBlock:^(NSArray<QXUserGiftWallModel *> * _Nonnull lightList, NSArray<QXUserGiftWallModel *> * _Nonnull grayList) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.dataArray addObjectsFromArray:lightList];
[weakSelf.dataArray addObjectsFromArray:grayList];
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
#pragma mark - UITableViewDataSource, UITableViewDelegate
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
cell.cellType = QXGiftCellTypeGiftWall;
cell.giftWall = self.dataArray[indexPath.row];
return cell;
}
- (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.collectionView;
}
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
self.scrollCallback = callback;
}
- (UIView *)listView {
return self;
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
@end

View File

@@ -0,0 +1,21 @@
//
// QXUserHomeHeaderView.h
// QXLive
//
// Created by 启星 on 2025/5/20.
//
#import <UIKit/UIKit.h>
#import "QXUserModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXUserHomeHeaderView : UIView
@property (nonatomic,strong)QXUserHomeModel *model;
@end
@interface QXTagImageCell : UICollectionViewCell
@property (nonatomic,strong)NSString *imageUrl;
@property (nonatomic,strong)UIImageView *imageView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,328 @@
//
// 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"
@interface QXUserHomeHeaderView()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic,strong) QXSeatHeaderView* headerView;
@property (nonatomic,strong) UIView * whiteBgView;
@property (nonatomic,strong) UIView * grayBgView;
@property (nonatomic,strong) UILabel * nameLabel;
@property (nonatomic,strong) UILabel * idLabel;
@property (nonatomic,strong) UILabel * ageLabel;
@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;
@property (nonatomic, strong)UIImageView *sexImageView;
@property (nonatomic,strong) UIButton *followBtn;
@property (nonatomic,strong) UIButton *playBtn;
@end
@implementation QXUserHomeHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor clearColor];
self.headerView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake(32, 46, 70, 70)];
[self.headerView addRoundedCornersWithRadius:35];
[self addSubview:self.headerView];
[self.headerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(32);
make.height.width.mas_equalTo(70);
make.top.mas_equalTo(26);
}];
self.sexImageView = [[UIImageView alloc] init];
[self addSubview:self.sexImageView];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.bottom.equalTo(self.headerView);
make.height.width.mas_equalTo(16);
}];
self.nameLabel = [[UILabel alloc] init];
self.nameLabel.textColor = QXConfig.textColor;
self.nameLabel.font = [UIFont boldSystemFontOfSize:16];
[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);
}];
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) {
make.left.equalTo(self.nameLabel.mas_right).offset(12);
make.height.mas_equalTo(24);
make.centerY.equalTo(self.nameLabel);
}];
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);
}];
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);
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(42, 16);
layout.minimumLineSpacing = 7;
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
[self.collectionView registerClass:[QXTagImageCell class] forCellWithReuseIdentifier:@"QXTagImageCell"];
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.ageLabel.mas_right).offset(8);
make.height.mas_equalTo(18);
make.centerY.equalTo(self.ageLabel);
make.width.mas_equalTo(300);
}];
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);
make.top.equalTo(self.ageLabel.mas_bottom).offset(4);
make.width.mas_equalTo(SCREEN_WIDTH-64);
make.height.mas_greaterThanOrEqualTo(22);
}];
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;
[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);
make.width.mas_equalTo(SCREEN_WIDTH-64);
}];
self.whiteBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 46, self.width, 167)];
self.whiteBgView.backgroundColor = [UIColor whiteColor];
[self.whiteBgView addRoundedCornersWithRadius:16];
[self insertSubview:self.whiteBgView belowSubview:self.headerView];
[self.whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.width.mas_equalTo(SCREEN_WIDTH-32);
make.top.equalTo(self.headerView.mas_top).offset(20);
make.bottom.equalTo(self);
}];
self.grayBgView = [[UIView alloc] initWithFrame:CGRectMake(0, self.whiteBgView.top+75, self.width, 92)];
self.grayBgView.backgroundColor = RGB16(0xF6F6F6);
[self.grayBgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self insertSubview:self.grayBgView belowSubview:self.whiteBgView];
[self.grayBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self);
make.height.mas_equalTo(92);
make.bottom.equalTo(self.whiteBgView);
}];
self.playBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.playBtn.left-6-91, self.whiteBgView.top+10, 91, 35)];
[self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
[self.playBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.playBtn.backgroundColor = RGB16(0x333333);
self.playBtn.hidden = YES;
self.playBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.playBtn addRoundedCornersWithRadius:17.5];
[self.playBtn addTarget:self action:@selector(playAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.playBtn];
[self.playBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-27);
make.width.mas_equalTo(91);
make.height.mas_equalTo(35);
make.top.equalTo(self.whiteBgView).offset(10);
}];
self.followBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.playBtn.left-6-91, self.whiteBgView.top+10, 91, 35)];
[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:17.5];
self.followBtn.hidden = YES;
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.followBtn];
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.playBtn.mas_left).offset(-6);
make.width.mas_equalTo(91);
make.height.mas_equalTo(35);
make.centerY.equalTo(self.playBtn);
}];
// self.nameLabel.text = @"张三";
// self.idLabel.text = @"313213213";
// self.ageLabel.text = @"36岁";
// self.introduceLabel.text = @"个人简介个人简介个人简介个人简个人简介";
[self.inCollectionView reloadData];
}
-(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];
}
}
-(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;
}
}
-(void)setModel:(QXUserHomeModel *)model{
_model = model;
[self.headerView setHeadIcon:model.avatar dress:model.dress];
self.nameLabel.text = model.nickname;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@",model.user_code];
self.ageLabel.text = [NSString stringWithFormat:@"%@|%ld岁",model.sex.intValue==1?QXText(@"男"):QXText(@"女"),[model.birthday ageWithDateOfBirth]];
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)];
}else{
[self.playBtn setTitle:QXText(@"私信") forState:(UIControlStateNormal)];
}
}
if (model.is_use_code.intValue == 1) {
self.useCodeImageView.hidden = NO;
}else{
self.useCodeImageView.hidden = YES;
}
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
self.sexImageView.image = sexImage;
}
-(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

View File

@@ -0,0 +1,21 @@
//
// QXImageCollectionViewCell.h
// QXLive
//
// Created by 启星 on 2025/6/5.
//
#import <UIKit/UIKit.h>
#import "QXPhotoModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXImageCollectionViewCell : UICollectionViewCell
@property (nonatomic,strong)UIImageView *imageView;
@property (nonatomic,strong)UIView *selectedBgView;
@property (nonatomic,strong)UIButton *selectedBtn;
@property (nonatomic,strong)QXPhotoModel*model;
@property (nonatomic,assign)NSInteger index;
@property (nonatomic,assign)BOOL selectedState;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,75 @@
//
// QXImageCollectionViewCell.m
// QXLive
//
// Created by on 2025/6/5.
//
#import "QXImageCollectionViewCell.h"
@implementation QXImageCollectionViewCell
- (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{
// self.imageView.image = [UIImage imageNamed:imageUrl];
// }
//}
-(void)setModel:(QXPhotoModel *)model{
_model = model;
[self.imageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.selectedBtn.selected = model.isSelected;
}
-(void)setSelectedState:(BOOL)selectedState{
_selectedState = selectedState;
self.selectedBtn.hidden = !selectedState;
self.selectedBgView.hidden = !selectedState;
}
-(void)initSubviews{
self.imageView = [[UIImageView alloc] init];
[self.contentView addSubview:self.imageView];
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
self.imageView.clipsToBounds = YES;
[self.imageView addRoundedCornersWithRadius:10];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self.contentView);
}];
self.selectedBgView = [[UIView alloc] init];
self.selectedBgView.backgroundColor = RGB16A(0xffffff, 0.2);
[self.selectedBgView addRoundedCornersWithRadius:10];
self.selectedBgView.hidden = YES;
[self.contentView addSubview:self.selectedBgView];
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self.contentView);
}];
self.selectedBtn = [[UIButton alloc] init];
self.selectedBtn.userInteractionEnabled = NO;
self.selectedBtn.hidden = YES;
// [self.selectedBtn addTarget:self action:@selector(selectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
[self.contentView addSubview:self.selectedBtn];
[self.selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.equalTo(self);
make.size.mas_equalTo(CGSizeMake(25, 25));
}];
}
//-(void)deleteAction:(UIButton*)sender{
// if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDelete:index:)]) {
// [self.delegate didClickDelete:self.imageUrl index:self.index];
// }
//}
@end

View File

@@ -0,0 +1,22 @@
//
// QXPhotoPasswordView.h
// QXLive
//
// Created by 启星 on 2025/5/29.
//
#import <UIKit/UIKit.h>
#import "QXPhotoModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol QXPhotoPasswordViewDelegate <NSObject>
@optional
-(void)didClickCommitWithPassword:(NSString*)password model:(QXPhotoModel*)model;
@end
@interface QXPhotoPasswordView : UIView
@property (nonatomic,strong)QXPhotoModel *model;
@property (nonatomic,weak)id<QXPhotoPasswordViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,99 @@
//
// QXPhotoPasswordView.m
// QXLive
//
// Created by on 2025/5/29.
//
#import "QXPhotoPasswordView.h"
@interface QXPhotoPasswordView()
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)UILabel *messageLabel;
@property (nonatomic,strong)UIView *textBgView;
@property (nonatomic,strong)UITextField *textField;
@property (nonatomic,strong)UIButton*cancelBtn;
@property (nonatomic,strong)UIButton*commitBtn;
@end
@implementation QXPhotoPasswordView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(200));
self.backgroundColor = [UIColor whiteColor];
[self addRoundedCornersWithRadius:16];
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 12, self.width-80, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.text = QXText(@"温馨提示");
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-40, 0, 40, 40)];
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.closeBtn setImage:[UIImage imageNamed:@"wallet_close"] forState:(UIControlStateNormal)];
[self addSubview:self.closeBtn];
self.messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(12, self.titleLabel.bottom+12, self.width-24, 21)];
self.messageLabel.font = [UIFont systemFontOfSize:14];
self.messageLabel.textColor = QXConfig.textColor;
self.messageLabel.text = QXText(@"确认开启相册私密吗");
[self addSubview:self.messageLabel];
self.textBgView = [[UIView alloc] initWithFrame:CGRectMake(12, self.messageLabel.bottom+12, self.width-24, 44)];
[self.textBgView addRoundedCornersWithRadius:11];
self.textBgView.backgroundColor = RGB16(0xeff2f8);
[self addSubview:self.textBgView];
self.textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 0, self.textBgView.width-24, 44)];
self.textField.font = [UIFont systemFontOfSize:16];
self.textField.textColor = QXConfig.textColor;
self.textField.placeholder = QXText(@"请输入密码");
[self.textBgView addSubview:self.textField];
CGFloat btnWidth = (self.width-19*2-16) / 2;
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(19, self.textBgView.bottom+23, btnWidth, 42)];
[self.cancelBtn setTitle:QXText(@"取消") forState:(UIControlStateNormal)];
[self.cancelBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateNormal)];
self.cancelBtn.backgroundColor = RGB16(0xf3f3f3);
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.cancelBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.cancelBtn addRoundedCornersWithRadius:21];
[self addSubview:self.cancelBtn];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.cancelBtn.right+16, self.cancelBtn.top, btnWidth, 42)];
[self.commitBtn setTitle:QXText(@"确认") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.commitBtn addRoundedCornersWithRadius:21];
[self addSubview:self.commitBtn];
}
-(void)setModel:(QXPhotoModel *)model{
_model = model;
}
-(void)closeAction{
[[QXGlobal shareGlobal] hideViewBlock:^{
}];
}
-(void)commitAction{
MJWeakSelf
[[QXGlobal shareGlobal] hideViewBlock:^{
if (weakSelf.delegate && [self.delegate respondsToSelector:@selector(didClickCommitWithPassword:model:)]) {
[weakSelf.delegate didClickCommitWithPassword:weakSelf.textField.text model:self.model];
}
}];
}
@end

View File

@@ -0,0 +1,23 @@
//
// QXPhotosDetailTopView.h
// QXLive
//
// Created by 启星 on 2025/6/5.
//
#import <UIKit/UIKit.h>
#import "QXPhotoModel.h"
NS_ASSUME_NONNULL_BEGIN
@protocol QXPhotosDetailTopViewDelegate <NSObject>
@optional
-(void)didClickEditWith:(QXPhotoDetailModel*)model;
@end
@interface QXPhotosDetailTopView : UIView
@property (nonatomic,assign)BOOL isMe;
@property (nonatomic,weak)id<QXPhotosDetailTopViewDelegate>delegate;
@property (nonatomic,strong)QXPhotoDetailModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,124 @@
//
// QXPhotosDetailTopView.m
// QXLive
//
// Created by on 2025/6/5.
//
#import "QXPhotosDetailTopView.h"
#import "QXMineNetwork.h"
#import "QXCreatPhotosViewController.h"
@interface QXPhotosDetailTopView()
@property (nonatomic,strong)UIImageView*bgImageView;
@property (nonatomic,strong)UIView*coverView;
@property (nonatomic,strong)UILabel*titleLabel;
@property (nonatomic,strong)UIButton*editBtn;
@property (nonatomic,strong)UIButton*countBtn;
@property (nonatomic,strong)UIButton*likeBtn;
@property (nonatomic,strong)UIButton*seeBtn;
@end
@implementation QXPhotosDetailTopView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubview];
}
return self;
}
-(void)initSubview{
self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
self.bgImageView.contentMode = UIViewContentModeScaleAspectFill;
self.bgImageView.clipsToBounds = YES;
[self addSubview:self.bgImageView];
// self.coverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
// self.coverView.backgroundColor = RGB16A(0xffffff, 0.65);
// [self addSubview:self.coverView];
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:effect];
UIVisualEffectView *vibrancyView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
vibrancyView.frame = self.bgImageView.frame;
[blurView.contentView addSubview:vibrancyView];
blurView.frame = self.bgImageView.frame;
[self.bgImageView addSubview:blurView];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (self.height-25)/2, self.width, 25)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
self.titleLabel.textColor = RGB16(0x333333);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.editBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.height-45)/2, 0, 45, 45)];
self.editBtn.centerY = self.titleLabel.centerY;
[self.editBtn setImage:[[UIImage imageNamed:@"photo_eidt"] imageByTintColor:RGB16(0x666666)] forState:(UIControlStateNormal)];
[self.editBtn addTarget:self action:@selector(editAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.editBtn];
self.countBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+2, self.width, 25)];
[self.countBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateNormal)];
[self.countBtn setTitle:[NSString localizedStringWithFormat:QXText(@"%@张照片"),@"0"] forState:(UIControlStateNormal)];
self.countBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self addSubview:self.countBtn];
self.likeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.height-40-5, self.width/2, 40)];
[self.likeBtn setImage:[UIImage imageNamed:@"photos_like"] forState:(UIControlStateNormal)];
[self.likeBtn setImage:[[UIImage imageNamed:@"photos_like"] imageByTintColor:RGB16(0xFB4344)] forState:(UIControlStateSelected)];
[self.likeBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.likeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.likeBtn setTitle:@" 0" forState:(UIControlStateNormal)];
[self.likeBtn addTarget:self action:@selector(likeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.likeBtn];
self.seeBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width/2, self.height-40-5, self.width/2, 40)];
[self.seeBtn setImage:[UIImage imageNamed:@"photos_see"] forState:(UIControlStateNormal)];
[self.seeBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.seeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.seeBtn setTitle:@" 0" forState:(UIControlStateNormal)];
[self addSubview:self.seeBtn];
}
-(void)editAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickEditWith:)]) {
[self.delegate didClickEditWith:self.model];
}
}
-(void)likeAction{
MJWeakSelf
[QXMineNetwork photosLikeWithAlbumId:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
weakSelf.likeBtn.selected = !weakSelf.likeBtn.selected;
if (weakSelf.likeBtn.selected) {
[weakSelf.likeBtn setTitle:[NSString stringWithFormat:@" %ld", weakSelf.likeBtn.titleLabel.text.integerValue+1] forState:UIControlStateNormal];
}else{
[weakSelf.likeBtn setTitle:[NSString stringWithFormat:@" %ld", weakSelf.likeBtn.titleLabel.text.integerValue-1] forState:UIControlStateNormal];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)setIsMe:(BOOL)isMe{
_isMe = isMe;
self.editBtn.hidden = !isMe;
}
-(void)setModel:(QXPhotoDetailModel *)model{
_model = model;
[self.bgImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
self.titleLabel.text = model.name;
self.likeBtn.selected = model.is_like.intValue == 1;
[self.titleLabel sizeToFit];
self.titleLabel.frame = CGRectMake((self.width-self.titleLabel.width)/2, (self.height-25)/2, self.titleLabel.width, 25);
self.editBtn.frame = CGRectMake(self.titleLabel.right, self.titleLabel.top-10, 45, 45);
if (model.pwd.length > 0) {
[self.countBtn setImage:[UIImage imageNamed:@"photos_lock_state"] forState:(UIControlStateNormal)];
}else{
[self.countBtn setImage:nil forState:(UIControlStateNormal)];
}
[self.countBtn setTitle:[NSString localizedStringWithFormat:QXText(@"%@张照片"),model.count] forState:(UIControlStateNormal)];
[self.likeBtn setTitle:[NSString stringWithFormat:@" %@",model.like_num] forState:(UIControlStateNormal)];
[self.seeBtn setTitle:[NSString stringWithFormat:@" %@",model.read_num] forState:(UIControlStateNormal)];
}
@end

View File

@@ -0,0 +1,17 @@
//
// QXPhotosMoveListView.h
// QXLive
//
// Created by 启星 on 2025/6/6.
//
#import <UIKit/UIKit.h>
#import "QXPhotoModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXPhotosMoveListView : UIView
@property (nonatomic,strong)void(^selecctedModelBlock)(QXPhotoModel *model);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,150 @@
//
// QXPhotosMoveListView.m
// QXLive
//
// Created by on 2025/6/6.
//
#import "QXPhotosMoveListView.h"
#import "QXUserPhotosView.h"
#import "QXMineNetwork.h"
@interface QXPhotosMoveListView()<UICollectionViewDelegate,UICollectionViewDataSource>
@property (nonatomic,strong)UILabel* titleLabel;
@property (nonatomic,strong)UIButton* cancelBtn;
@property (nonatomic,strong)UIButton* commitBtn;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,assign)NSInteger page;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,assign)NSInteger selectedIndex;
@end
@implementation QXPhotosMoveListView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.selectedIndex = -1;
self.backgroundColor = [UIColor whiteColor];
[self addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-100)/2, 16, 100, 27)];
self.titleLabel.text = QXText(@"选择相册");
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
[self addSubview:self.titleLabel];
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 12, 65, 35)];
[self.cancelBtn setTitle:QXText(@"取消") forState:(UIControlStateNormal)];
[self.cancelBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.cancelBtn];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-65, 12, 65, 35)];
[self.commitBtn setTitle:QXText(@"确定") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
// self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.commitBtn addRoundedCornersWithRadius:17.5];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.commitBtn];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-13*3)/4, (SCREEN_WIDTH-16*2-13*3)/4+46);
layout.minimumLineSpacing = 13;
layout.minimumInteritemSpacing = 13;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+8, self.width, self.height-16-self.titleLabel.bottom-8) collectionViewLayout:layout];
[self.collectionView registerClass:[QXUserPhotosCell class] forCellWithReuseIdentifier:@"QXUserPhotosCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.backgroundColor = RGB16(0xf6f6f6);
[self addSubview:self.collectionView];
MJWeakSelf
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getPhotoList];
}];
[self getPhotoList];
}
-(void)cancelAction{
[[QXGlobal shareGlobal] hideViewBlock:^{}];
}
-(void)commitAction{
if (self.selectedIndex == -1) {
showToast(@"请选择相册");
return;
}
MJWeakSelf
[[QXGlobal shareGlobal] hideViewBlock:^{
if (weakSelf.selecctedModelBlock) {
weakSelf.selecctedModelBlock(weakSelf.dataArray[self.selectedIndex]);
}
}];
}
-(void)getPhotoList{
MJWeakSelf
[QXMineNetwork photosListWithUserId:[QXGlobal shareGlobal].loginModel.user_id
page:self.page
successBlock:^(NSArray<QXPhotoModel *> * _Nonnull hotos) {
[weakSelf.collectionView.mj_footer endRefreshing];
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:hotos];
if (hotos.count == 0) {
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.collectionView.mj_footer endRefreshing];
}
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.collectionView.mj_footer endRefreshing];
}];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.dataArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXUserPhotosCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXUserPhotosCell" forIndexPath:indexPath];
QXPhotoModel *model = self.dataArray[indexPath.row];
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
cell.titleLabel.text = model.name;
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
cell.isLock = NO;
cell.selectedState = YES;
if (indexPath.row == self.selectedIndex) {
cell.selectedBtn.selected = YES;
}else{
cell.selectedBtn.selected = NO;
}
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
self.selectedIndex = indexPath.row;
[collectionView reloadData];
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
@end

View File

@@ -0,0 +1,16 @@
//
// QXPhotosSectionView.h
// QXLive
//
// Created by 启星 on 2025/6/5.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXPhotosSectionView : UICollectionReusableView
@property (nonatomic,strong)UILabel *titleLabel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// QXPhotosSectionView.m
// QXLive
//
// Created by on 2025/6/5.
//
#import "QXPhotosSectionView.h"
@implementation QXPhotosSectionView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, self.width-32, self.height)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = QXConfig.textColor;
[self addSubview:self.titleLabel];
}
@end

View File

@@ -0,0 +1,25 @@
//
// QXPhotosToolsView.h
// QXLive
//
// Created by 启星 on 2025/6/5.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger) {
QXPhotosToolsActionShare = 10,
QXPhotosToolsActionMove,
QXPhotosToolsActionDelete,
}QXPhotosToolsActionType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXPhotosToolsViewDelegate <NSObject>
@optional
-(void)didClickActionType:(QXPhotosToolsActionType)type;
@end
@interface QXPhotosToolsView : UIView
@property (nonatomic,weak)id<QXPhotosToolsViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,54 @@
//
// QXPhotosToolsView.m
// QXLive
//
// Created by on 2025/6/5.
//
#import "QXPhotosToolsView.h"
#import "UIButton+QX.h"
@interface QXPhotosToolsView()
@property (nonatomic,strong)NSArray *toolsTitleArray;
@property (nonatomic,strong)NSArray *toolsImageArray;
@end
@implementation QXPhotosToolsView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 1)];
line.backgroundColor = RGB16(0xE2E2E2);
[self addSubview:line];
self.toolsTitleArray = @[QXText(@"分享"),QXText(@"移动"),QXText(@"删除")];
self.toolsImageArray = @[@"photos_share",@"photos_move",@"photos_delete"];
CGFloat btnWidth = self.width/self.toolsImageArray.count;
for (int i = 0; i < self.toolsTitleArray.count; i++) {
NSString *title = self.toolsTitleArray[i];
NSString *image = self.toolsImageArray[i];
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(i*btnWidth, 1, btnWidth, 49)];
[btn setTitle:title forState:(UIControlStateNormal)];
[btn setTitleColor:QXConfig.textColor forState:(UIControlStateNormal)];
btn.titleLabel.font = [UIFont systemFontOfSize:14];
[btn setImage:[UIImage imageNamed:image] forState:(UIControlStateNormal)];
btn.tag = 10+i;
[btn addTarget:self action:@selector(btnAction:) forControlEvents:(UIControlEventTouchUpInside)];
[btn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:2];
[self addSubview:btn];
}
}
-(void)btnAction:(UIButton*)sender{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickActionType:)]) {
[self.delegate didClickActionType:sender.tag];
}
}
@end

View File

@@ -0,0 +1,31 @@
//
// QXUserPhotosView.h
// QXLive
//
// Created by 启星 on 2025/5/29.
//
#import <UIKit/UIKit.h>
#import "JXPagerView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXUserPhotosView : UIView<JXPagerViewListViewDelegate>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
@property (nonatomic,strong)NSString *user_id;
@end
@interface QXUserPhotosCell : UICollectionViewCell
@property (nonatomic,strong)UIImageView *photoImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *countLabel;
@property (nonatomic,strong)UIImageView *lockImageView;
@property (nonatomic,strong)UIVisualEffectView *blurView;
@property (nonatomic,assign)BOOL isLock;
@property (nonatomic,strong)UIButton *selectedBtn;
@property (nonatomic,strong)UIView *selectedBgView;
@property (nonatomic,assign)BOOL selectedState;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,361 @@
//
// QXUserPhotosView.m
// QXLive
//
// Created by on 2025/5/29.
//
#import "QXUserPhotosView.h"
#import "QXCreatPhotosViewController.h"
#import "QXPhotoPasswordView.h"
#import "QXMineNetwork.h"
#import "QXPhotosDetailVC.h"
@interface QXUserPhotosView()<UICollectionViewDelegate,UICollectionViewDataSource,QXPhotoPasswordViewDelegate>
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) BOOL isMe;
@end
@implementation QXUserPhotosView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.page = 1;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(photosListReload) name:noticePhotosStatusChange object:nil];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-13)/2, (SCREEN_WIDTH-16*2-13)/2+46);
layout.minimumLineSpacing = 13;
layout.minimumInteritemSpacing = 13;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
[self.collectionView registerClass:[QXUserPhotosCell class] forCellWithReuseIdentifier:@"QXUserPhotosCell"];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.showsHorizontalScrollIndicator = NO;
self.collectionView.backgroundColor = RGB16(0xf6f6f6);
[self addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(12);
make.top.mas_equalTo(12);
make.height.mas_equalTo(ScaleWidth(76));
make.right.mas_equalTo(-12);
}];
MJWeakSelf
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
weakSelf.page++;
[weakSelf getPhotos];
}];
}
return self;
}
- (instancetype)initWithOffsetY:(CGFloat)offsety {
self = [self initWithFrame:CGRectZero];
self.collectionView.contentOffset = CGPointMake(0, offsety);
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.collectionView.frame = self.bounds;
}
-(void)setUser_id:(NSString *)user_id{
_user_id = user_id;
if ([user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
self.isMe = YES;
}else{
self.isMe = NO;
}
[self getPhotos];
}
-(void)photosListReload{
self.page = 1;
[self getPhotos];
}
-(void)getPhotos{
MJWeakSelf
[QXMineNetwork photosListWithUserId:self.user_id
page:self.page
successBlock:^(NSArray<QXPhotoModel *> * _Nonnull hotos) {
[weakSelf.collectionView.mj_footer endRefreshing];
if (weakSelf.page == 1) {
[weakSelf.dataArray removeAllObjects];
}
[weakSelf.dataArray addObjectsFromArray:hotos];
if (hotos.count == 0) {
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.collectionView.mj_footer endRefreshing];
}
[weakSelf.collectionView reloadData];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
[weakSelf.collectionView.mj_footer endRefreshing];
}];
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
if (self.isMe) {
return self.dataArray.count+1;
}else{
return self.dataArray.count;
}
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXUserPhotosCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXUserPhotosCell" forIndexPath:indexPath];
if (self.isMe) {
if (indexPath.row == 0) {
cell.photoImageView.image = [UIImage imageNamed:@"user_photos_add"];
cell.titleLabel.text = @"";
cell.countLabel.text = @"";
cell.isLock = NO;
}else{
QXPhotoModel *model = self.dataArray[indexPath.row-1];
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
cell.titleLabel.text = model.name;
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
if (model.is_pwd.integerValue == 0) {
cell.isLock = NO;
}else{
cell.isLock = YES;
}
}
}else{
QXPhotoModel *model = self.dataArray[indexPath.row];
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
cell.titleLabel.text = model.name;
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
if (model.is_pwd.integerValue == 0) {
cell.isLock = NO;
}else{
cell.isLock = YES;
}
}
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
MJWeakSelf
if (self.isMe) {
if (indexPath.row == 0) {
QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init];
vc.createSuccessBlock = ^{
[weakSelf getPhotos];
};
[self.navigationController pushViewController:vc animated:YES];
}else{
QXPhotoModel *model = self.dataArray[indexPath.row-1];
if (model.is_pwd.integerValue == 0) {
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
vc.albumId = model.id;
vc.name = model.name;
vc.photoList = self.dataArray;
vc.userId = self.user_id;
[self.navigationController pushViewController:vc animated:YES];
}else{
if ([self.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
vc.albumId = model.id;
vc.name = model.name;
vc.photoList = self.dataArray;
vc.userId = self.user_id;
vc.pwd = model.pwd;
[self.navigationController pushViewController:vc animated:YES];
}else{
QXPhotoPasswordView *passwordView = [[QXPhotoPasswordView alloc] init];
passwordView.model = model;
passwordView.delegate = self;
[[QXGlobal shareGlobal] showView:passwordView popType:(PopViewTypePopFromCenter) tapDismiss:NO finishBlock:^{
}];
}
}
}
}else{
QXPhotoModel *model = self.dataArray[indexPath.row];
if (model.is_pwd.integerValue == 0) {
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
vc.albumId = model.id;
vc.name = model.name;
vc.photoList = self.dataArray;
vc.userId = self.user_id;
[self.navigationController pushViewController:vc animated:YES];
}else{
if ([self.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
vc.albumId = model.id;
vc.name = model.name;
vc.photoList = self.dataArray;
vc.userId = self.user_id;
vc.pwd = model.pwd;
[self.navigationController pushViewController:vc animated:YES];
}else{
QXPhotoPasswordView *passwordView = [[QXPhotoPasswordView alloc] init];
passwordView.model = model;
passwordView.delegate = self;
[[QXGlobal shareGlobal] showView:passwordView popType:(PopViewTypePopFromCenter) tapDismiss:NO finishBlock:^{
}];
}
}
}
}
-(void)didClickCommitWithPassword:(NSString *)password model:(nonnull QXPhotoModel *)model{
QXLOG(@"相册密码为%@",password);
if ([password isEqualToString:model.pwd]) {
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
vc.albumId = model.id;
vc.name = model.name;
vc.photoList = self.dataArray;
vc.userId = self.user_id;
vc.pwd = password;
[self.navigationController pushViewController:vc animated:YES];
}else{
showToast(@"密码错误");
}
}
- (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.collectionView;
}
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
self.scrollCallback = callback;
}
- (UIView *)listView {
return self;
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray arrayWithCapacity:1];
}
return _dataArray;
}
@end
@implementation QXUserPhotosCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setIsLock:(BOOL)isLock{
_isLock = isLock;
self.lockImageView.hidden = !isLock;
self.blurView.hidden = !isLock;
}
-(void)setSelectedState:(BOOL)selectedState{
_selectedState = selectedState;
self.selectedBtn.hidden = !selectedState;
self.selectedBgView.hidden = !selectedState;
}
-(void)initSubviews{
// user_photos_add
self.photoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.photoImageView.contentMode = UIViewContentModeScaleAspectFill;
self.photoImageView.clipsToBounds = YES;
[self.photoImageView addRoundedCornersWithRadius:6];
[self.contentView addSubview:self.photoImageView];
[self.photoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.equalTo(self.contentView);
make.height.equalTo(self.photoImageView.mas_width).multipliedBy(1);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:14];
self.titleLabel.textColor = QXConfig.textColor;
[self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView);
make.top.equalTo(self.photoImageView.mas_bottom).offset(6);
make.height.mas_equalTo(22);
}];
self.countLabel = [[UILabel alloc] init];
self.countLabel.font = [UIFont systemFontOfSize:14];
self.countLabel.textColor = RGB16(0x999999);
[self.contentView addSubview:self.countLabel];
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.equalTo(self.contentView);
make.top.equalTo(self.titleLabel.mas_bottom);
make.height.mas_equalTo(18);
}];
self.lockImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_photos_lock"]];
self.lockImageView.hidden = YES;
[self.contentView addSubview:self.lockImageView];
[self.lockImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self.photoImageView);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(22), ScaleWidth(22)));
}];
self.selectedBgView = [[UIView alloc] init];
self.selectedBgView.backgroundColor = RGB16A(0xffffff, 0.2);
[self.selectedBgView addRoundedCornersWithRadius:10];
self.selectedBgView.hidden = YES;
[self.contentView addSubview:self.selectedBgView];
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self.contentView);
}];
self.selectedBtn = [[UIButton alloc] init];
self.selectedBtn.userInteractionEnabled = NO;
self.selectedBtn.hidden = YES;
// [self.selectedBtn addTarget:self action:@selector(selectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
[self.contentView addSubview:self.selectedBtn];
[self.selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.equalTo(self);
make.size.mas_equalTo(CGSizeMake(25, 25));
}];
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:effect];
UIVisualEffectView *vibrancyView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
[blurView.contentView addSubview:vibrancyView];
self.blurView = blurView;
self.blurView.hidden = YES;
[self.photoImageView addSubview:blurView];
[blurView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.equalTo(self.photoImageView);
}];
[vibrancyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.bottom.equalTo(blurView);
}];
}
@end

View File

@@ -0,0 +1,22 @@
//
// QXDressCell.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXUserDressModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXDressCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIButton *selecteBtn;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *dressImageView;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIView *dayBgView;
@property (strong, nonatomic) QXUserDressModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,35 @@
//
// QXDressCell.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXDressCell.h"
@implementation QXDressCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.selecteBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xEFF2F8)] forState:(UIControlStateNormal)];
[self.selecteBtn setBackgroundImage:[UIImage imageNamed:@"mine_dress_bg"] forState:(UIControlStateSelected)];
}
-(void)setModel:(QXUserDressModel *)model{
_model = model;
self.nameLabel.text = model.title;
[self.dressImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.timeLabel.text = [NSString stringWithFormat:@"%@%@",model.remaining_day,QXText(@"天")];
// if (model.is_using.intValue == 1) {
// self.selecteBtn.selected = NO;
// }else{
// self.selecteBtn.selected = YES;
// }
if ([model.udid isEqualToString:@"-1"]) {
self.dayBgView.hidden = YES;
}else{
self.dayBgView.hidden = NO;
}
}
@end

View File

@@ -0,0 +1,112 @@
<?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="QXDressCell">
<rect key="frame" x="0.0" y="0.0" width="254" height="313"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="254" height="313"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="n0W-rO-R0R">
<rect key="frame" x="0.0" y="0.0" width="254" height="313"/>
<subviews>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Gk9-jf-oXA">
<rect key="frame" x="0.0" y="0.0" width="254" height="313"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i9y-iF-N7k">
<rect key="frame" x="10" y="281" width="234" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="rrg-mb-mKp"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.84705882349999995" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="dze-FS-DlP">
<rect key="frame" x="10" y="25" width="234" height="246"/>
</imageView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Gk9-jf-oXA" secondAttribute="trailing" id="Bp7-Zt-kLi"/>
<constraint firstAttribute="bottom" secondItem="Gk9-jf-oXA" secondAttribute="bottom" id="D7N-RZ-s1h"/>
<constraint firstItem="i9y-iF-N7k" firstAttribute="top" secondItem="dze-FS-DlP" secondAttribute="bottom" constant="10" id="EBD-B0-OJw"/>
<constraint firstAttribute="trailing" secondItem="dze-FS-DlP" secondAttribute="trailing" constant="10" id="Gmg-yY-toF"/>
<constraint firstAttribute="trailing" secondItem="i9y-iF-N7k" secondAttribute="trailing" constant="10" id="Hnd-Nf-T5i"/>
<constraint firstItem="Gk9-jf-oXA" firstAttribute="top" secondItem="n0W-rO-R0R" secondAttribute="top" id="ISl-Bq-oRs"/>
<constraint firstAttribute="bottom" secondItem="i9y-iF-N7k" secondAttribute="bottom" constant="11" id="NlS-CU-Esg"/>
<constraint firstItem="Gk9-jf-oXA" firstAttribute="leading" secondItem="n0W-rO-R0R" secondAttribute="leading" id="YbX-ky-chh"/>
<constraint firstItem="i9y-iF-N7k" firstAttribute="leading" secondItem="n0W-rO-R0R" secondAttribute="leading" constant="10" id="cp8-n9-EDw"/>
<constraint firstItem="dze-FS-DlP" firstAttribute="leading" secondItem="n0W-rO-R0R" secondAttribute="leading" constant="10" id="gEz-L3-3Jm"/>
<constraint firstItem="i9y-iF-N7k" firstAttribute="centerX" secondItem="n0W-rO-R0R" secondAttribute="centerX" id="qCk-41-a2W"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jon-rv-RWs">
<rect key="frame" x="213.66666666666666" y="0.0" width="40.333333333333343" height="15"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_number_bg" translatesAutoresizingMaskIntoConstraints="NO" id="acA-Gl-J3f">
<rect key="frame" x="0.0" y="0.0" width="40.333333333333336" height="15"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="30天" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fQr-Il-R17">
<rect key="frame" x="0.0" y="0.0" width="40.333333333333336" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="height" constant="15" id="2q7-7I-Hky"/>
<constraint firstAttribute="bottom" secondItem="fQr-Il-R17" secondAttribute="bottom" id="7HW-pS-gjG"/>
<constraint firstItem="acA-Gl-J3f" firstAttribute="top" secondItem="Jon-rv-RWs" secondAttribute="top" id="FNm-jz-oxK"/>
<constraint firstAttribute="bottom" secondItem="acA-Gl-J3f" secondAttribute="bottom" id="LDb-2v-ql7"/>
<constraint firstAttribute="trailing" secondItem="acA-Gl-J3f" secondAttribute="trailing" id="ZGX-R2-2Ir"/>
<constraint firstItem="acA-Gl-J3f" firstAttribute="leading" secondItem="Jon-rv-RWs" secondAttribute="leading" id="aeI-fV-YPy"/>
<constraint firstItem="fQr-Il-R17" firstAttribute="top" secondItem="Jon-rv-RWs" secondAttribute="top" id="by4-8e-Cmk"/>
<constraint firstAttribute="trailing" secondItem="fQr-Il-R17" secondAttribute="trailing" id="miF-DT-dZH"/>
<constraint firstItem="fQr-Il-R17" firstAttribute="leading" secondItem="Jon-rv-RWs" secondAttribute="leading" id="y8X-Je-6Vz"/>
<constraint firstAttribute="width" secondItem="Jon-rv-RWs" secondAttribute="height" multiplier="35:13" id="z2t-R2-CVb"/>
</constraints>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstItem="n0W-rO-R0R" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="LeJ-tT-9Lm"/>
<constraint firstAttribute="bottom" secondItem="n0W-rO-R0R" secondAttribute="bottom" id="P6e-1u-8A7"/>
<constraint firstAttribute="trailing" secondItem="Jon-rv-RWs" secondAttribute="trailing" id="Su3-5n-n7n"/>
<constraint firstItem="Jon-rv-RWs" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="YFF-dV-1x3"/>
<constraint firstItem="n0W-rO-R0R" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="gce-eV-4vT"/>
<constraint firstItem="dze-FS-DlP" firstAttribute="top" secondItem="fQr-Il-R17" secondAttribute="bottom" constant="10" id="hhX-32-Rb3"/>
<constraint firstAttribute="trailing" secondItem="n0W-rO-R0R" secondAttribute="trailing" id="yoy-Bu-dbi"/>
</constraints>
<size key="customSize" width="254" height="313"/>
<connections>
<outlet property="dayBgView" destination="Jon-rv-RWs" id="eXC-E7-7SM"/>
<outlet property="dressImageView" destination="dze-FS-DlP" id="PId-lg-hri"/>
<outlet property="nameLabel" destination="i9y-iF-N7k" id="E1m-pW-GYN"/>
<outlet property="selecteBtn" destination="Gk9-jf-oXA" id="cD7-e6-wLM"/>
<outlet property="timeLabel" destination="fQr-Il-R17" id="ztW-dh-cHn"/>
</connections>
<point key="canvasLocation" x="294.6564885496183" y="112.32394366197184"/>
</collectionViewCell>
</objects>
<resources>
<image name="gift_number_bg" width="22.666666030883789" height="8.6666669845581055"/>
</resources>
</document>

View File

@@ -0,0 +1,17 @@
//
// QXRechargePayTypeCell.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXRechargePayTypeView.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRechargePayTypeCell : UICollectionViewCell
@property (nonatomic,strong)QXPayTypeModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,45 @@
//
// QXRechargePayTypeCell.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXRechargePayTypeCell.h"
#import "QXRechargePayTypeView.h"
@interface QXRechargePayTypeCell()
@property (nonatomic,strong)QXRechargePayTypeView *payTypeView;
@end
@implementation QXRechargePayTypeCell
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXPayTypeModel *)model{
_model = model;
self.payTypeView.model = model;
}
-(void)initSubviews{
self.payTypeView = [[QXRechargePayTypeView alloc] init];
[self.contentView addSubview:self.payTypeView];
[self.payTypeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.bottom.equalTo(self);
}];
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXRechargePayTypeView.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXPayTypeModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRechargePayTypeView : UIView
@property (nonatomic,strong)UIImageView *imageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *selectedBtn;
@property (nonatomic,strong)QXPayTypeModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,60 @@
//
// QXRechargePayTypeView.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXRechargePayTypeView.h"
@implementation QXRechargePayTypeView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)setModel:(QXPayTypeModel *)model{
_model = model;
if ([model.icon hasPrefix:@"http"]) {
[self.imageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
}else{
self.imageView.image = [UIImage imageNamed:model.icon];
}
self.titleLabel.text = model.name;
self.selectedBtn.selected = model.isSelected;
}
-(void)initSubviews{
self.imageView = [[UIImageView alloc] init];
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
[self addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.centerY.equalTo(self);
make.size.mas_equalTo(CGSizeMake(30, 30));
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:14];
self.titleLabel.textColor = QXConfig.textColor;
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.imageView.mas_right).offset(8);
make.top.bottom.equalTo(self);
}];
self.selectedBtn = [[UIButton alloc] init];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
self.selectedBtn.userInteractionEnabled = NO;
[self addSubview:self.selectedBtn];
[self.selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self).offset(-16);
make.size.mas_equalTo(CGSizeMake(20, 20));
make.centerY.equalTo(self);
}];
}
@end

View File

@@ -0,0 +1,22 @@
//
// QXRechargePriceCell.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXRechargeListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRechargePriceCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIButton *cornBtn;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *customLabel;
//@property (nonatomic,assign) BOOL isCustom;
@property (nonatomic,strong) QXRechargeListModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,45 @@
//
// QXRechargePriceCell.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXRechargePriceCell.h"
@implementation QXRechargePriceCell
//-(void)setIsCustom:(BOOL)isCustom{
// _isCustom = isCustom;
// self.customLabel.hidden = !isCustom;
// self.cornBtn.hidden = isCustom;
// self.priceLabel.hidden = isCustom;
//}
-(void)setModel:(QXRechargeListModel *)model{
_model = model;
self.priceLabel.text = model.money;
[self.cornBtn setTitle:model.coins forState:(UIControlStateNormal)];
if (model.money.intValue == 0 && model.coins.intValue == 0) {
self.customLabel.hidden = NO;
self.cornBtn.hidden = YES;
self.priceLabel.hidden = YES;
}else{
self.customLabel.hidden = YES;
self.cornBtn.hidden = NO;
self.priceLabel.hidden = NO;
}
if (model.isSelected) {
self.bgView.layer.borderWidth = 1;
}else{
self.bgView.layer.borderWidth = 0;
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.bgView.layer.borderColor = RGB16(0x333333).CGColor;
}
@end

View File

@@ -0,0 +1,96 @@
<?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="System colors in document resources" minToolsVersion="11.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="QXRechargePriceCell">
<rect key="frame" x="0.0" y="0.0" width="192" height="109"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="192" height="109"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nHo-Pz-H75">
<rect key="frame" x="0.0" y="0.0" width="192" height="109"/>
<subviews>
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1OT-Sn-WEd">
<rect key="frame" x="10" y="16" width="172" height="20"/>
<accessibility key="accessibilityConfiguration">
<accessibilityTraits key="traits" button="YES" notEnabled="YES"/>
</accessibility>
<constraints>
<constraint firstAttribute="height" constant="20" id="BSv-Yw-o0Q"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title=" 9999" image="mine_recharge_corn">
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="55N-9b-roi">
<rect key="frame" x="10" y="73" width="172" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="pfj-hm-ZWY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="自定义" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xNn-bN-KCh">
<rect key="frame" x="75" y="46" width="42" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="1OT-Sn-WEd" firstAttribute="leading" secondItem="nHo-Pz-H75" secondAttribute="leading" constant="10" id="5a0-Vh-c80"/>
<constraint firstItem="1OT-Sn-WEd" firstAttribute="top" secondItem="nHo-Pz-H75" secondAttribute="top" constant="16" id="Ktn-2E-pb8"/>
<constraint firstAttribute="bottom" secondItem="55N-9b-roi" secondAttribute="bottom" constant="16" id="NFg-kL-mea"/>
<constraint firstAttribute="trailing" secondItem="1OT-Sn-WEd" secondAttribute="trailing" constant="10" id="gjz-gQ-HiA"/>
<constraint firstItem="55N-9b-roi" firstAttribute="leading" secondItem="nHo-Pz-H75" secondAttribute="leading" constant="10" id="jR5-2h-t4b"/>
<constraint firstItem="xNn-bN-KCh" firstAttribute="centerY" secondItem="nHo-Pz-H75" secondAttribute="centerY" id="jSm-d9-oyR"/>
<constraint firstItem="xNn-bN-KCh" firstAttribute="centerX" secondItem="nHo-Pz-H75" secondAttribute="centerX" id="n4b-Um-FRy"/>
<constraint firstAttribute="trailing" secondItem="55N-9b-roi" secondAttribute="trailing" constant="10" id="zTu-tz-zzk"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="nHo-Pz-H75" secondAttribute="bottom" id="7Wh-Fo-ztf"/>
<constraint firstItem="nHo-Pz-H75" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="8uy-7g-xVF"/>
<constraint firstItem="nHo-Pz-H75" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="XIM-WM-ulB"/>
<constraint firstAttribute="trailing" secondItem="nHo-Pz-H75" secondAttribute="trailing" id="tKd-Oe-p0d"/>
</constraints>
<size key="customSize" width="192" height="109"/>
<connections>
<outlet property="bgView" destination="nHo-Pz-H75" id="RUz-p6-dtq"/>
<outlet property="cornBtn" destination="1OT-Sn-WEd" id="zNH-co-Owm"/>
<outlet property="customLabel" destination="xNn-bN-KCh" id="RZw-J7-8Tr"/>
<outlet property="priceLabel" destination="55N-9b-roi" id="wL2-7m-W0o"/>
</connections>
<point key="canvasLocation" x="245.80152671755724" y="40.492957746478872"/>
</collectionViewCell>
</objects>
<resources>
<image name="mine_recharge_corn" width="20" height="20"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

View File

@@ -0,0 +1,32 @@
//
// QXRechargeView.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXRechargeListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRechargeView : UIView
@property (nonatomic,assign)BOOL isPop;
@property (nonatomic,assign)BOOL isOnlyDisplayPayType;
@property (nonatomic,strong)QXRechargeListModel *selectedModel;
-(void)showInView:(UIView *)view;
@end
@interface QXRechargeCustomView : UICollectionReusableView<UITextFieldDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *unitLabel;
@property (nonatomic,strong)UITextField *textField;
@property (nonatomic,strong)UILabel *cornLabel;
@property (nonatomic,strong)UIView *bottomLine;
@end
@interface QXRechargeHeaderView : UICollectionReusableView
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,511 @@
//
// QXRechargeView.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXRechargeView.h"
#import "QXRechargePriceCell.h"
#import "QXRechargePayTypeCell.h"
#import "QXMineNetwork.h"
#import <AlipaySDK/AlipaySDK.h>
#import <WXApi.h>
@class QXRechargeCustomView,QXRechargeHeaderView;
@interface QXRechargeView()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate>
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)QXRechargeCustomView *rechargeCustomView;
@property (nonatomic,strong)QXRechargeHeaderView *rechargeHeaderView;
@property (nonatomic,strong)UIButton *rechargeBtn;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,assign)BOOL isCustom;
@property (nonatomic,strong)QXPayTypeModel *selectedPayTypeModel;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UITapGestureRecognizer *tap;
@property (nonatomic,strong)NSMutableArray *rechargeDataArray;
@property (nonatomic,strong)NSMutableArray *payTypeArray;
@end
@implementation QXRechargeView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = @"0";
model.coins = @"0";
[self.rechargeDataArray addObject:model];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
tap.delegate = self;
tap.enabled = NO;
self.tap = tap;
[self addGestureRecognizer:tap];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.height)];
self.bgView.backgroundColor = [UIColor clearColor];
[self addSubview:self.bgView];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.text = QXText(@"充值");
self.titleLabel.hidden = YES;
[self.bgView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(12);
make.centerX.equalTo(self.bgView);
}];
[self.bgView addSubview:self.collectionView];
[self.bgView addSubview:self.rechargeBtn];
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-38);
make.left.mas_equalTo(38);
make.height.mas_equalTo(42);
make.bottom.mas_equalTo(-kSafeAreaBottom);
}];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.left.mas_equalTo(0);
make.top.equalTo(self.bgView);
make.bottom.equalTo(self.rechargeBtn.mas_top).offset(-10);
}];
[self getRechargeList];
}
-(void)getRechargeList{
MJWeakSelf
[QXMineNetwork getRechargeListSuccessBlock:^(NSArray<QXRechargeListModel *> * _Nonnull list) {
[weakSelf.rechargeDataArray removeAllObjects];
[weakSelf.rechargeDataArray addObjectsFromArray:list];
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = @"0";
model.coins = @"0";
[weakSelf.rechargeDataArray addObject:model];
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXMineNetwork walletPayTypeWithUserId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(QXPayTypeStatusModel * _Nonnull model) {
[weakSelf.payTypeArray removeAllObjects];
if (model.wx.is_pay_open.intValue == 1) {
[weakSelf.payTypeArray addObject:model.wx];
}
if (model.ali.is_pay_open.intValue == 1) {
[weakSelf.payTypeArray addObject:model.ali];
}
if (model.wx_tl.is_pay_open.intValue == 1) {
[weakSelf.payTypeArray addObject:model.wx_tl];
}
if (model.ali_tl.is_pay_open.intValue == 1) {
[weakSelf.payTypeArray addObject:model.ali_tl];
}
if (!self.isOnlyDisplayPayType) {
[weakSelf.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)setIsPop:(BOOL)isPop{
_isPop = isPop;
self.tap.enabled = YES;
self.bgView.frame = CGRectMake(0, 0, self.width, ScaleWidth(575));
self.bgView.backgroundColor = [UIColor whiteColor];
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
self.titleLabel.hidden = !isPop;
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self.collectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(0);
make.left.mas_equalTo(0);
make.top.equalTo(self.bgView).offset(50);
make.bottom.equalTo(self.rechargeBtn.mas_top).offset(-10);
}];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
-(void)showInView:(UIView *)view{
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-self.bgView.height;
}];
}
-(void)hide{
if (!self.isPop) {
return;
}
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
//-(void)setRechargeDataArray:(NSArray *)rechargeDataArray{
// _rechargeDataArray = rechargeDataArray;
// [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
//}
//-(void)setPayTypeArray:(NSArray *)payTypeArray{
// _payTypeArray = payTypeArray;
// [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];
//}
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
if (self.isOnlyDisplayPayType) {
return 1;
}
return 2;
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
if (section == 0 && !self.isOnlyDisplayPayType) {
return self.rechargeDataArray.count;
}
return self.payTypeArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
QXRechargePriceCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePriceCell" forIndexPath:indexPath];
cell.model = self.rechargeDataArray[indexPath.row];
return cell;
}else{
QXRechargePayTypeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXRechargePayTypeCell" forIndexPath:indexPath];
cell.model = self.payTypeArray[indexPath.row];
return cell;
}
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
return CGSizeMake((SCREEN_WIDTH-16*2-12*2)/3, 76);
}
return CGSizeMake(SCREEN_WIDTH, 40);
}
-(CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section{
if (section == 0) {
return 12;
}
return 0;
}
-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0 && [kind isEqualToString:UICollectionElementKindSectionFooter] && self.isCustom) {
self.rechargeCustomView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"QXRechargeCustomView" forIndexPath:indexPath];
return self.rechargeCustomView;
}else if (indexPath.section == 1 && [kind isEqualToString:UICollectionElementKindSectionHeader] ) {
self.rechargeHeaderView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXRechargeHeaderView" forIndexPath:indexPath];
return self.rechargeHeaderView;
}
return nil;
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
if (section == 0) {
return CGSizeZero;
}
return CGSizeMake(SCREEN_WIDTH, 40);
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section{
if (section == 0 && self.isCustom) {
return CGSizeMake(SCREEN_WIDTH, 50);
}
return CGSizeZero;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0 && !self.isOnlyDisplayPayType) {
QXRechargeListModel *model = self.rechargeDataArray[indexPath.row];
if (self.selectedModel) {
self.selectedModel.isSelected = NO;
}
model.isSelected = YES;
self.selectedModel = model;
if (model.money.intValue == 0 && model.coins.intValue == 0) {
self.isCustom = YES;
}else{
self.isCustom = NO;
}
[collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]];
}else{
QXPayTypeModel *model = self.payTypeArray[indexPath.row];
if (model == self.selectedPayTypeModel) {
return;
}
if (self.selectedPayTypeModel) {
self.selectedPayTypeModel.isSelected = NO;
}
model.isSelected = YES;
self.selectedPayTypeModel = model;
[collectionView reloadData];
}
}
-(void)rechargeAction:(UIButton*)sender{
if (self.selectedPayTypeModel == nil) {
showToast(@"请选择支付方式");
return;
}
if (self.selectedModel == nil) {
showToast(@"请选择充值金额");
return;
}
if (self.isPop) {
[self hide];
}
MJWeakSelf
[QXMineNetwork rechargePayWithMoney:self.selectedModel.money coin:self.selectedModel.coins type:self.selectedPayTypeModel.type userId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(NSDictionary * _Nonnull dict) {
if (weakSelf.selectedPayTypeModel.type.intValue == 2) {
NSDictionary *resultDict = dict[@"data"];
NSString *order = [NSString stringWithFormat:@"%@",resultDict[@"ali"]];
[[AlipaySDK defaultService] payOrder:order fromScheme:@"qxlive" callback:^(NSDictionary *resultDic) {
NSLog(@"支付宝H5支付回调 - %@", resultDic);
}];
}else if (weakSelf.selectedPayTypeModel.type.intValue == 1) {
NSDictionary *resultDict = dict[@"data"][@"wx"];
NSString *appid = resultDict[@"appid"];
NSString *partnerId = resultDict[@"partnerid"];
NSString *prepayId = [NSString stringWithFormat:@"%@",resultDict[@"prepayid"]];
NSString *nonceStr = resultDict[@"noncestr"];
UInt32 timeStamp = (UInt32)[resultDict[@"timestamp"] intValue];
NSString *package = resultDict[@"package"];
NSString *sign = resultDict[@"sign"];
PayReq *req = [[PayReq alloc] init];
req.openID = appid;
req.partnerId = partnerId;
req.prepayId = prepayId;
req.nonceStr = nonceStr;
req.timeStamp = timeStamp;
req.package = package;
req.sign = sign;
[WXApi sendReq:req completion:^(BOOL success) {
}];
}
else if (weakSelf.selectedPayTypeModel.type.intValue == 4) {
NSMutableDictionary*dic = [NSMutableDictionary dictionaryWithDictionary:dict[@"data"][@"tl"]];
[dic removeObjectForKey:@"json_data"];
NSString *json = [dic jsonStringEncoded];
NSString *thirdPartSchema = @"thirdPartSchema=qxlive://";
NSString *json1 = [json stringByReplacingOccurrencesOfString:@"\\" withString:@""];
NSCharacterSet *customSet1 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
// NSCharacterSet *customSet2 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
NSCharacterSet *customSet3 = [[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[]{}\""] invertedSet];
NSString *json2 = [json1 stringByAddingPercentEncodingWithAllowedCharacters:customSet1];
NSString *encodedString = [thirdPartSchema stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *queryString = [NSString stringWithFormat:@"payinfo=%@", json2];
NSString *doubleEncodedQuery = [queryString stringByAddingPercentEncodingWithAllowedCharacters:customSet3];
NSString *jumpStr = [NSString stringWithFormat:@"alipays://platformapi/startapp?appId=2021001104615521&page=pages/orderDetail/orderDetail&%@&query=%@",encodedString,doubleEncodedQuery];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:jumpStr] options:@{} completionHandler:nil];
}else if (weakSelf.selectedPayTypeModel.type.intValue == 5) {
WXLaunchMiniProgramReq *launchMiniProgramReq = [WXLaunchMiniProgramReq object];
launchMiniProgramReq.userName = @"gh_e64a1a89a0ad";
NSDictionary *dic = dict[@"data"][@"tl"];
NSString *param = @"";
for (NSString*key in dic.allKeys) {
if (param.length == 0) {
param = [param stringByAppendingFormat:@"%@=%@",key,dic[key]];
}else{
param = [param stringByAppendingFormat:@"&%@=%@",key,dic[key]];
}
}
launchMiniProgramReq.path = [NSString stringWithFormat:@"pages/orderDetail/orderDetail?%@",param];
launchMiniProgramReq.miniProgramType = WXMiniProgramTypeRelease;
[WXApi sendReq:launchMiniProgramReq completion:nil];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)
}];
}
-(UICollectionView *)collectionView{
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerNib:[UINib nibWithNibName:@"QXRechargePriceCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXRechargePriceCell"];
[_collectionView registerClass:[QXRechargePayTypeCell class] forCellWithReuseIdentifier:@"QXRechargePayTypeCell"];
[_collectionView registerClass:[QXRechargeCustomView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"QXRechargeCustomView"];
[_collectionView registerClass:[QXRechargeHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXRechargeHeaderView"];
}
return _collectionView;
}
-(UIButton *)rechargeBtn{
if (!_rechargeBtn) {
_rechargeBtn = [[UIButton alloc] init];
[_rechargeBtn setTitle:QXText(@"确认充值") forState:(UIControlStateNormal)];
[_rechargeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[_rechargeBtn addTarget:self action:@selector(rechargeAction:) forControlEvents:(UIControlEventTouchUpInside)];
[_rechargeBtn addRoundedCornersWithRadius:21];
_rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
_rechargeBtn.backgroundColor = QXConfig.themeColor;
}
return _rechargeBtn;
}
-(QXRechargeCustomView *)rechargeCustomView{
if (!_rechargeCustomView) {
_rechargeCustomView = [[QXRechargeCustomView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
}
return _rechargeCustomView;
}
-(QXRechargeHeaderView *)rechargeHeaderView{
if (!_rechargeHeaderView) {
_rechargeHeaderView = [[QXRechargeHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)];
}
return _rechargeHeaderView;
}
-(NSMutableArray *)rechargeDataArray{
if (!_rechargeDataArray) {
_rechargeDataArray = [NSMutableArray array];
}
return _rechargeDataArray;
}
-(NSMutableArray *)payTypeArray{
if (!_payTypeArray) {
_payTypeArray = [NSMutableArray array];
}
return _payTypeArray;
}
@end
@implementation QXRechargeCustomView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.bgView = [[UIView alloc] init];
[self addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.bottom.equalTo(self);
}];
self.unitLabel = [[UILabel alloc] init];
self.unitLabel.text = @"¥";
self.unitLabel.font = [UIFont boldSystemFontOfSize:18];
self.unitLabel.textColor = RGB16(0x333333);
[self.bgView addSubview:self.unitLabel];
[self.unitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.left.equalTo(self.bgView);
}];
self.cornLabel = [[UILabel alloc] init];
self.cornLabel.font = [UIFont systemFontOfSize:12];
self.cornLabel.textColor = RGB16(0x333333);
self.cornLabel.text = [NSString stringWithFormat:@"%@0%@",QXText(@"将获得"),QXText(@"金币")];
[self.bgView addSubview:self.cornLabel];
[self.cornLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.centerY.equalTo(self.bgView);
}];
self.textField = [[UITextField alloc] init];
self.textField.returnKeyType = UIReturnKeyDone;
self.textField.delegate = self;
self.textField.font = [UIFont systemFontOfSize:13];
self.textField.textColor = RGB16(0x333333);
self.textField.placeholder = QXText(@"请输入充值金额");
[self.bgView addSubview:self.textField];
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.unitLabel.mas_right).offset(3);
make.top.bottom.equalTo(self.bgView);
make.width.mas_equalTo(260);
}];
self.bottomLine = [[UIView alloc] init];
self.bottomLine.backgroundColor = RGB16(0x999999);
[self.bgView addSubview:self.bottomLine];
[self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.bottom.right.equalTo(self.bgView);
make.height.mas_equalTo(0.5);
}];
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}
@end
@implementation QXRechargeHeaderView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.bgView = [[UIView alloc] init];
[self addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.top.bottom.equalTo(self);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.text = QXText(@"支付方式");
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = RGB16(0x333333);
[self.bgView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.bgView);
make.right.mas_equalTo(-16);
make.top.bottom.equalTo(self);
}];
}
@end

View File

@@ -0,0 +1,42 @@
//
// QXMyCpRoomListCell.h
// QXLive
//
// Created by 启星 on 2025/7/1.
//
#import <UIKit/UIKit.h>
#import "QXRoomListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXMyCpRoomListCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
/// 头像
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
/// 房间类型
@property (weak, nonatomic) IBOutlet UIImageView *typeImageView;
/// 昵称
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;
/// ID
@property (weak, nonatomic) IBOutlet UILabel *IDLabel;
/// 关注数量
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
/// 收益金额
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@property (weak, nonatomic) IBOutlet UIButton *roomDetailBtn;
@property (weak, nonatomic) IBOutlet UIButton *roomRankBtn;
@property (weak, nonatomic) IBOutlet UIButton *rankValueBtn;
@property (weak, nonatomic) IBOutlet UIImageView *leftHeaderImageView;
@property (weak, nonatomic) IBOutlet UIImageView *rightHeaderImageView;
@property (weak, nonatomic) IBOutlet UILabel *relationLabel;
@property (nonatomic,strong)QXRoomListCpModel *cpModel;
/// 0 我创建的 1 我主持的
@property (nonatomic,assign)NSInteger type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,43 @@
//
// QXMyCpRoomListCell.m
// QXLive
//
// Created by on 2025/7/1.
//
#import "QXMyCpRoomListCell.h"
#import "QXRoomDetailViewController.h"
@implementation QXMyCpRoomListCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.roomDetailBtn.backgroundColor = QXConfig.themeColor;
[self.roomDetailBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
}
-(void)setType:(NSInteger)type{
_type = type;
}
-(void)setCpModel:(QXRoomListCpModel *)cpModel{
_cpModel = cpModel;
self.nickNameLabel.text = cpModel.room_name;
self.IDLabel.text = [NSString stringWithFormat:@"ID:%@",cpModel.room_number];
[self.leftHeaderImageView sd_setImageWithURL:[NSURL URLWithString:cpModel.user1_avatar]];
[self.rightHeaderImageView sd_setImageWithURL:[NSURL URLWithString:cpModel.user2_avatar]];
NSString *money = [NSString qx_showHotCountNum:cpModel.earnings.longLongValue];
self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
self.relationLabel.text = cpModel.relation;
NSTimeInterval timeInterval = [[NSDate date] timeIntervalSince1970];
long long milliseconds = (long long)(timeInterval);
long long time = cpModel.end_time.longLongValue - milliseconds;
self.timeLabel.text = [NSString getTimeWithSecond:time];
}
- (IBAction)detailAction:(id)sender {
QXRoomDetailViewController *vc = [[QXRoomDetailViewController alloc] init];
vc.type = self.type;
vc.room_id = self.cpModel.room_id;
[self.navigationController pushViewController:vc animated:YES];
}
@end

View File

@@ -0,0 +1,257 @@
<?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="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="Fcp-h6-XEB" customClass="QXMyCpRoomListCell">
<rect key="frame" x="0.0" y="0.0" width="560" height="159"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="560" height="159"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xgc-ZW-Nkl">
<rect key="frame" x="12" y="0.0" width="536" height="159"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="uIN-QL-vql">
<rect key="frame" x="0.0" y="0.0" width="536" height="159"/>
<color key="backgroundColor" red="0.95686274510000002" green="1" blue="0.96470588239999999" alpha="1" colorSpace="calibratedRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="vn3-DL-4Lf">
<rect key="frame" x="16" y="31" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="21H-g4-43L"/>
<constraint firstAttribute="height" constant="30" id="ShY-Pz-SYd"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="66B-mF-aS2">
<rect key="frame" x="47" y="31" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="WES-A1-9yH"/>
<constraint firstAttribute="height" constant="30" id="zPg-pT-808"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="my_cproom_head_bg" translatesAutoresizingMaskIntoConstraints="NO" id="dUG-ji-nPc">
<rect key="frame" x="14" y="21" width="65" height="65"/>
<constraints>
<constraint firstAttribute="width" constant="65" id="gAh-FV-YRh"/>
<constraint firstAttribute="height" constant="65" id="gcV-gk-RVv"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="6"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="my_room_cp" translatesAutoresizingMaskIntoConstraints="NO" id="vk0-vy-p5Y">
<rect key="frame" x="87" y="21" width="38" height="17"/>
<constraints>
<constraint firstAttribute="height" constant="17" id="6SK-e5-iey"/>
<constraint firstAttribute="width" constant="38" id="MpK-97-q4z"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="6"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="用户昵称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UHJ-6Y-z18">
<rect key="frame" x="133" y="20.666666666666668" width="59.666666666666657" height="18.000000000000004"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ID:123456789" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jTr-3w-TZs">
<rect key="frame" x="87" y="44" width="86.666666666666686" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123W" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ja1-Ki-jt0">
<rect key="frame" x="480.33333333333331" y="20" width="43.666666666666686" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="1" green="0.54117647059999996" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日收益" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rX1-aN-rOV">
<rect key="frame" x="472.33333333333331" y="45.666666666666664" width="51.666666666666686" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="25g-ef-U5f">
<rect key="frame" x="12" y="99" width="512" height="0.6666666666666714"/>
<color key="backgroundColor" red="0.8862745098" green="0.8862745098" blue="0.8862745098" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="GHR-jX-lZX"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="D0C-vN-9bM">
<rect key="frame" x="12" y="109.66666666666667" width="82" height="30.000000000000014"/>
<constraints>
<constraint firstAttribute="width" constant="82" id="1ma-Zs-rwu"/>
<constraint firstAttribute="height" constant="30" id="LeF-xp-5gw"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="房间明细"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="detailAction:" destination="Fcp-h6-XEB" eventType="touchUpInside" id="lrW-Uc-C5k"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="剩余33小时" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gpV-0C-EdQ">
<rect key="frame" x="451.66666666666669" y="116" width="76.333333333333314" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="到期时间:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="drY-i4-4zq">
<rect key="frame" x="381" y="116" width="62.666666666666686" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="aUe-ZW-OZm">
<rect key="frame" x="87" y="68" width="37" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="GZe-MB-Zgr"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title=" 45" image="my_cproom_value">
<color key="titleColor" red="0.050980392159999999" green="1" blue="0.72549019609999998" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BH8-hx-cKt">
<rect key="frame" x="142" y="68" width="37" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="18" id="nwC-I1-BPs"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title=" 45" image="my_cproom_rank">
<color key="titleColor" red="0.050980392159999999" green="1" blue="0.72549019609999998" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="兄弟闺蜜" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="un0-sV-Wtm">
<rect key="frame" x="14" y="67" width="65" height="15"/>
<constraints>
<constraint firstAttribute="height" constant="15" id="Ouk-GX-bra"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="11"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="uIN-QL-vql" firstAttribute="top" secondItem="xgc-ZW-Nkl" secondAttribute="top" id="1Zu-vq-MsP"/>
<constraint firstItem="UHJ-6Y-z18" firstAttribute="centerY" secondItem="vk0-vy-p5Y" secondAttribute="centerY" id="4qU-nr-5hs"/>
<constraint firstItem="un0-sV-Wtm" firstAttribute="leading" secondItem="dUG-ji-nPc" secondAttribute="leading" id="6M8-Ny-Q4H"/>
<constraint firstItem="jTr-3w-TZs" firstAttribute="top" secondItem="vk0-vy-p5Y" secondAttribute="bottom" constant="6" id="7lJ-Bb-BXk"/>
<constraint firstItem="D0C-vN-9bM" firstAttribute="leading" secondItem="xgc-ZW-Nkl" secondAttribute="leading" constant="12" id="8u4-3M-H50"/>
<constraint firstItem="drY-i4-4zq" firstAttribute="centerY" secondItem="gpV-0C-EdQ" secondAttribute="centerY" id="BWI-wi-28b"/>
<constraint firstItem="vk0-vy-p5Y" firstAttribute="leading" secondItem="dUG-ji-nPc" secondAttribute="trailing" constant="8" id="DXM-ht-NUL"/>
<constraint firstItem="D0C-vN-9bM" firstAttribute="top" secondItem="25g-ef-U5f" secondAttribute="bottom" constant="10" id="EgG-Gc-Gb5"/>
<constraint firstItem="dUG-ji-nPc" firstAttribute="top" secondItem="xgc-ZW-Nkl" secondAttribute="top" constant="21" id="FwI-30-Utf"/>
<constraint firstItem="66B-mF-aS2" firstAttribute="trailing" secondItem="dUG-ji-nPc" secondAttribute="trailing" constant="-2" id="JbX-Aw-2X7"/>
<constraint firstItem="jTr-3w-TZs" firstAttribute="leading" secondItem="vk0-vy-p5Y" secondAttribute="leading" id="KqJ-FN-K3y"/>
<constraint firstItem="vn3-DL-4Lf" firstAttribute="leading" secondItem="dUG-ji-nPc" secondAttribute="leading" constant="2" id="Mxz-74-Bqd"/>
<constraint firstAttribute="bottom" secondItem="uIN-QL-vql" secondAttribute="bottom" id="NKo-es-zHl"/>
<constraint firstItem="aUe-ZW-OZm" firstAttribute="bottom" secondItem="dUG-ji-nPc" secondAttribute="bottom" id="NSk-6I-Pit"/>
<constraint firstItem="BH8-hx-cKt" firstAttribute="centerY" secondItem="aUe-ZW-OZm" secondAttribute="centerY" id="Ntx-dh-4lK"/>
<constraint firstItem="UHJ-6Y-z18" firstAttribute="leading" secondItem="vk0-vy-p5Y" secondAttribute="trailing" constant="8" symbolic="YES" id="PJe-XP-CsH"/>
<constraint firstItem="BH8-hx-cKt" firstAttribute="leading" secondItem="aUe-ZW-OZm" secondAttribute="trailing" constant="18" id="SZA-gs-3Sn"/>
<constraint firstItem="25g-ef-U5f" firstAttribute="top" secondItem="dUG-ji-nPc" secondAttribute="bottom" constant="13" id="TzI-h6-fnl"/>
<constraint firstItem="dUG-ji-nPc" firstAttribute="leading" secondItem="xgc-ZW-Nkl" secondAttribute="leading" constant="14" id="Vbm-f0-cDa"/>
<constraint firstItem="un0-sV-Wtm" firstAttribute="trailing" secondItem="dUG-ji-nPc" secondAttribute="trailing" id="Xhn-dF-yCq"/>
<constraint firstAttribute="trailing" secondItem="rX1-aN-rOV" secondAttribute="trailing" constant="12" id="YgD-PR-qMa"/>
<constraint firstItem="vk0-vy-p5Y" firstAttribute="top" secondItem="dUG-ji-nPc" secondAttribute="top" id="Yxw-Ub-8at"/>
<constraint firstItem="66B-mF-aS2" firstAttribute="top" secondItem="vn3-DL-4Lf" secondAttribute="top" id="Zz7-L1-EDM"/>
<constraint firstAttribute="trailing" secondItem="25g-ef-U5f" secondAttribute="trailing" constant="12" id="b0r-go-fNq"/>
<constraint firstAttribute="trailing" secondItem="gpV-0C-EdQ" secondAttribute="trailing" constant="8" id="cCH-1o-Nl4"/>
<constraint firstItem="25g-ef-U5f" firstAttribute="leading" secondItem="xgc-ZW-Nkl" secondAttribute="leading" constant="12" id="e3h-5r-Pty"/>
<constraint firstAttribute="trailing" secondItem="Ja1-Ki-jt0" secondAttribute="trailing" constant="12" id="fBD-Qy-eNc"/>
<constraint firstItem="uIN-QL-vql" firstAttribute="leading" secondItem="xgc-ZW-Nkl" secondAttribute="leading" id="h4G-we-Le9"/>
<constraint firstItem="gpV-0C-EdQ" firstAttribute="leading" secondItem="drY-i4-4zq" secondAttribute="trailing" constant="8" symbolic="YES" id="k7w-sa-IYR"/>
<constraint firstItem="vn3-DL-4Lf" firstAttribute="top" secondItem="dUG-ji-nPc" secondAttribute="top" constant="10" id="lBQ-3e-wvt"/>
<constraint firstItem="un0-sV-Wtm" firstAttribute="bottom" secondItem="dUG-ji-nPc" secondAttribute="bottom" constant="-4" id="lJ1-2X-QUj"/>
<constraint firstItem="gpV-0C-EdQ" firstAttribute="centerY" secondItem="D0C-vN-9bM" secondAttribute="centerY" id="mcM-Ka-Gsf"/>
<constraint firstItem="Ja1-Ki-jt0" firstAttribute="centerY" secondItem="vk0-vy-p5Y" secondAttribute="centerY" id="ndE-vn-lcG"/>
<constraint firstItem="aUe-ZW-OZm" firstAttribute="leading" secondItem="jTr-3w-TZs" secondAttribute="leading" id="nip-o0-3wC"/>
<constraint firstAttribute="trailing" secondItem="uIN-QL-vql" secondAttribute="trailing" id="shS-bV-qVs"/>
<constraint firstItem="rX1-aN-rOV" firstAttribute="centerY" secondItem="dUG-ji-nPc" secondAttribute="centerY" id="vbO-dk-9Cf"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
</view>
<constraints>
<constraint firstItem="xgc-ZW-Nkl" firstAttribute="leading" secondItem="Fcp-h6-XEB" secondAttribute="leading" constant="12" id="20Y-bo-Mad"/>
<constraint firstAttribute="bottom" secondItem="xgc-ZW-Nkl" secondAttribute="bottom" id="Fss-nC-eNy"/>
<constraint firstAttribute="trailing" secondItem="xgc-ZW-Nkl" secondAttribute="trailing" constant="12" id="Z2t-Z7-ARM"/>
<constraint firstItem="xgc-ZW-Nkl" firstAttribute="top" secondItem="Fcp-h6-XEB" secondAttribute="top" id="sEP-95-LNU"/>
</constraints>
<size key="customSize" width="560" height="94"/>
<connections>
<outlet property="IDLabel" destination="jTr-3w-TZs" id="6hd-Uq-iMy"/>
<outlet property="bgImageView" destination="uIN-QL-vql" id="K3Z-cu-BY3"/>
<outlet property="headerImageView" destination="dUG-ji-nPc" id="gMV-Az-gWJ"/>
<outlet property="leftHeaderImageView" destination="vn3-DL-4Lf" id="2wH-ce-Oha"/>
<outlet property="moneyLabel" destination="Ja1-Ki-jt0" id="uI1-VT-c3N"/>
<outlet property="nickNameLabel" destination="UHJ-6Y-z18" id="TVZ-KB-F1c"/>
<outlet property="rankValueBtn" destination="BH8-hx-cKt" id="Rc2-7d-TjK"/>
<outlet property="relationLabel" destination="un0-sV-Wtm" id="uyc-PM-bBs"/>
<outlet property="rightHeaderImageView" destination="66B-mF-aS2" id="n0B-7q-iVL"/>
<outlet property="roomDetailBtn" destination="D0C-vN-9bM" id="TLY-yI-djH"/>
<outlet property="roomRankBtn" destination="aUe-ZW-OZm" id="VcG-Et-dsk"/>
<outlet property="timeLabel" destination="gpV-0C-EdQ" id="VNv-wg-PoH"/>
<outlet property="typeImageView" destination="vk0-vy-p5Y" id="uOH-pR-xtx"/>
</connections>
<point key="canvasLocation" x="528.24427480916029" y="35.563380281690144"/>
</collectionViewCell>
</objects>
<resources>
<image name="my_cproom_head_bg" width="65" height="65"/>
<image name="my_cproom_rank" width="14" height="14"/>
<image name="my_cproom_value" width="14" height="14"/>
<image name="my_room_cp" width="46" height="20"/>
<image name="user_header_placehoulder" width="40" height="40"/>
</resources>
</document>

View File

@@ -0,0 +1,45 @@
//
// QXMyRoomListCell.h
// IsLandVoice
//
// Created by 启星 on 2025/4/12.
//
#import <UIKit/UIKit.h>
#import "QXRoomListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXMyRoomListCell : UICollectionViewCell
/// 背景图
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
/// 头像
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
/// 房间类型
@property (weak, nonatomic) IBOutlet UIImageView *typeImageView;
/// 昵称
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;
/// ID
@property (weak, nonatomic) IBOutlet UILabel *IDLabel;
/// 关注数量
@property (weak, nonatomic) IBOutlet UILabel *followLabel;
/// 在线人数
@property (weak, nonatomic) IBOutlet UILabel *onlineLabel;
/// 访问量
@property (weak, nonatomic) IBOutlet UILabel *comeCountLabel;
/// 今日收益
@property (weak, nonatomic) IBOutlet UILabel *todayLabel;
/// 收益金额
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@property (weak, nonatomic) IBOutlet UIButton *roomDetailBtn;
@property (weak, nonatomic) IBOutlet UIButton *roomSubsidyBtn;
@property (nonatomic,assign)NSInteger bgImageCount;
@property (weak, nonatomic) IBOutlet UIImageView *roomWaitImageView;
@property (nonatomic,strong)QXRoomListModel *model;
/// 0 我创建的 1 我主持的
@property (nonatomic,assign)NSInteger type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,117 @@
//
// QXMyRoomListCell.m
// IsLandVoice
//
// Created by on 2025/4/12.
//
#import "QXMyRoomListCell.h"
#import "QXRoomDetailViewController.h"
#import "QXRoomSubsidyViewController.h"
@interface QXMyRoomListCell()
@property (nonatomic,strong)NSArray *bgImageNameArray;
@end
@implementation QXMyRoomListCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.roomDetailBtn.backgroundColor = QXConfig.themeColor;
[self.roomDetailBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.roomSubsidyBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.roomSubsidyBtn.backgroundColor = RGB16(0x333333);
}
-(void)setBgImageCount:(NSInteger)bgImageCount{
_bgImageCount = bgImageCount;
self.bgImageView.image = [UIImage imageNamed:self.bgImageNameArray[bgImageCount]];
}
-(void)setType:(NSInteger)type{
_type = type;
if (type == 0) {
self.roomSubsidyBtn.hidden = NO;
self.roomDetailBtn.hidden = NO;
}else{
self.roomSubsidyBtn.hidden = YES;
self.roomDetailBtn.hidden = NO;
}
}
//-(void)setModel:(SRLiveRoomModel *)model{
// _model = model;
// [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.cover_picture] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
// self.nickNameLabel.text = model.room_name;
// self.IDLabel.text = [NSString stringWithFormat:@"ID:%@",model.room_id];
// NSString *fav = [NSString sr_showHotCountNum:model.favorite_count];
// self.followLabel.text = [NSString stringWithFormat:@"关注:%@",fav];
// NSString *online = [NSString sr_showHotCountNum:model.online_num];
// self.onlineLabel.text = [NSString stringWithFormat:@"在线:%@",online];
// NSString *come = [NSString sr_showHotCountNum:model.come_count];
// self.comeCountLabel.text = [NSString stringWithFormat:@"访问:%@",come];
// if (self.type == 0) {
// self.todayLabel.text = @"今日收益";
// }else{
// self.todayLabel.text = [NSString stringWithFormat:@"收益分成比例:%@%%",model.earnings_ratio];
// }
// NSString *money = [NSString sr_showHotCountNum:model.today_income];
// self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
// [self.typeImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon] placeholderImage:nil];
//// if ([model.label_id isEqualToString:@"111"]) {
//// //
//// self.typeImageView.image = [UIImage imageNamed:@"Mask group 5"];
//// }else if ([model.label_id isEqualToString:@"108"]) {
//// //
//// self.typeImageView.image = [UIImage imageNamed:@"Mask group 4"];
//// }else{
//// //
//// self.typeImageView.image = [UIImage imageNamed:@"Mask group 3"];
//// }
//}
-(void)setModel:(QXRoomListModel *)model{
_model = model;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.room_cover] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.nickNameLabel.text = model.room_name;
self.IDLabel.text = [NSString stringWithFormat:@"ID:%@",model.room_number];
NSString *fav = [NSString qx_showHotCountNum:model.follow_num.longLongValue];
self.followLabel.text = [NSString stringWithFormat:@"关注:%@",fav];
NSString *online = [NSString qx_showHotCountNum:model.online_num.longLongValue];
self.onlineLabel.text = [NSString stringWithFormat:@"在线:%@",online];
NSString *come = [NSString qx_showHotCountNum:model.visit_num.longLongValue];
self.comeCountLabel.text = [NSString stringWithFormat:@"访问:%@",come];
if (self.type == 0) {
self.todayLabel.text = @"今日收益";
}else{
self.todayLabel.text = [NSString stringWithFormat:@"收益分成比例:%@%%",model.ratio];
}
NSString *money = [NSString qx_showHotCountNum:model.today_profit.longLongValue];
self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
[self.typeImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon] placeholderImage:nil];
if (model.apply_status.intValue == 1) {
self.roomWaitImageView.hidden = NO;
}else{
self.roomWaitImageView.hidden = YES;
}
}
- (IBAction)roomDetailAction:(id)sender {
QXRoomDetailViewController *vc = [[QXRoomDetailViewController alloc] init];
vc.type = self.type;
vc.room_id = self.model.room_id;
[self.navigationController pushViewController:vc animated:YES];
}
- (IBAction)subsidyAction:(id)sender {
QXRoomSubsidyViewController *vc = [[QXRoomSubsidyViewController alloc] init];
vc.room_id = self.model.room_id;
[self.navigationController pushViewController:vc animated:YES];
}
-(NSArray *)bgImageNameArray{
if (!_bgImageNameArray) {
_bgImageNameArray = @[@"Group 7026",@"Group 7024",@"Group 7025"];
}
return _bgImageNameArray;
}
@end

View File

@@ -0,0 +1,227 @@
<?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" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<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="QXMyRoomListCell">
<rect key="frame" x="0.0" y="0.0" width="560" height="159"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="560" height="159"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kMB-zj-bvu">
<rect key="frame" x="12" y="0.0" width="536" height="159"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="t6e-Ib-pCi">
<rect key="frame" x="0.0" y="0.0" width="536" height="159"/>
<color key="backgroundColor" red="0.95686274509803915" green="1" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="hCx-Bc-lup">
<rect key="frame" x="14" y="21" width="65" height="65"/>
<constraints>
<constraint firstAttribute="width" constant="65" id="Swl-8G-a2W"/>
<constraint firstAttribute="height" constant="65" id="rWW-H6-KUK"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="6"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="n8c-Bl-dxD">
<rect key="frame" x="87" y="21" width="38" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="38" id="1Pz-9J-qqg"/>
<constraint firstAttribute="height" constant="17" id="hS9-SD-vrA"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="6"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="用户昵称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N2H-oT-j7d">
<rect key="frame" x="133" y="20.666666666666668" width="59.666666666666657" height="18.000000000000004"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ID:123456789" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NQD-O5-Mxv">
<rect key="frame" x="87" y="44" width="86.666666666666686" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="关注:1234" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gwx-5C-Dyi">
<rect key="frame" x="86.999999999999986" y="70.333333333333329" width="145.66666666666663" height="15.666666666666671"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="在线:1.2W" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UEZ-KG-LO0">
<rect key="frame" x="232.66666666666669" y="70.333333333333329" width="145.66666666666669" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="访问:1234" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RxR-I5-aqT">
<rect key="frame" x="378.33333333333331" y="70.333333333333329" width="145.66666666666669" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123W" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7dX-Cp-SDr">
<rect key="frame" x="480.33333333333331" y="20" width="43.666666666666686" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="1" green="0.54117647059999996" blue="0.80000000000000004" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日收益" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xiq-z8-B3x">
<rect key="frame" x="472.33333333333331" y="45.666666666666664" width="51.666666666666686" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="k0N-ev-a0T">
<rect key="frame" x="12" y="99" width="512" height="0.6666666666666714"/>
<color key="backgroundColor" red="0.88627450980392153" green="0.88627450980392153" blue="0.88627450980392153" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="Dhz-Jd-Tft"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ay1-ie-dOO">
<rect key="frame" x="106" y="109.66666666666667" width="82" height="30.000000000000014"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="DWX-hC-OPc"/>
<constraint firstAttribute="width" constant="82" id="bdv-Lj-M5Q"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="房间补贴"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="subsidyAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="4uu-E6-s4b"/>
</connections>
</button>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="my_room_wait" translatesAutoresizingMaskIntoConstraints="NO" id="3bm-oL-g9B">
<rect key="frame" x="466" y="89" width="64" height="64"/>
<constraints>
<constraint firstAttribute="height" constant="64" id="Btr-TI-Qth"/>
<constraint firstAttribute="width" constant="64" id="sSX-Jv-Huj"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sme-1q-gFv">
<rect key="frame" x="12" y="109.66666666666667" width="82" height="30.000000000000014"/>
<constraints>
<constraint firstAttribute="width" constant="82" id="BB4-TU-RLg"/>
<constraint firstAttribute="height" constant="30" id="eh6-C7-fpO"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="房间明细"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="roomDetailAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="Lxe-l2-77m"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="gwx-5C-Dyi" firstAttribute="leading" secondItem="n8c-Bl-dxD" secondAttribute="leading" id="08v-sk-SNR"/>
<constraint firstItem="UEZ-KG-LO0" firstAttribute="width" secondItem="gwx-5C-Dyi" secondAttribute="width" id="6FW-rs-eE1"/>
<constraint firstItem="n8c-Bl-dxD" firstAttribute="top" secondItem="hCx-Bc-lup" secondAttribute="top" id="8eD-Qr-rlD"/>
<constraint firstAttribute="bottom" secondItem="t6e-Ib-pCi" secondAttribute="bottom" id="AhH-J8-YGz"/>
<constraint firstItem="sme-1q-gFv" firstAttribute="top" secondItem="k0N-ev-a0T" secondAttribute="bottom" constant="10" id="Bwd-Aa-dIn"/>
<constraint firstItem="N2H-oT-j7d" firstAttribute="centerY" secondItem="n8c-Bl-dxD" secondAttribute="centerY" id="Cvt-jd-YRa"/>
<constraint firstAttribute="trailing" secondItem="RxR-I5-aqT" secondAttribute="trailing" constant="12" id="EPe-MU-H2n"/>
<constraint firstAttribute="trailing" secondItem="3bm-oL-g9B" secondAttribute="trailing" constant="6" id="FFG-1q-qus"/>
<constraint firstItem="N2H-oT-j7d" firstAttribute="leading" secondItem="n8c-Bl-dxD" secondAttribute="trailing" constant="8" symbolic="YES" id="IUg-ec-S0W"/>
<constraint firstItem="UEZ-KG-LO0" firstAttribute="leading" secondItem="gwx-5C-Dyi" secondAttribute="trailing" id="KiF-aV-j2i"/>
<constraint firstItem="NQD-O5-Mxv" firstAttribute="leading" secondItem="n8c-Bl-dxD" secondAttribute="leading" id="LkZ-It-52D"/>
<constraint firstItem="n8c-Bl-dxD" firstAttribute="leading" secondItem="hCx-Bc-lup" secondAttribute="trailing" constant="8" id="Ozs-3q-8HK"/>
<constraint firstAttribute="trailing" secondItem="t6e-Ib-pCi" secondAttribute="trailing" id="Q80-US-afM"/>
<constraint firstAttribute="bottom" secondItem="3bm-oL-g9B" secondAttribute="bottom" constant="6" id="Qrl-mz-QDv"/>
<constraint firstItem="NQD-O5-Mxv" firstAttribute="top" secondItem="n8c-Bl-dxD" secondAttribute="bottom" constant="6" id="SEb-mJ-Hs3"/>
<constraint firstItem="RxR-I5-aqT" firstAttribute="leading" secondItem="UEZ-KG-LO0" secondAttribute="trailing" id="SHN-YW-EED"/>
<constraint firstItem="ay1-ie-dOO" firstAttribute="leading" secondItem="sme-1q-gFv" secondAttribute="trailing" constant="12" id="Uh7-dB-EuG"/>
<constraint firstItem="RxR-I5-aqT" firstAttribute="centerY" secondItem="gwx-5C-Dyi" secondAttribute="centerY" id="VVf-mE-Zsv"/>
<constraint firstItem="gwx-5C-Dyi" firstAttribute="bottom" secondItem="hCx-Bc-lup" secondAttribute="bottom" id="Zpq-MJ-IFT"/>
<constraint firstItem="sme-1q-gFv" firstAttribute="leading" secondItem="kMB-zj-bvu" secondAttribute="leading" constant="12" id="bEe-Ns-MKE"/>
<constraint firstItem="hCx-Bc-lup" firstAttribute="leading" secondItem="kMB-zj-bvu" secondAttribute="leading" constant="14" id="clK-gP-XU6"/>
<constraint firstItem="UEZ-KG-LO0" firstAttribute="centerY" secondItem="gwx-5C-Dyi" secondAttribute="centerY" id="eNF-UM-jtW"/>
<constraint firstItem="t6e-Ib-pCi" firstAttribute="top" secondItem="kMB-zj-bvu" secondAttribute="top" id="epf-k6-tdd"/>
<constraint firstAttribute="trailing" secondItem="7dX-Cp-SDr" secondAttribute="trailing" constant="12" id="exw-Lu-6EK"/>
<constraint firstItem="xiq-z8-B3x" firstAttribute="centerY" secondItem="hCx-Bc-lup" secondAttribute="centerY" id="hCb-to-coE"/>
<constraint firstItem="k0N-ev-a0T" firstAttribute="top" secondItem="hCx-Bc-lup" secondAttribute="bottom" constant="13" id="hrQ-j8-uOu"/>
<constraint firstItem="RxR-I5-aqT" firstAttribute="width" secondItem="gwx-5C-Dyi" secondAttribute="width" id="jH8-sQ-Y2W"/>
<constraint firstItem="7dX-Cp-SDr" firstAttribute="centerY" secondItem="n8c-Bl-dxD" secondAttribute="centerY" id="k1v-v1-rfA"/>
<constraint firstItem="hCx-Bc-lup" firstAttribute="top" secondItem="kMB-zj-bvu" secondAttribute="top" constant="21" id="lUy-k6-65s"/>
<constraint firstAttribute="trailing" secondItem="k0N-ev-a0T" secondAttribute="trailing" constant="12" id="osG-Ae-UXc"/>
<constraint firstItem="t6e-Ib-pCi" firstAttribute="leading" secondItem="kMB-zj-bvu" secondAttribute="leading" id="r2d-Lm-mmZ"/>
<constraint firstItem="k0N-ev-a0T" firstAttribute="leading" secondItem="kMB-zj-bvu" secondAttribute="leading" constant="12" id="rB0-hW-4Ld"/>
<constraint firstAttribute="trailing" secondItem="xiq-z8-B3x" secondAttribute="trailing" constant="12" id="ukL-M0-WWd"/>
<constraint firstItem="ay1-ie-dOO" firstAttribute="centerY" secondItem="sme-1q-gFv" secondAttribute="centerY" id="vdN-zt-xpb"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
</view>
<constraints>
<constraint firstAttribute="trailing" secondItem="kMB-zj-bvu" secondAttribute="trailing" constant="12" id="6om-tJ-1bC"/>
<constraint firstItem="kMB-zj-bvu" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="e9u-jg-kXk"/>
<constraint firstAttribute="bottom" secondItem="kMB-zj-bvu" secondAttribute="bottom" id="qDt-fJ-99W"/>
<constraint firstItem="kMB-zj-bvu" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="12" id="tz1-GN-mJn"/>
</constraints>
<size key="customSize" width="560" height="94"/>
<connections>
<outlet property="IDLabel" destination="NQD-O5-Mxv" id="T7K-Fu-olU"/>
<outlet property="bgImageView" destination="t6e-Ib-pCi" id="kde-Zh-JSf"/>
<outlet property="comeCountLabel" destination="RxR-I5-aqT" id="Ros-Uf-7C7"/>
<outlet property="followLabel" destination="gwx-5C-Dyi" id="uTA-Os-MrH"/>
<outlet property="headerImageView" destination="hCx-Bc-lup" id="bfX-FC-RjW"/>
<outlet property="moneyLabel" destination="7dX-Cp-SDr" id="igl-zs-dLw"/>
<outlet property="nickNameLabel" destination="N2H-oT-j7d" id="Zrg-Bj-xZR"/>
<outlet property="onlineLabel" destination="UEZ-KG-LO0" id="XG2-KV-U11"/>
<outlet property="roomDetailBtn" destination="sme-1q-gFv" id="bZb-3R-doL"/>
<outlet property="roomSubsidyBtn" destination="ay1-ie-dOO" id="USR-Gf-Jf1"/>
<outlet property="roomWaitImageView" destination="3bm-oL-g9B" id="Kwo-fW-Xr5"/>
<outlet property="todayLabel" destination="xiq-z8-B3x" id="8ct-tt-KqL"/>
<outlet property="typeImageView" destination="n8c-Bl-dxD" id="KCF-la-KYq"/>
</connections>
<point key="canvasLocation" x="528.24427480916029" y="35.563380281690144"/>
</collectionViewCell>
</objects>
<resources>
<image name="my_room_wait" width="64" height="64"/>
<image name="user_header_placehoulder" width="40" height="40"/>
</resources>
</document>

View File

@@ -0,0 +1,38 @@
//
// QXRoomDetailHeaderView.h
// IsLandVoice
//
// Created by 启星 on 2025/3/5.
//
#import <UIKit/UIKit.h>
#import "BRDatePickerView.h"
#import "QXRoomWaterModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomDetailHeaderView : UIView
@property (nonatomic,strong)QXRoomDetailModel *model;
@property (nonatomic,copy)void(^chooseDateBlock)(NSString*startTime,NSString*endTime);
@end
@interface QXDatePickerView : UIView
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIButton *cancelBtn;
@property (nonatomic,strong)UIButton *doneBtn;
@property (nonatomic,strong)UIButton *beginTimeBtn;
@property (nonatomic,strong)UIView *beginTimeLine;
@property (nonatomic,strong)UILabel *centerLabel;
@property (nonatomic,strong)UIButton *endTimeBtn;
@property (nonatomic,strong)UIView *endTimeLine;
@property (nonatomic,strong)UIView *pickerBGView;
@property (nonatomic,strong)BRDatePickerView *pickerView;
@property (nonatomic, assign)BRDatePickerMode pickerMode;
@property (nonatomic,strong)NSDate* beginDate;
@property (nonatomic,strong)NSDate* endDate;
@property (nonatomic,copy)void(^chooseDateBlock)(NSString*startTime,NSString*endTime);
@property (nonatomic,copy)void(^selectedDateBlock)(NSString*startTime,NSDate*startDate,NSString*endTime,NSDate*endDate);
-(void)show;
-(void)hide;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,382 @@
//
// QXRoomDetailHeaderView.m
// IsLandVoice
//
// Created by on 2025/3/5.
//
#import "QXRoomDetailHeaderView.h"
#import "UIButton+QX.h"
@class QXDatePickerView;
@interface QXRoomDetailHeaderView()
@property (nonatomic,strong)UIImageView*bigBgImageView;
@property (nonatomic,strong)UIImageView*bgImageView;
@property (nonatomic,strong)UIImageView*bottomBGView;
@property (nonatomic,strong)UIImageView*allPriceImageView;
@property (nonatomic,strong)UILabel*allPriceTitleLabel;
@property (nonatomic,strong)UILabel*allPriceLabel;
@property (nonatomic,strong)UILabel*allWaterTitleLabel;
@property (nonatomic,strong)UILabel*allWaterLabel;
@property (nonatomic,strong)UIImageView*allWaterImageView;
@property (nonatomic,strong)UIButton*timeBtn;
@property (nonatomic,strong)QXDatePickerView *pickerView;
@end
@implementation QXRoomDetailHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubView];
}
return self;
}
-(void)initSubView{
self.backgroundColor = [UIColor clearColor];
[self addSubview:self.bigBgImageView];
[self.bigBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self);
make.right.equalTo(self);
make.top.equalTo(self);
make.bottom.equalTo(self);
}];
[self addSubview:self.bottomBGView];
// [self.bottomBGView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self);
// make.right.equalTo(self);
// make.top.equalTo(self);
// make.bottom.equalTo(self);
// }];
[self addSubview:self.bgImageView];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self).offset(16);
make.right.equalTo(self).offset(-16);
make.top.equalTo(self).offset(11+kSafeAreaTop+44);
make.bottom.equalTo(self);
}];
[self addSubview:self.allPriceTitleLabel];
[self.allPriceTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.bgImageView).offset(16);
make.top.equalTo(self.bgImageView).offset(13);
make.width.mas_equalTo(128);
make.height.mas_equalTo(20);
}];
[self addSubview:self.allPriceImageView];
[self.allPriceImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.allPriceTitleLabel);
make.top.equalTo(self.bgImageView).offset(35);
make.height.width.mas_equalTo(40);
}];
[self addSubview:self.allPriceLabel];
[self.allPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.allPriceImageView.mas_right).offset(5);
make.top.equalTo(self.bgImageView).offset(32);
make.right.equalTo(self.bgImageView).offset(-16);
make.height.mas_equalTo(45);
}];
[self addSubview:self.allWaterTitleLabel];
[self.allWaterTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.bgImageView).offset(16);
make.top.equalTo(self.bgImageView).offset(87);
make.right.equalTo(self.bgImageView).offset(-16);
make.height.mas_equalTo(20);
}];
[self addSubview:self.allWaterImageView];
[self.allWaterImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.allWaterTitleLabel);
make.top.equalTo(self.bgImageView).offset(107);
make.height.width.mas_equalTo(20);
}];
[self addSubview:self.allWaterLabel];
[self.allWaterLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.allWaterImageView.mas_right).offset(5);
make.top.equalTo(self.bgImageView).offset(107);
make.right.equalTo(self.bgImageView).offset(-16);
make.height.mas_equalTo(20);
}];
[self addSubview:self.timeBtn];
[self.timeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgImageView).offset(-12);
make.centerY.equalTo(self.allPriceTitleLabel);
make.width.mas_greaterThanOrEqualTo(60);
make.height.mas_equalTo(40);
}];
}
-(void)layoutSubviews{
[super layoutSubviews];
self.bottomBGView.bottom = self.height;
}
-(void)timeAction:(UIButton*)sender{
[self.pickerView show];
}
-(void)setModel:(QXRoomDetailModel *)model{
_model = model;
self.allWaterLabel.text = [NSString stringWithFormat:@"%.2f",model.total_amount];;
self.allPriceLabel.text = [NSString stringWithFormat:@"%.2f",model.total_earning];
}
-(UIImageView *)bgImageView{
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_room_water_bg"]];
_bgImageView.contentMode = UIViewContentModeScaleToFill;
}
return _bgImageView;
}
-(UIImageView *)bigBgImageView{
if (!_bigBgImageView) {
_bigBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"detail_bg"]];
_bigBgImageView.contentMode = UIViewContentModeScaleToFill;
}
return _bigBgImageView;
}
-(UIImageView *)bottomBGView{
if (!_bottomBGView) {
UIImage*img = [UIImage imageNamed:@"mine_room_water_bg"];
CGFloat height = (SCREEN_WIDTH-32)/img.size.width*img.size.height;
_bottomBGView = [[UIImageView alloc] initWithFrame:CGRectMake(0, kSafeAreaTop+44+height/2.0, SCREEN_WIDTH, height/2.0)];
_bottomBGView.backgroundColor = [UIColor whiteColor];
[_bottomBGView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopRight|UIRectCornerTopLeft)];
}
return _bottomBGView;
}
-(UILabel *)allPriceTitleLabel{
if (!_allPriceTitleLabel) {
_allPriceTitleLabel = [[UILabel alloc] init];
_allPriceTitleLabel.textColor = [UIColor colorWithHexString:@"#999999"];
_allPriceTitleLabel.font = [UIFont systemFontOfSize:13];
_allPriceTitleLabel.text = @"累计收益";
}
return _allPriceTitleLabel;
}
-(UILabel *)allPriceLabel{
if (!_allPriceLabel) {
_allPriceLabel = [[UILabel alloc] init];
_allPriceLabel.textColor = [UIColor colorWithHexString:@"#333333"];
_allPriceLabel.font = [UIFont boldSystemFontOfSize:33];
_allPriceLabel.text = @"-";
}
return _allPriceLabel;
}
-(UILabel *)allWaterTitleLabel{
if (!_allWaterTitleLabel) {
_allWaterTitleLabel = [[UILabel alloc] init];
_allWaterTitleLabel.textColor = [UIColor colorWithHexString:@"#999999"];
_allWaterTitleLabel.font = [UIFont systemFontOfSize:13];
_allWaterTitleLabel.text = @"累计流水";
}
return _allWaterTitleLabel;
}
-(UIImageView *)allWaterImageView{
if (!_allWaterImageView) {
_allWaterImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallet_corn"]];
}
return _allWaterImageView;
}
-(UIImageView *)allPriceImageView{
if (!_allPriceImageView) {
_allPriceImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallet_diamond"]];
}
return _allPriceImageView;
}
-(UILabel *)allWaterLabel{
if (!_allWaterLabel) {
_allWaterLabel = [[UILabel alloc] init];
_allWaterLabel.textColor = [UIColor colorWithHexString:@"#333333"];
_allWaterLabel.font = [UIFont boldSystemFontOfSize:14];
_allWaterLabel.text = @"-";
}
return _allWaterLabel;
}
-(UIButton *)timeBtn{
if (!_timeBtn) {
_timeBtn = [[UIButton alloc] init];
[_timeBtn setTitle:@"全部" forState:UIControlStateNormal];
[_timeBtn setImage:[UIImage imageNamed:@"下拉"] forState:UIControlStateNormal];
[_timeBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateNormal)];
_timeBtn.titleLabel.font = [UIFont systemFontOfSize:13];
[_timeBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:3];
[_timeBtn addTarget:self action:@selector(timeAction:) forControlEvents:(UIControlEventTouchUpInside)];
}
return _timeBtn;
}
-(QXDatePickerView *)pickerView{
if (!_pickerView) {
_pickerView = [[QXDatePickerView alloc] init];
MJWeakSelf
_pickerView.chooseDateBlock = ^(NSString * _Nonnull startTime, NSString * _Nonnull endTime) {
[weakSelf.timeBtn setTitle:[NSString stringWithFormat:@"%@至%@",startTime,endTime] forState:(UIControlStateNormal)];
[weakSelf.timeBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleRight) imageTitleSpace:3];
if (weakSelf.chooseDateBlock) {
weakSelf.chooseDateBlock(startTime, endTime);
}
};
}
return _pickerView;
}
@end
@implementation QXDatePickerView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
[self createViews];
}
return self;
}
-(void)createViews{
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.5];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, ScaleWidth(400))];
self.bgView.backgroundColor = [UIColor whiteColor];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 70, 40)];
[self.cancelBtn setTitle:@"取消" forState:(UIControlStateNormal)];
[self.cancelBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateNormal)];
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[self.cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgView addSubview:self.cancelBtn];
self.doneBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.bgView.width-70, 0, 70, 40)];
[self.doneBtn setTitle:@"完成" forState:(UIControlStateNormal)];
[self.doneBtn addTarget:self action:@selector(doneAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.doneBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateNormal)];
self.doneBtn.titleLabel.font = [UIFont systemFontOfSize:15];
[self.bgView addSubview:self.doneBtn];
CGFloat btnWith = (self.bgView.width-40*2-25)/2.0;
self.beginTimeBtn = [[UIButton alloc] initWithFrame:CGRectMake(40, self.cancelBtn.bottom, btnWith, 40)];
[self.beginTimeBtn setTitle:@"开始时间" forState:(UIControlStateNormal)];
[self.beginTimeBtn setTitleColor:[UIColor colorWithHexString:@"#BBBBBB"] forState:(UIControlStateNormal)];
[self.beginTimeBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateSelected)];
[self.beginTimeBtn addTarget:self action:@selector(beginTimeAction) forControlEvents:(UIControlEventTouchUpInside)];
self.beginTimeBtn.titleLabel.font = [UIFont systemFontOfSize:14.f];
[self.bgView addSubview:self.beginTimeBtn];
self.beginTimeLine = [[UIView alloc] initWithFrame:CGRectMake(self.beginTimeBtn.left, self.beginTimeBtn.bottom, btnWith, 1)];
self.beginTimeLine.backgroundColor = [UIColor colorWithHexString:@"#BBBBBB"];
[self.bgView addSubview:self.beginTimeLine];
self.endTimeBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.bgView.width-40-btnWith, self.beginTimeBtn.top, btnWith, 40)];
[self.endTimeBtn setTitle:@"结束时间" forState:(UIControlStateNormal)];
[self.endTimeBtn setTitleColor:[UIColor colorWithHexString:@"#BBBBBB"] forState:(UIControlStateNormal)];
[self.endTimeBtn setTitleColor:[UIColor colorWithHexString:@"#333333"] forState:(UIControlStateSelected)];
[self.endTimeBtn addTarget:self action:@selector(endTimeAction) forControlEvents:(UIControlEventTouchUpInside)];
self.endTimeBtn.titleLabel.font = [UIFont systemFontOfSize:14.f];
[self.bgView addSubview:self.endTimeBtn];
self.endTimeLine = [[UIView alloc] initWithFrame:CGRectMake(self.endTimeBtn.left, self.endTimeBtn.bottom, btnWith, 1)];
self.endTimeLine.backgroundColor = [UIColor colorWithHexString:@"#BBBBBB"];
[self.bgView addSubview:self.endTimeLine];
self.centerLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.beginTimeBtn.right, self.beginTimeBtn.top, self.endTimeBtn.left-self.beginTimeBtn.right, 40)];
self.centerLabel.textAlignment = NSTextAlignmentCenter;
self.centerLabel.text = @"至";
self.centerLabel.textColor = [UIColor colorWithHexString:@"#666666"];
self.centerLabel.font = [UIFont systemFontOfSize:14];
[self.bgView addSubview:self.centerLabel];
self.pickerBGView = [[UIView alloc] initWithFrame:CGRectMake(0, self.beginTimeBtn.bottom+15, self.bgView.width, self.bgView.height-self.beginTimeBtn.bottom-30)];
[self.bgView addSubview:self.pickerBGView];
[self.pickerView addPickerToView:self.pickerBGView];
[self beginTimeAction];
}
-(void)beginTimeAction{
self.beginTimeBtn.selected = YES;
self.beginTimeLine.backgroundColor = [UIColor colorWithHexString:@"#333333"];
self.endTimeBtn.selected = NO;
self.endTimeLine.backgroundColor = [UIColor colorWithHexString:@"#BBBBBB"];
}
-(void)endTimeAction{
self.endTimeBtn.selected = YES;
self.endTimeLine.backgroundColor = [UIColor colorWithHexString:@"#333333"];
self.beginTimeBtn.selected = NO;
self.beginTimeLine.backgroundColor = [UIColor colorWithHexString:@"#BBBBBB"];
}
-(void)cancelAction{
[self hide];
}
-(void)doneAction{
if ([self.beginTimeBtn.titleLabel.text isEqualToString:@"开始时间"]) {
showToast(@"请选择开始时间");
return;
}
if ([self.endTimeBtn.titleLabel.text isEqualToString:@"结束时间"]) {
showToast(@"请选择结束时间");
return;
}
NSComparisonResult result = [self.endDate compare:self.beginDate];
if (result == NSOrderedAscending) {
showToast(@"结束时间早于开始时间");
return;
}
[self hide];
if (self.chooseDateBlock) {
self.chooseDateBlock(self.beginTimeBtn.titleLabel.text, self.endTimeBtn.titleLabel.text);
}
if (self.selectedDateBlock) {
self.selectedDateBlock(self.beginTimeBtn.titleLabel.text, self.beginDate, self.endTimeBtn.titleLabel.text, self.endDate);
}
}
-(void)show{
for (UIWindow *w in [UIApplication sharedApplication].windows) {
if ([w isKeyWindow]) {
[w addSubview:self];
break;
}
}
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(400);
}];
}
-(void)hide{
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
-(void)setPickerMode:(BRDatePickerMode)pickerMode{
_pickerMode = pickerMode;
self.pickerView.pickerMode = pickerMode;
}
-(BRDatePickerView *)pickerView{
if (!_pickerView) {
_pickerView = [[BRDatePickerView alloc] initWithPickerMode:BRDatePickerModeYMD];
_pickerView.maxDate = [NSDate date];
_pickerView.minDate = [NSDate br_setYear:2020];
_pickerView.selectDate = [NSDate date];
_pickerView.isAutoSelect = YES;
MJWeakSelf
_pickerView.resultBlock = ^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
if (weakSelf.beginTimeBtn.selected) {
[weakSelf.beginTimeBtn setTitle:selectValue forState:(UIControlStateNormal)];
weakSelf.beginDate = selectDate;
}else{
[weakSelf.endTimeBtn setTitle:selectValue forState:(UIControlStateNormal)];
weakSelf.endDate = selectDate;
}
};
}
return _pickerView;
}
@end

View File

@@ -0,0 +1,21 @@
//
// QXRoomSubsidyCell.h
// IsLandVoice
//
// Created by 启星 on 2025/4/23.
//
#import <UIKit/UIKit.h>
#import "QXSubsidyModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomSubsidyCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *ststusLabel;
@property (weak, nonatomic) IBOutlet UILabel *allWaterLabel;
@property (weak, nonatomic) IBOutlet UILabel *subsidyLabel;
@property (nonatomic,strong) QXSubsidyDetailModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,36 @@
//
// QXRoomSubsidyCell.m
// IsLandVoice
//
// Created by on 2025/4/23.
//
#import "QXRoomSubsidyCell.h"
@implementation QXRoomSubsidyCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXRoomSubsidyCell";
QXRoomSubsidyCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
}
return cell;
}
-(void)setModel:(QXSubsidyDetailModel *)model{
_model = model;
self.allWaterLabel.text = [NSString stringWithFormat:@"累计流水:%.1f",model.total_transaction.doubleValue];
self.subsidyLabel.text = [NSString stringWithFormat:@"获得补贴:%.1f",model.subsidy_amount.doubleValue];
self.ststusLabel.text = model.status==1?@"已发放":@"未发放";
}
- (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

View File

@@ -0,0 +1,76 @@
<?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="117" id="KGk-i7-Jjw" customClass="QXRoomSubsidyCell">
<rect key="frame" x="0.0" y="0.0" width="503" height="117"/>
<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="503" height="117"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UR5-5B-xN6">
<rect key="frame" x="16.000000000000004" y="11.999999999999998" width="42.333333333333343" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.28627450980000002" green="0.28627450980000002" blue="0.28627450980000002" 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="nYK-5C-hPt">
<rect key="frame" x="451" y="13.333333333333336" width="36" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" 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="kPU-jb-4hy">
<rect key="frame" x="16.000000000000004" y="88" width="35.333333333333343" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="1" green="0.54117647058823526" blue="0.80000000000000004" 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="qzG-cY-9Rw">
<rect key="frame" x="451" y="88" width="36" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.69803921568627447" green="0.396078431372549" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gh3-4f-DsJ">
<rect key="frame" x="16" y="58" width="471" height="1"/>
<color key="backgroundColor" red="0.92549019607843142" green="0.92549019607843142" blue="0.92549019607843142" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="QMb-fA-36Y"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="Gh3-4f-DsJ" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="4A7-l3-afF"/>
<constraint firstItem="kPU-jb-4hy" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="4gz-q1-clm"/>
<constraint firstItem="qzG-cY-9Rw" firstAttribute="centerY" secondItem="kPU-jb-4hy" secondAttribute="centerY" id="KZb-Hb-vTS"/>
<constraint firstAttribute="bottom" secondItem="kPU-jb-4hy" secondAttribute="bottom" constant="12" id="Mqk-fc-ej8"/>
<constraint firstItem="UR5-5B-xN6" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="QFg-RN-8Qa"/>
<constraint firstAttribute="trailing" secondItem="Gh3-4f-DsJ" secondAttribute="trailing" constant="16" id="ZTX-hU-e3i"/>
<constraint firstItem="Gh3-4f-DsJ" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="bXL-7Z-ee8"/>
<constraint firstAttribute="trailing" secondItem="nYK-5C-hPt" secondAttribute="trailing" constant="16" id="dRW-2J-pgO"/>
<constraint firstAttribute="trailing" secondItem="qzG-cY-9Rw" secondAttribute="trailing" constant="16" id="mOA-Co-wax"/>
<constraint firstItem="UR5-5B-xN6" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="qK0-WO-1kB"/>
<constraint firstItem="nYK-5C-hPt" firstAttribute="centerY" secondItem="UR5-5B-xN6" secondAttribute="centerY" id="tT5-eT-9d4"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="allWaterLabel" destination="kPU-jb-4hy" id="Taw-JH-3US"/>
<outlet property="ststusLabel" destination="nYK-5C-hPt" id="KAo-ro-KJ5"/>
<outlet property="subsidyLabel" destination="qzG-cY-9Rw" id="J65-1P-DAO"/>
<outlet property="titleLabel" destination="UR5-5B-xN6" id="xvb-1y-7yC"/>
</connections>
<point key="canvasLocation" x="278.62595419847327" y="45.422535211267608"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,21 @@
//
// QXRoomSubsidyHistoryCell.h
// IsLandVoice
//
// Created by 启星 on 2025/4/23.
//
#import <UIKit/UIKit.h>
#import "QXSubsidyModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomSubsidyHistoryCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *allWaterLabel;
@property (weak, nonatomic) IBOutlet UILabel *subsidyLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (nonatomic,strong)QXSubsidyHistoryModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,38 @@
//
// QXRoomSubsidyHistoryCell.m
// IsLandVoice
//
// Created by on 2025/4/23.
//
#import "QXRoomSubsidyHistoryCell.h"
@implementation QXRoomSubsidyHistoryCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXRoomSubsidyHistoryCell";
QXRoomSubsidyHistoryCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
}
return cell;
}
-(void)setModel:(QXSubsidyHistoryModel *)model{
_model = model;
self.allWaterLabel.text = [NSString stringWithFormat:@"%.1f",model.total_transaction.doubleValue];
self.subsidyLabel.text = [NSString stringWithFormat:@"%.1f",model.subsidy_amount.doubleValue];
self.timeLabel.text = [NSString stringWithFormat:@"%@-%@",model.start_time,model.end_time];
self.statusLabel.text = model.status==1?@"已发放":@"未发放";
self.statusLabel.textColor = model.status==1?[UIColor colorWithHexString:@"#999999"]:[UIColor colorWithHexString:@"#45D08C"];
}
- (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

View File

@@ -0,0 +1,76 @@
<?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="83" id="KGk-i7-Jjw" customClass="QXRoomSubsidyHistoryCell">
<rect key="frame" x="0.0" y="0.0" width="425" height="83"/>
<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="425" height="83"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2zi-eo-2ps">
<rect key="frame" x="16" y="33" width="145" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="145" id="3bZ-ss-pcv"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="loq-dz-VQy">
<rect key="frame" x="284" y="33" width="65" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="65" id="35B-OT-cUY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7Lc-Lt-9ql">
<rect key="frame" x="359" y="33" width="50" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="IYN-az-Gz2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="owo-ey-ihf">
<rect key="frame" x="171" y="33" width="103" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="2zi-eo-2ps" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="5gC-Z6-Kmd"/>
<constraint firstItem="2zi-eo-2ps" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="6OL-ko-Ucx"/>
<constraint firstAttribute="trailing" secondItem="7Lc-Lt-9ql" secondAttribute="trailing" constant="16" id="C46-cS-qVe"/>
<constraint firstItem="7Lc-Lt-9ql" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="ETn-cT-Izd"/>
<constraint firstItem="owo-ey-ihf" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="O8E-j3-Xcx"/>
<constraint firstItem="7Lc-Lt-9ql" firstAttribute="leading" secondItem="loq-dz-VQy" secondAttribute="trailing" constant="10" id="ZQV-zN-mAX"/>
<constraint firstItem="loq-dz-VQy" firstAttribute="leading" secondItem="owo-ey-ihf" secondAttribute="trailing" constant="10" id="fzO-pK-ePn"/>
<constraint firstItem="loq-dz-VQy" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="nRg-Tp-DgM"/>
<constraint firstItem="owo-ey-ihf" firstAttribute="leading" secondItem="2zi-eo-2ps" secondAttribute="trailing" constant="10" id="ycF-fG-qTf"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="allWaterLabel" destination="owo-ey-ihf" id="Bky-TJ-5OU"/>
<outlet property="statusLabel" destination="7Lc-Lt-9ql" id="c2d-ji-cbZ"/>
<outlet property="subsidyLabel" destination="loq-dz-VQy" id="fdL-3Z-HAS"/>
<outlet property="timeLabel" destination="2zi-eo-2ps" id="qGb-WO-qeC"/>
</connections>
<point key="canvasLocation" x="3.8167938931297707" y="13.028169014084508"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,25 @@
//
// QXRoomWaterListCell.h
// IsLandVoice
//
// Created by 启星 on 2025/3/5.
//
#import <UIKit/UIKit.h>
#import "QXRoomSubsidyViewController.h"
#import "QXRoomWaterModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomWaterListCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (nonatomic,strong)QXRoomWaterDetailModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,39 @@
//
// QXRoomWaterListCell.m
// IsLandVoice
//
// Created by on 2025/3/5.
//
#import "QXRoomWaterListCell.h"
@implementation QXRoomWaterListCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXRoomWaterListCell";
QXRoomWaterListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
}
return cell;
}
-(void)setModel:(QXRoomWaterDetailModel *)model{
_model = model;
self.nameLabel.text = model.sender_nickname;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.sender_avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
self.priceLabel.text = [NSString stringWithFormat:@"+%@",model.total_price];
self.detailLabel.text = [NSString stringWithFormat:@"赠送 %@ %@x%@",model.receive_nickname,model.gift_name,model.number];
}
- (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

View File

@@ -0,0 +1,85 @@
<?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>
<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="107" id="KGk-i7-Jjw" customClass="QXRoomWaterListCell">
<rect key="frame" x="0.0" y="0.0" width="507" height="107"/>
<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="507" height="107"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user_header_placehoulder" translatesAutoresizingMaskIntoConstraints="NO" id="nkf-mf-eKj">
<rect key="frame" x="16" y="33" width="41" height="41"/>
<constraints>
<constraint firstAttribute="height" constant="41" id="RxF-Ai-6xe"/>
<constraint firstAttribute="width" constant="41" id="gYA-4Y-hpp"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<real key="value" value="20.5"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="有你在身边" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8hM-GO-e2F">
<rect key="frame" x="73" y="33" width="69.666666666666686" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="赠送 摸鱼" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z01-RY-Nhw">
<rect key="frame" x="73" y="58.333333333333336" width="55.333333333333343" height="15.666666666666664"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+10.5元" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2nf-4S-3Rw">
<rect key="frame" x="440" y="45" width="51" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="lo0-vK-rqG">
<rect key="frame" x="16" y="106.66666666666667" width="475" height="0.3333333333333286"/>
<color key="backgroundColor" red="0.92549019607843142" green="0.92549019607843142" blue="0.92549019607843142" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="wSX-sv-RRQ"/>
</constraints>
</view>
</subviews>
<constraints>
<constraint firstItem="z01-RY-Nhw" firstAttribute="leading" secondItem="8hM-GO-e2F" secondAttribute="leading" id="LfE-bv-gr9"/>
<constraint firstItem="nkf-mf-eKj" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="RH8-NF-gom"/>
<constraint firstItem="nkf-mf-eKj" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="TVP-9J-v1o"/>
<constraint firstAttribute="trailing" secondItem="2nf-4S-3Rw" secondAttribute="trailing" constant="16" id="UMD-nM-f2y"/>
<constraint firstItem="z01-RY-Nhw" firstAttribute="bottom" secondItem="nkf-mf-eKj" secondAttribute="bottom" id="aXU-Jz-NJE"/>
<constraint firstItem="8hM-GO-e2F" firstAttribute="top" secondItem="nkf-mf-eKj" secondAttribute="top" id="eZY-bd-wIy"/>
<constraint firstItem="2nf-4S-3Rw" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="hja-Wp-5Db"/>
<constraint firstAttribute="bottom" secondItem="lo0-vK-rqG" secondAttribute="bottom" id="jXl-Gu-aPk"/>
<constraint firstAttribute="trailing" secondItem="lo0-vK-rqG" secondAttribute="trailing" constant="16" id="kjz-nU-ogz"/>
<constraint firstItem="lo0-vK-rqG" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="oH0-Up-tmQ"/>
<constraint firstItem="8hM-GO-e2F" firstAttribute="leading" secondItem="nkf-mf-eKj" secondAttribute="trailing" constant="16" id="vYA-ob-nie"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="detailLabel" destination="z01-RY-Nhw" id="h2T-ML-JME"/>
<outlet property="headerImageView" destination="nkf-mf-eKj" id="zNR-ta-foX"/>
<outlet property="nameLabel" destination="8hM-GO-e2F" id="nHO-a5-7aY"/>
<outlet property="priceLabel" destination="2nf-4S-3Rw" id="2zd-Nj-Xli"/>
</connections>
<point key="canvasLocation" x="281.67938931297709" y="41.197183098591552"/>
</tableViewCell>
</objects>
<resources>
<image name="user_header_placehoulder" width="128" height="128"/>
</resources>
</document>

View File

@@ -0,0 +1,21 @@
//
// QXBackpackRecordCell.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
#import "QXGiftModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXBackpackRecordCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *recordLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *giftImageView;
@property (weak, nonatomic) IBOutlet UIView *lineView;
@property (strong, nonatomic) QXBagRecordModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,23 @@
//
// QXBackpackRecordCell.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXBackpackRecordCell.h"
@implementation QXBackpackRecordCell
-(void)setModel:(QXBagRecordModel *)model{
_model = model;
self.titleLabel.text = model.remarks;
self.timeLabel.text = model.time;
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.gift_image]];
self.recordLabel.text = [NSString stringWithFormat:@"X%@%@",model.gift_num,model.gift_name];
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end

View File

@@ -0,0 +1,100 @@
<?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="System colors in document resources" minToolsVersion="11.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="QXBackpackRecordCell">
<rect key="frame" x="0.0" y="0.0" width="498" height="148"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="498" height="148"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nbi-D7-frH">
<rect key="frame" x="0.0" y="0.0" width="498" height="148"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="初级礼包" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UOc-ov-nZz">
<rect key="frame" x="16.999999999999996" y="12" width="55.666666666666657" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="ZHD-zS-NZX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2025.12.21 11:11:23" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Pb-QE-1Lw">
<rect key="frame" x="17.000000000000007" y="121.66666666666667" width="108.66666666666669" height="14.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="66t-9V-hju">
<rect key="frame" x="458" y="12" width="24" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="4Iw-1h-amt"/>
<constraint firstAttribute="width" constant="24" id="XDm-HF-ma8"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qtp-QY-lRw">
<rect key="frame" x="0.0" y="147.66666666666666" width="498" height="0.33333333333334281"/>
<color key="backgroundColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="0.5" id="yZN-w2-z2m"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="×1娃哈哈" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="D0y-5m-ldp">
<rect key="frame" x="386.33333333333331" y="14.333333333333334" width="66.666666666666686" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="UOc-ov-nZz" firstAttribute="leading" secondItem="nbi-D7-frH" secondAttribute="leading" constant="17" id="1Tl-xD-ymD"/>
<constraint firstItem="66t-9V-hju" firstAttribute="leading" secondItem="D0y-5m-ldp" secondAttribute="trailing" constant="5" id="1c9-dF-m5f"/>
<constraint firstItem="D0y-5m-ldp" firstAttribute="centerY" secondItem="66t-9V-hju" secondAttribute="centerY" id="4LB-5Q-Zat"/>
<constraint firstAttribute="bottom" secondItem="9Pb-QE-1Lw" secondAttribute="bottom" constant="12" id="7L1-aQ-Rhq"/>
<constraint firstAttribute="trailing" secondItem="66t-9V-hju" secondAttribute="trailing" constant="16" id="KPi-sO-awu"/>
<constraint firstAttribute="trailing" secondItem="qtp-QY-lRw" secondAttribute="trailing" id="MNG-sX-1qa"/>
<constraint firstItem="66t-9V-hju" firstAttribute="top" secondItem="nbi-D7-frH" secondAttribute="top" constant="12" id="PQK-nf-d3j"/>
<constraint firstItem="9Pb-QE-1Lw" firstAttribute="leading" secondItem="UOc-ov-nZz" secondAttribute="leading" id="Qrz-el-Ch5"/>
<constraint firstItem="UOc-ov-nZz" firstAttribute="top" secondItem="nbi-D7-frH" secondAttribute="top" constant="12" id="aL1-il-sc6"/>
<constraint firstAttribute="bottom" secondItem="qtp-QY-lRw" secondAttribute="bottom" id="aog-MM-aMB"/>
<constraint firstItem="qtp-QY-lRw" firstAttribute="leading" secondItem="nbi-D7-frH" secondAttribute="leading" id="g02-3N-dAm"/>
</constraints>
</view>
</subviews>
</view>
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
<constraints>
<constraint firstItem="nbi-D7-frH" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="Xwt-La-gyS"/>
<constraint firstAttribute="bottom" secondItem="nbi-D7-frH" secondAttribute="bottom" id="nBe-Yn-Dia"/>
<constraint firstItem="nbi-D7-frH" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="rPE-0M-ebp"/>
<constraint firstAttribute="trailing" secondItem="nbi-D7-frH" secondAttribute="trailing" id="wyV-3f-eZh"/>
</constraints>
<size key="customSize" width="498" height="148"/>
<connections>
<outlet property="giftImageView" destination="66t-9V-hju" id="mEc-8c-DTs"/>
<outlet property="lineView" destination="qtp-QY-lRw" id="Yn3-Z0-sqo"/>
<outlet property="recordLabel" destination="D0y-5m-ldp" id="rNa-Ph-x6M"/>
<outlet property="timeLabel" destination="9Pb-QE-1Lw" id="ygL-v1-iNp"/>
<outlet property="titleLabel" destination="UOc-ov-nZz" id="lQR-l1-JKK"/>
</connections>
<point key="canvasLocation" x="480.91603053435114" y="53.521126760563384"/>
</collectionViewCell>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

View File

@@ -0,0 +1,22 @@
//
// QXDayTaskCell.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXDayTaskCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;
@property (weak, nonatomic) IBOutlet UIButton *finishBtn;
@property (strong, nonatomic) QXDayTaskListModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,73 @@
//
// QXDayTaskCell.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXDayTaskCell.h"
#import "QXMineNetwork.h"
@implementation QXDayTaskCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXDayTaskCell";
QXDayTaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
-(void)setModel:(QXDayTaskListModel *)model{
_model = model;
self.titleLabel.text = model.task_name;
NSString*subTitle = [NSString stringWithFormat:@"金币+%@",model.gold_reward];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:subTitle];
[attr yy_setColor:RGB16(0xE24171) range:[subTitle rangeOfString:[NSString stringWithFormat:@"+%@",model.gold_reward]]];
self.subTitleLabel.attributedText = attr;
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:model.icon]];
if (model.task_status.intValue == 1) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = NO;
}else if (model.task_status.intValue == 2) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = YES;
}else{
self.finishBtn.selected = NO;
self.finishBtn.enabled = NO;
}
}
- (IBAction)finishAction:(id)sender {
if (self.model.task_status.intValue == 1) {
if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) {
QXGlobal.shareGlobal.taskModel = self.model;
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
}
}else if (self.model.task_status.intValue == 2) {
MJWeakSelf
[QXMineNetwork dayTaskDrawWithTaskId:self.model.task_id successBlock:^(NSDictionary * _Nonnull dict) {
showToast(@"领取成功");
weakSelf.model.task_status = @"3";
weakSelf.finishBtn.selected = NO;
weakSelf.finishBtn.enabled = NO;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self.finishBtn addRoundedCornersWithRadius:15];
self.finishBtn.layer.borderColor = RGB16(0xE24171).CGColor;
self.finishBtn.layer.borderWidth = 1;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -0,0 +1,83 @@
<?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="default" indentationWidth="10" rowHeight="108" id="KGk-i7-Jjw" customClass="QXDayTaskCell">
<rect key="frame" x="0.0" y="0.0" width="481" height="108"/>
<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="481" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Zzf-Hx-7yu">
<rect key="frame" x="16" y="34" width="40" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Xua-MB-4nn"/>
<constraint firstAttribute="width" constant="40" id="e6m-v0-EYD"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="34" width="333" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bni-4p-6Qt">
<rect key="frame" x="405" y="39" width="60" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="NYX-5D-Uw8"/>
<constraint firstAttribute="width" constant="60" id="afU-OP-XMX"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="去完成">
<color key="titleColor" red="0.88627450980392153" green="0.25490196078431371" blue="0.44313725490196076" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
</state>
<state key="disabled" title="已领取"/>
<state key="selected" title="领取"/>
<connections>
<action selector="finishAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="O2a-NK-IEM"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eqP-bF-SEp">
<rect key="frame" x="62" y="57" width="333" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="leading" secondItem="Zzf-Hx-7yu" secondAttribute="trailing" constant="6" id="0aO-hG-r1W"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="83a-aB-YJD"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="bottom" secondItem="Zzf-Hx-7yu" secondAttribute="bottom" id="HP4-ka-VMG"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="MeK-CK-V0P"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="aGe-7f-yAi"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="crV-1Z-BmV"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="itH-bd-9ay"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="poY-hN-bRh"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="y6a-e4-hfz"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="bni-4p-6Qt" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="IM5-xV-Df6"/>
</constraints>
<connections>
<outlet property="finishBtn" destination="bni-4p-6Qt" id="K8I-ow-9Uv"/>
<outlet property="iconImageView" destination="Zzf-Hx-7yu" id="D8z-6l-i8N"/>
<outlet property="subTitleLabel" destination="eqP-bF-SEp" id="NDK-d5-ZFa"/>
<outlet property="titleLabel" destination="gZv-uE-Dy3" id="2qO-s4-pJt"/>
</connections>
<point key="canvasLocation" x="261.83206106870227" y="42.253521126760567"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,37 @@
//
// QXDayTaskTopView.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
#import "QXProgressView.h"
#import "QXDayTaskModel.h"
typedef NS_ENUM(NSInteger) {
QXDayTaskTopSubViewTypeLeft = 0,
QXDayTaskTopSubViewTypeRight
}QXDayTaskTopSubViewType;
NS_ASSUME_NONNULL_BEGIN
@interface QXDayTaskTopView : UIView
@property (nonatomic,strong)QXDayTaskModel *model;
@end
@interface QXDayTaskTopSubView : UIView
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *subTitleLabel;
@property (nonatomic,strong)UIImageView *iconImageView;
@property (nonatomic,strong)UILabel *cornLabel;
@property (nonatomic,strong)QXProgressView *progressView;
@property (nonatomic,strong)UIButton *openBtn;
@property (nonatomic,assign)QXDayTaskTopSubViewType type;
@property (nonatomic,assign)double progress;
@property(nonatomic,strong)QXGiftBoxModel* boxModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,211 @@
//
// QXDayTaskTopView.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXDayTaskTopView.h"
#import "QXDayTaskRuleView.h"
#import "QXMineNetwork.h"
@interface QXDayTaskTopView()
@property (nonatomic,strong)UIImageView *topImageView;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UIButton *ruleBtn;
@property (nonatomic,strong)QXDayTaskTopSubView *leftBoxView;
@property (nonatomic,strong)QXDayTaskTopSubView *rightBoxView;
@end
@implementation QXDayTaskTopView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"day_task_top"]];
[self addSubview:self.topImageView];
self.topImageView.frame = CGRectMake(0, 0, self.width, ScaleWidth(187));
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScaleWidth(25), ScaleWidth(22), 250, 21)];
self.titleLabel.textColor = [UIColor whiteColor];
self.titleLabel.font = [UIFont systemFontOfSize:14];
[self addSubview:self.titleLabel];
self.ruleBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-25, 0, 25, 50)];
[self.ruleBtn setTitle:QXText(@"任务规则") forState:(UIControlStateNormal)];
self.ruleBtn.titleLabel.numberOfLines = 0;
[self.ruleBtn addRoundedCornersWithRadius:8 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerBottomLeft)];
[self.ruleBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.ruleBtn.titleLabel.font = [UIFont systemFontOfSize:12];
self.ruleBtn.backgroundColor = RGB16(0xEA927E);
[self.ruleBtn addTarget:self action:@selector(ruleAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.ruleBtn];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ScaleWidth(52), self.width, self.height-ScaleWidth(52)-12)];
[self.bgView addRoundedCornersWithRadius:16];
self.bgView.backgroundColor = [UIColor whiteColor];
[self addSubview:self.bgView];
CGFloat boxWidth = (self.width-16*3)/2;
self.leftBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(16, 16, boxWidth, self.bgView.height-16*2)];
[self.leftBoxView addRoundedCornersWithRadius:8];
self.leftBoxView.backgroundColor = RGB16(0xFCE4ED);
self.leftBoxView.type = QXDayTaskTopSubViewTypeLeft;
[self.bgView addSubview:self.leftBoxView];
self.rightBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(self.leftBoxView.right+16, 16, boxWidth, self.leftBoxView.height) ];
self.rightBoxView.backgroundColor = RGB16(0xFDE8AE);
[self.rightBoxView addRoundedCornersWithRadius:8];
self.rightBoxView.type = QXDayTaskTopSubViewTypeRight;
[self.bgView addSubview:self.rightBoxView];
// self.leftBoxView.progress = 0.4;
// self.rightBoxView.progress = 1;
// self.titleLabel.text = [NSString stringWithFormat:@"%@:%@",QXText(@"今日累计获得金币"),@"20"];
}
-(void)setModel:(QXDayTaskModel *)model{
_model = model;
self.titleLabel.text = [NSString stringWithFormat:@"%@:%@",QXText(@"今日累计充值金币"),model.user_gold];
self.leftBoxView.boxModel = model.gift_box_list.firstObject;
self.rightBoxView.boxModel = model.gift_box_list.lastObject;
}
-(void)ruleAction{
QXDayTaskRuleView *ruleView = [[QXDayTaskRuleView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
[self.viewController.view addSubview:ruleView];
}
@end
@implementation QXDayTaskTopSubView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.width-20, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = RGB16(0xE24171);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.titleLabel.bottom, self.width-20, 18)];
self.subTitleLabel.font = [UIFont systemFontOfSize:12];
self.subTitleLabel.textColor = RGB16(0x999999);
self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.subTitleLabel];
self.iconImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"day_task_left"]];
self.iconImageView.frame = CGRectMake((self.width-ScaleWidth(60))/2, self.subTitleLabel.bottom, ScaleWidth(60), ScaleWidth(60));
[self addSubview:self.iconImageView];
self.cornLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.iconImageView.bottom, self.width-20, 18)];
self.cornLabel.font = [UIFont systemFontOfSize:12];
self.cornLabel.textColor = RGB16(0x999999);
self.cornLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.cornLabel];
self.openBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(80))/2, self.height-30-ScaleWidth(10), ScaleWidth(80), 30)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xf8b6a8)] forState:(UIControlStateDisabled)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xff512c)] forState:(UIControlStateNormal)];
[self.openBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xf8b6a8)] forState:(UIControlStateSelected)];
[self.openBtn setTitle:QXText(@"未解锁") forState:(UIControlStateDisabled)];
[self.openBtn setTitle:QXText(@"已领取") forState:(UIControlStateSelected)];
[self.openBtn setTitle:QXText(@"已解锁") forState:(UIControlStateNormal)];
[self.openBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
self.openBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.openBtn addTarget:self action:@selector(openAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.openBtn addRoundedCornersWithRadius:15];
self.openBtn.enabled = NO;
[self addSubview:self.openBtn];
self.progressView = [[QXProgressView alloc] initWithFrame:CGRectMake((self.width-ScaleWidth(70))/2, self.openBtn.top-4-13, ScaleWidth(70), 13)];
self.progressView.bgColor = RGB16(0xFFB8CD);
self.progressView.progressColor = RGB16(0xE24272);
self.progressView.progressTitleColor = RGB16(0xE24272);
[self addSubview:self.progressView];
// self.titleLabel.text = @"初级礼盒";
// self.subTitleLabel.text = @"最高可获得1000金币";
// self.cornLabel.text = @"满200金币";
}
-(void)setBoxModel:(QXGiftBoxModel *)boxModel{
_boxModel = boxModel;
self.titleLabel.text = boxModel.name;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:boxModel.title];
[attr yy_setColor:RGB16(0xE24171) range:[boxModel.title rangeOfString:boxModel.highest_gain]];
self.subTitleLabel.attributedText = attr;
if (boxModel.icon.length > 0 && ([boxModel.icon hasPrefix:@"http"] || [boxModel.icon hasPrefix:@"https"])) {
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:boxModel.icon]];
}
self.cornLabel.text = [NSString stringWithFormat:@"满%@金币",boxModel.meet];
self.progressView.progress = boxModel.unlock_progress.doubleValue;
if (boxModel.status.intValue == 0) {
self.openBtn.enabled = NO;
}else if (boxModel.status.intValue == 1) {
self.openBtn.selected = NO;
self.openBtn.enabled = YES;
}else{
self.openBtn.enabled = YES;
self.openBtn.selected = YES;
}
}
-(void)openAction{
if (self.openBtn.selected == NO && self.openBtn.enabled == YES) {
MJWeakSelf
[QXMineNetwork openDayTaskGiftWithGiftBoxId:self.boxModel.id successBlock:^(NSString * _Nonnull giftName) {
weakSelf.boxModel.status = @"2";
weakSelf.openBtn.enabled = YES;
weakSelf.openBtn.selected = YES;
showToast(giftName);
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
}
-(void)setProgress:(double)progress{
_progress = progress;
self.progressView.progress = progress;
if (progress >= 1) {
self.openBtn.enabled = YES;
}else{
self.openBtn.enabled = NO;
}
}
-(void)setType:(QXDayTaskTopSubViewType)type{
_type = type;
switch (type) {
case QXDayTaskTopSubViewTypeLeft:{
self.iconImageView.image = [UIImage imageNamed:@"day_task_left"];
self.progressView.bgColor = RGB16(0xFFB8CD);
self.progressView.progressColor = RGB16(0xE24272);
self.progressView.progressTitleColor = RGB16(0xE24272);
}
break;
case QXDayTaskTopSubViewTypeRight:{
self.iconImageView.image = [UIImage imageNamed:@"day_task_right"];
self.progressView.bgColor = RGB16(0xFFCFB3);
self.progressView.progressColor = RGB16(0xF35F07);
self.progressView.progressTitleColor = RGB16(0xF35F07);
}
break;
default:
break;
}
}
@end

View File

@@ -0,0 +1,19 @@
//
// QXProgressView.h
// QXLive
//
// Created by 启星 on 2025/5/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXProgressView : UIView
@property (nonatomic,strong)UIColor *bgColor;
@property (nonatomic,strong)UIColor *progressColor;
@property (nonatomic,strong)UIColor *progressTitleColor;
@property (nonatomic,assign)double progress;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,69 @@
//
// QXProgressView.m
// QXLive
//
// Created by on 2025/5/26.
//
#import "QXProgressView.h"
@interface QXProgressView()
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIView *progressView;
@property (nonatomic,strong)UILabel *progressLabel;
@end
@implementation QXProgressView
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width-32, self.height)];
[self addSubview:self.bgView];
self.bgView.backgroundColor = RGB16(0xFFB8CD);
[self.bgView addRoundedCornersWithRadius:self.height/2];
self.progressView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 2, self.height)];
[self addSubview:self.progressView];
self.progressView.backgroundColor = RGB16(0xE24171);
[self.progressView addRoundedCornersWithRadius:self.height/2];
self.progressLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width-30, 0, 30, self.height)];
self.progressLabel.textColor = RGB16(0xE24171);
self.progressLabel.font = [UIFont systemFontOfSize:10];
[self addSubview:self.progressLabel];
}
-(void)setBgColor:(UIColor *)bgColor{
_bgColor = bgColor;
self.bgView.backgroundColor = bgColor;
}
-(void)setProgressColor:(UIColor *)progressColor{
_progressColor = progressColor;
self.progressView.backgroundColor = progressColor;
}
-(void)setProgressTitleColor:(UIColor *)progressTitleColor{
_progressTitleColor = progressTitleColor;
self.progressLabel.textColor = progressTitleColor;
}
-(void)setProgress:(double)progress{
_progress = progress;
self.progressLabel.text = [NSString stringWithFormat:@"%d%%",(int)(progress*100)];
[UIView animateWithDuration:0.3 animations:^{
self.progressView.width = (self.width-32)*progress;
}];
}
@end

View File

@@ -0,0 +1,20 @@
//
// QXTaskGiftRecordCell.h
// QXLive
//
// Created by 启星 on 2025/7/11.
//
#import <UIKit/UIKit.h>
#import "QXDayTaskModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXTaskGiftRecordCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *giftLabel;
@property (nonatomic,strong)QXTaskGiftBoxRecordModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// QXTaskGiftRecordCell.m
// QXLive
//
// Created by on 2025/7/11.
//
#import "QXTaskGiftRecordCell.h"
@implementation QXTaskGiftRecordCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXTaskGiftRecordCell";
QXTaskGiftRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
-(void)setModel:(QXTaskGiftBoxRecordModel *)model{
_model = model;
self.titleLabel.text = model.createtime;
self.nameLabel.text = model.gift_bag_name;
self.giftLabel.text = model.gift_name;
}
- (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

View File

@@ -0,0 +1,64 @@
<?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="default" indentationWidth="10" rowHeight="85" id="KGk-i7-Jjw" customClass="QXTaskGiftRecordCell">
<rect key="frame" x="0.0" y="0.0" width="470" height="85"/>
<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="470" height="85"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="90x-Pq-7Yx">
<rect key="frame" x="16" y="34" width="145" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="145" id="eyv-DX-Iw2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" 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="iHp-kF-eHc">
<rect key="frame" x="176" y="34" width="75" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="75" id="XWb-kE-QcY"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" 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="sTG-EW-ijM">
<rect key="frame" x="266" y="34" width="188" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="sTG-EW-ijM" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="31t-GF-bPI"/>
<constraint firstAttribute="trailing" secondItem="sTG-EW-ijM" secondAttribute="trailing" constant="16" id="4wm-bs-goZ"/>
<constraint firstItem="iHp-kF-eHc" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="B4m-MY-ulS"/>
<constraint firstItem="90x-Pq-7Yx" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="SjY-lW-NP0"/>
<constraint firstItem="90x-Pq-7Yx" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="fTY-fD-Pbd"/>
<constraint firstItem="iHp-kF-eHc" firstAttribute="leading" secondItem="90x-Pq-7Yx" secondAttribute="trailing" constant="15" id="kMC-3d-RBx"/>
<constraint firstItem="sTG-EW-ijM" firstAttribute="leading" secondItem="iHp-kF-eHc" secondAttribute="trailing" constant="15" id="wwQ-Uf-j1C"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="giftLabel" destination="sTG-EW-ijM" id="JSB-Yz-MH2"/>
<outlet property="nameLabel" destination="iHp-kF-eHc" id="yvt-RY-bmn"/>
<outlet property="titleLabel" destination="90x-Pq-7Yx" id="Xbl-i4-AOV"/>
</connections>
<point key="canvasLocation" x="253.43511450381678" y="13.028169014084508"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,18 @@
//
// QXUserInfoEditCell.h
// QXLive
//
// Created by 启星 on 2025/5/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXUserInfoEditCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UITextField *textField;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// QXUserInfoEditCell.m
// QXLive
//
// Created by on 2025/5/20.
//
#import "QXUserInfoEditCell.h"
@implementation QXUserInfoEditCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXUserInfoEditCell";
QXUserInfoEditCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.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

View File

@@ -0,0 +1,66 @@
<?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="default" indentationWidth="10" rowHeight="121" id="KGk-i7-Jjw" customClass="QXUserInfoEditCell">
<rect key="frame" x="0.0" y="0.0" width="446" height="121"/>
<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="446" height="121"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TgL-rR-nuf">
<rect key="frame" x="16" y="52" width="70" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="yA5-8Q-P0V"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RL3-7c-bnu">
<rect key="frame" x="116" y="50" width="280" height="21"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="arrowRight" translatesAutoresizingMaskIntoConstraints="NO" id="okn-C5-YbU">
<rect key="frame" x="406" y="48.666666666666664" width="24" height="23.999999999999993"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="7Jo-BL-h1O"/>
<constraint firstAttribute="height" constant="24" id="AwW-eh-n6F"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="TgL-rR-nuf" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="1ND-Uq-ZxA"/>
<constraint firstItem="RL3-7c-bnu" firstAttribute="leading" secondItem="TgL-rR-nuf" secondAttribute="trailing" constant="30" id="U79-hX-qzV"/>
<constraint firstItem="okn-C5-YbU" firstAttribute="leading" secondItem="RL3-7c-bnu" secondAttribute="trailing" constant="10" id="cxM-JH-W4m"/>
<constraint firstAttribute="trailing" secondItem="okn-C5-YbU" secondAttribute="trailing" constant="16" id="kJo-zv-8QV"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="TgL-rR-nuf" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="26h-i4-67a"/>
<constraint firstItem="RL3-7c-bnu" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="G82-qj-4Dh"/>
<constraint firstItem="okn-C5-YbU" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="YcG-R5-5mU"/>
</constraints>
<connections>
<outlet property="textField" destination="RL3-7c-bnu" id="9Bv-gF-NHv"/>
<outlet property="titleLabel" destination="TgL-rR-nuf" id="xJs-ev-q9x"/>
</connections>
<point key="canvasLocation" x="235.11450381679387" y="46.83098591549296"/>
</tableViewCell>
</objects>
<resources>
<image name="arrowRight" width="16" height="16"/>
</resources>
</document>

View File

@@ -0,0 +1,42 @@
//
// QXUserInfoEditFooterView.h
// QXLive
//
// Created by 启星 on 2025/5/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXUserInfoImageCellDelegate <NSObject>
@optional
-(void)didClickDelete:(NSString*)imageUrl index:(NSInteger)index;
/// 图片上传完成
-(void)didUploadFinishedWithImageUrlList:(NSArray*)urlList;
@end
@interface QXUserInfoEditFooterView : UIView
/// 隐藏头 默认不隐藏
@property (nonatomic,assign)BOOL hideTitle;
/// 最大可选择张数 默认6张
@property (nonatomic,assign)NSInteger maxCount;
@property (nonatomic,weak)id<QXUserInfoImageCellDelegate>delegate;
/// 编辑资料时显示传值
@property (nonatomic,strong)NSArray *imgs;
@end
@interface QXUserInfoImageCell : UICollectionViewCell
@property (nonatomic,strong)UIImageView *imageView;
@property (nonatomic,strong)UIButton *deleteBtn;
@property (nonatomic,strong)NSString *imageUrl;
@property (nonatomic,assign)NSInteger index;
@property (nonatomic,weak)id<QXUserInfoImageCellDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,359 @@
//
// QXUserInfoEditFooterView.m
// QXLive
//
// Created by on 2025/5/20.
//
#import "QXUserInfoEditFooterView.h"
#import <TZImagePickerController/TZImageManager.h>
#import <TZImagePickerController/TZImagePickerController.h>
#import "UIImage+QX.h"
#import "NSString+QX.h"
#import "QXOSSManager.h"
#import "YBImageBrowser/YBImageBrowser.h"
@class QXUserInfoImageCell;
@interface QXUserInfoEditFooterView()<UICollectionViewDelegate,UICollectionViewDataSource,TZImagePickerControllerDelegate,QXUserInfoImageCellDelegate>
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong)NSMutableArray *dataArray;
@property (nonatomic,strong)NSMutableArray *keyArray;
@property (nonatomic,strong)NSMutableArray *urlArray;
@property (nonatomic,strong)NSMutableArray *selectedAssets;
@property (nonatomic,strong)NSMutableArray *selectedPhotos;
@end
@implementation QXUserInfoEditFooterView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.maxCount = 6;
[self.urlArray addObject:@"mine_room_cover_add"];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 12, self.width-32, 24)];
NSString *maxStr = [NSString stringWithFormat:@"(%@)",QXText(@"最多上传6张")];
NSString *str = [NSString stringWithFormat:@"%@%@",QXText(@"背景图片"),maxStr];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
[attr yy_setFont:[UIFont systemFontOfSize:16] range:[str rangeOfString:QXText(@"背景图片")]];
[attr yy_setFont:[UIFont systemFontOfSize:12] range:[str rangeOfString:maxStr]];
[attr yy_setColor:QXConfig.textColor range:[str rangeOfString:QXText(@"背景图片")]];
[attr yy_setColor:RGB16(0x666666) range:[str rangeOfString:maxStr]];
self.titleLabel.attributedText = attr;
[self addSubview:self.titleLabel];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 20;
layout.minimumInteritemSpacing = 20;
int itemWidth = (self.width-16*2-20*2)/3;
layout.itemSize = CGSizeMake(itemWidth, itemWidth);
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+6, self.width, self.height-self.titleLabel.bottom-6) collectionViewLayout:layout];
self.collectionView.scrollEnabled = NO;
self.collectionView.backgroundColor = [UIColor clearColor];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
[self.collectionView registerClass:[QXUserInfoImageCell class] forCellWithReuseIdentifier:@"QXUserInfoImageCell"];
[self addSubview:self.collectionView];
}
-(void)setHideTitle:(BOOL)hideTitle{
_hideTitle = hideTitle;
if (hideTitle) {
self.titleLabel.hidden = YES;
self.collectionView.frame = CGRectMake(0, 12, self.width, self.height-24);
}
}
-(void)setImgs:(NSArray *)imgs{
_imgs = imgs;
[self.urlArray removeAllObjects];
[self.urlArray addObjectsFromArray:imgs];
if (_imgs.count < 6) {
[self.urlArray addObject:@"mine_room_cover_add"];
}
[self.collectionView reloadData];
}
-(void)setMaxCount:(NSInteger)maxCount{
_maxCount = maxCount;
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
return self.urlArray.count;
}
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXUserInfoImageCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXUserInfoImageCell" forIndexPath:indexPath];
cell.imageUrl = self.urlArray[indexPath.row];
cell.delegate = self;
cell.index = indexPath.row;
return cell;
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
NSString *imageUrl = self.urlArray[indexPath.row];
if ([imageUrl hasPrefix:@"http"] || [imageUrl hasPrefix:@"https"]) {
if (self.imgs != nil) {
YBImageBrowser *browser = [YBImageBrowser new];
NSMutableArray *sourceArray = [NSMutableArray array];
for (NSString *url in self.urlArray) {
if ([url hasPrefix:@"http"] || [url hasPrefix:@"https"]) {
YBIBImageData *data = [[YBIBImageData alloc] init];
data.imageURL = [NSURL URLWithString:url];
QXUserInfoImageCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
data.projectiveView = cell.imageView;
[sourceArray addObject:data];
}
}
browser.dataSourceArray = sourceArray;
browser.currentPage = indexPath.row;
[browser show];
}else{
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithSelectedAssets:self.selectedAssets selectedPhotos:self.selectedPhotos index:indexPath.item];
imagePickerVc.maxImagesCount = self.maxCount;
imagePickerVc.allowPickingGif = NO;
imagePickerVc.autoSelectCurrentWhenDone = NO;
imagePickerVc.allowPickingOriginalPhoto = NO;
imagePickerVc.allowPickingMultipleVideo = NO;
imagePickerVc.showSelectedIndex = YES;
imagePickerVc.isSelectOriginalPhoto = NO;
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
self->_selectedAssets = [NSMutableArray arrayWithArray:assets];
[self->_collectionView reloadData];
}];
[self.viewController presentViewController:imagePickerVc animated:YES completion:nil];
}
}else{
if (self.imgs != nil) {
self.maxCount = 7 - self.urlArray.count ;
}
[self selectAlbumPhoto];
}
}
-(void)didClickDelete:(NSString *)imageUrl index:(NSInteger)index{
if (self.imgs != nil) {
[self.urlArray removeObjectAtIndex:index];
if (![self.urlArray.lastObject isEqualToString:@"mine_room_cover_add"]) {
[self.urlArray addObject:@"mine_room_cover_add"];
}
[self.collectionView reloadData];
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDelete:index:)]) {
[self.delegate didClickDelete:imageUrl index:index];
}
}else{
NSInteger index = [self.urlArray indexOfObject:imageUrl];
[self.dataArray removeObjectAtIndex:index];
[self.keyArray removeObjectAtIndex:index];
[self.selectedAssets removeObjectAtIndex:index];
[self.selectedPhotos removeObjectAtIndex:index];
[self.urlArray removeObjectAtIndex:index];
if (![self.urlArray.lastObject isEqualToString:@"mine_room_cover_add"]) {
[self.urlArray addObject:@"mine_room_cover_add"];
}
[self.collectionView reloadData];
}
}
-(void)selectAlbumPhoto {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:self.maxCount columnNumber:4 delegate:self pushPhotoPickerVc:YES];
imagePickerVc.maxImagesCount = self.maxCount;
imagePickerVc.allowCameraLocation = NO;
imagePickerVc.allowPickingOriginalPhoto = NO;
if (self.imgs == nil) {
if (self.selectedAssets.count>0) {
imagePickerVc.selectedAssets = self.selectedAssets;
}
}
imagePickerVc.showSelectedIndex = YES;
imagePickerVc.allowTakeVideo = NO;
imagePickerVc.allowPickingVideo = NO;
imagePickerVc.showSelectBtn = NO;
imagePickerVc.allowCrop = NO;
imagePickerVc.allowPickingGif = NO;
MJWeakSelf
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
[weakSelf.dataArray removeAllObjects];
[weakSelf.keyArray removeAllObjects];
for (int i = 0 ;i < assets.count ;i ++) {
PHAsset*asset = assets[i];
[[TZImageManager manager] getOriginalPhotoDataWithAsset:asset completion:^(NSData *data, NSDictionary *info, BOOL isDegraded) {
// NSString *imageType = [NSString contentTypeWithImageData:data];
// NSData *imgData = data;
// if ([imageType isEqualToString:@"HEIC"] || [imageType isEqualToString:@"HEIF"] || [imageType isEqualToString:@"tiff"] || [imageType isEqualToString:@"webp"]) {
UIImage *dataImg = [UIImage imageWithData:data];
NSData *imgData = UIImageJPEGRepresentation(dataImg, 0.5);
// }
[weakSelf.dataArray addObject:imgData];
[weakSelf.keyArray addObject:[weakSelf imagePathWithKey:[NSString contentTypeWithImageData:imgData]]];
if (weakSelf.dataArray.count == assets.count) {
[weakSelf OSSUploadPhoto];
}
}];
[self.selectedAssets removeAllObjects];
[self.selectedAssets addObjectsFromArray:assets];
[self.selectedPhotos removeAllObjects];
[self.selectedPhotos addObjectsFromArray:photos];
}
}];
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
[imagePickerVc.navigationBar setBackgroundImage:[UIImage qx_imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
[self.viewController presentViewController:imagePickerVc animated:YES completion:nil];
}
- (void)OSSUploadPhoto{
__weak typeof(self)weakSelf = self;
showLoadingInView(self.viewController.view);
[[QXOSSManager sharedInstance] activityUploadFile:self.dataArray withObjectKey:self.keyArray isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
dispatch_async_and_wait(dispatch_get_main_queue(), ^{
hideLoadingInView(weakSelf.viewController.view);
if (state == UploadImageSuccess) {
showToast(QXText(@"上传成功"));
if (self.imgs == nil) {
[weakSelf.urlArray removeAllObjects];
if (names.count < self.maxCount) {
for (NSString*fileName in names) {
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
[weakSelf.urlArray addObject:fileUrl];
}
[weakSelf.urlArray addObject:@"mine_room_cover_add"];
}else if (names.count == self.maxCount){
for (NSString*fileName in names) {
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
[weakSelf.urlArray addObject:fileUrl];
}
}else{
for (int i = 0; i < self.maxCount; i++) {
NSString *name = names[i];
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,name];
[weakSelf.urlArray addObject:fileUrl];
}
}
[weakSelf uploadImgs];
}else{
NSMutableArray *arr = [NSMutableArray array];
for (NSString*fileName in names) {
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
[weakSelf.urlArray insertObject:fileUrl atIndex:0];
[arr addObject:fileUrl];
}
[weakSelf uploadImgs:arr];
}
}else{
showToast(QXText(@"上传失败"));
}
});
}];
}
- (NSString *)imagePathWithKey:(NSString *)keyPath {
NSString *fileBasePath = IMG_FILE_BASE_PATH;
return [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,keyPath];
}
-(void)uploadImgs{
[self.collectionView reloadData];
if (self.delegate && [self.delegate respondsToSelector:@selector(didUploadFinishedWithImageUrlList:)]) {
NSMutableArray *arr = [NSMutableArray arrayWithArray:self.urlArray];
if ([arr containsObject:@"mine_room_cover_add"]) {
[arr removeObject:@"mine_room_cover_add"];
}
[self.delegate didUploadFinishedWithImageUrlList:arr];
}
}
-(void)uploadImgs:(NSArray*)imgs{
[self.collectionView reloadData];
if (self.delegate && [self.delegate respondsToSelector:@selector(didUploadFinishedWithImageUrlList:)]) {
[self.delegate didUploadFinishedWithImageUrlList:imgs];
}
}
-(NSMutableArray *)dataArray{
if (!_dataArray) {
_dataArray = [NSMutableArray array];
}
return _dataArray;
}
- (NSMutableArray *)keyArray{
if (!_keyArray) {
_keyArray = [NSMutableArray array];
}
return _keyArray;
}
-(NSMutableArray *)urlArray{
if (!_urlArray) {
_urlArray = [NSMutableArray array];
}
return _urlArray;
}
-(NSMutableArray *)selectedAssets{
if (!_selectedAssets) {
_selectedAssets = [NSMutableArray array];
}
return _selectedAssets;
}
-(NSMutableArray *)selectedPhotos{
if (!_selectedPhotos) {
_selectedPhotos = [NSMutableArray array];
}
return _selectedPhotos;
}
@end
@implementation QXUserInfoImageCell
- (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.deleteBtn.hidden = NO;
[self.imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:nil];
}else{
if ([imageUrl isEqualToString:@"mine_room_cover_add"]) {
self.imageView.image = [UIImage imageNamed:imageUrl];
self.deleteBtn.hidden = YES;
}else{
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,imageUrl];
[self.imageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:nil];
self.deleteBtn.hidden = NO;
}
}
}
-(void)initSubviews{
self.imageView = [[UIImageView alloc] init];
[self.contentView addSubview:self.imageView];
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
self.imageView.clipsToBounds = YES;
[self.imageView addRoundedCornersWithRadius:10];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.left.right.equalTo(self.contentView);
}];
self.deleteBtn = [[UIButton alloc] init];
[self.deleteBtn addTarget:self action:@selector(deleteAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.deleteBtn setImage:[UIImage imageNamed:@"Plus Circle"] forState:(UIControlStateNormal)];
[self.contentView addSubview:self.deleteBtn];
[self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.equalTo(self);
make.size.mas_equalTo(CGSizeMake(25, 25));
}];
}
-(void)deleteAction:(UIButton*)sender{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDelete:index:)]) {
[self.delegate didClickDelete:self.imageUrl index:self.index];
}
}
@end

View File

@@ -0,0 +1,22 @@
//
// QXUserInfoEditHeaderView.h
// QXLive
//
// Created by 启星 on 2025/5/20.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXUserInfoEditHeaderViewDelegate <NSObject>
@optional
-(void)didClickHeader;
@end
@interface QXUserInfoEditHeaderView : UIView
@property (nonatomic,weak)id<QXUserInfoEditHeaderViewDelegate>delegate;
@property (nonatomic,strong)NSArray *imgs;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,175 @@
//
// QXUserInfoEditHeaderView.m
// QXLive
//
// Created by on 2025/5/20.
//
#import "QXUserInfoEditHeaderView.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
#import "QXSeatHeaderView.h"
#import "UIButton+QX.h"
#import <TZImagePickerController/TZImageManager.h>
#import <TZImagePickerController/TZImagePickerController.h>
#import "UIImage+QX.h"
#import "NSString+QX.h"
#import "QXOSSManager.h"
#import <ImSDK_Plus/ImSDK_Plus.h>
#import "QXMineNetwork.h"
@interface QXUserInfoEditHeaderView()<SDCycleScrollViewDelegate,TZImagePickerControllerDelegate>
@property (nonatomic,strong)SDCycleScrollView * cycleScrollView;
@property (nonatomic,strong) QXSeatHeaderView* headerView;
@property (nonatomic,strong) UIButton* headerBtn;
@property (nonatomic,strong) UIView * bgView;
@property (nonatomic,strong) UILabel * titleLabel;
@property (nonatomic,strong) NSString * avartar;
@end
@implementation QXUserInfoEditHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, self.width, 169+kSafeAreaTop+16) delegate:self placeholderImage:nil];
self.cycleScrollView.backgroundColor = QXConfig.themeColor;
self.cycleScrollView.imageURLStringsGroup = @[[QXGlobal shareGlobal].loginModel.avatar?[QXGlobal shareGlobal].loginModel.avatar:@""];
self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
[self addSubview:self.cycleScrollView];
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, self.cycleScrollView.bottom-16, self.width, 94)];
self.bgView.backgroundColor = [UIColor whiteColor];
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
[self addSubview:self.bgView];
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, self.bgView.height-40, self.bgView.width-160, 40)];
self.titleLabel.font = [UIFont systemFontOfSize:12];
self.titleLabel.numberOfLines = 2;
self.titleLabel.textColor = RGB16(0x999999);
self.titleLabel.text = QXText(@"尊敬的用户每月可修改2次剩余2次 使用头像卡不限更换次数还剩0张");
[self.bgView addSubview:self.titleLabel];
self.headerView = [[QXSeatHeaderView alloc] initWithFrame:CGRectMake((self.width-104)/2, self.bgView.top-52, 104, 104)];
self.headerView.layer.borderWidth = 1.5;
self.headerView.layer.borderColor = UIColor.whiteColor.CGColor;
[self.headerView addRoundedCornersWithRadius:52];
[self.headerView setHeadIcon:[QXGlobal shareGlobal].loginModel.avatar dress:@""];
[self addSubview:self.headerView];
self.headerBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.width-100)/2, self.headerView.top+2, 100, 100)];
[self.headerBtn addRoundedCornersWithRadius:52];
self.headerBtn.backgroundColor = RGB16A(0x333333, 0.22);
[self.headerBtn setImage:[UIImage imageNamed:@"userinfo_header_edit"] forState:(UIControlStateNormal)];
[self.headerBtn setTitle:QXText(@"更换头像") forState:(UIControlStateNormal)];
self.headerBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.headerBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
[self.headerBtn addTarget:self action:@selector(headerAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.headerBtn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:2];
[self addSubview:self.headerBtn];
}
-(void)headerAction{
[self selectAlbumPhoto];
}
-(void)setImgs:(NSArray *)imgs{
_imgs = imgs;
if (imgs.count == 0) {
self.cycleScrollView.imageURLStringsGroup = @[[QXGlobal shareGlobal].loginModel.avatar?[QXGlobal shareGlobal].loginModel.avatar:@""];
}else{
self.cycleScrollView.imageURLStringsGroup = imgs;
}
}
-(void)selectAlbumPhoto {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:nil];
imagePickerVc.maxImagesCount = 1;
imagePickerVc.allowCameraLocation = NO;
imagePickerVc.allowPickingOriginalPhoto = NO;
imagePickerVc.allowTakeVideo = NO;
imagePickerVc.allowPickingVideo = NO;
imagePickerVc.showSelectBtn = NO;
imagePickerVc.allowCrop = YES;
imagePickerVc.cropRect = CGRectMake(0, (SCREEN_HEIGHT-SCREEN_WIDTH)/2, SCREEN_WIDTH, SCREEN_WIDTH);
MJWeakSelf
[imagePickerVc setDidFinishPickingPhotosHandle:^(NSArray<UIImage *> *photos, NSArray *assets, BOOL isSelectOriginalPhoto) {
if (photos.count) {
NSData *imageData = [photos.firstObject qx_compressImageQualityWithToByte:(SCREEN_WIDTH*SCREEN_HEIGHT*2)];
[weakSelf OSSUploadPhotoWithFileData:imageData contentType:[NSString contentTypeWithImageData:imageData]];
}
}];
imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
[imagePickerVc.navigationBar setBackgroundImage:[UIImage qx_imageWithColor:RGB16(0x333333)] forBarMetrics:UIBarMetricsDefault];
[self.viewController presentViewController:imagePickerVc animated:YES completion:nil];
}
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType {
[self OSSUploadPhotoWithFileData:fileData contentType:contentType isVideoCover:NO];
}
- (void)OSSUploadPhotoWithFileData:(NSData *)fileData contentType:(NSString *)contentType isVideoCover:(BOOL)isVideoCover {
if (!fileData || !contentType) {
showToastInView(QXText(@"资源加载错误"), self.viewController.view);
return;
}
if (fileData.length > 1024*1024 && [contentType isEqualToString:IMG_FILE_BASE_PATH]) {
showToastInView(QXText(@"请不要上传超过1M的头像"), self.viewController.view);
return;
}
NSMutableArray *files = [[NSMutableArray alloc] initWithObjects:fileData, nil];
NSString *fileBasePath = IMG_FILE_BASE_PATH;//
NSString *fileName = [NSString stringWithFormat:@"%@%@/%@.%@",fileBasePath,[[QXOSSManager sharedInstance] currentDate],[NSUUID UUID].UUIDString,contentType];
NSMutableArray *fileNames = [[NSMutableArray alloc] initWithObjects:fileName, nil];
__weak typeof(self)weakSelf = self;
showLoadingInView(self.viewController.view);
[[QXOSSManager sharedInstance] uploadFile:files withObjectKey:fileNames isAsync:YES complete:^(NSArray<NSString *> *names, UploadImageState state) {
dispatch_async(dispatch_get_main_queue(), ^{
hideLoadingInView(weakSelf.viewController.view);
});
if (state == UploadImageSuccess) {
NSString *fileName = [names lastObject];
NSString *fileUrl =[NSString stringWithFormat:@"https://%@.%@/%@",OSS_BUCKET_NAME,OSSEndPoint,fileName];
weakSelf.avartar = fileUrl;
[weakSelf chamgeAvatar];
}else{
showToastInView(QXText(@"文件上传失败,请重新尝试"), weakSelf.viewController.view);
}
}];
}
-(void)chamgeAvatar{
MJWeakSelf
[QXMineNetwork editUserInfoWithNickname:@""
birthday:@""
sex:@""
avatar:self.avartar
images:@""
profile:@""
tag_id:@""
successBlock:^(NSDictionary * _Nonnull dict) {
///
[QXGlobal shareGlobal].loginModel.avatar = weakSelf.avartar;
[weakSelf.headerView.headImageView sd_setImageWithURL:[NSURL URLWithString:weakSelf.avartar]];
[[QXGlobal shareGlobal] updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
if (weakSelf.imgs.count == 0) {
weakSelf.cycleScrollView.imageURLStringsGroup = @[[QXGlobal shareGlobal].loginModel.avatar];
}
///
V2TIMUserFullInfo *info = [[V2TIMUserFullInfo alloc] init];
info.faceURL = weakSelf.avartar;
info.nickName = [QXGlobal shareGlobal].loginModel.nickname;
[[V2TIMManager sharedInstance] setSelfInfo:info succ:^{
QXLOG(@"腾讯IM同步个人信息成功");
} fail:^(int code, NSString * _Nullable desc) {
QXLOG(@"腾讯IM同步个人信息失败");
}];
showToast(QXText(@"修改成功"));
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}
@end

View File

@@ -0,0 +1,64 @@
//
// QXBlackListCell.h
// QXLive
//
// Created by 启星 on 2025/5/12.
//
#import <UIKit/UIKit.h>
#import "QXLoginModel.h"
#import "QXUserModel.h"
#import "QXRoomModel.h"
typedef NS_ENUM(NSInteger) {
/// 黑名单
QXBlackListCellTypeBlack = 0,
/// 粉丝
QXBlackListCellTypeFans = 1,
/// 关注
QXBlackListCellTypeFocus = 2,
/// 登录
QXBlackListCellTypeLogin,
/// 在线观众
QXBlackListCellTypeOnline,
/// 抱麦
QXBlackListCellTypeHugSeat,
/// 排行榜
QXBlackListCellTypeRank,
/// 访客
QXBlackListCellTypeVisit,
}QXBlackListCellType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXBlackListCellDelegate <NSObject>
@optional
-(void)didRemoveSuccess:(QXUserHomeModel *)userModel;
/// 点击关注
-(void)didFocus:(UIButton*)sender userModel:(QXUserHomeModel *)userModel;
-(void)didClickLoginWithModel:(QXLoginModel*)model;
-(void)didHugSeatWithModel:(QXRoomUserInfoModel*)model;
@end
@interface QXBlackListCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *headerImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIButton *removeBtn;
@property (weak, nonatomic)id <QXBlackListCellDelegate> delegate;
@property (assign, nonatomic)QXBlackListCellType cellType;
@property (weak, nonatomic) IBOutlet UIView *iconBgView;
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
@property (nonatomic,strong)QXLoginModel *loginModel;
@property (nonatomic,strong)QXUserHomeModel *userModel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *headerLeftConstraint;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *roleLabel;
@property (nonatomic,strong)QXRoomUserInfoModel *onlineUser;
@property (nonatomic,strong)QXRoomOnlineList *rankModel;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,304 @@
//
// QXBlackListCell.m
// QXLive
//
// Created by on 2025/5/12.
//
#import "QXBlackListCell.h"
@interface QXBlackListCell()
@property (nonatomic,strong)NSMutableArray *iconViewArray;
@end
@implementation QXBlackListCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXBlackListCell";
QXBlackListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
- (IBAction)removeAction:(UIButton*)sender {
switch (self.cellType) {
case QXBlackListCellTypeBlack:{
if (self.delegate && [self.delegate respondsToSelector:@selector(didRemoveSuccess:)]) {
[self.delegate didRemoveSuccess:self.userModel];
}
}
break;
case QXBlackListCellTypeFans:
case QXBlackListCellTypeFocus:{
if (self.delegate && [self.delegate respondsToSelector:@selector(didFocus:userModel:)]) {
[self.delegate didFocus:sender userModel:self.userModel];
}
}
break;
case QXBlackListCellTypeLogin:{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickLoginWithModel:)]) {
[self.delegate didClickLoginWithModel:self.loginModel];
}
}
break;
case QXBlackListCellTypeHugSeat:{
if (self.delegate && [self.delegate respondsToSelector:@selector(didHugSeatWithModel:)]) {
[self.delegate didHugSeatWithModel:self.onlineUser];
}
}
break;
default:
break;
}
}
-(void)setLoginModel:(QXLoginModel *)loginModel{
_loginModel = loginModel;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:loginModel.avatar]];
self.nameLabel.text = loginModel.nickname;
if (loginModel.sex.intValue == 1) {
self.sexImageView.image = [UIImage imageNamed:@"user_sex_boy"];
self.sexImageView.hidden = NO;
}else if(loginModel.sex.intValue == 2){
self.sexImageView.image = [UIImage imageNamed:@"user_sex_girl"];
self.sexImageView.hidden = NO;
}else{
self.sexImageView.hidden = YES;
}
}
-(void)setUserModel:(QXUserHomeModel *)userModel{
_userModel = userModel;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:userModel.avatar]];
self.nameLabel.text = userModel.nickname;
if (userModel.sex.intValue == 1) {
self.sexImageView.image = [UIImage imageNamed:@"user_sex_boy"];
self.sexImageView.hidden = NO;
}else if(userModel.sex.intValue == 2){
self.sexImageView.image = [UIImage imageNamed:@"user_sex_girl"];
self.sexImageView.hidden = NO;
}else{
self.sexImageView.hidden = YES;
}
self.removeBtn.selected = userModel.is_follow==1?YES:NO;
if (userModel.icon.count > 0) {
self.iconBgView.hidden = NO;
for (int i = 0;i < self.userModel.icon.count;i++) {
if (i < 3) {
UIImageView *iconImageView = self.iconViewArray[i];
iconImageView.hidden = NO;
[iconImageView sd_setImageWithURL:[NSURL URLWithString:self.userModel.icon[i]]];
}
}
}else{
self.iconBgView.hidden = YES;
}
}
-(void)setOnlineUser:(QXRoomUserInfoModel *)onlineUser{
_onlineUser = onlineUser;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:onlineUser.avatar]];
self.nameLabel.text = onlineUser.nickname;
if (onlineUser.sex.intValue == 1) {
self.sexImageView.image = [UIImage imageNamed:@"user_sex_boy"];
self.sexImageView.hidden = NO;
}else if(onlineUser.sex.intValue == 2){
self.sexImageView.image = [UIImage imageNamed:@"user_sex_girl"];
self.sexImageView.hidden = NO;
}else{
self.sexImageView.hidden = YES;
}
if (onlineUser.role.intValue == 1) {
self.roleLabel.text = QXText(@"房主");
}else if(onlineUser.role.intValue == 2) {
self.roleLabel.text = QXText(@"管理");
}else if(onlineUser.role.intValue == 3) {
self.roleLabel.text = QXText(@"主持");
}else{
self.roleLabel.text = QXText(@"观众");
}
if (onlineUser.pit_number.intValue > 0) {
[self.removeBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateNormal)];
[self.removeBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
self.removeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.removeBtn.backgroundColor = [UIColor clearColor];
[self.removeBtn setTitle:[NSString stringWithFormat:@"%@号麦",onlineUser.pit_number] forState:(UIControlStateNormal)];
if (onlineUser.pit_number.intValue == 10) {
[self.removeBtn setTitle:[NSString stringWithFormat:@"%@麦",QXText(@"嘉宾")] forState:(UIControlStateNormal)];
}
if (onlineUser.pit_number.intValue == 9) {
[self.removeBtn setTitle:[NSString stringWithFormat:@"%@麦",QXText(@"主持")] forState:(UIControlStateNormal)];
}
}else{
if (self.cellType == QXBlackListCellTypeHugSeat) {
[self.removeBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
[self.removeBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
self.removeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.removeBtn.backgroundColor = [UIColor clearColor];
[self.removeBtn setTitle:@"抱麦" forState:(UIControlStateNormal)];
}else{
[self.removeBtn setTitle:@"" forState:(UIControlStateNormal)];
}
}
if (onlineUser.icon.count > 0) {
self.iconBgView.hidden = NO;
for (int i = 0;i < self.onlineUser.icon.count;i++) {
if (i < 3) {
UIImageView *iconImageView = self.iconViewArray[i];
iconImageView.hidden = NO;
[iconImageView sd_setImageWithURL:[NSURL URLWithString:self.onlineUser.icon[i]]];
}
}
}else{
self.iconBgView.hidden = YES;
}
}
-(void)setRankModel:(QXRoomOnlineList *)rankModel{
_rankModel = rankModel;
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:rankModel.avatar]];
self.nameLabel.text = rankModel.nickname;
if (rankModel.sex.intValue == 1) {
self.sexImageView.image = [UIImage imageNamed:@"user_sex_boy"];
self.sexImageView.hidden = NO;
}else if(rankModel.sex.intValue == 2){
self.sexImageView.image = [UIImage imageNamed:@"user_sex_girl"];
self.sexImageView.hidden = NO;
}else{
self.sexImageView.hidden = YES;
}
if (rankModel.icon.count > 0) {
self.iconBgView.hidden = NO;
for (int i = 0;i < rankModel.icon.count;i++) {
if (i < 3) {
UIImageView *iconImageView = self.iconViewArray[i];
iconImageView.hidden = NO;
[iconImageView sd_setImageWithURL:[NSURL URLWithString:rankModel.icon[i]]];
}
}
}else{
self.iconBgView.hidden = YES;
}
[self.removeBtn setTitle:[NSString stringWithFormat:@" %@",rankModel.total?rankModel.total:rankModel.gift_prices] forState:(UIControlStateNormal)];
}
-(void)setCellType:(QXBlackListCellType)cellType{
_cellType = cellType;
switch (cellType) {
case QXBlackListCellTypeBlack:{
[self.removeBtn setTitle:QXText(@"移除") forState:(UIControlStateNormal)];
UIImage *norImage = [UIImage imageWithColor:RGB16(0x333333)];
[self.removeBtn setBackgroundImage:norImage forState:(UIControlStateNormal)];
}
break;
case QXBlackListCellTypeFans:{
[self.removeBtn setTitle:QXText(@"回关") forState:(UIControlStateNormal)];
[self.removeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.removeBtn setTitle:QXText(@"已互关") forState:(UIControlStateSelected)];
UIImage *norImage = [UIImage imageWithColor:QXConfig.themeColor];
[self.removeBtn setBackgroundImage:norImage forState:(UIControlStateNormal)];
UIImage *selImage = [UIImage imageWithColor:RGB16(0xEFF2F8)];
[self.removeBtn setBackgroundImage:selImage forState:(UIControlStateSelected)];
}
break;
case QXBlackListCellTypeFocus:{
[self.removeBtn setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
[self.removeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.removeBtn setTitle:QXText(@"已关注") forState:(UIControlStateSelected)];
UIImage *norImage = [UIImage imageWithColor:QXConfig.themeColor];
[self.removeBtn setBackgroundImage:norImage forState:(UIControlStateNormal)];
UIImage *selImage = [UIImage imageWithColor:RGB16(0xEFF2F8)];
[self.removeBtn setBackgroundImage:selImage forState:(UIControlStateSelected)];
}
break;
case QXBlackListCellTypeLogin:{
[self.removeBtn setTitle:QXText(@"登录") forState:(UIControlStateNormal)];
UIImage *norImage = [UIImage imageWithColor:QXConfig.themeColor];
[self.removeBtn setBackgroundImage:norImage forState:(UIControlStateNormal)];
}
break;
case QXBlackListCellTypeOnline:{
[self.removeBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateNormal)];
[self.removeBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
self.removeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.removeBtn.backgroundColor = [UIColor clearColor];
self.roleLabel.hidden = NO;
}
break;
case QXBlackListCellTypeHugSeat:{
[self.removeBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateNormal)];
[self.removeBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
self.removeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.removeBtn.backgroundColor = [UIColor clearColor];
self.roleLabel.hidden = NO;
}
break;
case QXBlackListCellTypeRank:{
self.titleLabel.hidden = NO;
self.headerLeftConstraint.constant = 44;
self.nameLabel.textColor = RGB16(0xffffff);
[self.removeBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.removeBtn setBackgroundImage:nil forState:(UIControlStateNormal)];
[self.removeBtn setImage:[UIImage imageNamed:@"room_rank_value_icon"] forState:(UIControlStateNormal)];
[self.removeBtn setTitle:@" 0" forState:(UIControlStateNormal)];
self.removeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.removeBtn.backgroundColor = [UIColor clearColor];
}
break;
case QXBlackListCellTypeVisit:{
[self.removeBtn setTitle:QXText(@"关注") forState:(UIControlStateNormal)];
[self.removeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.removeBtn setTitle:QXText(@"已关注") forState:(UIControlStateSelected)];
UIImage *norImage = [UIImage imageWithColor:QXConfig.themeColor];
[self.removeBtn setBackgroundImage:norImage forState:(UIControlStateNormal)];
UIImage *selImage = [UIImage imageWithColor:RGB16(0xEFF2F8)];
[self.removeBtn setBackgroundImage:selImage forState:(UIControlStateSelected)];
self.removeBtn.hidden = YES;
}
break;
default:
break;
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
CGFloat iconWidth = 38;
CGFloat iconHeight = 16;
CGFloat margin = 6;
for (int i = 0; i < 3; i++) {
UIImageView *iconImageView = [[UIImageView alloc] init];
iconImageView.hidden = YES;
[self.iconBgView addSubview:iconImageView];
[iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(i*(iconWidth+margin));
make.width.mas_equalTo(iconWidth);
make.height.mas_equalTo(iconHeight);
make.centerY.equalTo(self.iconBgView);
}];
[self.iconViewArray addObject:iconImageView];
}
}
-(NSMutableArray *)iconViewArray{
if (!_iconViewArray) {
_iconViewArray = [NSMutableArray array];
}
return _iconViewArray;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end

View File

@@ -0,0 +1,136 @@
<?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="default" indentationWidth="10" rowHeight="124" id="KGk-i7-Jjw" customClass="QXBlackListCell">
<rect key="frame" x="0.0" y="0.0" width="516" 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="516" height="124"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="2x4-X2-0Ee">
<rect key="frame" x="16" y="37" width="50" height="50"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="FZO-Db-S0r"/>
<constraint firstAttribute="height" constant="50" id="jg8-Fv-y71"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Eq-O4-ACD">
<rect key="frame" x="76" y="41" width="330" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="9Za-2L-Rv2"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tP4-mF-MDR">
<rect key="frame" x="421" y="46" width="79" height="32"/>
<color key="backgroundColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="KkC-PS-thG"/>
<constraint firstAttribute="width" constant="79" id="pIz-RR-Izs"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="移除">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="removeAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="ixo-hh-Q00"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ocy-ib-avk">
<rect key="frame" x="50" y="71" width="16" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="dMe-HM-Ngn"/>
<constraint firstAttribute="width" constant="16" id="wq1-j5-0BI"/>
</constraints>
</imageView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9dz-yF-Htz">
<rect key="frame" x="76" y="69" width="329" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="Eck-GR-Ln9"/>
</constraints>
</view>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="03X-4t-Yn8">
<rect key="frame" x="16.000000000000004" y="53.666666666666664" width="35.333333333333343" height="16.999999999999993"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uoV-9s-SrU">
<rect key="frame" x="23.666666666666671" y="78" width="35" height="14"/>
<color key="backgroundColor" red="0.72941176470000002" green="0.38823529410000002" blue="0.86666666670000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="YiI-F2-QB0"/>
<constraint firstAttribute="height" constant="14" id="uIC-LI-i2u"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="7"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<constraints>
<constraint firstItem="uoV-9s-SrU" firstAttribute="centerX" secondItem="2x4-X2-0Ee" secondAttribute="centerX" id="0xO-ho-O06"/>
<constraint firstItem="2x4-X2-0Ee" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="642-Aw-byL"/>
<constraint firstItem="ocy-ib-avk" firstAttribute="bottom" secondItem="2x4-X2-0Ee" secondAttribute="bottom" id="BNP-bY-AF0"/>
<constraint firstItem="uoV-9s-SrU" firstAttribute="bottom" secondItem="2x4-X2-0Ee" secondAttribute="bottom" constant="5" id="F7B-Jc-4Sr"/>
<constraint firstAttribute="trailing" secondItem="tP4-mF-MDR" secondAttribute="trailing" constant="16" id="KBk-DE-jja"/>
<constraint firstItem="9dz-yF-Htz" firstAttribute="top" secondItem="0Eq-O4-ACD" secondAttribute="bottom" constant="4" id="PdK-w4-wyM"/>
<constraint firstItem="tP4-mF-MDR" firstAttribute="leading" secondItem="9dz-yF-Htz" secondAttribute="trailing" constant="16" id="Sgy-cN-hNl"/>
<constraint firstItem="tP4-mF-MDR" firstAttribute="leading" secondItem="0Eq-O4-ACD" secondAttribute="trailing" constant="15" id="a8I-Zz-dzM"/>
<constraint firstItem="ocy-ib-avk" firstAttribute="trailing" secondItem="2x4-X2-0Ee" secondAttribute="trailing" id="cIq-ni-x4p"/>
<constraint firstItem="tP4-mF-MDR" firstAttribute="centerY" secondItem="2x4-X2-0Ee" secondAttribute="centerY" id="foQ-Ke-Z4r"/>
<constraint firstItem="9dz-yF-Htz" firstAttribute="leading" secondItem="0Eq-O4-ACD" secondAttribute="leading" id="jWB-9g-wpJ"/>
<constraint firstItem="0Eq-O4-ACD" firstAttribute="top" secondItem="2x4-X2-0Ee" secondAttribute="top" constant="4" id="kzA-P7-kb3"/>
<constraint firstItem="0Eq-O4-ACD" firstAttribute="leading" secondItem="2x4-X2-0Ee" secondAttribute="trailing" constant="10" id="nsc-L7-KIp"/>
<constraint firstItem="03X-4t-Yn8" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="w49-cW-YZB"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="03X-4t-Yn8" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="Qpr-db-ozW"/>
<constraint firstItem="2x4-X2-0Ee" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="e1E-QC-o5D"/>
</constraints>
<connections>
<outlet property="headerImageView" destination="2x4-X2-0Ee" id="djB-Rp-cKT"/>
<outlet property="headerLeftConstraint" destination="642-Aw-byL" id="NK5-lE-nH5"/>
<outlet property="iconBgView" destination="9dz-yF-Htz" id="rCR-5k-TAC"/>
<outlet property="nameLabel" destination="0Eq-O4-ACD" id="3bb-Hb-hp9"/>
<outlet property="removeBtn" destination="tP4-mF-MDR" id="fV5-A9-I8F"/>
<outlet property="roleLabel" destination="uoV-9s-SrU" id="0Mh-FN-gHb"/>
<outlet property="sexImageView" destination="ocy-ib-avk" id="jmO-hM-tLv"/>
<outlet property="titleLabel" destination="03X-4t-Yn8" id="tKl-Qk-CXV"/>
</connections>
<point key="canvasLocation" x="287.02290076335879" y="47.887323943661976"/>
</tableViewCell>
</objects>
</document>

View File

@@ -0,0 +1,19 @@
//
// QXNoticeAnchorCell.h
// QXLive
//
// Created by 启星 on 2025/5/14.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXNoticeAnchorCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *headerImagView;
@property (weak, nonatomic) IBOutlet UIButton *btnSwitch;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,33 @@
//
// QXNoticeAnchorCell.m
// QXLive
//
// Created by on 2025/5/14.
//
#import "QXNoticeAnchorCell.h"
@implementation QXNoticeAnchorCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXNoticeAnchorCell";
QXNoticeAnchorCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
}
return cell;
}
- (IBAction)btnSwitchAction:(UIButton *)sender {
sender.selected = !sender.selected;
}
- (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

View File

@@ -0,0 +1,78 @@
<?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="default" indentationWidth="10" rowHeight="218" id="KGk-i7-Jjw" customClass="QXNoticeAnchorCell">
<rect key="frame" x="0.0" y="0.0" width="665" height="218"/>
<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="665" height="218"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A33-lf-bv5">
<rect key="frame" x="609" y="89" width="40" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="Mb9-G1-4hI"/>
<constraint firstAttribute="height" constant="40" id="sfr-a5-HD5"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="home_switch_on"/>
<state key="selected" image="home_switch_off"/>
<connections>
<action selector="btnSwitchAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="CLN-b8-5oC"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="kqD-zm-rKh">
<rect key="frame" x="16" y="84" width="50" height="50"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="Yju-ae-sh1"/>
<constraint firstAttribute="height" constant="50" id="iIe-IH-Mma"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRaiuds">
<integer key="value" value="25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="如梦幻泡影" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wjO-Nb-dzj">
<rect key="frame" x="76" y="98.666666666666671" width="523" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="wjO-Nb-dzj" firstAttribute="leading" secondItem="kqD-zm-rKh" secondAttribute="trailing" constant="10" id="Bzl-K0-MiK"/>
<constraint firstAttribute="trailing" secondItem="A33-lf-bv5" secondAttribute="trailing" constant="16" id="RUh-nG-aSw"/>
<constraint firstItem="kqD-zm-rKh" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="V89-Eg-OBF"/>
<constraint firstItem="wjO-Nb-dzj" firstAttribute="centerY" secondItem="kqD-zm-rKh" secondAttribute="centerY" id="WOM-Bx-f8F"/>
<constraint firstItem="A33-lf-bv5" firstAttribute="leading" secondItem="wjO-Nb-dzj" secondAttribute="trailing" constant="10" id="cZU-YS-5XN"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="A33-lf-bv5" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="Bui-BI-8JV"/>
<constraint firstItem="kqD-zm-rKh" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="NLE-6e-ut5"/>
</constraints>
<connections>
<outlet property="btnSwitch" destination="A33-lf-bv5" id="tLw-p8-g0j"/>
<outlet property="headerImagView" destination="kqD-zm-rKh" id="X1T-k9-ngy"/>
<outlet property="nameLabel" destination="wjO-Nb-dzj" id="xQo-OW-2R1"/>
</connections>
<point key="canvasLocation" x="402.29007633587787" y="80.985915492957744"/>
</tableViewCell>
</objects>
<resources>
<image name="home_switch_off" width="40" height="32"/>
<image name="home_switch_on" width="40" height="32"/>
</resources>
</document>

View File

@@ -0,0 +1,29 @@
//
// QXChirldModeView.h
// QXLive
//
// Created by 启星 on 2025/5/12.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger) {
QXPasswordViewTypeChirldMode = 0,
QXPasswordViewTypeRoom
}QXPasswordViewType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXPasswordViewDelegate <NSObject>
@optional
/// 输入完成回调
-(void)inputFinished:(NSString*)password;
@end
@interface QXPasswordView : UIView
@property (nonatomic,assign) QXPasswordViewType type;
@property (nonatomic,weak)id <QXPasswordViewDelegate> delegate;
-(instancetype)initWithFrame:(CGRect)frame type:(QXPasswordViewType)type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,213 @@
//
// QXChirldModeView.m
// QXLive
//
// Created by on 2025/5/12.
//
#import "QXPasswordView.h"
CGFloat labelWith = 50;
CGFloat labelHeight = 63;
@interface QXPasswordView()<UITextFieldDelegate>
@property(nonatomic,strong)UILabel *titleLabel;
@property(nonatomic,strong)UIButton *forgotBtn;
@property(nonatomic,strong)UITextField *textField;
@property(nonatomic,strong)UILabel *label1;
@property(nonatomic,strong)UILabel *label2;
@property(nonatomic,strong)UILabel *label3;
@property(nonatomic,strong)UILabel *label4;
@end
@implementation QXPasswordView
- (instancetype)initWithFrame:(CGRect)frame type:(QXPasswordViewType)type
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
[self setType:type];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.equalTo(self).offset(30);
make.height.mas_equalTo(24);
}];
self.label1 = [[UILabel alloc] init];
[self setCustomLabel:self.label1];
[self addSubview:self.label1];
self.label2 = [[UILabel alloc] init];
[self setCustomLabel:self.label2];
[self addSubview:self.label2];
self.label3 = [[UILabel alloc] init];
[self setCustomLabel:self.label3];
[self addSubview:self.label3];
self.label4 = [[UILabel alloc] init];
[self setCustomLabel:self.label4];
[self addSubview:self.label4];
[self.label2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.mas_centerX).offset(-8);
make.size.mas_equalTo(CGSizeMake(labelWith, labelHeight));
make.top.equalTo(self.titleLabel.mas_bottom).offset(30);
}];
[self.label3 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.mas_centerX).offset(8);
make.size.mas_equalTo(CGSizeMake(labelWith, labelHeight));
make.top.equalTo(self.label2);
}];
[self.label1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.label2.mas_left).offset(-16);
make.size.mas_equalTo(CGSizeMake(labelWith, labelHeight));
make.top.equalTo(self.label2);
}];
[self.label4 mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.label3.mas_right).offset(16);
make.size.mas_equalTo(CGSizeMake(labelWith, labelHeight));
make.top.equalTo(self.label2);
}];
self.textField = [[UITextField alloc] init];
self.textField.delegate = self;
self.textField.font = [UIFont systemFontOfSize:1];
self.textField.keyboardType = UIKeyboardTypeNumberPad;
self.textField.returnKeyType = UIReturnKeyDone;
self.textField.textColor = [UIColor clearColor];
self.textField.userInteractionEnabled = YES;
// [self.textField addTarget:self action:@selector(textDidChange:) forControlEvents:(UIControlEventEditingChanged)];
[self insertSubview:self.textField atIndex:0];
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.equalTo(self.label1);
make.width.height.mas_equalTo(1);
}];
self.forgotBtn = [[UIButton alloc] init];
[self.forgotBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
self.forgotBtn.titleLabel.font = [UIFont systemFontOfSize:12];
[self.forgotBtn setTitle:[NSString stringWithFormat:@"%@?%@",QXText(@"忘记密码"),QXText(@"请联系客服")] forState:(UIControlStateNormal)];
[self.forgotBtn addTarget:self action:@selector(forgotAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.forgotBtn];
[self.forgotBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.label1.mas_bottom).offset(10);
make.height.mas_equalTo(38);
make.centerX.equalTo(self);
}];
}
-(void)forgotAction{
}
-(void)setCustomLabel:(UILabel*)label{
label.font = [UIFont boldSystemFontOfSize:22];
label.layer.cornerRadius = 5;
label.layer.masksToBounds = YES;
label.textColor = QXConfig.textColor;
label.textAlignment = NSTextAlignmentCenter;
label.backgroundColor = RGB16(0xEFF2F8);
MJWeakSelf
[label addTapBlock:^(id _Nonnull obj) {
[weakSelf.textField becomeFirstResponder];
}];
// label.layer.shadowColor = [UIColor grayColor].CGColor;
// label.layer.shadowOpacity = 0.5;
// label.layer.shadowOffset = CGSizeMake(0, 2);
// label.layer.shadowRadius = 5;
// label.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, labelWith, labelHeight) cornerRadius:0].CGPath;
// [label addShadowWithColor:[UIColor grayColor] radius:5 frame:CGRectMake(0, 0, labelWith, labelHeight)];
}
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[textField resignFirstResponder];
return YES;
}
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
if (string.length>1) {
//
return NO;
}
if (textField.text.length <= 4) {
if (textField.text.length == 0) {
if ([string isEqualToString:@""]) {
//
}else{
self.label1.text = string;
}
}else if (textField.text.length == 1){
if ([string isEqualToString:@""]) {
self.label1.text = @"";
}else{
self.label2.text = string;
}
}else if (textField.text.length == 2){
if ([string isEqualToString:@""]) {
self.label2.text = @"";
}else{
self.label3.text = string;
}
self.label4.text = @"";
}else if (textField.text.length == 3){
if ([string isEqualToString:@""]) {
self.label3.text = @"";
}else{
self.label4.text = string;
self.textField.text = [NSString stringWithFormat:@"%@%@%@%@",self.label1.text,self.label2.text,self.label3.text,self.label4.text];
[self.textField resignFirstResponder];
if (self.delegate && [self.delegate respondsToSelector:@selector(inputFinished:)]) {
[self.delegate inputFinished:[NSString stringWithFormat:@"%@%@%@%@",self.label1.text,self.label2.text,self.label3.text,self.label4.text]];
}
}
}else{
if ([string isEqualToString:@""]) {
self.label4.text = @"";
return YES;
}
return NO;
}
return YES;
}
return NO;
}
-(void)setType:(QXPasswordViewType)type{
_type = type;
switch (type) {
case QXPasswordViewTypeChirldMode:{
self.titleLabel.text = QXText(@"请输入监护密码");
}
break;
case QXPasswordViewTypeRoom:{
self.titleLabel.text = QXText(@"请输入房间密码");
}
break;
default:
break;
}
}
@end

View File

@@ -0,0 +1,37 @@
//
// QXSettingCell.h
// QXLive
//
// Created by 启星 on 2025/5/12.
//
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSInteger) {
/// 显示左侧label 右侧lable 向右箭头
QXSettingCellTypeNormal = 0,
/// 只显示右侧详细信息
QXSettingCellTypeOnlyDetail = 1,
/// 只显示箭头
QXSettingCellTypeOnlyArrow,
/// 开关
QXSettingCellTypeSwitch,
/// 标题在上 详情在下 带箭头
QXSettingCellTypeTitleTopAndArrow,
/// 标题在上 详情在下 不带箭头
QXSettingCellTypeTitleTopNoArrow
}QXSettingCellType;
NS_ASSUME_NONNULL_BEGIN
@interface QXSettingCell : UITableViewCell
@property (strong, nonatomic) UILabel *titleLabel;
@property (strong, nonatomic) UILabel *detailLabel;
@property (strong, nonatomic) UIImageView *rightArrow;
@property (strong, nonatomic) NSLayoutConstraint *rightConstraint;
@property (strong, nonatomic) UIButton *btnSwitch;
@property (strong, nonatomic) UIView *lineView;
@property (assign, nonatomic) QXSettingCellType cellType;
@property (assign, nonatomic) BOOL needLine;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,215 @@
//
// QXSettingCell.m
// QXLive
//
// Created by on 2025/5/12.
//
#import "QXSettingCell.h"
@implementation QXSettingCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXSettingCell";
QXSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[QXSettingCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
}
return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubviews];
}
return self;
}
-(void)setCellType:(QXSettingCellType )cellType{
_cellType = cellType;
switch (cellType) {
case QXSettingCellTypeNormal:{
self.detailLabel.hidden = NO;
self.rightArrow.hidden = NO;
self.btnSwitch.hidden = YES;
self.detailLabel.textAlignment = NSTextAlignmentRight;
[self.rightArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.centerY.equalTo(self.contentView);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.detailLabel.mas_left).offset(-10);
}];
[self.detailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.rightArrow.mas_left).offset(-10);
make.centerY.equalTo(self.contentView);
make.width.mas_equalTo(120);
}];
}
break;
case QXSettingCellTypeOnlyArrow:{
self.detailLabel.hidden = YES;
self.rightArrow.hidden = NO;
self.rightConstraint.constant = 16;
self.btnSwitch.hidden = YES;
[self.rightArrow mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.centerY.equalTo(self.contentView);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.rightArrow.mas_left).offset(-10);
}];
}
break;
case QXSettingCellTypeOnlyDetail:{
self.detailLabel.hidden = NO;
self.rightArrow.hidden = YES;
self.btnSwitch.hidden = YES;
self.detailLabel.textAlignment = NSTextAlignmentRight;
[self.detailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.centerY.equalTo(self.contentView);
make.width.mas_greaterThanOrEqualTo(120);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.detailLabel.mas_left).offset(-10);
}];
}
break;
case QXSettingCellTypeSwitch:{
self.detailLabel.hidden = YES;
self.rightArrow.hidden = YES;
self.btnSwitch.hidden = NO;
[self.btnSwitch mas_remakeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.size.mas_equalTo(CGSizeMake(40, 40));
make.centerY.equalTo(self.contentView);
}];
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.btnSwitch.mas_left).offset(-10);
}];
}
break;
case QXSettingCellTypeTitleTopAndArrow:{
self.detailLabel.hidden = NO;
self.rightArrow.hidden = NO;
self.btnSwitch.hidden = YES;
self.detailLabel.textAlignment = NSTextAlignmentLeft;
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(9);
make.height.mas_equalTo(21);
make.right.equalTo(self.rightArrow.mas_left).offset(-10);
}];
[self.detailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.equalTo(self.titleLabel.mas_bottom);
make.bottom.equalTo(self.contentView).offset(-9);
make.right.equalTo(self.rightArrow.mas_left).offset(-10);
}];
}
break;
case QXSettingCellTypeTitleTopNoArrow:{
self.detailLabel.hidden = NO;
self.rightArrow.hidden = YES;
self.btnSwitch.hidden = YES;
self.detailLabel.textAlignment = NSTextAlignmentLeft;
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.mas_equalTo(9);
make.height.mas_equalTo(21);
make.right.equalTo(self.contentView).offset(-10);
}];
[self.detailLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.top.equalTo(self.titleLabel.mas_bottom);
make.bottom.equalTo(self.contentView).offset(-9);
make.right.equalTo(self.contentView).offset(-10);
}];
}
break;
default:
break;
}
}
-(void)initSubviews{
self.rightArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrowRight"]];
[self.contentView addSubview:self.rightArrow];
[self.rightArrow mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.centerY.equalTo(self.contentView);
}];
self.btnSwitch = [[UIButton alloc] init];
[self.btnSwitch setImage:[UIImage imageNamed:@"home_switch_off"] forState:(UIControlStateNormal)];
[self.btnSwitch setImage:[UIImage imageNamed:@"home_switch_on"] forState:(UIControlStateSelected)];
[self.btnSwitch addTarget:self action:@selector(btnSwitchAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self.contentView addSubview:self.btnSwitch];
[self.btnSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(-16);
make.size.mas_equalTo(CGSizeMake(40, 40));
make.centerY.equalTo(self.contentView);
}];
self.detailLabel = [[UILabel alloc] init];
self.detailLabel.font = [UIFont systemFontOfSize:13];
self.detailLabel.textAlignment = NSTextAlignmentRight;
self.detailLabel.textColor = RGB16(0x494949);
[self.contentView addSubview:self.detailLabel];
[self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.rightArrow.mas_left).offset(-10);
make.centerY.equalTo(self.contentView);
make.width.mas_equalTo(120);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont systemFontOfSize:14];
self.titleLabel.textColor = RGB16(0x333333);
[self.contentView addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.centerY.equalTo(self.contentView);
make.right.equalTo(self.detailLabel.mas_left).offset(-10);
}];
self.lineView = [[UIView alloc] init];
self.lineView.backgroundColor = [UIColor lightGrayColor];
[self.contentView addSubview:self.lineView];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16);
make.right.mas_equalTo(-16);
make.height.mas_equalTo(0.5);
make.bottom.equalTo(self.contentView);
}];
}
-(void)setNeedLine:(BOOL)needLine{
_needLine = needLine;
self.lineView.hidden = !needLine;
}
- (void)btnSwitchAction:(UIButton *)sender {
sender.selected = !sender.selected;
}
- (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

View File

@@ -0,0 +1,20 @@
//
// QXCornRecordCell.h
// QXLive
//
// Created by 启星 on 2025/5/27.
//
#import <UIKit/UIKit.h>
#import "QXCoinDetailModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXCornRecordCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *reasonLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (nonatomic,strong) QXCoinDetailModel *model;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,42 @@
//
// QXCornRecordCell.m
// QXLive
//
// Created by on 2025/5/27.
//
#import "QXCornRecordCell.h"
#import "NSDate+QX.h"
@implementation QXCornRecordCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXCornRecordCell";
QXCornRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
}
return cell;
}
-(void)setModel:(QXCoinDetailModel *)model{
_model = model;
self.reasonLabel.text = model.remarks;
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //,1000 , 1000
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
NSString*time = [formatter stringFromDate:date];
self.timeLabel.text = time;
self.priceLabel.text = [NSString stringWithFormat:@"%.2f",model.change_value.doubleValue];
}
- (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

View File

@@ -0,0 +1,77 @@
<?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="85" id="KGk-i7-Jjw" customClass="QXCornRecordCell">
<rect key="frame" x="0.0" y="0.0" width="393" height="85"/>
<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="393" height="85"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="每日签到" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9Ov-rS-XTy">
<rect key="frame" x="16" y="12" width="242" height="21"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="M6b-EW-qW0"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.84705882349999995" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2024.12.14 11:22:55" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fEd-EE-hdG">
<rect key="frame" x="16" y="56" width="357" height="15"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="mine_recharge_corn" translatesAutoresizingMaskIntoConstraints="NO" id="otM-9U-0Vb">
<rect key="frame" x="361" y="14.666666666666664" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="TBo-Q1-4cA"/>
<constraint firstAttribute="height" constant="16" id="XDZ-Mi-dJN"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="+99999" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fxs-N2-aqw">
<rect key="frame" x="278" y="12.666666666666664" width="80" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="80" id="wGg-jd-N7q"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<color key="textColor" red="1" green="0.15294116735458374" blue="0.15294116735458374" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="otM-9U-0Vb" secondAttribute="trailing" constant="16" id="1Jo-bc-EXX"/>
<constraint firstItem="9Ov-rS-XTy" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="12" id="4J4-MP-MMr"/>
<constraint firstItem="9Ov-rS-XTy" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="7Wh-Dd-Lsz"/>
<constraint firstItem="otM-9U-0Vb" firstAttribute="leading" secondItem="Fxs-N2-aqw" secondAttribute="trailing" constant="3" id="JOW-D1-VCO"/>
<constraint firstAttribute="bottom" secondItem="fEd-EE-hdG" secondAttribute="bottom" constant="14" id="R8J-ww-6pD"/>
<constraint firstAttribute="trailing" secondItem="fEd-EE-hdG" secondAttribute="trailing" constant="20" id="g4d-4v-ibb"/>
<constraint firstItem="Fxs-N2-aqw" firstAttribute="leading" secondItem="9Ov-rS-XTy" secondAttribute="trailing" constant="20" id="kVM-pQ-Cml"/>
<constraint firstItem="fEd-EE-hdG" firstAttribute="leading" secondItem="9Ov-rS-XTy" secondAttribute="leading" id="mlg-f5-ftM"/>
<constraint firstItem="Fxs-N2-aqw" firstAttribute="centerY" secondItem="9Ov-rS-XTy" secondAttribute="centerY" id="ubr-E6-gOU"/>
<constraint firstItem="otM-9U-0Vb" firstAttribute="centerY" secondItem="9Ov-rS-XTy" secondAttribute="centerY" id="wqd-tc-4FI"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="priceLabel" destination="Fxs-N2-aqw" id="rfF-fe-gWN"/>
<outlet property="reasonLabel" destination="9Ov-rS-XTy" id="JXd-OS-yeh"/>
<outlet property="timeLabel" destination="fEd-EE-hdG" id="4VS-rn-KzE"/>
</connections>
<point key="canvasLocation" x="194.6564885496183" y="13.028169014084508"/>
</tableViewCell>
</objects>
<resources>
<image name="mine_recharge_corn" width="20" height="20"/>
</resources>
</document>

View File

@@ -0,0 +1,16 @@
//
// QXReVerificationPopView.h
// QXLive
//
// Created by 启星 on 2025/5/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXReVerificationPopView : UIView
@property (nonatomic,copy)void(^commitBlock)(NSString*code);
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,113 @@
//
// QXReVerificationPopView.m
// QXLive
//
// Created by on 2025/5/27.
//
#import "QXReVerificationPopView.h"
#import "QXLoginTextField.h"
#import "QXLoginNetwork.h"
@interface QXReVerificationPopView()<QXLoginTextFieldDelegate>
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)QXLoginTextField *codeTextField;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)UIButton *commitBtn;
@end
@implementation QXReVerificationPopView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
- (instancetype)init
{
self = [super init];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = [UIColor whiteColor];
[self addRoundedCornersWithRadius:16];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = QXConfig.textColor;
self.titleLabel.text = QXText(@"二次验证");
[self addSubview:self.titleLabel];
self.codeTextField = [[QXLoginTextField alloc] init];
self.codeTextField.delegate = self;
self.codeTextField.type = LoginTextTypeCode;
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
[self.codeTextField addRoundedCornersWithRadius:10];
[self addSubview:self.codeTextField];
self.closeBtn = [[UIButton alloc] init];
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.closeBtn setImage:[UIImage imageNamed:@"wallet_close"] forState:(UIControlStateNormal)];
[self addSubview:self.closeBtn];
self.commitBtn = [[UIButton alloc] init];
[self.commitBtn setTitle:QXText(@"确定") forState:(UIControlStateNormal)];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];;
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.commitBtn];
[self.commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(38);
make.right.mas_equalTo(-38);
make.height.mas_equalTo(42);
make.bottom.mas_equalTo(-16);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.mas_equalTo(12);
make.height.mas_equalTo(24);
}];
[self.codeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.right.mas_equalTo(-10);
make.bottom.equalTo(self.commitBtn.mas_top).offset(-30);
make.height.mas_equalTo(44);
}];
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.equalTo(self);
make.size.mas_equalTo(CGSizeMake(45, 45));
}];
}
-(void)closeAction{
[[QXGlobal shareGlobal] hideViewBlock:^{
}];
}
-(void)commitAction{
if (self.commitBlock) {
self.commitBlock(self.codeTextField.textField.text);
}
}
-(void)didClickSendCode:(UIButton *)sender{
NSString*mobile = [QXGlobal shareGlobal].loginModel.mobile;
if (mobile.length == 0) {
showToast(@"请先绑定手机号");
return;
}
MJWeakSelf
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile type:GetSmscodeTypeWithDraw successBlock:^(id _Nonnull responseObject) {
[weakSelf.codeTextField startTimeDown];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
@end

View File

@@ -0,0 +1,21 @@
//
// QXWalletDateView.h
// QXLive
//
// Created by 启星 on 2025/5/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXWalletDateViewDelegate <NSObject>
@optional
-(void)didSelectedStartDate:(NSString*)startDateString startDate:(NSDate*)startDate endDateString:(NSString*)endDateString endDate:(NSDate*)endDate;
@end
@interface QXWalletDateView : UIView
@property (nonatomic,weak)id<QXWalletDateViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,89 @@
//
// QXWalletDateView.m
// QXLive
//
// Created by on 2025/5/27.
//
#import "QXWalletDateView.h"
#import "QXRoomDetailHeaderView.h"
@interface QXWalletDateView()
@property (nonatomic,strong)UILabel *startLabel;
@property (nonatomic,strong)UIImageView *leadToImageView;
@property (nonatomic,strong)UILabel *endLabel;
@property (nonatomic,strong)UIImageView *dateImageView;
@property (nonatomic,strong)QXDatePickerView *pickerView;
@end
@implementation QXWalletDateView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubviews];
}
return self;
}
-(void)initSubviews{
self.backgroundColor = RGB16(0xF8F8F8);
[self addRoundedCornersWithRadius:5];
self.leadToImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"corn_date_lead_to"]];
[self addSubview:self.leadToImageView];
[self.leadToImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self).offset(-14);
make.size.mas_equalTo(CGSizeMake(14, 14));
make.centerY.equalTo(self);
}];
self.dateImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"corn_date"]];
[self addSubview:self.dateImageView];
[self.dateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self);
make.size.mas_equalTo(CGSizeMake(14, 14));
make.right.mas_equalTo(-12);
}];
self.startLabel = [[UILabel alloc] init];
self.startLabel.text = QXText(@"开始时间");
self.startLabel.font = [UIFont systemFontOfSize:13];
self.startLabel.textColor = RGB16(0xa6a6a6);
[self addSubview:self.startLabel];
[self.startLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(12);
make.centerY.equalTo(self);
make.right.equalTo(self.leadToImageView.mas_left).offset(-5);
}];
self.endLabel = [[UILabel alloc] init];
self.endLabel.text = QXText(@"结束时间");
self.endLabel.font = [UIFont systemFontOfSize:13];
self.endLabel.textColor = RGB16(0xa6a6a6);
[self addSubview:self.endLabel];
[self.endLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.leadToImageView.mas_right).offset(12);
make.centerY.equalTo(self);
make.right.equalTo(self.dateImageView.mas_left).offset(-5);
}];
MJWeakSelf
[self addTapBlock:^(id _Nonnull obj) {
[weakSelf.pickerView show];
}];
}
-(QXDatePickerView *)pickerView{
if (!_pickerView) {
_pickerView = [[QXDatePickerView alloc] init];
_pickerView.pickerMode = BRDatePickerModeYMDHMS;
MJWeakSelf
_pickerView.selectedDateBlock = ^(NSString * _Nonnull startTime, NSDate * _Nonnull startDate, NSString * _Nonnull endTime, NSDate * _Nonnull endDate) {
weakSelf.startLabel.text = startTime;
weakSelf.endLabel.text = endTime;
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(didSelectedStartDate:startDate:endDateString:endDate:)]) {
[weakSelf.delegate didSelectedStartDate:startTime startDate:startDate endDateString:endTime endDate:endDate];
}
};
}
return _pickerView;
}
@end

View File

@@ -0,0 +1,17 @@
//
// QXWalletHomeCell.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXWalletHomeCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
+(instancetype)cellWithTableView:(UITableView *)tableView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
//
// QXWalletHomeCell.m
// QXLive
//
// Created by on 2025/5/16.
//
#import "QXWalletHomeCell.h"
@implementation QXWalletHomeCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
static NSString *cellId = @"QXWalletHomeCell";
QXWalletHomeCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.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

View File

@@ -0,0 +1,75 @@
<?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="System colors in document resources" minToolsVersion="11.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="119" id="KGk-i7-Jjw" customClass="QXWalletHomeCell">
<rect key="frame" x="0.0" y="0.0" width="477" height="119"/>
<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="477" height="119"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2Jr-Iv-ZVP">
<rect key="frame" x="16" y="6" width="445" height="107"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GRE-zM-0ma">
<rect key="frame" x="12" y="45" width="35.333333333333336" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="arrowRight" translatesAutoresizingMaskIntoConstraints="NO" id="c2a-Jb-s2X">
<rect key="frame" x="405" y="41.666666666666664" width="24" height="23.999999999999993"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="Npj-rj-nqt"/>
<constraint firstAttribute="height" constant="24" id="QVY-OL-9UH"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="GRE-zM-0ma" firstAttribute="leading" secondItem="2Jr-Iv-ZVP" secondAttribute="leading" constant="12" id="4IG-QW-dUi"/>
<constraint firstAttribute="trailing" secondItem="c2a-Jb-s2X" secondAttribute="trailing" constant="16" id="kro-Nn-63X"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="7"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<constraints>
<constraint firstItem="2Jr-Iv-ZVP" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="6" id="2v9-ZJ-EMj"/>
<constraint firstItem="2Jr-Iv-ZVP" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="IiU-gz-TfH"/>
<constraint firstAttribute="bottom" secondItem="2Jr-Iv-ZVP" secondAttribute="bottom" constant="6" id="MBW-fP-cW2"/>
<constraint firstAttribute="trailing" secondItem="2Jr-Iv-ZVP" secondAttribute="trailing" constant="16" id="gCm-6H-6E9"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<constraints>
<constraint firstItem="GRE-zM-0ma" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="gGc-sV-aWf"/>
<constraint firstItem="c2a-Jb-s2X" firstAttribute="centerY" secondItem="aW0-zy-SZf" secondAttribute="centerY" id="v8x-7j-nsd"/>
</constraints>
<connections>
<outlet property="titleLabel" destination="GRE-zM-0ma" id="Jpd-7Z-kMy"/>
</connections>
<point key="canvasLocation" x="258.77862595419845" y="46.126760563380287"/>
</tableViewCell>
</objects>
<resources>
<image name="arrowRight" width="16" height="16"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

View File

@@ -0,0 +1,32 @@
//
// QXWalletHomeTopView.h
// QXLive
//
// Created by 启星 on 2025/5/16.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol QXWalletHomeTopViewDelegate <NSObject>
@optional
-(void)didClickButtonIsRecharge:(BOOL)isRecharge;
@end
@interface QXWalletHomeTopView : UIView
@property (nonatomic,weak)id <QXWalletHomeTopViewDelegate> delegate;
@property (nonatomic,strong)NSString*coin;
@property (nonatomic,strong)NSString*earnings;
@end
@interface QXWalletHomeTopSubview : UIView
@property (nonatomic,strong)UIImageView *bgImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *priceLabel;
@property (nonatomic,strong)UIButton *btn;
@property (nonatomic,assign)BOOL isCorn;
@property (nonatomic,weak)id <QXWalletHomeTopViewDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

Some files were not shown because too many files have changed in this diff Show More