12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- //
- // JLWithdrawalRecordViewController.m
- // shiku_im
- //
- // Created by JayLuo on 2020/1/14.
- // Copyright © 2020 Reese. All rights reserved.
- //
- #import "JLWithdrawalRecordViewController.h"
- #import "JLWithdrawalRecordViewCell.h"
- @interface JLWithdrawalRecordViewController ()<UITableViewDataSource, UITableViewDelegate>
- @property (nonatomic, strong) NSMutableArray *array;
- @property (nonatomic, strong) UITableView *table;
- @end
- @implementation JLWithdrawalRecordViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.title = @"提现记录";
- self.isGotoBack = YES;
- self.heightFooter = 0;
- self.heightHeader = JX_SCREEN_TOP;
- [self createHeadAndFoot];
- [self createTableView];
- [self getData];
- }
- - (void)createTableView {
- _table = [[UITableView alloc] initWithFrame:self.tableBody.frame style:UITableViewStylePlain];
- _table.frame =CGRectMake(0,0,self_width,self_height-JX_SCREEN_TOP);
- _table.delegate = self;
- _table.dataSource = self;
- [_table setSeparatorStyle:UITableViewCellSeparatorStyleNone];
- _table.backgroundColor = [UIColor clearColor];
- // _table.separatorStyle = UITableViewCellSeparatorStyleNone;
- // _table.sectionIndexColor = [UIColor grayColor]; //修改右边索引字体的颜色
- // _table.sectionIndexBackgroundColor = [UIColor clearColor];
- // [_table setAutoresizesSubviews:YES];
- // [_table setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)];
- // _table.estimatedRowHeight = 0;
- // _table.estimatedSectionFooterHeight = 0;
- // _table.estimatedSectionHeaderHeight = 0;
- [_table registerNib:[UINib nibWithNibName:@"JLWithdrawalRecordViewCell" bundle:nil] forCellReuseIdentifier:@"JLWithdrawalRecordViewCell"];
- self.tableBody.backgroundColor = HEXCOLOR(0xF0EFF4);
- self.tableBody.scrollEnabled = NO;
- [self.tableBody addSubview:_table];
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
- return _array.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- JLWithdrawalRecordViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"JLWithdrawalRecordViewCell" forIndexPath:indexPath];
- NSDictionary *dict = _array[indexPath.row];
- cell.dict = dict;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
- NSDictionary *dict = _array[indexPath.row];
- NSString *status = [NSString stringWithFormat:@"%@", dict[@"status"]];
-
- return [status intValue] == -1?150:120;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
- return 5;
- }
- - (void)getData {
- [_wait show];
- _array = [NSMutableArray array];
- NSString *userId = [g_default objectForKey:kMY_USER_ID];
- [g_server withdrawlListUserId:userId toView:self];
- }
- -(void)didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{
- [_wait stop];
-
- if([aDownload.action isEqualToString:act_withdrawlList]){
- _array = array1.mutableCopy;
- [_table reloadData];
- }
- }
- @end
|