| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- //
- // 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<nameArray.count; i++) {
-
- int height;
- if (i<5) {
- height = 170+40*i;
- }else{
- height = 190+40*i;
- }
-
- UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, height, 90, 40)];
- nameLabel.text = nameArray[i];
- nameLabel.font = [UIFont systemFontOfSize:15];
- nameLabel.textColor = RGBValueColor(0x999999, 1.0);
- [self.view addSubview:nameLabel];
-
- UILabel *valueLabel = [[UILabel alloc]initWithFrame:CGRectMake(130, height, ScreenWidth-150, 40)];
- valueLabel.text = self.valueArray[i];
- valueLabel.font = [UIFont systemFontOfSize:15];
- valueLabel.textAlignment = NSTextAlignmentRight;
- valueLabel.textColor = RGBValueColor(0x333333, 1.0);
- [self.view addSubview:valueLabel];
- }
-
- UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 380, ScreenWidth, 0.5)];
- lineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
- [self.view addSubview:lineView];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- /*
- #pragma mark - Navigation
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
- @end
|