| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- //
- // DepositAmountCell.m
- // IBOSS
- //
- // Created by 关宏厚 on 2020/7/24.
- // Copyright © 2020 elongtian. All rights reserved.
- //
- #import "PaymentMethodCell.h"
- @interface PaymentMethodCell()<UITextFieldDelegate>{
-
- }
- @end
- @implementation PaymentMethodCell
- - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- }
- return self;
- }
- - (void)parsePaymentMethod:(PayTypeModel *) model
- {
- UILabel *lbPaymentNameTitle = [[UILabel alloc] init];
- lbPaymentNameTitle.frame = CGRectMake(10, 10,0, 0);
- lbPaymentNameTitle.text = @"收款名称:";
- lbPaymentNameTitle.font =[UIFont systemFontOfSize:14];
- [lbPaymentNameTitle sizeToFit];
- [self.contentView addSubview:lbPaymentNameTitle];
-
- UILabel *lbPaymentName = [[UILabel alloc] init];
- lbPaymentName.frame = CGRectMake(CGRectGetMaxX(lbPaymentNameTitle.frame)+5, 10,0, 0);
- lbPaymentName.text = model.settlementTypeName;
- lbPaymentName.font =[UIFont systemFontOfSize:14];
- [lbPaymentName sizeToFit];
- [self.contentView addSubview:lbPaymentName];
-
- UILabel *lblAmountInfo = [[UILabel alloc] init];
- lblAmountInfo.frame = CGRectMake(10,CGRectGetMaxY(lbPaymentNameTitle.frame)+15,0, 0);
- lblAmountInfo.text = @"收款金额:";
- lblAmountInfo.font =[UIFont systemFontOfSize:14];
- [lblAmountInfo sizeToFit];
- [self.contentView addSubview:lblAmountInfo];
-
- UITextField *txtAmountInfo = [[UITextField alloc] init];
- txtAmountInfo.frame = CGRectMake(CGRectGetMaxX(lblAmountInfo.frame)+5, CGRectGetMaxY(lbPaymentNameTitle.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lblAmountInfo.frame)+5),18);
-
- txtAmountInfo.font =[UIFont systemFontOfSize:14];
- txtAmountInfo.tag = 1001;
- txtAmountInfo.keyboardType=UIKeyboardTypeDecimalPad;
- txtAmountInfo.delegate = self;
- txtAmountInfo.text=model.receivableSum;
- txtAmountInfo.placeholder = @"请输入金额";
- [self.contentView addSubview:txtAmountInfo];
-
- UILabel *lbRemark = [[UILabel alloc] init];
- lbRemark.frame = CGRectMake(10,CGRectGetMaxY(lblAmountInfo.frame)+15,0, 0);
- lbRemark.text = @"备 注:";
- lbRemark.font =[UIFont systemFontOfSize:14];
- [lbRemark sizeToFit];
- [self.contentView addSubview:lbRemark];
-
- UITextField *tfRemark = [[UITextField alloc] init];
- tfRemark.frame = CGRectMake(CGRectGetMaxX(lbRemark.frame)+5, CGRectGetMaxY(lblAmountInfo.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lbRemark.frame)+5),18);
- tfRemark.tag = 1002;
- tfRemark.font =[UIFont systemFontOfSize:14];
- tfRemark.delegate = self;
- tfRemark.text=model.remarks;
- tfRemark.placeholder = @"请输入备注";
-
- [self.contentView addSubview:tfRemark];
-
- UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(lbRemark.frame)+5, SCREENWIDTH, 1)];
- line.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:line];
-
- }
- /**
- textfield结束编辑回调函数
-
- @param field <#field description#>
- */
- - (void) textFieldDidEndEditing:(UITextField *) field
- {
- [self endEditing:YES];
- if(field.tag == 1001){
- [_cellDelegate update:(int)_position flag:1 text:field.text];
- }
- else{
- [_cellDelegate update:(int)_position flag:2 text:field.text];
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- }
- @end
|