// // YOUPAIHRCoinDetailCell.m // VQU // // Created by xiaohaoran on 2021/10/19. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIHRCoinDetailCell.h" @interface YOUPAIHRCoinDetailCell () @property(nonatomic,strong)UILabel *youpaiptitleLabel; @property(nonatomic,strong)UILabel *youpaiptimeLabel; @property(nonatomic,strong)UILabel *youpaipcountLabel; @end @implementation YOUPAIHRCoinDetailCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self youpaifsetSubView]; } return self; } -(void)youpaifsetSubView{ //bgview UIView *bgView = [UIView new]; [self.contentView addSubview:bgView]; [bgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(14); make.right.mas_equalTo(-14); make.bottom.mas_equalTo(-5); make.top.mas_equalTo(0); }]; bgView.backgroundColor = LCSubBkgColor; bgView.layer.cornerRadius = 5; bgView.layer.masksToBounds = YES; //title UILabel *titleLabel = [UILabel new]; self.youpaiptitleLabel = titleLabel; [bgView addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(12); make.top.mas_equalTo(19); }]; titleLabel.text = @"购买贵族币"; titleLabel.font= LCBoldFont(14); titleLabel.textColor = [UIColor whiteColor]; //时间 UILabel *timeLabel = [UILabel new]; self.youpaiptimeLabel = timeLabel; [bgView addSubview:timeLabel]; [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(titleLabel); make.top.mas_equalTo(titleLabel.mas_bottom).offset(6); }]; timeLabel.text = @"2020.12.17 23:47:30"; timeLabel.font= [UIFont systemFontOfSize:12]; timeLabel.textColor = HexColorFromRGB(0x999999); //数量 UILabel *countLabel = [UILabel new]; self.youpaipcountLabel = countLabel; [bgView addSubview:countLabel]; [countLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(0); make.right.mas_equalTo(-12); }]; countLabel.text = @"+10币"; countLabel.font= [UIFont systemFontOfSize:18]; countLabel.textColor = HexColorFromRGB(0xffffff); } -(void)setYoupaipmodel:(YOUPAIHRCoinDetailModel *)model{ _youpaipmodel = model; self.youpaipcountLabel.text = model.youpaipchange_value; self.youpaiptitleLabel.text = model.youpaipbc; self.youpaiptimeLabel.text = model.youpaipcreate_time; } @end