提交
This commit is contained in:
@@ -77,7 +77,7 @@
|
||||
}
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getDressTypeListSuccessBlock:^(NSArray<QXUserDressTypeModel *> * _Nonnull list) {
|
||||
[QXMineNetwork getDressTypeListWithFrom:@"2" successBlock:^(NSArray<QXUserDressTypeModel *> * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
for (QXUserDressTypeModel*model in list) {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXBackpackSubViewController : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
/// 0背包道具 1背包收入 2背包支出
|
||||
/// 0背包道具 1背包收入 2背包支出 3热度卡
|
||||
@property (nonatomic,assign)NSInteger type;
|
||||
|
||||
@end
|
||||
|
||||
@@ -28,8 +28,16 @@
|
||||
if (self.type == 0) {
|
||||
[self getBagList];
|
||||
self.collectionView.frame = CGRectMake(0, 12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
}else{
|
||||
[self getGiftRecordListIsIncome:self.type == 1];
|
||||
}else if(self.type == 1){
|
||||
[self getBagList];
|
||||
self.collectionView.frame = CGRectMake(0, 12, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
}else if(self.type == 2){
|
||||
[self getGiftRecordListIsIncome:YES];
|
||||
[self.collectionView addRoundedCornersWithRadius:16];
|
||||
self.collectionView.backgroundColor = [UIColor whiteColor];
|
||||
self.collectionView.frame = CGRectMake(16, 12, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
}else if(self.type == 3){
|
||||
[self getGiftRecordListIsIncome:NO];
|
||||
[self.collectionView addRoundedCornersWithRadius:16];
|
||||
self.collectionView.backgroundColor = [UIColor whiteColor];
|
||||
self.collectionView.frame = CGRectMake(16, 12, SCREEN_WIDTH-32, SCREEN_HEIGHT-NavContentHeight-44-10);
|
||||
@@ -95,7 +103,7 @@
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
if (self.type == 0 || self.type == 1) {
|
||||
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
|
||||
cell.roomGiftModel = self.dataArray[indexPath.row];
|
||||
cell.cellType = QXGiftCellTypeBackpack;
|
||||
@@ -112,7 +120,7 @@
|
||||
}
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.type == 0) {
|
||||
if (self.type == 0 || self.type == 1) {
|
||||
CGFloat width = (SCREEN_WIDTH-15*2-22*2)/3;
|
||||
return CGSizeMake(width, width/100*136);
|
||||
}else{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
}
|
||||
- (void)initSubViews{
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[QXText(@"背包道具"),QXText(@"背包收入"),QXText(@"背包支出")];
|
||||
self.titles = @[QXText(@"背包道具"),@"热度卡",QXText(@"背包收入"),QXText(@"背包支出")];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(15, kSafeAreaTop+44, SCREEN_WIDTH-30, 44);
|
||||
|
||||
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic,assign)BOOL isLight;
|
||||
/// 数据源
|
||||
@property(nonatomic,strong)NSArray<QXUserGiftWallModel*> *giftArray;
|
||||
/// 用户id
|
||||
@property (nonatomic,strong)NSString*userId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "QXGiftWallSubViewController.h"
|
||||
#import "QXMineGiftWallCell.h"
|
||||
#import "QXGiftWallDetailView.h"
|
||||
|
||||
@interface QXGiftWallSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@@ -58,5 +59,14 @@
|
||||
cell.model = self.giftArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.isLight) {
|
||||
QXUserGiftWallModel *model = self.giftArray[indexPath.row];
|
||||
QXGiftWallDetailView *giftDetailView = [[QXGiftWallDetailView alloc] init];
|
||||
giftDetailView.userId = self.userId;
|
||||
giftDetailView.giftModel = model;
|
||||
[giftDetailView showInView:self.view];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -92,8 +92,10 @@
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
if (index == 0) {
|
||||
self.lightVC.userId = self.userId;
|
||||
return self.lightVC;
|
||||
}else{
|
||||
self.grayVC.userId = self.userId;
|
||||
return self.grayVC;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
}
|
||||
-(void)getData{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getDressTypeListSuccessBlock:^(NSArray<QXUserDressTypeModel *> * _Nonnull list) {
|
||||
[QXMineNetwork getDressTypeListWithFrom:@"2" successBlock:^(NSArray<QXUserDressTypeModel *> * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
for (QXUserDressTypeModel*model in list) {
|
||||
|
||||
@@ -242,9 +242,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
装扮类型列表
|
||||
type 1 道具商城 2个性装扮
|
||||
*/
|
||||
+(void)getDressTypeListSuccessBlock:(void (^)(NSArray<QXUserDressTypeModel*>* list))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
+(void)getDressTypeListWithFrom:(NSString*)type
|
||||
successBlock:(void (^)(NSArray<QXUserDressTypeModel*>* list))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
|
||||
/**
|
||||
@@ -300,6 +302,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+(void)beforeJoinRoomWithRoomId:(NSString *)room_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
|
||||
roomNeedPasswordBlock:(void (^)(NSString * msg))roomNeedPasswordBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
|
||||
@@ -307,6 +310,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
进入房间
|
||||
*/
|
||||
+(void)joinRoomWithRoomId:(NSString*)room_id
|
||||
room_password:(NSString*)room_password
|
||||
successBlock:(void (^)(QXRoomModel* roomModel))successBlock
|
||||
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
@@ -1604,6 +1608,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
user_id:(NSString*)user_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
/**
|
||||
礼物墙礼物用户列表
|
||||
*/
|
||||
+(void)giftWallUserListWithUserId:(NSString*)user_id
|
||||
page:(NSInteger)page
|
||||
gift_id:(NSString*)gift_id
|
||||
successBlock:(void (^)(NSArray<QXUserHomeModel*>* list,NSString*count))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -487,8 +487,10 @@
|
||||
/**
|
||||
获取装扮类型列表
|
||||
*/
|
||||
+(void)getDressTypeListSuccessBlock:(void (^)(NSArray<QXUserDressTypeModel *> * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
[[QXRequset shareInstance] getWithUrl:QXDressTypeList parameters:@{} needCache:NO success:^(id responseObject) {
|
||||
+(void)getDressTypeListWithFrom:(NSString*)type
|
||||
successBlock:(void (^)(NSArray<QXUserDressTypeModel *> * _Nonnull))successBlock
|
||||
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
[[QXRequset shareInstance] postWithUrl:QXDressTypeList parameters:@{@"type":type?type:@""} needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
NSArray *list = [NSArray yy_modelArrayWithClass:[QXUserDressTypeModel class] json:responseObject[@"data"]];
|
||||
successBlock(list);
|
||||
@@ -591,6 +593,7 @@
|
||||
+(void)beforeJoinRoomWithRoomId:(NSString *)room_id
|
||||
successBlock:(void (^)(NSDictionary* dict))successBlock
|
||||
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
|
||||
roomNeedPasswordBlock:(void (^)(NSString * msg))roomNeedPasswordBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
[[QXRequset shareInstance] postWithUrl:QXBeforeJoinRoom parameters:@{@"room_id":room_id} needCache:NO success:^(id responseObject) {
|
||||
int code = [responseObject[@"code"] intValue];
|
||||
@@ -605,6 +608,11 @@
|
||||
if (roomErrorBlock) {
|
||||
roomErrorBlock(roomId,content);
|
||||
}
|
||||
}if(code == 101){
|
||||
NSString* message = [NSString stringWithFormat:@"%@",responseObject[@"msg"]];
|
||||
if (roomNeedPasswordBlock) {
|
||||
roomNeedPasswordBlock(message);
|
||||
}
|
||||
}else{
|
||||
if (successBlock) {
|
||||
successBlock(responseObject[@"data"]);
|
||||
@@ -615,9 +623,10 @@
|
||||
}];
|
||||
}
|
||||
|
||||
+(void)joinRoomWithRoomId:(NSString *)room_id successBlock:(nonnull void (^)(QXRoomModel * _Nonnull))successBlock roomErrorBlock:(nonnull void (^)(NSString * _Nonnull, NSString * _Nonnull))roomErrorBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
+(void)joinRoomWithRoomId:(NSString *)room_id room_password:(NSString*)room_password successBlock:(nonnull void (^)(QXRoomModel * _Nonnull))successBlock roomErrorBlock:(nonnull void (^)(NSString * _Nonnull, NSString * _Nonnull))roomErrorBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"room_id":room_id?:@""
|
||||
@"room_id":room_id?:@"",
|
||||
@"room_password":room_password?:@""
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXJoinRoom parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
int code = [responseObject[@"code"] intValue];
|
||||
@@ -3290,4 +3299,29 @@
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
/**
|
||||
礼物墙礼物用户列表
|
||||
*/
|
||||
+(void)giftWallUserListWithUserId:(NSString*)user_id
|
||||
page:(NSInteger)page
|
||||
gift_id:(NSString*)gift_id
|
||||
successBlock:(void (^)(NSArray<QXUserHomeModel*>* list,NSString*count))successBlock
|
||||
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
|
||||
NSDictionary *parameters =@{
|
||||
@"user_id":user_id?:@"",
|
||||
@"gift_id":gift_id?:@"",
|
||||
@"page":[NSNumber numberWithInteger:page]
|
||||
};
|
||||
[[QXRequset shareInstance] postWithUrl:QXUserGiftWallUserList parameters:parameters needCache:NO success:^(id responseObject) {
|
||||
if (successBlock) {
|
||||
NSArray*list = [NSArray yy_modelArrayWithClass:[QXUserHomeModel class] json:responseObject[@"data"][@"users"]];
|
||||
NSString*count = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"count"]];
|
||||
successBlock(list,count);
|
||||
}
|
||||
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
|
||||
failBlock(error,msg);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
self.fullEffectView.hidden = NO;
|
||||
[self.fullEffectView previewEffectWith:self.model.play_image];
|
||||
}
|
||||
if ([self.typeId isEqualToString:@"12"]) {
|
||||
if ([self.typeId isEqualToString:@"12"] || [self.typeId isEqualToString:@"13"]) {
|
||||
self.titleArray = @[@"商品名称",@"商品单价",@"购买次数",@"商品总价"];
|
||||
}else{
|
||||
self.titleArray = @[@"商品名称",@"商品价格",@"有效期至",@"购买时长"];
|
||||
|
||||
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, assign)BRDatePickerMode pickerMode;
|
||||
@property (nonatomic,strong)NSDate* beginDate;
|
||||
@property (nonatomic,strong)NSDate* endDate;
|
||||
@property (nonatomic,strong)NSString *startSelectValue;
|
||||
@property (nonatomic,strong)NSString *endSelectValue;
|
||||
@property (nonatomic,copy)void(^chooseDateBlock)(NSString*startTime,NSString*endTime);
|
||||
@property (nonatomic,copy)void(^selectedDateBlock)(NSString*startTime,NSDate*startDate,NSString*endTime,NSDate*endDate);
|
||||
-(void)show;
|
||||
|
||||
@@ -338,11 +338,19 @@
|
||||
}
|
||||
-(void)setBeginDate:(NSDate *)beginDate{
|
||||
_beginDate = beginDate;
|
||||
[self.beginTimeBtn setTitle:[NSString stringWithFormat:@"%02ld:%02ld",(long)beginDate.br_hour,beginDate.br_minute] forState:(UIControlStateNormal)];
|
||||
if (self.pickerMode == BRDatePickerModeHM) {
|
||||
[self.beginTimeBtn setTitle:[NSString stringWithFormat:@"%02ld:%02ld",(long)beginDate.br_hour,beginDate.br_minute] forState:(UIControlStateNormal)];
|
||||
}else{
|
||||
[self.beginTimeBtn setTitle:self.startSelectValue forState:(UIControlStateNormal)];
|
||||
}
|
||||
}
|
||||
-(void)setEndDate:(NSDate *)endDate{
|
||||
_endDate = endDate;
|
||||
[self.endTimeBtn setTitle:[NSString stringWithFormat:@"%02ld:%02ld",(long)endDate.br_hour,endDate.br_minute] forState:(UIControlStateNormal)];
|
||||
if (self.pickerMode == BRDatePickerModeHM) {
|
||||
[self.endTimeBtn setTitle:[NSString stringWithFormat:@"%02ld:%02ld",(long)endDate.br_hour,endDate.br_minute] forState:(UIControlStateNormal)];
|
||||
}else{
|
||||
[self.endTimeBtn setTitle:self.endSelectValue forState:(UIControlStateNormal)];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)doneAction{
|
||||
@@ -401,10 +409,12 @@
|
||||
MJWeakSelf
|
||||
_pickerView.resultBlock = ^(NSDate * _Nullable selectDate, NSString * _Nullable selectValue) {
|
||||
if (weakSelf.beginTimeBtn.selected) {
|
||||
weakSelf.startSelectValue = selectValue;
|
||||
[weakSelf.beginTimeBtn setTitle:selectValue forState:(UIControlStateNormal)];
|
||||
weakSelf.beginDate = selectDate;
|
||||
}else{
|
||||
[weakSelf.endTimeBtn setTitle:selectValue forState:(UIControlStateNormal)];
|
||||
weakSelf.endSelectValue = selectValue;
|
||||
weakSelf.endDate = selectDate;
|
||||
}
|
||||
};
|
||||
|
||||
25
QXLive/Mine(音域)/View/礼物墙/QXGiftWallDetailView.h
Normal file
25
QXLive/Mine(音域)/View/礼物墙/QXGiftWallDetailView.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// QXGiftWallDetailView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2026/1/23.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiftWallDetailView : UIView
|
||||
@property (nonatomic,strong)NSString*userId;
|
||||
@property (nonatomic,strong)QXUserGiftWallModel*giftModel;
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@interface QXGiftWallDetailCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
@property (nonatomic,strong)QXUserHomeModel*user;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
233
QXLive/Mine(音域)/View/礼物墙/QXGiftWallDetailView.m
Normal file
233
QXLive/Mine(音域)/View/礼物墙/QXGiftWallDetailView.m
Normal file
@@ -0,0 +1,233 @@
|
||||
//
|
||||
// QXGiftWallDetailView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2026/1/23.
|
||||
//
|
||||
|
||||
#import "QXGiftWallDetailView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@interface QXGiftWallDetailView()<UICollectionViewDataSource,UICollectionViewDelegate>
|
||||
@property (strong, nonatomic)UIView *bgView;
|
||||
@property (strong, nonatomic)UILabel *titleLabel;
|
||||
@property (strong, nonatomic)UIButton *closeBtn;
|
||||
@property (strong, nonatomic)UILabel *subTitleLabel;
|
||||
@property (strong, nonatomic)UILabel *giftCountLabel;
|
||||
@property (strong, nonatomic)UICollectionView *collectionView;
|
||||
@property (strong, nonatomic)NSMutableArray *dataArray;
|
||||
@property (assign, nonatomic)NSInteger page;
|
||||
@end
|
||||
|
||||
@implementation QXGiftWallDetailView
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.4];
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-ScaleWidth(348))/2, (SCREEN_HEIGHT-ScaleWidth(429))/2, ScaleWidth(348), ScaleWidth(429))];
|
||||
self.bgView.backgroundColor = RGB16(0x134039);
|
||||
[self.bgView addRoundedCornersWithRadius:16];
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.textColor = RGB16(0xffffff);
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
self.titleLabel.text = @"黄金游轮";
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(20);
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
self.closeBtn = [[UIButton alloc] init];
|
||||
[self.closeBtn setImage:[UIImage imageNamed:@"wallet_close"] forState:(UIControlStateNormal)];
|
||||
[self.closeBtn addTarget:self action:@selector(hide) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.bgView addSubview:self.closeBtn];
|
||||
[self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.width.mas_equalTo(35);
|
||||
make.top.mas_equalTo(2);
|
||||
make.right.mas_equalTo(-2);
|
||||
}];
|
||||
|
||||
self.subTitleLabel = [[UILabel alloc] init];
|
||||
self.subTitleLabel.textColor = RGB16A(0xffffff,0.65);
|
||||
self.subTitleLabel.font = [UIFont boldSystemFontOfSize:12];
|
||||
self.subTitleLabel.text = @"— 历史累计集卡详情 —";
|
||||
[self.bgView addSubview:self.subTitleLabel];
|
||||
[self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.titleLabel.mas_bottom).offset(6);
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
self.giftCountLabel = [[UILabel alloc] init];
|
||||
self.giftCountLabel.textColor = RGB16(0xffffff);
|
||||
self.giftCountLabel.font = [UIFont boldSystemFontOfSize:14];
|
||||
self.giftCountLabel.text = @"黄金邮轮 26 人数 23";
|
||||
[self.bgView addSubview:self.giftCountLabel];
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.subTitleLabel.mas_bottom).offset(13);
|
||||
make.centerX.equalTo(self.bgView);
|
||||
}];
|
||||
|
||||
[self.bgView addSubview:self.collectionView];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(0);
|
||||
make.left.mas_equalTo(0);
|
||||
make.top.equalTo(self.giftCountLabel.mas_bottom).offset(5);
|
||||
make.bottom.equalTo(self.bgView).offset(-10);
|
||||
}];
|
||||
}
|
||||
-(void)setGiftModel:(QXUserGiftWallModel *)giftModel{
|
||||
_giftModel = giftModel;
|
||||
self.titleLabel.text = giftModel.gift_name;
|
||||
NSString *userCount = giftModel.top_users_count;
|
||||
NSString *giftCount = giftModel.total_count;
|
||||
NSString *giftInfo = [NSString stringWithFormat:@"%@%@ 人数%@",giftModel.gift_name,giftCount,userCount];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:giftInfo];
|
||||
[attr yy_setColor:RGB16(0xFFFF59) range:[giftInfo rangeOfString:userCount]];
|
||||
[attr yy_setColor:RGB16(0xFFFF59) range:[giftInfo rangeOfString:giftCount]];
|
||||
self.giftCountLabel.attributedText = attr;
|
||||
}
|
||||
|
||||
-(void)getUserList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork giftWallUserListWithUserId:self.userId page:self.page gift_id:self.giftModel.gift_id successBlock:^(NSArray<QXUserHomeModel *> * _Nonnull list, NSString * _Nonnull count) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.collectionView reloadData];
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
if (list.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_header endRefreshing];
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXGiftWallDetailCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftWallDetailCell" forIndexPath:indexPath];
|
||||
cell.user = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)showInView:(UIView *)view{
|
||||
self.page = 1;
|
||||
[self getUserList];
|
||||
self.bgView.alpha = 0;
|
||||
self.bgView.frame = CGRectMake((SCREEN_WIDTH-ScaleWidth(348))/2, (view.height-ScaleWidth(429))/2, ScaleWidth(348), ScaleWidth(429));
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.alpha = 1;
|
||||
}completion:^(BOOL finished) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.alpha = 0;
|
||||
}completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 20;
|
||||
layout.minimumInteritemSpacing = 20;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
NSInteger itemWidth =(ScaleWidth(348)-16*2-20*3)/4;
|
||||
layout.itemSize = CGSizeMake(itemWidth, itemWidth+22);
|
||||
_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:[QXGiftWallDetailCell class] forCellWithReuseIdentifier:@"QXGiftWallDetailCell"];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getUserList];
|
||||
}];
|
||||
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getUserList];
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXGiftWallDetailCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
self.contentView.backgroundColor = [UIColor clearColor];
|
||||
self.backgroundColor = UIColor.clearColor;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setUser:(QXUserHomeModel *)user{
|
||||
_user = user;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:user.avatar]];
|
||||
self.nameLabel.text = user.nickname;
|
||||
self.countLabel.text = [NSString stringWithFormat:@"x%@",user.count];
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.headerImageView = [[UIImageView alloc] init];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.contentView addSubview:self.headerImageView];
|
||||
NSInteger itemWidth =(ScaleWidth(348)-16*2-20*3)/4;
|
||||
[self.headerImageView addRoundedCornersWithRadius:itemWidth/2];
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.contentView);
|
||||
make.height.equalTo(self.headerImageView.mas_width);
|
||||
}];
|
||||
|
||||
self.countLabel = [[UILabel alloc] init];
|
||||
self.countLabel.textColor = RGB16(0xFFFF93);
|
||||
self.countLabel.font = [UIFont boldSystemFontOfSize:12];
|
||||
self.countLabel.text = @"x0";
|
||||
[self.contentView addSubview:self.countLabel];
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.contentView);
|
||||
make.bottom.equalTo(self.headerImageView).offset(-4);
|
||||
make.height.mas_equalTo(17);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = RGB16(0xFFFF93);
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:12];
|
||||
self.nameLabel.text = @"羽声语音";
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.contentView);
|
||||
make.bottom.equalTo(self.contentView);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -55,7 +55,7 @@
|
||||
self.userCountLabel.text = [NSString stringWithFormat:@"等%@人",model.top_users_count];
|
||||
|
||||
if (model.top_users.count > 0) {
|
||||
self.countLabel.hidden = NO;
|
||||
// self.countLabel.hidden = NO;
|
||||
self.userCountLabel.hidden = NO;
|
||||
QXUserHomeModel *md1;
|
||||
QXUserHomeModel *md2;
|
||||
@@ -89,7 +89,7 @@
|
||||
}
|
||||
|
||||
}else{
|
||||
self.countLabel.hidden = YES;
|
||||
// self.countLabel.hidden = YES;
|
||||
self.userCountLabel.hidden = YES;
|
||||
self.userImageView1.hidden = YES;
|
||||
self.userImageView2.hidden = YES;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6dg-55-CAQ">
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="6dg-55-CAQ">
|
||||
<rect key="frame" x="66" y="211" width="18" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="18" id="SU0-l9-dWa"/>
|
||||
@@ -56,19 +56,31 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mxk-cv-aBW">
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mxk-cv-aBW">
|
||||
<rect key="frame" x="54" y="211" width="18" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="18" id="Kwg-ZJ-I5s"/>
|
||||
<constraint firstAttribute="height" constant="18" id="xl5-Rc-fQg"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="9"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Rfn-Wi-s2Q">
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Rfn-Wi-s2Q">
|
||||
<rect key="frame" x="42" y="211" width="18" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="18" id="n8I-xi-ccY"/>
|
||||
<constraint firstAttribute="height" constant="18" id="pmp-Ws-KWh"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="9"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="等12人" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5R5-ei-HVw">
|
||||
<rect key="frame" x="90" y="214.66666666666666" width="70" height="11"/>
|
||||
|
||||
@@ -207,6 +207,29 @@ CGFloat labelHeight = 63;
|
||||
break;
|
||||
case QXPasswordViewTypeRoom:{
|
||||
self.titleLabel.text = QXText(@"请输入房间密码");
|
||||
self.titleLabel.hidden = YES;
|
||||
[self.label2 mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.mas_centerX).offset(-8);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(44), ScaleWidth(44)));
|
||||
make.top.equalTo(self).offset(0);
|
||||
}];
|
||||
[self.label3 mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.mas_centerX).offset(8);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(44), ScaleWidth(44)));
|
||||
make.top.equalTo(self.label2);
|
||||
}];
|
||||
|
||||
[self.label1 mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.label2.mas_left).offset(-16);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(44), ScaleWidth(44)));
|
||||
make.top.equalTo(self.label2);
|
||||
}];
|
||||
|
||||
[self.label4 mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.label3.mas_right).offset(16);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(44), ScaleWidth(44)));
|
||||
make.top.equalTo(self.label2);
|
||||
}];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user