123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- //
- // MyWorkFlowFooterView.m
- // smartRhino
- //
- // Created by tederen on 2019/11/7.
- // Copyright © 2019 tederen. All rights reserved.
- //
- #import "MyWorkFlowFooterView.h"
- @interface MyWorkFlowFooterView()
- //@property (nonatomic, strong) TDButton cancelButton;
- @end
- @implementation MyWorkFlowFooterView
- - (instancetype)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
- if (self) {
- [self addSubview:self.agreeView];
- [self addSubview:self.noAgreeView];
- [self addSubview:self.disscusView];
- [self addSubview:self.waitView];
- [self addSubview:self.nextAggreView];
- self.backgroundColor = [UIColor whiteColor];
- CGFloat with = self.frame.size.width/5;
- CGFloat heght = self.frame.size.height;
- self.agreeView.frame = CGRectMake(0,0,with,heght);
- self.noAgreeView.frame = CGRectMake(with,0, with, heght);
- self.waitView.frame = CGRectMake(with*2,0,with,heght);
- self.disscusView.frame = CGRectMake(with*3,0, with, heght);
- self.nextAggreView.frame = CGRectMake(with*4,0, with, heght);
- }
- return self;
- }
- - (MyWorkFlowFooterViewCell *)agreeView{
- if (!_agreeView) {
- _agreeView = [[MyWorkFlowFooterViewCell alloc]init];
- _agreeView.button.tag = 100;
- [_agreeView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
- }
- return _agreeView;
- }
- - (MyWorkFlowFooterViewCell *)noAgreeView{
- if (!_noAgreeView) {
- _noAgreeView = [[MyWorkFlowFooterViewCell alloc]init];
- _noAgreeView.button.tag = 101;
- [_noAgreeView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
-
- }
- return _noAgreeView;
- }
- - (MyWorkFlowFooterViewCell *)disscusView{
- if (!_disscusView) {
- _disscusView = [[MyWorkFlowFooterViewCell alloc]init];
- _disscusView.button.tag = 102;
- [_disscusView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
-
- }
- return _disscusView;
- }
- - (MyWorkFlowFooterViewCell *)waitView{
- if (!_waitView) {
- _waitView = [[MyWorkFlowFooterViewCell alloc]init];
- _waitView.button.tag = 103;
- [_waitView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
- }
- return _waitView;
- }
- - (MyWorkFlowFooterViewCell *)nextAggreView{
- if (!_nextAggreView) {
- _nextAggreView = [[MyWorkFlowFooterViewCell alloc]init];
- _nextAggreView.button.tag = 104;
- [_nextAggreView.button addTarget:self action:@selector(butoonhander:) forControlEvents:UIControlEventTouchDown];
-
- }
- return _nextAggreView;
- }
- - (void)butoonhander:(UIButton *)sender{
- if ([self.delegate respondsToSelector:@selector(didMyWorkFlowFooterViewBack:)]) {
- [self.delegate didMyWorkFlowFooterViewBack:sender.tag];
- return;
- }
- }
- @end
- @implementation MyWorkFlowFooterViewCell
- - (instancetype)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
- if (self) {
- [self addSubview:self.imageVIew];
- [self addSubview:self.nameLab];
- [self addSubview:self.button];
- [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.mas_equalTo(self).offset(15);
- make.centerY.equalTo(self);
- }];
- [self.imageVIew mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.nameLab.mas_left).offset(-5);
- make.centerY.equalTo(self);
- }];
- [self.button mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.top.bottom.equalTo(self);
- }];
-
-
- }
- return self;
- }
- - (UILabel *)nameLab{
- if (!_nameLab) {
- _nameLab = [UILabel new];
- _nameLab.textColor = k6;
- _nameLab.font = [UIFont systemFontOfSize:16];
-
- }
- return _nameLab;
- }
- - (UIImageView *)imageVIew{
- if (!_imageVIew) {
- _imageVIew = [UIImageView new];
- }
- return _imageVIew;
- }
- - (UIButton *)button{
- if (!_button) {
- _button = [UIButton new];
-
- }
- return _button;
- }
- @end
|