1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // ASCheckoutCommentCell.m
- // Asteria
- //
- // Created by xingyu on 2024/5/10.
- //
- #import "ASCheckoutCommentCell.h"
- @implementation ASCheckoutCommentData
- @end
- @interface ASCheckoutCommentCell()<UITextFieldDelegate>
- @property (nonatomic, strong) UIView *backView;
- @property (nonatomic, strong) UILabel *titleLab;
- @property (nonatomic, strong) TT_CustonTF *commentTF;
- @end
- @implementation ASCheckoutCommentCell
- - (void)setupSubviewS {
- self.backgroundColor = [UIColor colorWithHexString:@"#F8F8F8"];
-
- [self.contentView addSubview:self.backView];
-
- [self.backView addSubview:self.titleLab];
- [self.backView addSubview:self.commentTF];
-
- [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.mas_equalTo(10);
- make.right.mas_equalTo(-10);
- make.bottom.mas_equalTo(0);
- }];
-
- [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.top.mas_equalTo(20);
- }];
-
- [self.commentTF mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(10);
- make.right.mas_equalTo(-10);
- make.top.equalTo(self.titleLab.mas_bottom).offset(20);
- make.height.mas_equalTo(45);
- make.bottom.mas_equalTo(-20);
- }];
- }
- - (void)textFieldDidEndEditing:(UITextField *)textField {
- self.commentData.commentStr = textField.text;
- if(self.currencyparameterClose){
- self.currencyparameterClose(0,self.commentData);
- }
- }
- - (UIView *)backView {
- if (!_backView) {
- _backView = [[UIView alloc] init];
- TT_ViewRadius(_backView, 4);
- _backView.backgroundColor = [UIColor whiteColor];
- }
- return _backView;
- }
- - (UILabel *)titleLab {
- if (!_titleLab) {
- _titleLab = [UILabel labelCreateWithText:@"Comment" font:[UIFont fontWithName:Rob_Bold size:16] textColor:Col_000];
- }
- return _titleLab;
- }
- -(TT_CustonTF *)commentTF{
- if(!_commentTF){
- _commentTF = [[TT_CustonTF alloc] init];
- _commentTF.delegate = self;
- _commentTF.placeholder = @"Fill in your message";
- _commentTF.font = [UIFont fontWithName:Rob_Regular size:14];
- _commentTF.textColor = Col_000;
- TT_ViewBorderRadius(_commentTF, 4, 1, Col_666);
- }
- return _commentTF;
- }
- @end
|