JXMyHelpCerCell.m 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // JXMyHelpCerCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/16.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXMyHelpCerCell.h"
  9. @interface JXMyHelpCerCell()
  10. @property (nonatomic,weak) UIImageView *leftIMG;
  11. @property (nonatomic,weak) UILabel *leftLab;
  12. @property (nonatomic,weak) UILabel *rightL;
  13. @property (nonatomic,weak) UIImageView *rightIMG;
  14. @end
  15. @implementation JXMyHelpCerCell
  16. - (void)awakeFromNib {
  17. [super awakeFromNib];
  18. // Initialization code
  19. }
  20. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  21. if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
  22. UIImageView *leftIMG=[[UIImageView alloc]init];
  23. leftIMG.image=[UIImage imageNamed:@"helpCenterL"];
  24. [self.contentView addSubview:leftIMG];
  25. self.leftIMG=leftIMG;
  26. [leftIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  28. make.left.mas_equalTo(15);
  29. }];
  30. UILabel *leftLab=[[UILabel alloc]init];
  31. leftLab.text=@"我的上级是谁?";
  32. leftLab.textColor=kRGBColor51;
  33. leftLab.font=[UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
  34. [self.contentView addSubview:leftLab];
  35. self.leftLab=leftLab;
  36. [leftLab mas_makeConstraints:^(MASConstraintMaker *make) {
  37. make.centerY.mas_equalTo(leftIMG.mas_centerY);
  38. make.left.mas_equalTo(leftIMG.mas_right).mas_offset(10);
  39. }];
  40. UIImageView *rightIMG=[[UIImageView alloc]init];
  41. rightIMG.image=[UIImage imageNamed:@"组20"];
  42. [self.contentView addSubview:rightIMG];
  43. [rightIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  44. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  45. make.right.mas_equalTo(-15);
  46. }];
  47. UILabel *rightL=[[UILabel alloc]init];
  48. rightL.text=@"上级联系方式";
  49. rightL.textColor=kRGBColor151;
  50. rightL.textAlignment=NSTextAlignmentRight;
  51. rightL.font=[UIFont systemFontOfSize:13 weight:UIFontWeightRegular];
  52. [self.contentView addSubview:rightL];
  53. self.rightL=rightL;
  54. [rightL mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.centerY.mas_equalTo(self.contentView.mas_centerY);
  56. make.right.mas_equalTo(-40);
  57. }];
  58. UILabel *line_View=[[UILabel alloc]init];
  59. line_View.backgroundColor=kRGBColor(246, 246, 246);
  60. [self.contentView addSubview:line_View];
  61. self.line_View=line_View;
  62. [line_View mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.bottom.mas_equalTo(self.contentView.mas_bottom);
  64. make.right.mas_equalTo(-15);
  65. make.left.mas_equalTo(15);
  66. make.height.mas_equalTo(1);
  67. }];
  68. }
  69. return self;
  70. }
  71. + (instancetype)cellWithTableView:(UITableView *)tableView
  72. {
  73. static NSString *ID = @"JXMyHelpCerCell";
  74. JXMyHelpCerCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  75. if (!cell) {
  76. cell = [[JXMyHelpCerCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  77. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  78. }
  79. return cell;
  80. }
  81. -(void)setModeL:(StatusesModel *)modeL{
  82. _modeL=modeL;
  83. self.leftIMG.image=[UIImage imageNamed:modeL.image];
  84. self.leftLab.text=modeL.text;
  85. self.rightL.text=modeL.subtile;
  86. }
  87. @end