提交
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "QXRedBagRecordViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@class QXRedBagRecordCell;
|
||||
@interface QXRedBagRecordViewController ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
@@ -18,6 +19,7 @@
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXDrawRedPacketModel *model;
|
||||
@end
|
||||
|
||||
@implementation QXRedBagRecordViewController
|
||||
@@ -40,10 +42,10 @@
|
||||
self.senderNameLabel = [[UILabel alloc] init];
|
||||
self.senderNameLabel.textColor = RGB16(0xffffff);
|
||||
self.senderNameLabel.font = [UIFont systemFontOfSize:18];
|
||||
self.senderNameLabel.text = @"傻狗涛的红包";
|
||||
self.senderNameLabel.text = @"-";
|
||||
[self.topView addSubview:self.senderNameLabel];
|
||||
[self.senderNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView).offset(41);;
|
||||
make.centerX.equalTo(self.topView).offset(41-13);;
|
||||
make.top.equalTo(self.topView).offset(92);
|
||||
}];
|
||||
|
||||
@@ -58,7 +60,7 @@
|
||||
}];
|
||||
|
||||
self.remarkLabel = [[UILabel alloc] init];
|
||||
self.remarkLabel.text = @"恭喜发财大吉大利";
|
||||
self.remarkLabel.text = @"-";
|
||||
self.remarkLabel.textColor = RGB16(0xffffff);
|
||||
self.remarkLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.remarkLabel];
|
||||
@@ -71,7 +73,7 @@
|
||||
self.moneyLabel = [[UILabel alloc] init];
|
||||
self.moneyLabel.font = [UIFont boldSystemFontOfSize:19];
|
||||
self.moneyLabel.textColor = RGB16(0xffffff);
|
||||
self.moneyLabel.text = @"5000金币";
|
||||
self.moneyLabel.text = @"0金币";
|
||||
[self.topView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
@@ -80,7 +82,7 @@
|
||||
|
||||
self.bottomLabel = [[UILabel alloc] init];
|
||||
self.bottomLabel.textColor = RGB16(0xffffff);
|
||||
self.bottomLabel.text = @"已存入金币";
|
||||
self.bottomLabel.text = @"已存入钱包";
|
||||
self.bottomLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.bottomLabel];
|
||||
[self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -126,14 +128,41 @@
|
||||
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:backBtn];
|
||||
}
|
||||
|
||||
-(void)setRedbagId:(NSString *)redbagId{
|
||||
_redbagId = redbagId;
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRedpacketRecordWithRedpacketId:redbagId successBlock:^(QXDrawRedPacketModel* model) {
|
||||
weakSelf.model = model;
|
||||
weakSelf.remarkLabel.text = model.redpacket_info.remark;
|
||||
[weakSelf.senderHeaderImageView sd_setImageWithURL:[NSURL URLWithString:model.redpacket_info.avatar]];
|
||||
weakSelf.senderNameLabel.text = [NSString stringWithFormat:@"%@的红包",model.redpacket_info.nickname];
|
||||
NSString *coinStr = @"";
|
||||
if (weakSelf.model.redpacket_info.coin_type.intValue == 1) {
|
||||
weakSelf.bottomLabel.text = @"已存入金币";
|
||||
coinStr = [NSString stringWithFormat:@"%@%@",model.my_record.amount,@"金币"];
|
||||
}else{
|
||||
weakSelf.bottomLabel.text = @"已存入钻石";
|
||||
coinStr = [NSString stringWithFormat:@"%@%@",model.my_record.amount,@"钻石"];
|
||||
}
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:coinStr];
|
||||
[attr yy_setFont:[UIFont boldSystemFontOfSize:46] range:[coinStr rangeOfString:[NSString stringWithFormat:@"%@",model.my_record.amount]]];
|
||||
weakSelf.moneyLabel.attributedText = attr;
|
||||
weakSelf.countLabel.text = [NSString stringWithFormat:@"已领取%ld/%@",model.redpacket_info.total_count.integerValue-model.redpacket_info.left_count.integerValue,model.redpacket_info.total_count];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
return self.model.records.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRedBagRecordCell *cell = [QXRedBagRecordCell cellWithTabelView:tableView];
|
||||
cell.recordModel = self.model.records[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)backAction{
|
||||
@@ -172,6 +201,13 @@
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setRecordModel:(QXDrawRedpacketRecordModel *)recordModel{
|
||||
_recordModel = recordModel;
|
||||
self.nameLabel.text = recordModel.nickname;
|
||||
[self.userHeaderImageView sd_setImageWithURL:[NSURL URLWithString:recordModel.avatar]];
|
||||
self.timeLabel.text = recordModel.createtime;
|
||||
self.moneyLabel.text = recordModel.amount;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.bgView = [[UIView alloc] init];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
|
||||
Reference in New Issue
Block a user