Files
yuyin_ios/SweetParty/主类/Mine/Wallet/ZMKHBindBankVC.m
2025-08-08 11:05:33 +08:00

104 lines
4.4 KiB
Objective-C

//
// ZMKHBindBankVC.m
// sugar
//
// Created by bj_szd on 2022/6/21.
// Copyright © 2022 sugar. All rights reserved.
//
#import "ZMKHBindBankVC.h"
@interface ZMKHBindBankVC ()
@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 UITextField *phoneTF;
@property (weak, nonatomic) IBOutlet UITextField *idcardTF;
@property (weak, nonatomic) IBOutlet UIButton *quitBtn;
@end
@implementation ZMKHBindBankVC
- (void)viewDidLoad {
[super viewDidLoad];
[self loadBar:YES needBack:YES needBackground:NO];
self.titleLabel.text = @"绑定银行卡";
self.titleLabel.textColor = HEXCOLOR(0x333333);
self.leftButtonView.image = ImageNamed(@"blackBack");
self.barView.backgroundColor = kClearColor;
self.bgView.backgroundColor = HEXCOLOR(0xFFFFFF);
// UIImageView *topBgImgV = [[UIImageView alloc] init];
// topBgImgV.image = ImageNamed(@"home_top_bg");
// [self.bgView insertSubview:topBgImgV atIndex:0];
// [topBgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
// make.top.left.right.equalTo(self.bgView);
// make.height.mas_equalTo(ScreenWidth/375*812);
// }];
self.nameTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入您的真实姓名" attributes:@{NSForegroundColorAttributeName:HEXCOLORA(0xBBBBBB, 1)}];
self.cardTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入您的银行卡号" attributes:@{NSForegroundColorAttributeName:HEXCOLORA(0xBBBBBB, 1)}];
self.bankTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入您的开卡银行" attributes:@{NSForegroundColorAttributeName:HEXCOLORA(0xBBBBBB, 1)}];
self.openTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入银行卡绑定的手机号" attributes:@{NSForegroundColorAttributeName:HEXCOLORA(0xBBBBBB, 1)}];
self.idcardTF.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@"请输入您的身份证号" attributes:@{NSForegroundColorAttributeName:HEXCOLORA(0xBBBBBB, 1)}];
_quitBtn.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(APPW-32*2, 46) direction:(FXGradientChangeDirectionHorizontal) startColor:mainLightColor endColor:mainDeepColor];
if (self.model.bank_card_number.length > 0) {
self.nameTF.text = self.model.bank_user_name;
self.cardTF.text = self.model.bank_card_number;
self.bankTF.text = self.model.bank_card_name;
self.openTF.text = self.model.bank_tel_no;
self.idcardTF.text = self.model.bank_cert_id;
}
}
- (IBAction)onConfirm:(id)sender {
if (self.nameTF.text.length==0) {
[SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请输入真实姓名"];
return;
}
if (self.cardTF.text.length==0) {
[SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请输入银行卡号"];
return;
}
if (self.bankTF.text.length==0) {
[SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请输入银行名称"];
return;
}
if (self.openTF.text.length==0) {
[SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请输入您的手机号"];
return;
}
if (self.idcardTF.text.length==0) {
[SVProgressHUD showImage:[UIImage imageNamed:@""] status:@"请输入您的身份证号"];
return;
}
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setValue:self.bankTF.text forKey:@"bank_card_name"];
[dict setValue:self.cardTF.text forKey:@"bank_card_number"];
[dict setValue:self.nameTF.text forKey:@"bank_user_name"];
[dict setValue:self.openTF.text forKey:@"bank_tel_no"];
[dict setValue:self.idcardTF.text forKey:@"bank_cert_id"];
[MBProgressHUD showLoadToView:MainWindow()];
[BJHttpTool BJ_binding_bank_cardWithParameters:dict success:^(id response) {
if ([response[@"code"] integerValue]==200) {
[self.navigationController popViewControllerAnimated:YES];
}
[MBProgressHUD hideHUD];
[MBProgressHUD showAutoMessage:response[@"msg"]];
} failure:^(NSError *error) {
}];
}
@end