BusinessCell.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. //
  2. // BusinessCell.m
  3. // jitao
  4. //
  5. // Created by 罗云飞 on 2017/12/24.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "BusinessCell.h"
  9. @implementation BusinessCell
  10. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  11. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  12. if (self) {
  13. UILabel *line = [UILabel new];
  14. line.backgroundColor = NewLineGrayColor;
  15. [self.contentView addSubview:line];
  16. line.sd_layout
  17. .leftEqualToView(self.contentView)
  18. .heightIs(10)
  19. .rightEqualToView(self.contentView)
  20. .topEqualToView(self.contentView);
  21. _image = [UIImageView new];
  22. [_image setImage:[UIImage imageNamed:@"dd"]];
  23. [self.contentView addSubview:_image];
  24. _image.sd_layout
  25. .heightIs(fitScreenWidth(14))
  26. .widthIs(fitScreenHeight(18))
  27. .leftSpaceToView(self.contentView, 15)
  28. .topSpaceToView(line, fitScreenWidth(15));
  29. _title = [UILabel new];
  30. _title.text = @"科技爱好是否看见啊还是开发撒娇话费卡萨";
  31. _title.font = NewFont(fitScreenWidth(14));
  32. _title.textColor = [UIColor colorWithString:@"#3C3C3C"];
  33. _title.numberOfLines = 1;
  34. _title.lineBreakMode = NSLineBreakByTruncatingTail;
  35. [self.contentView addSubview:_title];
  36. _title.sd_layout
  37. .leftSpaceToView(_image, 10)
  38. .heightIs(fitScreenWidth(44))
  39. .topSpaceToView(line, 0)
  40. .rightSpaceToView(self.contentView, fitScreenWidth(130));
  41. _time = [UILabel new];
  42. _time.text = [NSString stringWithFormat:@"%@",@"2018-11-11 8:00"];
  43. _time.font = NewFont(fitScreenWidth(12));
  44. _time.textColor = [UIColor colorWithString:@"#9A9A9A"];
  45. [_time setSingleLineAutoResizeWithMaxWidth:0];
  46. [self.contentView addSubview:_time];
  47. _time.sd_layout
  48. .rightSpaceToView(self.contentView, 15)
  49. .heightIs(fitScreenWidth(44))
  50. .topSpaceToView(line, 0);
  51. UILabel *line1 = [UILabel new];
  52. line1.backgroundColor = NewLineGrayColor;
  53. [self.contentView addSubview:line1];
  54. line1.sd_layout
  55. .leftEqualToView(self.contentView)
  56. .heightIs(0.8)
  57. .rightEqualToView(self.contentView)
  58. .topSpaceToView(line, fitScreenHeight(44));
  59. _ordernumber = [UILabel new];
  60. _ordernumber.text = [NSString stringWithFormat:@"订单编号:%@",@"1231321"];
  61. _ordernumber.font = NewFont(fitScreenWidth(13));
  62. _ordernumber.textColor = [UIColor colorWithString:@"#FF8523"];
  63. [_ordernumber setSingleLineAutoResizeWithMaxWidth:0];
  64. [self.contentView addSubview:_ordernumber];
  65. _ordernumber.sd_layout
  66. .leftEqualToView(_image)
  67. .heightIs(fitScreenWidth(44))
  68. .topSpaceToView(line1, 0);
  69. _expenditure = [UILabel new];
  70. _expenditure.text = [NSString stringWithFormat:@"支出:¥%@",@"1231321"];
  71. _expenditure.font = NewFont(fitScreenWidth(13));
  72. _expenditure.textColor = [UIColor colorWithString:@"#158CD8"];
  73. [_expenditure setSingleLineAutoResizeWithMaxWidth:0];
  74. [self.contentView addSubview:_expenditure];
  75. _expenditure.sd_layout
  76. .leftSpaceToView(_ordernumber, fitScreenWidth(26))
  77. .heightIs(fitScreenWidth(44))
  78. .topSpaceToView(line1, 0);
  79. }
  80. return self;
  81. }
  82. - (void)awakeFromNib {
  83. [super awakeFromNib];
  84. // Initialization code
  85. }
  86. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  87. [super setSelected:selected animated:animated];
  88. // Configure the view for the selected state
  89. }
  90. @end