| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- //
- // UseStorageCell.m
- // IBOSSmini
- //
- // Created by ssl on 2018/3/1.
- // Copyright © 2018年 elongtian. All rights reserved.
- //
- #import "UseStorageCell.h"
- @interface UseStorageCell()<UITextFieldDelegate>{
- UITextField *_textField;
- }
- @end
- @implementation UseStorageCell
- - (void)parseEarnestInfo:(UseStorageModel *) model{
- CGFloat lblx=20;
- UILabel *lbSettlementType = [[UILabel alloc] init];
- lbSettlementType.frame = CGRectMake(lblx, 10,0, 0);
- lbSettlementType.text = @"结算方式:";
- lbSettlementType.font =[UIFont systemFontOfSize:14];
- [lbSettlementType sizeToFit];
- [self.contentView addSubview:lbSettlementType];
-
- UILabel *lbSettlementTypeName = [[UILabel alloc] init];
- lbSettlementTypeName.frame = CGRectMake(CGRectGetMaxX(lbSettlementType.frame)+5, 10,0, 0);
- lbSettlementTypeName.text = model.settlementTypeName == nil ? @" ":model.settlementTypeName;
- lbSettlementTypeName.font =[UIFont systemFontOfSize:14];
- [lbSettlementTypeName sizeToFit];
- [self.contentView addSubview:lbSettlementTypeName];
-
- UILabel *lbPrestoreSum = [[UILabel alloc] init];
- lbPrestoreSum.frame = CGRectMake(lblx,CGRectGetMaxY(lbSettlementType.frame)+15,0, 0);
- lbPrestoreSum.text = @"预存金额:";
- lbPrestoreSum.font =[UIFont systemFontOfSize:14];
- [lbPrestoreSum sizeToFit];
- [self.contentView addSubview:lbPrestoreSum];
-
- UILabel *tfPrestoreSum = [[UILabel alloc] init];
- tfPrestoreSum.frame = CGRectMake(CGRectGetMaxX(lbPrestoreSum.frame)+5, CGRectGetMaxY(lbSettlementTypeName.frame)+15,0, 0);
- tfPrestoreSum.text = model.prestoreSum;
- tfPrestoreSum.font =[UIFont systemFontOfSize:14];
- [tfPrestoreSum sizeToFit];
- [self.contentView addSubview:tfPrestoreSum];
-
-
-
- UILabel *lbFreezesum = [[UILabel alloc] init];
- lbFreezesum.frame = CGRectMake(lblx,CGRectGetMaxY(lbPrestoreSum.frame)+15,0, 0);
- lbFreezesum.text = @"冻结金额:";
- lbFreezesum.font =[UIFont systemFontOfSize:14];
- [lbFreezesum sizeToFit];
- [self.contentView addSubview:lbFreezesum];
-
- UILabel *tfFreezesum = [[UILabel alloc] init];
- tfFreezesum.frame = CGRectMake(CGRectGetMaxX(lbFreezesum.frame)+5, CGRectGetMaxY(tfPrestoreSum.frame)+15,0, 0);
- tfFreezesum.text = model.freezeSum;
- tfFreezesum.font =[UIFont systemFontOfSize:14];
- [tfFreezesum sizeToFit];
- [self.contentView addSubview:tfFreezesum];
-
- UILabel *lbWaitauditsum = [[UILabel alloc] init];
- lbWaitauditsum.frame = CGRectMake(lblx,CGRectGetMaxY(lbFreezesum.frame)+15,0, 0);
- lbWaitauditsum.text = @"取待审核:";
- lbWaitauditsum.font =[UIFont systemFontOfSize:14];
- [lbWaitauditsum sizeToFit];
- [self.contentView addSubview:lbWaitauditsum];
-
- UILabel *tfWaitauditsum = [[UILabel alloc] init];
- tfWaitauditsum.frame = CGRectMake(CGRectGetMaxX(lbFreezesum.frame)+5, CGRectGetMaxY(tfFreezesum.frame)+15,0, 0);
- tfWaitauditsum.text = model.waitAuditSum;
- tfWaitauditsum.font =[UIFont systemFontOfSize:14];
- [tfWaitauditsum sizeToFit];
- [self.contentView addSubview:tfWaitauditsum];
-
-
- UILabel *lbWaitsetprestore = [[UILabel alloc] init];
- lbWaitsetprestore.frame = CGRectMake(lblx,CGRectGetMaxY(lbWaitauditsum.frame)+15,0, 0);
- lbWaitsetprestore.text = @"存待审核:";
- lbWaitsetprestore.font =[UIFont systemFontOfSize:14];
- [lbWaitsetprestore sizeToFit];
- [self.contentView addSubview:lbWaitsetprestore];
-
- UILabel *tfWaitsetprestore = [[UILabel alloc] init];
- tfWaitsetprestore.frame = CGRectMake(CGRectGetMaxX(lbWaitsetprestore.frame)+5, CGRectGetMaxY(tfWaitauditsum.frame)+15,0, 0);
- tfWaitsetprestore.text = model.waitSetPrestore;
- tfWaitsetprestore.font =[UIFont systemFontOfSize:14];
- [tfWaitsetprestore sizeToFit];
- [self.contentView addSubview:tfWaitsetprestore];
-
-
- UILabel *lbMoneyInformation = [[UILabel alloc] init];
- lbMoneyInformation.frame = CGRectMake(lblx,CGRectGetMaxY(lbWaitsetprestore.frame)+15,0, 0);
- lbMoneyInformation.text = @"款项信息:";
- lbMoneyInformation.font =[UIFont systemFontOfSize:14];
- [lbMoneyInformation sizeToFit];
- [self.contentView addSubview:lbMoneyInformation];
-
- UITextField *tfMoneyInformation = [[UITextField alloc] init];
- tfMoneyInformation.frame = CGRectMake(CGRectGetMaxX(lbMoneyInformation.frame)+5, CGRectGetMaxY(tfWaitsetprestore.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lbMoneyInformation.frame)+5),18);
- tfMoneyInformation.text = model.earnestSum;
- tfMoneyInformation.font =[UIFont systemFontOfSize:14];
- tfMoneyInformation.tag = 1001;
- tfMoneyInformation.keyboardType=UIKeyboardTypeDecimalPad;
- tfMoneyInformation.delegate = self;
- [tfMoneyInformation addTarget:self action:@selector(searchTextFieldChangeAction:) forControlEvents:UIControlEventEditingChanged];
- tfMoneyInformation.placeholder = @"请输入款项信息";
- [self.contentView addSubview:tfMoneyInformation];
-
- UILabel *lbRemark = [[UILabel alloc] init];
- lbRemark.frame = CGRectMake(lblx,CGRectGetMaxY(lbMoneyInformation.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(tfMoneyInformation.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lbRemark.frame)+5),18);
- tfRemark.text = model.remarks;
- tfRemark.tag = 1002;
- tfRemark.font =[UIFont systemFontOfSize:14];
- tfRemark.delegate = self;
- tfRemark.placeholder = @"请输入备注";
- [tfRemark addTarget:self action:@selector(searchTextFieldChangeAction:) forControlEvents:UIControlEventEditingChanged];
- [self.contentView addSubview:tfRemark];
-
- UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(lbRemark.frame), SCREENWIDTH, 1)];
- line.backgroundColor = LineBackgroundColor;
- [self.contentView addSubview:line];
- }
- - (void)textFieldDidBeginEditing:(UITextField *)textField{
- _textField = textField;
- }
- - (void)searchTextFieldChangeAction: (id)sender
- {
- if(_textField.tag == 1001){
- [_cellDelegate update:(int)_position flag:1 text:_textField.text];
- }else{
- [_cellDelegate update:(int)_position flag:2 text:_textField.text];
- }
-
- }
- @end
|