WithdrawalDetailController.m 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. //
  2. // WithdrawalDetailController.m
  3. // model
  4. //
  5. // Created by 杨键 on 2018/8/3.
  6. // Copyright © 2018年 Mine. All rights reserved.
  7. //
  8. #import "WithdrawalDetailController.h"
  9. @interface WithdrawalDetailController ()
  10. {
  11. NSString *type;
  12. }
  13. @property (nonatomic,strong) NSMutableArray *valueArray;
  14. @end
  15. @implementation WithdrawalDetailController
  16. - (NSMutableArray *)valueArray {
  17. if (!_valueArray) {
  18. _valueArray = [NSMutableArray arrayWithCapacity:0];
  19. }
  20. return _valueArray;
  21. }
  22. - (void)viewDidLoad {
  23. [super viewDidLoad];
  24. self.title = @"提现详情";
  25. self.view.backgroundColor = [UIColor whiteColor];
  26. [self creatNavBar];
  27. [self getDataFromNetworking];
  28. }
  29. - (void)creatNavBar {
  30. //返回按钮
  31. UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
  32. btn.frame = CGRectMake(0, 0, 40, 40);
  33. [btn setImage:[UIImage imageNamed:@"fanhui2"] forState:UIControlStateNormal];
  34. btn.imageEdgeInsets = UIEdgeInsetsMake(0, -20, 0, 0);
  35. [btn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
  36. UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
  37. UIBarButtonItem *nagetiveSpacer = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
  38. //nagetiveSpacer.width = -12;//这个值可以根据自己需要自己调整
  39. self.navigationItem.leftBarButtonItems = @[nagetiveSpacer, leftItem];
  40. }
  41. - (void)backClick {
  42. [self.navigationController popViewControllerAnimated:YES];
  43. }
  44. #pragma mark -- 网络请求
  45. - (void)getDataFromNetworking {
  46. [MBProgressHUD showHUDAddedTo:self.view animated:YES];
  47. NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:self.withdrawPk,@"cashrecordpk", nil];
  48. [YanCNetWorkManager requestPostWithURLStr:Url_getWithdrawDetail(PublicUrl) parameters:dic finish:^(id dataDic) {
  49. [MBProgressHUD hideHUDForView:self.view animated:YES];
  50. NSString *issuccess = dataDic[@"msg"];
  51. if ([issuccess isEqualToString:@"success"]) {
  52. NSDictionary *dic = dataDic[@"data"];
  53. type = [dic objectForKey:@"ptype"];
  54. [self.valueArray addObject:[dic objectForKey:@"pstate"]];
  55. [self.valueArray addObject:[dic objectForKey:@"fee"]];
  56. [self.valueArray addObject:[dic objectForKey:@"abstract"]];
  57. [self.valueArray addObject:[dic objectForKey:@"feedate"]];
  58. [self.valueArray addObject:[dic objectForKey:@"accountingdate"]];
  59. [self.valueArray addObject:[dic objectForKey:@"wid"]];
  60. [self.valueArray addObject:[dic objectForKey:@"phone"]];
  61. [self creatUI];
  62. } else {
  63. [MBProgressHUD showInfo:@"请求失败!"];
  64. }
  65. } enError:^(NSError *error) {
  66. [MBProgressHUD hideHUDForView:self.view animated:YES];
  67. }];
  68. }
  69. -(void)creatUI{
  70. UIImageView *icon = [[UIImageView alloc]init];
  71. icon.image = [UIImage imageNamed:@"zhifubao-1"];
  72. [self.view addSubview:icon];
  73. [icon mas_makeConstraints:^(MASConstraintMaker *make) {
  74. make.top.equalTo(self.view.mas_top).offset(20);
  75. make.centerX.equalTo(self.view.mas_centerX);
  76. make.height.equalTo(@50);
  77. make.width.equalTo(@50);
  78. }];
  79. UILabel *titleLabel = [[UILabel alloc]init];
  80. titleLabel.text = [NSString stringWithFormat:@"提现-%@",type];
  81. titleLabel.textColor = RGBValueColor(0x333333, 1.0);
  82. titleLabel.textAlignment = NSTextAlignmentCenter;
  83. titleLabel.font = [UIFont systemFontOfSize:16];
  84. [self.view addSubview:titleLabel];
  85. [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  86. make.top.equalTo(icon.mas_bottom).offset(10);
  87. make.centerX.equalTo(self.view.mas_centerX);
  88. make.height.equalTo(@20);
  89. make.width.equalTo(self.view);
  90. }];
  91. UILabel *amountLabel = [[UILabel alloc]init];
  92. amountLabel.text = self.valueArray[1];
  93. amountLabel.textColor = RGBValueColor(0x333333, 1.0);
  94. amountLabel.textAlignment = NSTextAlignmentCenter;
  95. amountLabel.font = [UIFont systemFontOfSize:30];
  96. [self.view addSubview:amountLabel];
  97. [amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  98. make.top.equalTo(titleLabel.mas_bottom).offset(10);
  99. make.centerX.equalTo(self.view.mas_centerX);
  100. make.height.equalTo(@40);
  101. make.width.equalTo(self.view);
  102. }];
  103. NSArray *nameArray = @[@"当前状态",@"提现金额",@"个人所得税",@"申请时间",@"到账时间",@"提现账号",@"提现单号"];
  104. for (int i=0; i<nameArray.count; i++) {
  105. int height;
  106. if (i<5) {
  107. height = 170+40*i;
  108. }else{
  109. height = 190+40*i;
  110. }
  111. UILabel *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, height, 90, 40)];
  112. nameLabel.text = nameArray[i];
  113. nameLabel.font = [UIFont systemFontOfSize:15];
  114. nameLabel.textColor = RGBValueColor(0x999999, 1.0);
  115. [self.view addSubview:nameLabel];
  116. UILabel *valueLabel = [[UILabel alloc]initWithFrame:CGRectMake(130, height, ScreenWidth-150, 40)];
  117. valueLabel.text = self.valueArray[i];
  118. valueLabel.font = [UIFont systemFontOfSize:15];
  119. valueLabel.textAlignment = NSTextAlignmentRight;
  120. valueLabel.textColor = RGBValueColor(0x333333, 1.0);
  121. [self.view addSubview:valueLabel];
  122. }
  123. UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 380, ScreenWidth, 0.5)];
  124. lineView.backgroundColor = RGBValueColor(0xdfdfdf, 1.0);
  125. [self.view addSubview:lineView];
  126. }
  127. - (void)didReceiveMemoryWarning {
  128. [super didReceiveMemoryWarning];
  129. // Dispose of any resources that can be recreated.
  130. }
  131. /*
  132. #pragma mark - Navigation
  133. // In a storyboard-based application, you will often want to do a little preparation before navigation
  134. - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  135. // Get the new view controller using [segue destinationViewController].
  136. // Pass the selected object to the new view controller.
  137. }
  138. */
  139. @end