// // SPWalletBindBankVC.m // SweetParty // // Created by bj_szd on 2022/6/10. // #import "SPWalletBindBankVC.h" @interface SPWalletBindBankVC () @property (weak, nonatomic) IBOutlet UITextField *nameTF; @property (weak, nonatomic) IBOutlet UITextField *cardTF; @property (weak, nonatomic) IBOutlet UITextField *bankTF; @property (weak, nonatomic) IBOutlet UITextField *openTF; @property (weak, nonatomic) IBOutlet UIButton *confirmBtn; @end @implementation SPWalletBindBankVC - (void)viewDidLoad { [super viewDidLoad]; [self showNaviBarWithTitle:@"绑定支付宝"]; [self.confirmBtn setJianBianWithCGSize:CGSizeMake(ScreenWidth-15*2, 44)]; UIImageView *bgImgV = [[UIImageView alloc] initWithImage:ImageNamed(@"home_bg")]; [self.view addSubview:bgImgV]; [self.view sendSubviewToBack:bgImgV]; [bgImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.left.right.equalTo(self.view); make.height.mas_equalTo(ScreenWidth/375*812); }]; self.nameTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入真实姓名" attributes:@{NSForegroundColorAttributeName:HEXCOLOR(0x999999)}]; self.cardTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入支付宝账号" attributes:@{NSForegroundColorAttributeName:HEXCOLOR(0x999999)}]; // self.bankTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入银行名称" attributes:@{NSForegroundColorAttributeName:[kWhiteColor colorWithAlphaComponent:0.6]}]; // self.openTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入开户行" attributes:@{NSForegroundColorAttributeName:[kWhiteColor colorWithAlphaComponent:0.6]}]; if (self.model.alipay_account.length > 0) { self.nameTF.text = self.model.alipay_name; self.cardTF.text = self.model.alipay_account; // self.bankTF.text = self.model.bank_card; // self.openTF.text = self.model.open_bank; } } - (IBAction)onConfirm:(id)sender { if (self.nameTF.text.length==0) { [HelpPageDefine showMessage:@"请输入真实姓名"]; return; } if (self.cardTF.text.length==0) { [HelpPageDefine showMessage:@"请输入支付宝账号"]; return; } // if (self.bankTF.text.length==0) { // [HelpPageDefine showMessage:@"请输入银行名称"]; // return; // } // if (self.openTF.text.length==0) { // [HelpPageDefine showMessage:@"请输入开户行"]; // return; // } NSDictionary *params = @{@"alipay_name":self.nameTF.text, @"alipay_account":self.cardTF.text}; [[AFNetworkRequset shared] postRequestWithParams:params Path:@"api/user/binding_zfb" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.navigationController popViewControllerAnimated:YES]; }); } Failure:^(id _Nonnull errorData) { }]; } @end