1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- //
- // SPSBInputBankViewController.m
- // 我的社保
- //
- // Created by shanp on 2021/5/19.
- //
- #import "SPSBInputBankViewController.h"
- #import "SPSBUIGeneralHeader.h"
- #import "SPSBTextField.h"
- #import "SPSBVerificationProfile.h"
- #import "UIView+SPSBLoadingTipsView.h"
- @interface SPSBInputBankViewController () {
- SPSBTextField *_textField;
- }
- @end
- @implementation SPSBInputBankViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self setupUI];
- }
- #pragma mark - Action
- - (void)saveAction {
- jxh_endEdit();
- if (_textField.text.length < SPSBMinBankNameLength) {
- [self.view showToastWithTitle:@"请输入正确的银行名称"];
- return;
- }
- _spsb_completionAction(_textField.text);
- [self.navigationController popToViewController:self.navigationController.viewControllers[self.navigationController.viewControllers.count - 3] animated:true];
- }
- - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
- jxh_endEdit();
- }
- #pragma mark - Network Action
- #pragma mark - UI
- - (void)setupUI {
- self.view.backgroundColor = spsb_F5F5F5_color();
- self.title = @"银行卡";
- [self createRightButton];
- [self cerateTextField];
- }
- - (void)cerateTextField {
- UIView *view = UIView.new;
- view.backgroundColor = spsb_FFFFFF_color(1.f);
- [self.view addSubview:view];
- [view makeConstraints:^(JXHConstraintMaker *make) {
- make.top.equalTo(self.view.safetop).offset(12);
- make.leading.and.trailing.equalTo(0);
- make.height.equalTo(50);
- }];
-
- UILabel *titleLabel = [UILabel convenienceWithFont:spsb_font(16) text:@"开户银行" textColor:spsb_333333_color()];
- [view addSubview:titleLabel];
- [titleLabel makeConstraints:^(JXHConstraintMaker *make) {
- make.leading.equalTo(15);
- make.centerY.equalTo(0);
- }];
-
- _textField = [SPSBTextField convenienceWithFont:spsb_font(16) placeholder:@"请输入开户银行名称" placeholderColor:spsb_CCCCCC_color() textColor:spsb_666666_color() clearButtonMode:UITextFieldViewModeWhileEditing returnType:UIReturnKeyDone delegate:self];
- _textField.textAlignment = NSTextAlignmentRight;
- _textField.spsb_maxCount = SPSBMaxBankNumLength;
- [view addSubview:_textField];
- [_textField makeConstraints:^(JXHConstraintMaker *make) {
- make.leading.equalTo(135);
- make.trailing.equalTo(-15);
- make.top.and.bottom.equalTo(0);
- }];
- }
- - (void)createRightButton {
- UIButton *rightButton = [UIButton convenienceWithFont:spsb_font(15) target:self action:@selector(saveAction)];
- [rightButton setTitle:@"保存" titleColor:spsb_3296FB_color() state:JXHButtonControlStateNormal];
- rightButton.frame = CGRectMake(0, 0, 60, 44);
- [rightButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
- UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:rightButton];
- self.navigationItem.rightBarButtonItem = rightItem;
- }
- @end
|