// // WithdrawalDetailController.m // model // // Created by 杨键 on 2018/8/3. // Copyright © 2018年 Mine. All rights reserved. // #import "WithdrawalDetailController.h" @interface WithdrawalDetailController () { NSString *type; } @property (nonatomic,strong) NSMutableArray *valueArray; @end @implementation WithdrawalDetailController - (NSMutableArray *)valueArray { if (!_valueArray) { _valueArray = [NSMutableArray arrayWithCapacity:0]; } return _valueArray; } - (void)viewDidLoad { [super viewDidLoad]; self.title = @"提现详情"; self.view.backgroundColor = [UIColor whiteColor]; [self creatNavBar]; [self getDataFromNetworking]; } - (void)creatNavBar { //返回按钮 UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(0, 0, 40, 40); [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal]; btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0); [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn]; UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; //nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整 self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem]; } - (void)backClick { [self.navigationController popViewControllerAnimated:YES]; } #pragma mark -- 网络请求 - (void)getDataFromNetworking { [MBProgressHUD showHUDAddedTo:self.view animated:YES]; NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:self.withdrawPk,@"cashrecordpk", nil]; [YanCNetWorkManager requestPostWithURLStr:Url_getWithdrawDetail(PublicUrl) parameters:dic finish:^(id dataDic) { [MBProgressHUD hideHUDForView:self.view animated:YES]; NSString *issuccess = dataDic[@"msg"]; if ([issuccess isEqualToString:@"success"]) { NSDictionary *dic = dataDic[@"data"]; type = [dic objectForKey:@"ptype"]; [self.valueArray addObject:[dic objectForKey:@"pstate"]]; [self.valueArray addObject:[dic objectForKey:@"fee"]]; [self.valueArray addObject:[dic objectForKey:@"abstract"]]; [self.valueArray addObject:[dic objectForKey:@"feedate"]]; [self.valueArray addObject:[dic objectForKey:@"accountingdate"]]; [self.valueArray addObject:[dic objectForKey:@"wid"]]; [self.valueArray addObject:[dic objectForKey:@"phone"]]; [self creatUI]; } else { [MBProgressHUD showInfo:@"请求失败!"]; } } enError:^(NSError *error) { [MBProgressHUD hideHUDForView:self.view animated:YES]; }]; } -(void)creatUI{ UIImageView *icon = [[UIImageView alloc]init]; icon.image = [UIImage imageNamed:@"zhifubao-1"]; [self.view addSubview:icon]; [icon mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.view.mas_top).offset(20); make.centerX.equalTo(self.view.mas_centerX); make.height.equalTo(@50); make.width.equalTo(@50); }]; UILabel *titleLabel = [[UILabel alloc]init]; titleLabel.text = [NSString stringWithFormat:@"提现-%@",type]; titleLabel.textColor = RGBValueColor(0x333333, 1.0); titleLabel.textAlignment = NSTextAlignmentCenter; titleLabel.font = [UIFont systemFontOfSize:16]; [self.view addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(icon.mas_bottom).offset(10); make.centerX.equalTo(self.view.mas_centerX); make.height.equalTo(@20); make.width.equalTo(self.view); }]; UILabel *amountLabel = [[UILabel alloc]init]; amountLabel.text = self.valueArray[1]; amountLabel.textColor = RGBValueColor(0x333333, 1.0); amountLabel.textAlignment = NSTextAlignmentCenter; amountLabel.font = [UIFont systemFontOfSize:30]; [self.view addSubview:amountLabel]; [amountLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(titleLabel.mas_bottom).offset(10); make.centerX.equalTo(self.view.mas_centerX); make.height.equalTo(@40); make.width.equalTo(self.view); }]; NSArray *nameArray = @[@"当前状态",@"提现金额",@"个人所得税",@"申请时间",@"到账时间",@"提现账号",@"提现单号"]; for (int i=0; i