// // QXAliBindViewController.m // QXLive // // Created by 启星 on 2025/7/9. // #import "QXAliBindViewController.h" #import "QXLoginTextField.h" #import "QXMineNetwork.h" @interface QXAliBindViewController () @property (nonatomic,strong)QXLoginTextField *aliTextField; @property (nonatomic,strong)QXLoginTextField *bankNumberTextField; @property (nonatomic,strong)QXLoginTextField *bankNameTextField; @property (nonatomic,strong)QXLoginTextField *bankAddressTextField; @property (nonatomic,strong)UIButton *commitBtn; @end @implementation QXAliBindViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } -(void)setNavgationItems{ [super setNavgationItems]; self.navigationItem.title = self.isAli?@"绑定支付宝":@"绑定银行卡"; } -(void)initSubViews{ if (self.isAli) { self.aliTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAliPay)]; self.aliTextField.backgroundColor = RGB16(0xEFF2F8); [self.aliTextField addRoundedCornersWithRadius:11]; [self.view addSubview:self.aliTextField]; self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.aliTextField.bottom+16, SCREEN_WIDTH-38*2, 42)]; }else{ self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankNumber)]; self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8); [self.bankNumberTextField addRoundedCornersWithRadius:11]; [self.view addSubview:self.bankNumberTextField]; self.bankNameTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNumberTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankName)]; self.bankNameTextField.backgroundColor = RGB16(0xEFF2F8); [self.bankNameTextField addRoundedCornersWithRadius:11]; [self.view addSubview:self.bankNameTextField]; self.bankNumberTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.bankNameTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeBankAddress)]; self.bankNumberTextField.backgroundColor = RGB16(0xEFF2F8); [self.bankNumberTextField addRoundedCornersWithRadius:11]; [self.view addSubview:self.bankNumberTextField]; self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.bankNumberTextField.bottom+16, SCREEN_WIDTH-38*2, 42)]; } self.commitBtn.needEventInterval = 1; [self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)]; [self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; [self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)]; [self.commitBtn addRoundedCornersWithRadius:21]; self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14]; self.commitBtn.backgroundColor = QXConfig.themeColor; [self.view addSubview:self.commitBtn]; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view endEditing:YES]; } -(void)commitAction{ MJWeakSelf [QXMineNetwork walletBindWithUserId:QXGlobal.shareGlobal.loginModel.user_id type:self.model.type alipay_account:self.aliTextField.textField.text bank_card_number:self.bankNumberTextField.textField.text bank_card:self.bankNameTextField.textField.text open_bank:self.bankAddressTextField.textField.text successBlock:^(NSDictionary * _Nonnull dict) { [weakSelf.navigationController popViewControllerAnimated:YES]; } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { }];; } @end