MyWorkFlowFooterView.m 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. //
  2. // MyWorkFlowFooterView.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/7.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "MyWorkFlowFooterView.h"
  9. @interface MyWorkFlowFooterView()
  10. //@property (nonatomic, strong) TDButton cancelButton;
  11. @end
  12. @implementation MyWorkFlowFooterView
  13. - (instancetype)initWithFrame:(CGRect)frame{
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. [self addSubview:self.agreeView];
  17. [self addSubview:self.noAgreeView];
  18. [self addSubview:self.disscusView];
  19. [self addSubview:self.waitView];
  20. [self addSubview:self.nextAggreView];
  21. self.backgroundColor = [UIColor whiteColor];
  22. CGFloat with = self.frame.size.width/5;
  23. CGFloat heght = self.frame.size.height;
  24. self.agreeView.frame = CGRectMake(0,0,with,heght);
  25. self.noAgreeView.frame = CGRectMake(with,0, with, heght);
  26. self.waitView.frame = CGRectMake(with*2,0,with,heght);
  27. self.disscusView.frame = CGRectMake(with*3,0, with, heght);
  28. self.nextAggreView.frame = CGRectMake(with*4,0, with, heght);
  29. }
  30. return self;
  31. }
  32. - (MyWorkFlowFooterViewCell *)agreeView{
  33. if (!_agreeView) {
  34. _agreeView = [[MyWorkFlowFooterViewCell alloc]init];
  35. _agreeView.button.tag = 100;
  36. [_agreeView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
  37. }
  38. return _agreeView;
  39. }
  40. - (MyWorkFlowFooterViewCell *)noAgreeView{
  41. if (!_noAgreeView) {
  42. _noAgreeView = [[MyWorkFlowFooterViewCell alloc]init];
  43. _noAgreeView.button.tag = 101;
  44. [_noAgreeView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
  45. }
  46. return _noAgreeView;
  47. }
  48. - (MyWorkFlowFooterViewCell *)disscusView{
  49. if (!_disscusView) {
  50. _disscusView = [[MyWorkFlowFooterViewCell alloc]init];
  51. _disscusView.button.tag = 102;
  52. [_disscusView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
  53. }
  54. return _disscusView;
  55. }
  56. - (MyWorkFlowFooterViewCell *)waitView{
  57. if (!_waitView) {
  58. _waitView = [[MyWorkFlowFooterViewCell alloc]init];
  59. _waitView.button.tag = 103;
  60. [_waitView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
  61. }
  62. return _waitView;
  63. }
  64. - (MyWorkFlowFooterViewCell *)nextAggreView{
  65. if (!_nextAggreView) {
  66. _nextAggreView = [[MyWorkFlowFooterViewCell alloc]init];
  67. _nextAggreView.button.tag = 104;
  68. [_nextAggreView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
  69. }
  70. return _nextAggreView;
  71. }
  72. - (void)butoonhander:(UIButton *)sender{
  73. if ([self.delegate respondsToSelector:@selector(didMyWorkFlowFooterViewBack:)]) {
  74. [self.delegate didMyWorkFlowFooterViewBack:sender.tag];
  75. return;
  76. }
  77. }
  78. @end
  79. @implementation MyWorkFlowFooterViewCell
  80. - (instancetype)initWithFrame:(CGRect)frame{
  81. self = [super initWithFrame:frame];
  82. if (self) {
  83. [self addSubview:self.imageVIew];
  84. [self addSubview:self.nameLab];
  85. [self addSubview:self.button];
  86. [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
  87. make.centerX.mas_equalTo(self).offset(15);
  88. make.centerY.equalTo(self);
  89. }];
  90. [self.imageVIew mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.right.equalTo(self.nameLab.mas_left).offset(-5);
  92. make.centerY.equalTo(self);
  93. }];
  94. [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
  95. make.left.right.top.bottom.equalTo(self);
  96. }];
  97. }
  98. return self;
  99. }
  100. - (UILabel *)nameLab{
  101. if (!_nameLab) {
  102. _nameLab = [UILabel new];
  103. _nameLab.textColor = k6;
  104. _nameLab.font = [UIFont systemFontOfSize:16];
  105. }
  106. return _nameLab;
  107. }
  108. - (UIImageView *)imageVIew{
  109. if (!_imageVIew) {
  110. _imageVIew = [UIImageView new];
  111. }
  112. return _imageVIew;
  113. }
  114. - (UIButton *)button{
  115. if (!_button) {
  116. _button = [UIButton new];
  117. }
  118. return _button;
  119. }
  120. @end