// // ASSignDayView.m // Asteria // // Created by iOS on 2023/5/16. // #import "ASSignDayView.h" @implementation ASSignDayView - (void)setDay:(NSInteger)day st:(NSInteger)isSgin { self.dayLb.text = [NSString stringWithFormat:@"D%ld", day]; if (isSgin == 2) { self.dayLb.textColor = Col_000; self.statusImgV.image = [UIImage imageNamed:@"sd_signed"]; } else { if (isSgin == 1) { self.dayLb.textColor = Col_666; self.statusImgV.image = [UIImage imageNamed:@"sd_waitSign"]; } else { self.dayLb.textColor = Col_999; self.statusImgV.image = [UIImage imageNamed:@"sd_tomorrowSign"]; } } } - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self configSubV]; } return self; } - (void)configSubV { self.backgroundColor = UIColor.clearColor; [self addSubview:self.dayLb]; [self addSubview:self.statusImgV]; [self.dayLb mas_makeConstraints:^(MASConstraintMaker *make) { make.top.leading.trailing.equalTo(self); make.width.equalTo(@30); make.height.equalTo(@14); }]; [self.statusImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.equalTo(@11); make.bottom.equalTo(self); make.centerX.equalTo(self); make.top.equalTo(self.dayLb.mas_bottom).offset(8); }]; } - (UILabel *)dayLb { if (!_dayLb) { UILabel *lb = [UILabel baseLb]; lb.font = [UIFont fontWithName:Rob_Regular size:12]; lb.textColor = Col_000; lb.textAlignment = NSTextAlignmentCenter; _dayLb = lb; } return _dayLb; } - (UIImageView *)statusImgV { if (!_statusImgV) { UIImageView *img = [UIImageView baseImgV]; _statusImgV = img; } return _statusImgV; } @end