GainsAccountBindVC.m 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // GainsAccountBindVC.m
  3. // BuguLive
  4. //
  5. // Created by hym on 2016/11/28.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "GainsAccountBindVC.h"
  9. #import "GainsWithdrawVC.h"
  10. @interface GainsAccountBindVC ()
  11. @property (weak, nonatomic) IBOutlet UITextField *tfPayName;
  12. @property (weak, nonatomic) IBOutlet UITextField *tfPayAccount;
  13. @property (weak, nonatomic) IBOutlet UIButton *btnAffirm;
  14. @property (nonatomic, strong) NetHttpsManager *httpManager;
  15. @end
  16. @implementation GainsAccountBindVC
  17. - (void)viewDidLoad
  18. {
  19. [super viewDidLoad];
  20. self.title = ASLocalizedString(@"账号绑定");
  21. self.navigationItem.leftBarButtonItem = [UIBarButtonItem
  22. itemWithTarget:self
  23. action:@selector(backToVC)
  24. image:@"com_arrow_vc_back"
  25. highImage:@"com_arrow_vc_back"];
  26. // self.btnAffirm.layer.borderColor = kAppMainColor.CGColor;
  27. [self.btnAffirm setBackgroundColor:RGB(118, 59, 243)];
  28. [self.btnAffirm setTitleColor:[UIColor whiteColor]
  29. forState:UIControlStateNormal];
  30. // self.btnAffirm.layer.borderWidth = 1.0f;
  31. self.btnAffirm.layer.cornerRadius = self.btnAffirm.frame.size.height/2.0f;
  32. self.btnAffirm.layer.masksToBounds = YES;
  33. //
  34. self.view.backgroundColor = kBackGroundColor;
  35. _httpManager = [NetHttpsManager manager];
  36. }
  37. - (void)backToVC {
  38. [self.navigationController popViewControllerAnimated:YES];
  39. }
  40. - (void)didReceiveMemoryWarning {
  41. [super didReceiveMemoryWarning];
  42. }
  43. - (IBAction)onClick:(id)sender {
  44. if ([_tfPayName.text length] == 0) {
  45. [FanweMessage alert:ASLocalizedString(@"请输入支付宝名称")];
  46. return;
  47. }
  48. if ([_tfPayAccount.text length] == 0) {
  49. [FanweMessage alert:ASLocalizedString(@"请输入支付宝账号")];
  50. return;
  51. }
  52. NSMutableDictionary *parmDict = [NSMutableDictionary dictionary];
  53. [parmDict setObject:@"user_center" forKey:@"ctl"];
  54. [parmDict setObject:@"binding_alipay" forKey:@"act"];
  55. [parmDict setObject:_tfPayName.text forKey:@"alipay_name"];
  56. [parmDict setObject:_tfPayAccount.text forKey:@"alipay_account"];
  57. [_httpManager POSTWithParameters:parmDict SuccessBlock:^(NSDictionary *responseJson){
  58. if ([responseJson toInt:@"status"] ==1)
  59. {
  60. GainsWithdrawVC *vc = [[GainsWithdrawVC alloc] initWithNibName:@"GainsWithdrawVC" bundle:nil];
  61. [[AppDelegate sharedAppDelegate] pushViewController:vc animated:YES];
  62. }
  63. } FailureBlock:^(NSError *error)
  64. {
  65. }];
  66. }
  67. @end