ASLoginBindingC.m 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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 dismissViewControllerAnimated:YES completion:nil];
  48. }
  49. }
  50. -(TT_CustonTF *)xxx_firstName{
  51. IPhoneXHeigh
  52. if (!_xxx_firstName) {
  53. _xxx_firstName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(20, securitytop_Y+50, (KScreenWidth-60)/2, 50)
  54. PlaceHolder:@"* First Name"
  55. andLifImage:nil
  56. AndRightImage:nil
  57. LiftImageFrame:CGRectZero
  58. RightImageFrame:CGRectZero
  59. AndTag:0
  60. AndKeyboardType:UIKeyboardTypeDefault
  61. clearButtonMode:UITextFieldViewModeAlways
  62. AndReturnKeyType:UIReturnKeyDone
  63. masksToBounds:YES
  64. conrenRadius:4
  65. BorderColor:[UIColor colorWithHexString:@"#000000"]
  66. BorderWidth:1];
  67. _xxx_firstName.font = [UIFont systemFontOfSize:14];
  68. _xxx_firstName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
  69. _xxx_firstName.textAlignment = NSTextAlignmentCenter;
  70. _xxx_firstName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* First Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}];
  71. }
  72. return _xxx_firstName;
  73. }
  74. -(TT_CustonTF *)xxx_lasetName{
  75. if (!_xxx_lasetName) {
  76. _xxx_lasetName = [TT_ControlTool FTT_ControlToolUITextFieldFrame:CGRectMake(CGRectGetMaxX(self.xxx_firstName.frame)+20,self.xxx_firstName.mj_y, (KScreenWidth-60)/2, 50)
  77. PlaceHolder:@"* Last Name"
  78. andLifImage:nil
  79. AndRightImage:nil
  80. LiftImageFrame:CGRectZero
  81. RightImageFrame:CGRectZero
  82. AndTag:0
  83. AndKeyboardType:UIKeyboardTypeDefault
  84. clearButtonMode:UITextFieldViewModeAlways
  85. AndReturnKeyType:UIReturnKeyDone
  86. masksToBounds:YES
  87. conrenRadius:4
  88. BorderColor:[UIColor colorWithHexString:@"#000000"]
  89. BorderWidth:1];
  90. _xxx_lasetName.font = [UIFont systemFontOfSize:14];
  91. _xxx_lasetName.backgroundColor = [UIColor colorWithHexString:@"#FFFFFF"];
  92. _xxx_lasetName.textAlignment = NSTextAlignmentCenter;
  93. _xxx_lasetName.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"* Last Name" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#0B0B0B"]}];
  94. }
  95. return _xxx_lasetName;
  96. }
  97. -(EamilTFmatchV *)xxx_regMmailV{
  98. if (!_xxx_regMmailV) {
  99. _xxx_regMmailV = [[EamilTFmatchV alloc]initWithFrame:CGRectMake(0,CGRectGetMaxY(self.xxx_firstName.frame)+30 , KScreenWidth, 50)];
  100. }
  101. return _xxx_regMmailV;
  102. }
  103. -(UIButton *)xxx_bindBtn{
  104. if(!_xxx_bindBtn){
  105. _xxx_bindBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  106. _xxx_bindBtn.frame = CGRectMake(20, CGRectGetMaxY(self.xxx_regMmailV.frame)+30, KScreenWidth-40, 45);
  107. [_xxx_bindBtn setTitle:@"BINDING" forState:UIControlStateNormal];
  108. [_xxx_bindBtn setTitleColor:[UIColor colorWithHexString:@"#FFFFFF"] forState:UIControlStateNormal];
  109. _xxx_bindBtn.backgroundColor = [UIColor colorWithHexString:@"#000000"];
  110. _xxx_bindBtn.layer.cornerRadius = 4;
  111. _xxx_bindBtn.clipsToBounds = YES;
  112. [_xxx_bindBtn addTarget:self action:@selector(handle_xxx_bindBtnEvent:) forControlEvents:UIControlEventTouchUpInside];
  113. }
  114. return _xxx_bindBtn;
  115. }
  116. @end