//
//  ProductPerfectInfoView.m
//  Open
//
//  Created by 雷俊博 on 2020/7/27.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "ProductPerfectInfoView.h"
#import "PerferctInfoCell.h"

@interface ProductPerfectInfoView ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;

@end

@implementation ProductPerfectInfoView
- (void)awakeFromNib {
    [super awakeFromNib];
    [self.tableView registerNib:[UINib nibWithNibName:@"PerferctInfoCell" bundle:nil] forCellReuseIdentifier:@"cell"];
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 100;
    self.tableView.estimatedSectionHeaderHeight = 10.0;
    self.tableView.estimatedSectionFooterHeight = 10.0;
    
    
}

#pragma mark - UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    PerferctInfoCell*cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (indexPath.section == 0) {
        cell.lb_title.text = @"本息保障，50万以内100%赔付";
        cell.lb_content.text = @"银行存款产品，完全执行存款保险条例";
        cell.img.image = [UIImage imageNamed:@"saveguarantee4"];
    }else if (indexPath.section == 1){
        cell.lb_title.text = @"可提前支取，最快实时到账";
        cell.lb_content.text = @"未满付息周期提前支取，根据实际存款天数按银行当日挂牌活期利率付息";
        cell.img.image = [UIImage imageNamed:@"saveUp"];
    }else{
        cell.lb_title.text = @"当日起息，30天期满派息";
        cell.lb_content.text = @"22：00前购买当日起息(含节假日)，产品最高期限5年";
    }
    
    return cell;
}

#pragma mark - UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.1;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
