MOSecurityStatusCell.m 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // MOSecurityStatusCell.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2025/3/10.
  6. //
  7. #import "MOSecurityStatusCell.h"
  8. @interface MOSecurityStatusCell ()
  9. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bgHeight;
  10. @property (weak, nonatomic) IBOutlet UIView *bgView;
  11. @property (weak, nonatomic) IBOutlet UILabel *titleLabel;
  12. @property (weak, nonatomic) IBOutlet UIImageView *startView;
  13. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *startWidth;
  14. @property (weak, nonatomic) IBOutlet UILabel *statusLabel;
  15. @end
  16. @implementation MOSecurityStatusCell
  17. - (void)awakeFromNib {
  18. [super awakeFromNib];
  19. self.backgroundColor = [UIColor clearColor];
  20. //Cell 去除选中效果
  21. self.selectionStyle = UITableViewCellSelectionStyleNone;
  22. self.bgView.backgroundColor = [MOTools colorWithHexString:@"#FFFFFF"];
  23. self.bgView.layer.masksToBounds = YES;
  24. self.bgView.layer.cornerRadius = 16;
  25. self.bgHeight.constant = SCREENWIDTH;
  26. self.titleLabel.font = [MOTextTools regularFont:16];
  27. self.titleLabel.textColor = kBaseTextColor_1;
  28. self.titleLabel.text = NSLocalString(@"mimo_mine_account_security_tip_one");
  29. self.statusLabel.font = [MOTextTools semiboldFont:16];
  30. self.statusLabel.textColor = [MOTools colorWithHexString:@"#F23051"];
  31. }
  32. - (void)setCellModel:(MOSecurityData *)cellModel{
  33. _cellModel = cellModel;
  34. if(cellModel.level == 2){//hight
  35. self.startView.image = [UIImage imageNamed:@"icon_account_leve_hight"];
  36. self.startWidth.constant = 72;
  37. self.statusLabel.text = NSLocalString(@"mimo_security_high");
  38. self.statusLabel.textColor = [MOTools colorWithHexString:@"#4363FF"];
  39. }
  40. else{//low
  41. self.startView.image = [UIImage imageNamed:@"icon_account_leve_low"];
  42. self.startWidth.constant = 30;
  43. self.statusLabel.text = NSLocalString(@"mimo_security_low");
  44. self.statusLabel.textColor = [MOTools colorWithHexString:@"#F23051"];
  45. }
  46. }
  47. @end