| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- //
- // MOGiftUserCell.m
- // MiMoLive
- //
- // Created by SuperC on 2024/8/19.
- //
- #import "MOGiftUserCell.h"
- @interface MOGiftUserCell ()
- @property (weak, nonatomic) IBOutlet UIView *headBgView;
- @property (weak, nonatomic) IBOutlet BigBtn *headBtn;
- @property (weak, nonatomic) IBOutlet UILabel *tagLab;
- @property (weak, nonatomic) IBOutlet NSLayoutConstraint *tagLabWidth;
- @property (nonatomic, assign) BOOL isChoose;
- @end
- @implementation MOGiftUserCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
-
- self.headBgView.layer.cornerRadius = 36.0 / 2.0;
- self.headBgView.layer.masksToBounds = YES;
-
- self.headBtn.layer.cornerRadius = 32.0 / 2.0;
- self.headBtn.layer.masksToBounds = YES;
- self.headBtn.imageView.contentMode = UIViewContentModeScaleAspectFill;
-
- self.tagLab.layer.cornerRadius = 12.0 / 2.0;
- self.tagLab.layer.masksToBounds = YES;
- self.tagLab.font = [MOTextTools poppinsRegularFont:8.0];
-
- self.backgroundColor = [UIColor clearColor];
-
- self.tagLab.font = [MOTextTools poppinsRegularFont:8.0];
- }
- - (void)setIsManage:(BOOL)isManage{
- _isManage = isManage;
-
- if(isManage){
- self.tagLabWidth.constant = 30.0;
- self.tagLab.text = @"Host";
- }
- else{
- self.tagLabWidth.constant = 18.0;
- }
- }
- - (void)setIsChoose:(BOOL)isChoose{
- _isChoose = isChoose;
-
- if(isChoose){
- self.headBgView.layer.borderWidth = 1.0;
- self.headBgView.layer.borderColor = [MOTools colorWithHexString:@"#4363FF"].CGColor;
-
- self.tagLab.backgroundColor = [MOTools colorWithHexString:@"#4363FF"];
- self.tagLab.textColor = [MOTools colorWithHexString:@"#FFFFFF" alpha:1.0];
- }
- else{
- self.headBgView.layer.borderColor = [UIColor clearColor].CGColor;
-
- self.tagLab.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.6];
- self.tagLab.textColor = [UIColor whiteColor];
- }
-
- }
- - (void)setCellModel:(MOUserProfile *)cellModel{
- _cellModel = cellModel;
-
- if([cellModel.id isEqualToString:self.anchorUser.id]){
- self.tagLab.text = @"Host";
- }
- else{
- self.tagLab.text = [NSString stringWithFormat:@"%zd",self.cellModel.seatNum];
- }
-
- [self.headBtn sd_setImageWithURL:[NSURL URLWithString:cellModel.avatar] forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"icon_mine_placeHolder"]];
-
- self.isChoose = cellModel.isSelect;
- }
- - (IBAction)headBtnClick:(id)sender {
- self.cellModel.isSelect = !self.cellModel.isSelect;
- self.isChoose = self.cellModel.isSelect;
- self.cellStatusChangeBlock ? self.cellStatusChangeBlock(self.cellModel) : nil;
- }
- @end
|