YOUPAIHRCoinDetailCell.m 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // YOUPAIHRCoinDetailCell.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/10/19.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRCoinDetailCell.h"
  9. @interface YOUPAIHRCoinDetailCell ()
  10. @property(nonatomic,strong)UILabel *youpaiptitleLabel;
  11. @property(nonatomic,strong)UILabel *youpaiptimeLabel;
  12. @property(nonatomic,strong)UILabel *youpaipcountLabel;
  13. @end
  14. @implementation YOUPAIHRCoinDetailCell
  15. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  16. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  17. [self youpaifsetSubView];
  18. }
  19. return self;
  20. }
  21. -(void)youpaifsetSubView{
  22. //bgview
  23. UIView *bgView = [UIView new];
  24. [self.contentView addSubview:bgView];
  25. [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.mas_equalTo(14);
  27. make.right.mas_equalTo(-14);
  28. make.bottom.mas_equalTo(-5);
  29. make.top.mas_equalTo(0);
  30. }];
  31. bgView.backgroundColor = LCSubBkgColor;
  32. bgView.layer.cornerRadius = 5;
  33. bgView.layer.masksToBounds = YES;
  34. //title
  35. UILabel *titleLabel = [UILabel new];
  36. self.youpaiptitleLabel = titleLabel;
  37. [bgView addSubview:titleLabel];
  38. [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.left.mas_equalTo(12);
  40. make.top.mas_equalTo(19);
  41. }];
  42. titleLabel.text = @"购买贵族币";
  43. titleLabel.font= LCBoldFont(14);
  44. titleLabel.textColor = [UIColor whiteColor];
  45. //时间
  46. UILabel *timeLabel = [UILabel new];
  47. self.youpaiptimeLabel = timeLabel;
  48. [bgView addSubview:timeLabel];
  49. [timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  50. make.left.mas_equalTo(titleLabel);
  51. make.top.mas_equalTo(titleLabel.mas_bottom).offset(6);
  52. }];
  53. timeLabel.text = @"2020.12.17 23:47:30";
  54. timeLabel.font= [UIFont systemFontOfSize:12];
  55. timeLabel.textColor = HexColorFromRGB(0x999999);
  56. //数量
  57. UILabel *countLabel = [UILabel new];
  58. self.youpaipcountLabel = countLabel;
  59. [bgView addSubview:countLabel];
  60. [countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  61. make.centerY.mas_equalTo(0);
  62. make.right.mas_equalTo(-12);
  63. }];
  64. countLabel.text = @"+10币";
  65. countLabel.font= [UIFont systemFontOfSize:18];
  66. countLabel.textColor = HexColorFromRGB(0xffffff);
  67. }
  68. -(void)setYoupaipmodel:(YOUPAIHRCoinDetailModel *)model{
  69. _youpaipmodel = model;
  70. self.youpaipcountLabel.text = model.youpaipchange_value;
  71. self.youpaiptitleLabel.text = model.youpaipbc;
  72. self.youpaiptimeLabel.text = model.youpaipcreate_time;
  73. }
  74. @end