// // KWMineHomeOrderHeadView.m // westkissMob // // Created by iOS on 2022/9/16. // #import "KWMineHomeOrderHeadView.h" //#import "" @interface KWMineHomeOrderHeadView () //@property (nonatomic, strong) UIView *bgV; @property (nonatomic, strong) UILabel *titleLB; @property (nonatomic, strong) UILabel *rightLB; @property (nonatomic, strong) UIImageView *moreV; @property (nonatomic, strong) UIButton *moreBt; @end @implementation KWMineHomeOrderHeadView - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithReuseIdentifier:reuseIdentifier]; if (self) { [self configSubV]; } return self; } - (void)configSubV { self.contentView.backgroundColor = UIColor.whiteColor; [self.contentView addSubview:self.titleLB]; [self.contentView addSubview:self.rightLB]; [self.contentView addSubview:self.moreV]; [self.contentView addSubview:self.moreBt]; [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(20); make.top.equalTo(self.contentView).offset(20); make.bottom.equalTo(self.contentView).offset(-20); make.height.equalTo(@20); }]; [self.rightLB mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.titleLB.mas_right).offset(10); make.centerY.equalTo(self.titleLB); make.width.equalTo(@90); make.height.equalTo(@20); }]; [self.moreV mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.contentView).offset(-25); make.left.equalTo(self.rightLB.mas_right).offset(5); make.centerY.equalTo(self.titleLB); make.width.height.equalTo(@13); }]; [self.moreBt mas_makeConstraints:^(MASConstraintMaker *make) { make.height.equalTo(@40); make.centerY.equalTo(self.rightLB); make.left.equalTo(self.rightLB); make.right.equalTo(self.moreV); }]; } - (UIImageView *)moreV { if (!_moreV) { UIImageView *imgV = [[UIImageView alloc] init]; imgV.image = [UIImage imageNamed:@"uc_more"]; imgV.contentMode = UIViewContentModeScaleAspectFit; _moreV = imgV; } return _moreV; } - (UILabel *)titleLB { if (!_titleLB) { UILabel *lb = [[UILabel alloc] init]; lb.font = [UIFont fontWithName:Rob_Bold size:16]; lb.textColor = [UIColor blackColor]; lb.backgroundColor = [UIColor clearColor]; lb.text = @"ORDERS"; _titleLB = lb; } return _titleLB; } - (UILabel *)rightLB { if (!_rightLB) { UILabel *lb = [[UILabel alloc] init]; lb.font = [UIFont fontWithName:Rob_Regular size:14]; lb.textColor = _0B0B0B; lb.textAlignment = NSTextAlignmentRight; lb.backgroundColor = [UIColor clearColor]; lb.text = @"All Orders"; _rightLB = lb; } return _rightLB; } - (UIButton *)moreBt { if (!_moreBt) { _moreBt = [UIButton buttonWithType:UIButtonTypeCustom]; [_moreBt addTarget:self action:@selector(moreBtAction) forControlEvents:UIControlEventTouchUpInside]; } return _moreBt; } - (void)moreBtAction { if (self.toAllBlock) { self.toAllBlock(); } } @end