// // recordEditBottomView.m // Private-x // // Created by xd h on 2025/4/8. // #import "recordEditBottomView.h" @interface recordEditBottomView () @property(nonatomic,strong) UIButton*leftButton; @property(nonatomic,strong) UIImageView*leftImageV; @property(nonatomic,strong) UILabel *leftLabel; @property(nonatomic,strong) UIButton*rightButton; @property(nonatomic,strong) UIImageView*rightImageV; @property(nonatomic,strong) UILabel *rightLabel; //@property(nonatomic,strong) UIButton*midButton; //@property(nonatomic,strong) UIImageView*midImageV; //@property(nonatomic,strong) UILabel *midLabel; @end @implementation recordEditBottomView - (id)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; self.backgroundColor = [UIColor whiteColor]; [self drawAnyView]; return self; } - (void)drawAnyView{ CGFloat curButFullWidth = SCREEN_W/2.0; _leftButton = [[UIButton alloc] init]; [_leftButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside]; _leftButton.tag = 1; [self addSubview:_leftButton]; [_leftButton mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(curButFullWidth); make.left.mas_equalTo(0); make.height.mas_equalTo(60); make.top.mas_equalTo(0); }]; _leftImageV = [[UIImageView alloc] init]; _leftImageV.image = [UIImage imageNamed:@"edit_upload_icon"]; [_leftButton addSubview:_leftImageV]; [_leftImageV mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(25); make.height.mas_equalTo(25); make.centerX.equalTo(_leftButton.mas_centerX); make.centerY.equalTo(_leftButton.mas_centerY).offset(-10); }]; _leftLabel = [[UILabel alloc] init]; _leftLabel.textColor = [UIColor hwColor:@"#0A132B"]; _leftLabel.textAlignment = NSTextAlignmentCenter; _leftLabel.font = [UIFont systemFontOfSize:12.0]; _leftLabel.text = NSLocalizedString(@"my_set_no_File_upload",nil); [_leftButton addSubview:_leftLabel]; [_leftLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(curButFullWidth); make.height.mas_equalTo(25); make.centerX.equalTo(_leftButton.mas_centerX); make.centerY.equalTo(_leftButton.mas_centerY).offset(10); }]; // _midButton = [[UIButton alloc] init]; // [_midButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside]; // _midButton.tag = 2; // [self addSubview:_midButton]; // // [_midButton mas_makeConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(curButFullWidth); // make.left.mas_equalTo(curButFullWidth); // make.height.mas_equalTo(60); // make.top.mas_equalTo(0); // }]; // // _midImageV = [[UIImageView alloc] init]; // _midImageV.image = [UIImage imageNamed:@"edit_share_icon"]; // [_midButton addSubview:_midImageV]; // // [_midImageV mas_makeConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(25); // make.height.mas_equalTo(25); // make.centerX.equalTo(_midButton.mas_centerX); // make.centerY.equalTo(_midButton.mas_centerY).offset(-10); // }]; // // _midLabel = [[UILabel alloc] init]; // _midLabel.textColor = [UIColor hwColor:@"#0A132B"]; // _midLabel.textAlignment = NSTextAlignmentCenter; // _midLabel.font = [UIFont systemFontOfSize:12.0]; // _midLabel.text = NSLocalizedString(@"common_edit_share",nil); // [_midButton addSubview:_midLabel]; // // [_midLabel mas_makeConstraints:^(MASConstraintMaker *make) { // make.width.mas_equalTo(curButFullWidth); // make.height.mas_equalTo(25); // make.centerX.equalTo(_midButton.mas_centerX); // make.centerY.equalTo(_midButton.mas_centerY).offset(10); // }]; _rightButton = [[UIButton alloc] init]; [_rightButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside]; _rightButton.tag = 3; [self addSubview:_rightButton]; [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(curButFullWidth); make.right.mas_equalTo(0); make.height.mas_equalTo(60); make.top.mas_equalTo(0); }]; _rightImageV = [[UIImageView alloc] init]; _rightImageV.image = [UIImage imageNamed:@"edit_del_icon"]; [_rightButton addSubview:_rightImageV]; [_rightImageV mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(25); make.height.mas_equalTo(25); make.centerX.equalTo(_rightButton.mas_centerX); make.centerY.equalTo(_rightButton.mas_centerY).offset(-10); }]; _rightLabel = [[UILabel alloc] init]; _rightLabel.textColor = [UIColor hwColor:@"#0A132B"]; _rightLabel.textAlignment = NSTextAlignmentCenter; _rightLabel.font = [UIFont systemFontOfSize:12.0]; _rightLabel.text = NSLocalizedString(@"File_upload_Record_delete",nil); [_rightButton addSubview:_rightLabel]; [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(curButFullWidth); make.height.mas_equalTo(25); make.centerX.equalTo(_rightButton.mas_centerX); make.centerY.equalTo(_rightButton.mas_centerY).offset(10); }]; // } - (void)didClickButFun:(UIButton*)but { NSInteger tag = but.tag; if(tag == 1){ //1.4.3 新需求 有传输任务超过200个时 不给上传 if([nasDownloadFileManager shareInstance].downLoadFileModelDataArr.count >= 200){ [[iToast makeText:NSLocalizedString(@"download_task_not_done_tip",nil)] show]; return; } } if(_didClickButtonFun){ _didClickButtonFun(tag); } } - (void)setButtonStateFunBy:(BOOL)canClick { CGFloat alpha = canClick ? 1.0 : 0.5; _leftButton.enabled = canClick; _rightButton.enabled = canClick; //_midButton.enabled = canClick; _leftButton.alpha = alpha; _rightButton.alpha = alpha; ///_midButton.alpha = alpha; } @end