123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- //
- // recordEditBottomView.m
- // 双子星云手机
- //
- // 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
|