RebateSuccessTableViewController.m 1.74 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9
//
//  RebateSuccessTableViewController.m
//  Lighting
//
//  Created by 曹云霄 on 16/8/28.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "RebateSuccessTableViewController.h"
曹云霄's avatar
曹云霄 committed
10 11
#import "PromptTableViewCell.h"
#import "PromptHeaderTableViewCell.h"
曹云霄's avatar
曹云霄 committed
12 13 14 15 16 17 18 19 20 21 22 23 24

@interface RebateSuccessTableViewController ()

@end

@implementation RebateSuccessTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.tableFooterView = [UIView new];
}

曹云霄's avatar
曹云霄 committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.titleArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        PromptHeaderTableViewCell *headerView = [tableView dequeueReusableCellWithIdentifier:@"PromptHeaderTableViewCell" forIndexPath:indexPath];
        headerView.headerViewContentLabel.text = self.titleArray[indexPath.row];
        return headerView;
    }
    PromptTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PromptTableViewCell" forIndexPath:indexPath];
    cell.contentLabel.text = self.titleArray[indexPath.row];
    return cell;
}

曹云霄's avatar
曹云霄 committed
42 43
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
曹云霄's avatar
曹云霄 committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    if (indexPath.row == 0) {
        return;
    }
    WS(weakSelf);
    [self dismissViewControllerAnimated:YES completion:^{
        if (weakSelf.ClickEvent) {
            weakSelf.ClickEvent([NSIndexPath indexPathForRow:indexPath.row-1 inSection:0]);
        }
    }];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        return 150;
曹云霄's avatar
曹云霄 committed
59
    }
曹云霄's avatar
曹云霄 committed
60
    return 68;
曹云霄's avatar
曹云霄 committed
61 62 63 64 65
}



@end