ASLoginBindingC.m 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. //
  2. // ASLoginBindingC.m
  3. // westkissMob
  4. //
  5. // Created by 王猛 on 2022/11/16.
  6. //
  7. #import "ASLoginBindingC.h"
  8. #import "EamilTFmatchV.h"
  9. #import <OneSignal/OneSignal.h>
  10. @interface ASLoginBindingC ()
  11. @property (nonatomic, strong) EamilTFmatchV *xxx_regMmailV;
  12. @property (nonatomic, strong) TT_CustonTF *xxx_firstName;
  13. @property (nonatomic, strong) TT_CustonTF *xxx_lasetName;
  14. @property (nonatomic, strong) UIButton *xxx_bindBtn;
  15. @end
  16. @implementation ASLoginBindingC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.view.backgroundColor = [UIColor colorWithHexString:@"#FFF8F9"];
  20. self.title = @"BINDING";
  21. [self tt_addSubviews];
  22. }
  23. - (void)tt_addSubviews{
  24. [self.view addSubview:self.xxx_firstName];
  25. [self.view addSubview:self.xxx_lasetName];
  26. [self.view addSubview:self.xxx_regMmailV];
  27. [self.view addSubview:self.xxx_bindBtn];
  28. [self.view bringSubviewToFront:self.xxx_regMmailV];
  29. }
  30. -(void)handle_xxx_bindBtnEvent:(UIButton *)btn{
  31. if (self.xxx_firstName.text.length == 0) {
  32. [self.view makeToast:@"Please Input FirstName" duration:2 position:CSToastPositionCenter];
  33. return;
  34. }else if (self.xxx_lasetName.text.length == 0){
  35. [self.view makeToast:@"Please Input LastName" duration:2 position:CSToastPositionCenter];
  36. return;
  37. }else if(self.xxx_regMmailV.xxx_emailTF.text.length == 0 || ![Current_normalTool xxx_isValidateEmail:self.xxx_regMmailV.xxx_emailTF.text]){
  38. [self.view makeToast:@"Please prvide an email address." duration:2 position:CSToastPositionCenter];
  39. return;
  40. }
  41. NSMutableDictionary *parDIc = [NSMutableDictionary dictionaryWithDictionary:self.thirdLogDic];
  42. parDIc[@"firstName"] = self.xxx_firstName.text;
  43. parDIc[@"lastName"] =self.xxx_lasetName.text;
  44. parDIc[@"email"] = self.xxx_regMmailV.xxx_emailTF.text;
  45. if (self.bindFinishBlock) {
  46. self.bindFinishBlock(parDIc);
  47. [self.navigationController popViewControllerAnimated:YES];
  48. // [self dismissViewControllerAnimated:YES completion:nil];
  49. }
  50. }
  51. -(TT_CustonTF *)xxx_firstName{
  52. IPhoneXHeigh
  53. if (!_xxx_firstName) {
  54. _xxx_firstName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(20, securitytop_Y+50, (KScreenWidth-60)/2, 50)
  55. PlaceHolder:@"* First Name"
  56. andLifImage:nil
  57. AndRightImage:nil
  58. LiftImageFrame:CGRectZero
  59. RightImageFrame:CGRectZero
  60. AndTag:0
  61. AndKeyboardType:UIKeyboardTypeDefault
  62. clearButtonMode:UITextFieldViewModeAlways
  63. AndReturnKeyType:UIReturnKeyDone
  64. masksToBounds:YES
  65. conrenRadius:4
  66. BorderColor:[UIColor colorWithHexString:@"#000000"]
  67. BorderWidth:1];
  68. _xxx_firstName.font = [UIFont systemFontOfSize:14];
  69. _xxx_firstName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
  70. _xxx_firstName.textAlignment = NSTextAlignmentCenter;
  71. _xxx_firstName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* First Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}];
  72. }
  73. return _xxx_firstName;
  74. }
  75. -(TT_CustonTF *)xxx_lasetName{
  76. if (!_xxx_lasetName) {
  77. _xxx_lasetName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(CGRectGetMaxX(self.xxx_firstName.frame)+20,self.xxx_firstName.mj_y, (KScreenWidth-60)/2, 50)
  78. PlaceHolder:@"* Last Name"
  79. andLifImage:nil
  80. AndRightImage:nil
  81. LiftImageFrame:CGRectZero
  82. RightImageFrame:CGRectZero
  83. AndTag:0
  84. AndKeyboardType:UIKeyboardTypeDefault
  85. clearButtonMode:UITextFieldViewModeAlways
  86. AndReturnKeyType:UIReturnKeyDone
  87. masksToBounds:YES
  88. conrenRadius:4
  89. BorderColor:[UIColor colorWithHexString:@"#000000"]
  90. BorderWidth:1];
  91. _xxx_lasetName.font = [UIFont systemFontOfSize:14];
  92. _xxx_lasetName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
  93. _xxx_lasetName.textAlignment = NSTextAlignmentCenter;
  94. _xxx_lasetName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* Last Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}];
  95. }
  96. return _xxx_lasetName;
  97. }
  98. -(EamilTFmatchV *)xxx_regMmailV{
  99. if (!_xxx_regMmailV) {
  100. _xxx_regMmailV = [[EamilTFmatchV alloc]initWithFrame:CGRectMake(0,CGRectGetMaxY(self.xxx_firstName.frame)+30 , KScreenWidth, 50)];
  101. }
  102. return _xxx_regMmailV;
  103. }
  104. -(UIButton *)xxx_bindBtn{
  105. if(!_xxx_bindBtn){
  106. _xxx_bindBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  107. _xxx_bindBtn.frame = CGRectMake(20, CGRectGetMaxY(self.xxx_regMmailV.frame)+30, KScreenWidth-40, 45);
  108. [_xxx_bindBtn setTitle:@"BINDING" forState:UIControlStateNormal];
  109. [_xxx_bindBtn setTitleColor:[UIColor colorWithHexString:@"#FFFFFF"] forState:UIControlStateNormal];
  110. _xxx_bindBtn.backgroundColor = [UIColor colorWithHexString:@"#000000"];
  111. _xxx_bindBtn.layer.cornerRadius = 4;
  112. _xxx_bindBtn.clipsToBounds = YES;
  113. [_xxx_bindBtn addTarget:self action:@selector(handle_xxx_bindBtnEvent:) forControlEvents:UIControlEventTouchUpInside];
  114. }
  115. return _xxx_bindBtn;
  116. }
  117. @end