UseStorageCell.m 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. //
  2. // UseStorageCell.m
  3. // IBOSSmini
  4. //
  5. // Created by ssl on 2018/3/1.
  6. // Copyright © 2018年 elongtian. All rights reserved.
  7. //
  8. #import "UseStorageCell.h"
  9. @interface UseStorageCell()<UITextFieldDelegate>{
  10. UITextField *_textField;
  11. }
  12. @end
  13. @implementation UseStorageCell
  14. - (void)parseEarnestInfo:(UseStorageModel *) model{
  15. CGFloat lblx=20;
  16. UILabel *lbSettlementType = [[UILabel alloc] init];
  17. lbSettlementType.frame = CGRectMake(lblx, 10,0, 0);
  18. lbSettlementType.text = @"结算方式:";
  19. lbSettlementType.font =[UIFont systemFontOfSize:14];
  20. [lbSettlementType sizeToFit];
  21. [self.contentView addSubview:lbSettlementType];
  22. UILabel *lbSettlementTypeName = [[UILabel alloc] init];
  23. lbSettlementTypeName.frame = CGRectMake(CGRectGetMaxX(lbSettlementType.frame)+5, 10,0, 0);
  24. lbSettlementTypeName.text = model.settlementTypeName == nil ? @" ":model.settlementTypeName;
  25. lbSettlementTypeName.font =[UIFont systemFontOfSize:14];
  26. [lbSettlementTypeName sizeToFit];
  27. [self.contentView addSubview:lbSettlementTypeName];
  28. UILabel *lbPrestoreSum = [[UILabel alloc] init];
  29. lbPrestoreSum.frame = CGRectMake(lblx,CGRectGetMaxY(lbSettlementType.frame)+15,0, 0);
  30. lbPrestoreSum.text = @"预存金额:";
  31. lbPrestoreSum.font =[UIFont systemFontOfSize:14];
  32. [lbPrestoreSum sizeToFit];
  33. [self.contentView addSubview:lbPrestoreSum];
  34. UILabel *tfPrestoreSum = [[UILabel alloc] init];
  35. tfPrestoreSum.frame = CGRectMake(CGRectGetMaxX(lbPrestoreSum.frame)+5, CGRectGetMaxY(lbSettlementTypeName.frame)+15,0, 0);
  36. tfPrestoreSum.text = model.prestoreSum;
  37. tfPrestoreSum.font =[UIFont systemFontOfSize:14];
  38. [tfPrestoreSum sizeToFit];
  39. [self.contentView addSubview:tfPrestoreSum];
  40. UILabel *lbFreezesum = [[UILabel alloc] init];
  41. lbFreezesum.frame = CGRectMake(lblx,CGRectGetMaxY(lbPrestoreSum.frame)+15,0, 0);
  42. lbFreezesum.text = @"冻结金额:";
  43. lbFreezesum.font =[UIFont systemFontOfSize:14];
  44. [lbFreezesum sizeToFit];
  45. [self.contentView addSubview:lbFreezesum];
  46. UILabel *tfFreezesum = [[UILabel alloc] init];
  47. tfFreezesum.frame = CGRectMake(CGRectGetMaxX(lbFreezesum.frame)+5, CGRectGetMaxY(tfPrestoreSum.frame)+15,0, 0);
  48. tfFreezesum.text = model.freezeSum;
  49. tfFreezesum.font =[UIFont systemFontOfSize:14];
  50. [tfFreezesum sizeToFit];
  51. [self.contentView addSubview:tfFreezesum];
  52. UILabel *lbWaitauditsum = [[UILabel alloc] init];
  53. lbWaitauditsum.frame = CGRectMake(lblx,CGRectGetMaxY(lbFreezesum.frame)+15,0, 0);
  54. lbWaitauditsum.text = @"取待审核:";
  55. lbWaitauditsum.font =[UIFont systemFontOfSize:14];
  56. [lbWaitauditsum sizeToFit];
  57. [self.contentView addSubview:lbWaitauditsum];
  58. UILabel *tfWaitauditsum = [[UILabel alloc] init];
  59. tfWaitauditsum.frame = CGRectMake(CGRectGetMaxX(lbFreezesum.frame)+5, CGRectGetMaxY(tfFreezesum.frame)+15,0, 0);
  60. tfWaitauditsum.text = model.waitAuditSum;
  61. tfWaitauditsum.font =[UIFont systemFontOfSize:14];
  62. [tfWaitauditsum sizeToFit];
  63. [self.contentView addSubview:tfWaitauditsum];
  64. UILabel *lbWaitsetprestore = [[UILabel alloc] init];
  65. lbWaitsetprestore.frame = CGRectMake(lblx,CGRectGetMaxY(lbWaitauditsum.frame)+15,0, 0);
  66. lbWaitsetprestore.text = @"存待审核:";
  67. lbWaitsetprestore.font =[UIFont systemFontOfSize:14];
  68. [lbWaitsetprestore sizeToFit];
  69. [self.contentView addSubview:lbWaitsetprestore];
  70. UILabel *tfWaitsetprestore = [[UILabel alloc] init];
  71. tfWaitsetprestore.frame = CGRectMake(CGRectGetMaxX(lbWaitsetprestore.frame)+5, CGRectGetMaxY(tfWaitauditsum.frame)+15,0, 0);
  72. tfWaitsetprestore.text = model.waitSetPrestore;
  73. tfWaitsetprestore.font =[UIFont systemFontOfSize:14];
  74. [tfWaitsetprestore sizeToFit];
  75. [self.contentView addSubview:tfWaitsetprestore];
  76. UILabel *lbMoneyInformation = [[UILabel alloc] init];
  77. lbMoneyInformation.frame = CGRectMake(lblx,CGRectGetMaxY(lbWaitsetprestore.frame)+15,0, 0);
  78. lbMoneyInformation.text = @"款项信息:";
  79. lbMoneyInformation.font =[UIFont systemFontOfSize:14];
  80. [lbMoneyInformation sizeToFit];
  81. [self.contentView addSubview:lbMoneyInformation];
  82. UITextField *tfMoneyInformation = [[UITextField alloc] init];
  83. tfMoneyInformation.frame = CGRectMake(CGRectGetMaxX(lbMoneyInformation.frame)+5, CGRectGetMaxY(tfWaitsetprestore.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lbMoneyInformation.frame)+5),18);
  84. tfMoneyInformation.text = model.earnestSum;
  85. tfMoneyInformation.font =[UIFont systemFontOfSize:14];
  86. tfMoneyInformation.tag = 1001;
  87. tfMoneyInformation.keyboardType=UIKeyboardTypeDecimalPad;
  88. tfMoneyInformation.delegate = self;
  89. [tfMoneyInformation addTarget:self action:@selector(searchTextFieldChangeAction:) forControlEvents:UIControlEventEditingChanged];
  90. tfMoneyInformation.placeholder = @"请输入款项信息";
  91. [self.contentView addSubview:tfMoneyInformation];
  92. UILabel *lbRemark = [[UILabel alloc] init];
  93. lbRemark.frame = CGRectMake(lblx,CGRectGetMaxY(lbMoneyInformation.frame)+15,0, 0);
  94. lbRemark.text = @"备 注:";
  95. lbRemark.font =[UIFont systemFontOfSize:14];
  96. [lbRemark sizeToFit];
  97. [self.contentView addSubview:lbRemark];
  98. UITextField *tfRemark = [[UITextField alloc] init];
  99. tfRemark.frame = CGRectMake(CGRectGetMaxX(lbRemark.frame)+5, CGRectGetMaxY(tfMoneyInformation.frame)+15,SCREENWIDTH-(CGRectGetMaxX(lbRemark.frame)+5),18);
  100. tfRemark.text = model.remarks;
  101. tfRemark.tag = 1002;
  102. tfRemark.font =[UIFont systemFontOfSize:14];
  103. tfRemark.delegate = self;
  104. tfRemark.placeholder = @"请输入备注";
  105. [tfRemark addTarget:self action:@selector(searchTextFieldChangeAction:) forControlEvents:UIControlEventEditingChanged];
  106. [self.contentView addSubview:tfRemark];
  107. UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(lbRemark.frame), SCREENWIDTH, 1)];
  108. line.backgroundColor = LineBackgroundColor;
  109. [self.contentView addSubview:line];
  110. }
  111. - (void)textFieldDidBeginEditing:(UITextField *)textField{
  112. _textField = textField;
  113. }
  114. - (void)searchTextFieldChangeAction: (id)sender
  115. {
  116. if(_textField.tag == 1001){
  117. [_cellDelegate update:(int)_position flag:1 text:_textField.text];
  118. }else{
  119. [_cellDelegate update:(int)_position flag:2 text:_textField.text];
  120. }
  121. }
  122. @end