//
//  WithDrawPayWayCell.m
//  Open
//
//  Created by 雷俊博 on 2020/10/26.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "WithDrawPayWayCell.h"

@interface WithDrawPayWayCell ()<WithDrawFooterViewDelegate>


@end

@implementation WithDrawPayWayCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        //标题
        UILabel* lb_title = [UILabel new];
        lb_title.textColor = [UIColor colorWithHex:0x4d4d4d];
        lb_title.font = [UIFont boldSystemFontOfSize:16.0];
        lb_title.text = @"提现方式";
        [self.contentView addSubview:lb_title];
        self.titleLabel = lb_title;
        
        //方式
        CGFloat width = (ScreenWidth - 2 * 10 * WIDTHRADIU - 20 * WIDTHRADIU * 2)  / 3;
        CGFloat height = 40 * WIDTHRADIU;
        CGRect cellFrame = CGRectMake(20 * WIDTHRADIU, 45 * WIDTHRADIU, width, height);
        WithDrawCollectionViewCell *cell = [[WithDrawCollectionViewCell alloc]initWithFrame:cellFrame];
        cell.hiddenImg = YES;
        cell.cellSelected = YES;
        
        [self.contentView addSubview:cell];
        
        self.cell = cell;

        //绑定
        CGRect footerFrame = CGRectMake(0, 95* WIDTHRADIU, ScreenWidth, 35 * WIDTHRADIU);
        WithDrawFooterView *footerView = [[WithDrawFooterView alloc]initWithFrame:footerFrame];
        footerView.delegate = self;
        [self.contentView addSubview:footerView];
        self.footerView = footerView;
        
        [self configFrame];
    }
    return self;
}

- (void)configFrame {
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(20 * WIDTHRADIU);
        make.top.offset(15 * WIDTHRADIU);
    }];
    
   
}


#pragma mark - WithDrawFooterViewDelegate
- (void)bindWxWithbtn:(UIButton *)sender
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(bindWXWithCell:)]) {
        [self.delegate bindWXWithCell:self];
    }
}


+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"WithDrawPayWayCell";
    
    WithDrawPayWayCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    
    if (cell == nil) {
        cell = [[WithDrawPayWayCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
