// // ASInfomationSetController.m // Asteria // // Created by iOS on 2023/7/5. // #import "ASInfomationSetController.h" #import "KWTextField.h" #import #import "ASHomeAlertWindow.h" @interface ASInfomationSetController () /// 0: 只有邮箱 1: 邮箱加密码 2: 邮箱+验证码+密码 3 邮箱+验证码 @property (nonatomic,assign) NSInteger showType; @property (nonatomic, strong) UIScrollView *scrollV; @property (nonatomic, strong) UIStackView *totalStackV; @property (nonatomic, strong) KWTextField *lastNTf; @property (nonatomic, strong) KWTextField *nameTf; @property (nonatomic, strong) KWTextField *birthTf; @property (nonatomic, strong) UIStackView *passStackV; @property (nonatomic, strong) UIButton *changePassBt; @property (nonatomic, strong) KWTextField *emailTf; @property (nonatomic, strong) KWTextField *oldPassTf; @property (nonatomic, strong) KWTextField *nPassTf; @property (nonatomic, strong) UIButton *bottomBt; @property (nonatomic, strong) NSDate *currentDate; //@property (nonatomic, strong) KWInfoSettingViewModel *vm; @end @implementation ASInfomationSetController - (void)viewDidLoad { [super viewDidLoad]; // self.vm = [KWInfoSettingViewModel new]; self.titleStr = @"Information"; [self setNavRightSearch:^{ }]; self.statusBgV.backgroundColor = Col_FFF; self.customNavBar.backgroundColor = Col_FFF; [self loadSubVs]; [self setData]; } - (void)setData { ASUserModel *m = ASUserInfoManager.shared.userInfo; NSString *bob = ASUserInfoManager.shared.birthDay; self.lastNTf.text = m.lastname; self.nameTf.text = m.firstname; self.currentDate = [NSDate dateWithString:bob format:@"MM dd, yyyy"]; self.birthTf.text = [self.currentDate stringWithFormat:@"MM/dd/yyyy"]; self.showType = 0; self.emailTf.text = m.email; [self configViewsByShowType]; } - (void)loadSubVs { [self.view addSubview:self.scrollV]; UIStackView *tStackV = [[UIStackView alloc] init]; tStackV.axis = UILayoutConstraintAxisVertical; tStackV.alignment = UIStackViewAlignmentFill; tStackV.distribution = UIStackViewDistributionFill; tStackV.spacing = 20; self.totalStackV = tStackV; UIStackView *topStackV = [[UIStackView alloc] init]; topStackV.axis = UILayoutConstraintAxisHorizontal; topStackV.alignment = UIStackViewAlignmentFill; topStackV.distribution = UIStackViewDistributionFillEqually; topStackV.spacing = 20; [self.totalStackV addArrangedSubview:topStackV]; NSArray *titles = @[@"First Name", @"Last Name", @"Date Of Birth"]; NSArray *placeHolders = @[@"Pleace Input Name", @"Pleace Input Last Name", @"Pleace Select Date Of Birth"]; for (int i = 0; i