XMGXianShiMshaCell.m 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. //
  2. // XMGXianShiMshaCell.m
  3. // 振飞商城
  4. //
  5. // Created by 123 on 2020/5/16.
  6. // Copyright © 2020 Vibration Fly. All rights reserved.
  7. //
  8. #import "XMGXianShiMshaCell.h"
  9. @interface XMGXianShiMshaCell()
  10. @property (nonatomic,weak) UILabel *titleL;
  11. @property (nonatomic,weak) UILabel *contenL;
  12. @property (nonatomic,weak) UIImageView *headIMG;
  13. @property (nonatomic,weak) UILabel *jiangJL;
  14. @end
  15. @implementation XMGXianShiMshaCell
  16. -(instancetype)initWithFrame:(CGRect)frame{
  17. if (self=[super initWithFrame:frame]) {
  18. self.userInteractionEnabled=YES;
  19. // self.backgroundColor=[UIColor clearColor];
  20. self.layer.cornerRadius=5;
  21. self.layer.masksToBounds=YES;
  22. UILabel *titleL = [[UILabel alloc] init];
  23. titleL.font=[UIFont systemFontOfSize:18 weight:UIFontWeightBold];
  24. titleL.textColor=kRGBColor(255, 229, 182);
  25. titleL.text=@"盈利榜";
  26. titleL.textAlignment=NSTextAlignmentCenter;
  27. [self addSubview:titleL];
  28. self.titleL=titleL;
  29. UIImageView *headIMG = [[UIImageView alloc] init];
  30. headIMG.contentMode=UIViewContentModeScaleAspectFit;
  31. headIMG.image=[UIImage imageNamed:@"组1"];
  32. headIMG.userInteractionEnabled=YES;
  33. [self addSubview:headIMG];
  34. self.headIMG=headIMG;
  35. UILabel *contenL = [[UILabel alloc] init];
  36. contenL.font=[UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
  37. contenL.textColor=kRGBColor(255, 229, 182);
  38. contenL.textAlignment=NSTextAlignmentCenter;
  39. contenL.text=@"宸荨樱桃";
  40. [self addSubview:contenL];
  41. self.contenL=contenL;
  42. UILabel *jiangJL = [[UILabel alloc] init];
  43. jiangJL.font=[UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
  44. jiangJL.textColor=kRGBColor(255, 229, 182);
  45. jiangJL.textAlignment=NSTextAlignmentCenter;
  46. jiangJL.text=@"盈利奖金:70000";
  47. [self addSubview:jiangJL];
  48. self.jiangJL=jiangJL;
  49. [self UIlayoutSubviews];
  50. }
  51. return self;
  52. }
  53. - (void)UIlayoutSubviews{
  54. [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.top.mas_equalTo(20);
  56. make.left.and.right.mas_equalTo(0);
  57. }];
  58. [self.headIMG mas_makeConstraints:^(MASConstraintMaker *make) {
  59. make.top.mas_equalTo(self.titleL.mas_bottom).mas_offset(13);
  60. make.centerX.mas_equalTo(self.mas_centerX);
  61. }];
  62. [self.contenL mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.top.mas_equalTo(self.headIMG.mas_bottom).mas_offset(13);
  64. make.left.mas_equalTo(0);
  65. make.right.mas_equalTo(0);
  66. }];
  67. [self.jiangJL mas_makeConstraints:^(MASConstraintMaker *make) {
  68. make.top.mas_equalTo(self.contenL.mas_bottom).mas_offset(5);
  69. make.left.mas_equalTo(0);
  70. make.right.mas_equalTo(0);
  71. }];
  72. }
  73. -(void)setShaModel:(StatusesModel *)shaModel{
  74. _shaModel=shaModel;
  75. //self.headIMG.image=[UIImage imageNamed:shaModel.image];
  76. ///self.titleL.text=[NSString stringWithFormat:@"%@",shaModel.money];
  77. // self.contenL.text=shaModel.subtile;
  78. if ([shaModel.type intValue]==1) {
  79. self.jiangJL.text=[NSString stringWithFormat:@"盈利奖金%@",shaModel.money];
  80. }else if([shaModel.type intValue]==2){
  81. self.jiangJL.text=[NSString stringWithFormat:@"充值榜%@",shaModel.money];
  82. }else if([shaModel.type intValue]==3){
  83. self.jiangJL.text=[NSString stringWithFormat:@"打码榜%@",shaModel.money];
  84. }
  85. }
  86. @end