ASCheckoutCommentCell.m 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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) TT_CustonTF *commentTF;
  12. @end
  13. @implementation ASCheckoutCommentCell
  14. - (void)setupSubviewS {
  15. self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
  16. UIView *backView = [[UIView alloc] init];
  17. TT_ViewRadius(backView, 4);
  18. backView.backgroundColor = [UIColor whiteColor];
  19. [self.contentView addSubview:backView];
  20. [backView mas_makeConstraints:^(MASConstraintMaker *make) {
  21. make.left.top.mas_equalTo(10);
  22. make.right.mas_equalTo(-10);
  23. make.bottom.mas_equalTo(0);
  24. }];
  25. UILabel *titleLab = [UILabel labelCreateWithText:@"Comment" font:[UIFont fontWithName:Rob_Bold size:16] textColor:Col_000];
  26. [backView addSubview:titleLab];
  27. [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.left.mas_equalTo(10);
  29. make.top.mas_equalTo(20);
  30. }];
  31. [backView addSubview:self.commentTF];
  32. [self.commentTF mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.left.mas_equalTo(10);
  34. make.right.mas_equalTo(-10);
  35. make.top.equalTo(titleLab.mas_bottom).offset(20);
  36. make.height.mas_equalTo(45);
  37. make.bottom.mas_equalTo(-20);
  38. }];
  39. }
  40. - (void)textFieldDidEndEditing:(UITextField *)textField {
  41. self.commentData.commentStr = textField.text;
  42. if(self.currencyparameterClose){
  43. self.currencyparameterClose(0,self.commentData);
  44. }
  45. }
  46. -(TT_CustonTF *)commentTF{
  47. if(!_commentTF){
  48. _commentTF = [[TT_CustonTF alloc] init];
  49. _commentTF.delegate = self;
  50. _commentTF.placeholder = @"Fill in your message";
  51. _commentTF.font = [UIFont fontWithName:Rob_Regular size:14];
  52. _commentTF.textColor = Col_000;
  53. TT_ViewBorderRadius(_commentTF, 4, 1, Col_666);
  54. }
  55. return _commentTF;
  56. }
  57. @end