JLWithdrawalRecordViewController.m 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. //
  2. // JLWithdrawalRecordViewController.m
  3. // shiku_im
  4. //
  5. // Created by JayLuo on 2020/1/14.
  6. // Copyright © 2020 Reese. All rights reserved.
  7. //
  8. #import "JLWithdrawalRecordViewController.h"
  9. #import "JLWithdrawalRecordViewCell.h"
  10. @interface JLWithdrawalRecordViewController ()<UITableViewDataSource, UITableViewDelegate>
  11. @property (nonatomic, strong) NSMutableArray *array;
  12. @property (nonatomic, strong) UITableView *table;
  13. @end
  14. @implementation JLWithdrawalRecordViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. self.title = @"提现记录";
  18. self.isGotoBack = YES;
  19. self.heightFooter = 0;
  20. self.heightHeader = JX_SCREEN_TOP;
  21. [self createHeadAndFoot];
  22. [self createTableView];
  23. [self getData];
  24. }
  25. - (void)createTableView {
  26. _table = [[UITableView alloc] initWithFrame:self.tableBody.frame style:UITableViewStylePlain];
  27. _table.frame =CGRectMake(0,0,self_width,self_height-JX_SCREEN_TOP);
  28. _table.delegate = self;
  29. _table.dataSource = self;
  30. [_table setSeparatorStyle:UITableViewCellSeparatorStyleNone];
  31. _table.backgroundColor = [UIColor clearColor];
  32. // _table.separatorStyle = UITableViewCellSeparatorStyleNone;
  33. // _table.sectionIndexColor = [UIColor grayColor]; //修改右边索引字体的颜色
  34. // _table.sectionIndexBackgroundColor = [UIColor clearColor];
  35. // [_table setAutoresizesSubviews:YES];
  36. // [_table setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
  37. // _table.estimatedRowHeight = 0;
  38. // _table.estimatedSectionFooterHeight = 0;
  39. // _table.estimatedSectionHeaderHeight = 0;
  40. [_table registerNib:[UINib nibWithNibName:@"JLWithdrawalRecordViewCell" bundle:nil] forCellReuseIdentifier:@"JLWithdrawalRecordViewCell"];
  41. self.tableBody.backgroundColor = HEXCOLOR(0xF0EFF4);
  42. self.tableBody.scrollEnabled = NO;
  43. [self.tableBody addSubview:_table];
  44. }
  45. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  46. return 1;
  47. }
  48. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  49. return _array.count;
  50. }
  51. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  52. JLWithdrawalRecordViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"JLWithdrawalRecordViewCell" forIndexPath:indexPath];
  53. NSDictionary *dict = _array[indexPath.row];
  54. cell.dict = dict;
  55. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  56. return cell;
  57. }
  58. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  59. NSDictionary *dict = _array[indexPath.row];
  60. NSString *status = [NSString stringWithFormat:@"%@", dict[@"status"]];
  61. return [status intValue] == -1?150:120;
  62. }
  63. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  64. return 5;
  65. }
  66. - (void)getData {
  67. [_wait show];
  68. _array = [NSMutableArray array];
  69. NSString *userId = [g_default objectForKey:kMY_USER_ID];
  70. [g_server withdrawlListUserId:userId toView:self];
  71. }
  72. -(void)didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
  73. [_wait stop];
  74. if([aDownload.action isEqualToString:act_withdrawlList]){
  75. _array = array1.mutableCopy;
  76. [_table reloadData];
  77. }
  78. }
  79. @end