ASCheckoutCommentCell.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // ASCheckoutCommentCell.m
  3. // Asteria
  4. //
  5. // Created by xingyu on 2024/5/10.
  6. //
  7. #import "ASCheckoutCommentCell.h"
  8. @implementation ASCheckoutCommentData
  9. @end
  10. @interface ASCheckoutCommentCell()<UITextFieldDelegate>
  11. @property (nonatomic, strong) UIView *backView;
  12. @property (nonatomic, strong) UILabel *titleLab;
  13. @property (nonatomic, strong) TT_CustonTF *commentTF;
  14. @end
  15. @implementation ASCheckoutCommentCell
  16. - (void)setupSubviewS {
  17. self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
  18. [self.contentView addSubview:self.backView];
  19. [self.backView addSubview:self.titleLab];
  20. [self.backView addSubview:self.commentTF];
  21. [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.left.top.mas_equalTo(10);
  23. make.right.mas_equalTo(-10);
  24. make.bottom.mas_equalTo(0);
  25. }];
  26. [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.left.mas_equalTo(10);
  28. make.top.mas_equalTo(20);
  29. }];
  30. [self.commentTF mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.left.mas_equalTo(10);
  32. make.right.mas_equalTo(-10);
  33. make.top.equalTo(self.titleLab.mas_bottom).offset(20);
  34. make.height.mas_equalTo(45);
  35. make.bottom.mas_equalTo(-20);
  36. }];
  37. }
  38. - (void)textFieldDidEndEditing:(UITextField *)textField {
  39. self.commentData.commentStr = textField.text;
  40. if(self.currencyparameterClose){
  41. self.currencyparameterClose(0,self.commentData);
  42. }
  43. }
  44. - (UIView *)backView {
  45. if (!_backView) {
  46. _backView = [[UIView alloc] init];
  47. TT_ViewRadius(_backView, 4);
  48. _backView.backgroundColor = [UIColor whiteColor];
  49. }
  50. return _backView;
  51. }
  52. - (UILabel *)titleLab {
  53. if (!_titleLab) {
  54. _titleLab = [UILabel labelCreateWithText:@"Comment" font:[UIFont fontWithName:Rob_Bold size:16] textColor:Col_000];
  55. }
  56. return _titleLab;
  57. }
  58. -(TT_CustonTF *)commentTF{
  59. if(!_commentTF){
  60. _commentTF = [[TT_CustonTF alloc] init];
  61. _commentTF.delegate = self;
  62. _commentTF.placeholder = @"Fill in your message";
  63. _commentTF.font = [UIFont fontWithName:Rob_Regular size:14];
  64. _commentTF.textColor = Col_000;
  65. TT_ViewBorderRadius(_commentTF, 4, 1, Col_666);
  66. }
  67. return _commentTF;
  68. }
  69. @end