JXPhangBangCell.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. //
  2. // JXPhangBangCell.m
  3. // shiku_im
  4. //
  5. // Created by 123 on 2020/5/19.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JXPhangBangCell.h"
  9. @interface JXPhangBangCell()
  10. @property (nonatomic,weak) UILabel *indexLb;
  11. @property (nonatomic,weak) UIImageView *headIM;
  12. @property (nonatomic,weak) UILabel *titleL;
  13. @property (nonatomic,weak) UILabel *statusL;
  14. @end
  15. @implementation JXPhangBangCell
  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. self.backgroundColor = kRGBColor(181, 27, 35);
  23. //索引
  24. UILabel *indexLb=[[UILabel alloc]init];
  25. indexLb.textColor=kRGBColor(255, 241, 173);
  26. indexLb.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
  27. [self.contentView addSubview:indexLb];
  28. self.indexLb=indexLb;
  29. [indexLb mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.top.mas_offset(7);
  31. make.left.mas_equalTo(18);
  32. make.height.mas_equalTo(50);
  33. }];
  34. UIImageView *headIM=[[UIImageView alloc]init];
  35. headIM.image=[UIImage imageNamed:@"组1"];
  36. [self.contentView addSubview:headIM];
  37. headIM.layer.cornerRadius=25;
  38. headIM.layer.masksToBounds=YES;
  39. [g_server delHeadImage:g_server.myself.userId];
  40. [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:headIM];
  41. self.headIM=headIM;
  42. [headIM mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.top.mas_offset(7);
  44. make.left.mas_equalTo(indexLb.mas_right).mas_offset(20);
  45. make.height.mas_equalTo(50);
  46. make.width.mas_equalTo(50);
  47. }];
  48. UILabel *titleL=[[UILabel alloc]init];
  49. titleL.text=@"XJ****12";
  50. titleL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
  51. titleL.textColor=kRGBColor(255, 241, 173);
  52. titleL.textAlignment=NSTextAlignmentCenter;
  53. [self.contentView addSubview:titleL];
  54. self.titleL=titleL;
  55. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.top.mas_offset(7);
  57. make.left.mas_offset(130);
  58. make.right.mas_offset(-130);
  59. make.height.mas_equalTo(50);
  60. }];
  61. UILabel *statusL=[[UILabel alloc]init];
  62. statusL.textColor=kRGBColor(255, 241, 173);
  63. statusL.text=@"今日盈利 211001.2";
  64. statusL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
  65. [self.contentView addSubview:statusL];
  66. self.statusL=statusL;
  67. [statusL mas_makeConstraints:^(MASConstraintMaker *make) {
  68. make.top.mas_offset(7);
  69. make.right.mas_offset(-10);
  70. make.height.mas_equalTo(50);
  71. }];
  72. /* */
  73. }
  74. return self;
  75. }
  76. - (void)createLayoutsub{
  77. }
  78. + (instancetype)cellWithTableView:(UITableView *)tableView
  79. {
  80. static NSString *ID = @"JXPhangBangCell";
  81. JXPhangBangCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  82. if (!cell) {
  83. cell = [[JXPhangBangCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  84. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  85. }
  86. return cell;
  87. }
  88. -(void)createStatuModl:(JXMyModel *)model andIndexPath:(NSInteger)indexRow{
  89. self.indexLb.text=[NSString stringWithFormat:@"%zd",indexRow+1];
  90. [g_server getHeadImageSmall:model.userId userName:g_server.myself.userNickname imageView:self.headIM];
  91. self.titleL.text=[NSString stringWithFormat:@"%@",model.membershipAccount];
  92. if ([model.type intValue]==1) {
  93. self.statusL.text=[NSString stringWithFormat:@"盈利奖金%@",model.money];
  94. }else if ([model.type intValue]==2) {
  95. self.statusL.text=[NSString stringWithFormat:@"总充值%@",model.money];
  96. } else {
  97. self.statusL.text=[NSString stringWithFormat:@"总打码%@",model.money];
  98. }
  99. }
  100. @end