KWMineHomeOrderHeadView.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // KWMineHomeOrderHeadView.m
  3. // westkissMob
  4. //
  5. // Created by iOS on 2022/9/16.
  6. //
  7. #import "KWMineHomeOrderHeadView.h"
  8. //#import ""
  9. @interface KWMineHomeOrderHeadView ()
  10. //@property (nonatomic, strong) UIView *bgV;
  11. @property (nonatomic, strong) UILabel *titleLB;
  12. @property (nonatomic, strong) UILabel *rightLB;
  13. @property (nonatomic, strong) UIImageView *moreV;
  14. @property (nonatomic, strong) UIButton *moreBt;
  15. @end
  16. @implementation KWMineHomeOrderHeadView
  17. - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
  18. self = [super initWithReuseIdentifier:reuseIdentifier];
  19. if (self) {
  20. [self configSubV];
  21. }
  22. return self;
  23. }
  24. - (void)configSubV {
  25. self.contentView.backgroundColor = UIColor.whiteColor;
  26. [self.contentView addSubview:self.titleLB];
  27. [self.contentView addSubview:self.rightLB];
  28. [self.contentView addSubview:self.moreV];
  29. [self.contentView addSubview:self.moreBt];
  30. [self.titleLB mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.left.equalTo(self.contentView).offset(20);
  32. make.top.equalTo(self.contentView).offset(20);
  33. make.bottom.equalTo(self.contentView).offset(-20);
  34. make.height.equalTo(@20);
  35. }];
  36. [self.rightLB mas_makeConstraints:^(MASConstraintMaker *make) {
  37. make.left.equalTo(self.titleLB.mas_right).offset(10);
  38. make.centerY.equalTo(self.titleLB);
  39. make.width.equalTo(@90);
  40. make.height.equalTo(@20);
  41. }];
  42. [self.moreV mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.right.equalTo(self.contentView).offset(-25);
  44. make.left.equalTo(self.rightLB.mas_right).offset(5);
  45. make.centerY.equalTo(self.titleLB);
  46. make.width.height.equalTo(@13);
  47. }];
  48. [self.moreBt mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.height.equalTo(@40);
  50. make.centerY.equalTo(self.rightLB);
  51. make.left.equalTo(self.rightLB);
  52. make.right.equalTo(self.moreV);
  53. }];
  54. }
  55. - (UIImageView *)moreV {
  56. if (!_moreV) {
  57. UIImageView *imgV = [[UIImageView alloc] init];
  58. imgV.image = [UIImage imageNamed:@"uc_more"];
  59. imgV.contentMode = UIViewContentModeScaleAspectFit;
  60. _moreV = imgV;
  61. }
  62. return _moreV;
  63. }
  64. - (UILabel *)titleLB {
  65. if (!_titleLB) {
  66. UILabel *lb = [[UILabel alloc] init];
  67. lb.font = [UIFont fontWithName:Rob_Bold size:16];
  68. lb.textColor = [UIColor blackColor];
  69. lb.backgroundColor = [UIColor clearColor];
  70. lb.text = @"ORDERS";
  71. _titleLB = lb;
  72. }
  73. return _titleLB;
  74. }
  75. - (UILabel *)rightLB {
  76. if (!_rightLB) {
  77. UILabel *lb = [[UILabel alloc] init];
  78. lb.font = [UIFont fontWithName:Rob_Regular size:14];
  79. lb.textColor = _0B0B0B;
  80. lb.textAlignment = NSTextAlignmentRight;
  81. lb.backgroundColor = [UIColor clearColor];
  82. lb.text = @"All Orders";
  83. _rightLB = lb;
  84. }
  85. return _rightLB;
  86. }
  87. - (UIButton *)moreBt {
  88. if (!_moreBt) {
  89. _moreBt = [UIButton buttonWithType:UIButtonTypeCustom];
  90. [_moreBt addTarget:self action:@selector(moreBtAction) forControlEvents:UIControlEventTouchUpInside];
  91. }
  92. return _moreBt;
  93. }
  94. - (void)moreBtAction {
  95. if (self.toAllBlock) {
  96. self.toAllBlock();
  97. }
  98. }
  99. @end