recordEditBottomView.m 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. //
  2. // recordEditBottomView.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2025/4/8.
  6. //
  7. #import "recordEditBottomView.h"
  8. @interface recordEditBottomView ()
  9. @property(nonatomic,strong) UIButton*leftButton;
  10. @property(nonatomic,strong) UIImageView*leftImageV;
  11. @property(nonatomic,strong) UILabel *leftLabel;
  12. @property(nonatomic,strong) UIButton*rightButton;
  13. @property(nonatomic,strong) UIImageView*rightImageV;
  14. @property(nonatomic,strong) UILabel *rightLabel;
  15. //@property(nonatomic,strong) UIButton*midButton;
  16. //@property(nonatomic,strong) UIImageView*midImageV;
  17. //@property(nonatomic,strong) UILabel *midLabel;
  18. @end
  19. @implementation recordEditBottomView
  20. - (id)initWithFrame:(CGRect)frame{
  21. self = [super initWithFrame:frame];
  22. self.backgroundColor = [UIColor whiteColor];
  23. [self drawAnyView];
  24. return self;
  25. }
  26. - (void)drawAnyView{
  27. CGFloat curButFullWidth = SCREEN_W/2.0;
  28. _leftButton = [[UIButton alloc] init];
  29. [_leftButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  30. _leftButton.tag = 1;
  31. [self addSubview:_leftButton];
  32. [_leftButton mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.width.mas_equalTo(curButFullWidth);
  34. make.left.mas_equalTo(0);
  35. make.height.mas_equalTo(60);
  36. make.top.mas_equalTo(0);
  37. }];
  38. _leftImageV = [[UIImageView alloc] init];
  39. _leftImageV.image = [UIImage imageNamed:@"edit_upload_icon"];
  40. [_leftButton addSubview:_leftImageV];
  41. [_leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.width.mas_equalTo(25);
  43. make.height.mas_equalTo(25);
  44. make.centerX.equalTo(_leftButton.mas_centerX);
  45. make.centerY.equalTo(_leftButton.mas_centerY).offset(-10);
  46. }];
  47. _leftLabel = [[UILabel alloc] init];
  48. _leftLabel.textColor = [UIColor hwColor:@"#0A132B"];
  49. _leftLabel.textAlignment = NSTextAlignmentCenter;
  50. _leftLabel.font = [UIFont systemFontOfSize:12.0];
  51. _leftLabel.text = NSLocalizedString(@"my_set_no_File_upload",nil);
  52. [_leftButton addSubview:_leftLabel];
  53. [_leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  54. make.width.mas_equalTo(curButFullWidth);
  55. make.height.mas_equalTo(25);
  56. make.centerX.equalTo(_leftButton.mas_centerX);
  57. make.centerY.equalTo(_leftButton.mas_centerY).offset(10);
  58. }];
  59. // _midButton = [[UIButton alloc] init];
  60. // [_midButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  61. // _midButton.tag = 2;
  62. // [self addSubview:_midButton];
  63. //
  64. // [_midButton mas_makeConstraints:^(MASConstraintMaker *make) {
  65. // make.width.mas_equalTo(curButFullWidth);
  66. // make.left.mas_equalTo(curButFullWidth);
  67. // make.height.mas_equalTo(60);
  68. // make.top.mas_equalTo(0);
  69. // }];
  70. //
  71. // _midImageV = [[UIImageView alloc] init];
  72. // _midImageV.image = [UIImage imageNamed:@"edit_share_icon"];
  73. // [_midButton addSubview:_midImageV];
  74. //
  75. // [_midImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  76. // make.width.mas_equalTo(25);
  77. // make.height.mas_equalTo(25);
  78. // make.centerX.equalTo(_midButton.mas_centerX);
  79. // make.centerY.equalTo(_midButton.mas_centerY).offset(-10);
  80. // }];
  81. //
  82. // _midLabel = [[UILabel alloc] init];
  83. // _midLabel.textColor = [UIColor hwColor:@"#0A132B"];
  84. // _midLabel.textAlignment = NSTextAlignmentCenter;
  85. // _midLabel.font = [UIFont systemFontOfSize:12.0];
  86. // _midLabel.text = NSLocalizedString(@"common_edit_share",nil);
  87. // [_midButton addSubview:_midLabel];
  88. //
  89. // [_midLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  90. // make.width.mas_equalTo(curButFullWidth);
  91. // make.height.mas_equalTo(25);
  92. // make.centerX.equalTo(_midButton.mas_centerX);
  93. // make.centerY.equalTo(_midButton.mas_centerY).offset(10);
  94. // }];
  95. _rightButton = [[UIButton alloc] init];
  96. [_rightButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
  97. _rightButton.tag = 3;
  98. [self addSubview:_rightButton];
  99. [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
  100. make.width.mas_equalTo(curButFullWidth);
  101. make.right.mas_equalTo(0);
  102. make.height.mas_equalTo(60);
  103. make.top.mas_equalTo(0);
  104. }];
  105. _rightImageV = [[UIImageView alloc] init];
  106. _rightImageV.image = [UIImage imageNamed:@"edit_del_icon"];
  107. [_rightButton addSubview:_rightImageV];
  108. [_rightImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  109. make.width.mas_equalTo(25);
  110. make.height.mas_equalTo(25);
  111. make.centerX.equalTo(_rightButton.mas_centerX);
  112. make.centerY.equalTo(_rightButton.mas_centerY).offset(-10);
  113. }];
  114. _rightLabel = [[UILabel alloc] init];
  115. _rightLabel.textColor = [UIColor hwColor:@"#0A132B"];
  116. _rightLabel.textAlignment = NSTextAlignmentCenter;
  117. _rightLabel.font = [UIFont systemFontOfSize:12.0];
  118. _rightLabel.text = NSLocalizedString(@"File_upload_Record_delete",nil);
  119. [_rightButton addSubview:_rightLabel];
  120. [_rightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  121. make.width.mas_equalTo(curButFullWidth);
  122. make.height.mas_equalTo(25);
  123. make.centerX.equalTo(_rightButton.mas_centerX);
  124. make.centerY.equalTo(_rightButton.mas_centerY).offset(10);
  125. }];
  126. //
  127. }
  128. - (void)didClickButFun:(UIButton*)but
  129. {
  130. NSInteger tag = but.tag;
  131. if(tag == 1){
  132. //1.4.3 新需求 有传输任务超过200个时 不给上传
  133. if([nasDownloadFileManager shareInstance].downLoadFileModelDataArr.count >= 200){
  134. [[iToast makeText:NSLocalizedString(@"download_task_not_done_tip",nil)] show];
  135. return;
  136. }
  137. }
  138. if(_didClickButtonFun){
  139. _didClickButtonFun(tag);
  140. }
  141. }
  142. - (void)setButtonStateFunBy:(BOOL)canClick
  143. {
  144. CGFloat alpha = canClick ? 1.0 : 0.5;
  145. _leftButton.enabled = canClick;
  146. _rightButton.enabled = canClick;
  147. //_midButton.enabled = canClick;
  148. _leftButton.alpha = alpha;
  149. _rightButton.alpha = alpha;
  150. ///_midButton.alpha = alpha;
  151. }
  152. @end