ThirdTableViewCell.m 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // ThirdTableViewCell.m
  3. // BuguLive
  4. //
  5. // Created by fanwe2014 on 16/7/22.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "ThirdTableViewCell.h"
  9. @interface ThirdTableViewCell ()<UITextFieldDelegate>
  10. @end
  11. @implementation ThirdTableViewCell
  12. - (void)awakeFromNib
  13. {
  14. [super awakeFromNib];
  15. self.identificationType.textColor = self.identificationName.textColor = self.contactWay.textColor = self.identificationNumLabel.textColor = kAppGrayColor1;
  16. self.identificationButton.layer.borderWidth = 0;
  17. self.identificationButton.layer.borderColor = [UIColor clearColor].CGColor;
  18. self.typeTextFiled.layer.borderWidth = 0;
  19. self.typeTextFiled.layer.borderColor = [UIColor clearColor].CGColor;
  20. self.typeTextFiled.textColor = self.nameTextFiled.textColor = self.contactTextFiled.textColor = self.identificationNumFiled.textColor = kAppGrayColor4;
  21. self.typeTextFiled.placeholder = ASLocalizedString(@"请选择认证类型");
  22. self.nameTextFiled.placeholder = ASLocalizedString(@"请输入您的真实姓名");
  23. self.contactTextFiled.placeholder = ASLocalizedString(@"请输入您的联系方式");
  24. self.identificationNumFiled.placeholder = ASLocalizedString(@"请输入您的身份证号码");
  25. self.selectionStyle = UITableViewCellSelectionStyleNone;
  26. for (UIView *subview in self.contentView.subviews) {
  27. [subview setLocalizedString];
  28. }
  29. }
  30. - (void)creatCellWithAuthentication:(int)authentication andIdTypeStr:(NSString *)idTypeStr andIdNameStr:(NSString *)idNameStr andIdContactStr:(NSString *)idContactStr andIdNumStr:(NSString *)idNumStr andShowIdNum:(int)idNum
  31. {
  32. if (idNum == 1)
  33. {
  34. self.identificationNumLabel.hidden = NO;
  35. self.idStartLabel.hidden = NO;
  36. self.identificationNumFiled.hidden = NO;
  37. }else
  38. {
  39. self.identificationNumLabel.hidden = YES;
  40. self.idStartLabel.hidden = YES;
  41. self.identificationNumFiled.hidden = YES;
  42. }
  43. if (authentication == 1 || authentication == 2 || authentication == 3)
  44. {
  45. if (authentication == 3)
  46. {
  47. self.typeTextFiled.userInteractionEnabled = YES;
  48. self.nameTextFiled.userInteractionEnabled = YES;
  49. self.contactTextFiled.userInteractionEnabled = YES;
  50. self.identificationButton.userInteractionEnabled = YES;
  51. self.identificationNumFiled.userInteractionEnabled = YES;
  52. }else
  53. {
  54. self.typeTextFiled.userInteractionEnabled = NO;
  55. self.nameTextFiled.userInteractionEnabled = NO;
  56. self.contactTextFiled.userInteractionEnabled = NO;
  57. self.identificationButton.userInteractionEnabled = NO;
  58. self.identificationNumFiled.userInteractionEnabled = NO;
  59. }
  60. self.typeTextFiled.text = idTypeStr;
  61. self.nameTextFiled.text = idNameStr;
  62. self.contactTextFiled.text = idContactStr;
  63. self.identificationNumFiled.text = idNumStr;
  64. }else
  65. {
  66. self.typeTextFiled.userInteractionEnabled = YES;
  67. self.nameTextFiled.userInteractionEnabled = YES;
  68. self.contactTextFiled.userInteractionEnabled = YES;
  69. self.identificationButton.userInteractionEnabled = YES;
  70. self.identificationNumFiled.userInteractionEnabled = YES;
  71. }
  72. }
  73. - (BOOL)textFieldShouldReturn:(UITextField *)textField
  74. {
  75. return YES;
  76. }
  77. //认证类型的点击事件
  78. - (IBAction)buttonClick:(UIButton *)sender
  79. {
  80. if (self.delegate)
  81. {
  82. if ([self.delegate respondsToSelector:@selector(getIdentificationWithCell:)])
  83. {
  84. [self.delegate getIdentificationWithCell:self];
  85. }
  86. }
  87. }
  88. @end