//
//  AddressTableViewCell.m
//  ChooseLocation
//
//  Created by Sekorm on 16/8/26.
//  Copyright © 2016年 HY. All rights reserved.
//

#import "AddressTableViewCell.h"
#import "AddressItem.h"

@interface AddressTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet UIImageView *selectFlag;
@end
@implementation AddressTableViewCell

- (void)setItem:(AddressItem *)item{
    
    _item = item;
    _addressLabel.text = item.name;
    _addressLabel.textColor = item.isSelected ? [UIColor orangeColor] : [UIColor blackColor] ;
    _selectFlag.hidden = !item.isSelected;
}

- (void)setProvinceModel:(ProvinceModel *)provinceModel
{
    _provinceModel = provinceModel;
    _addressLabel.text = provinceModel.provice_name;
    _addressLabel.textColor = provinceModel.isSelected ? [UIColor orangeColor] : [UIColor blackColor] ;
    _selectFlag.hidden = !provinceModel.isSelected;
}
- (void)setCityModel:(CModel *)cityModel
{
    _cityModel = cityModel;
    _addressLabel.text = cityModel.city_name;
    _addressLabel.textColor = cityModel.isSelected ? [UIColor orangeColor] : [UIColor blackColor] ;
    _selectFlag.hidden = !cityModel.isSelected;
}

- (void)setCountyModel:(CountyModel *)countyModel
{
    _countyModel = countyModel;
    _addressLabel.text = countyModel.county_name;
    _addressLabel.textColor = countyModel.isSelected ? [UIColor orangeColor] : [UIColor blackColor] ;
    _selectFlag.hidden = !countyModel.isSelected;
}

- (void)setModel:(PayCityModel *)model{
    
    _model = model;
    _addressLabel.text = model.name;
    _addressLabel.textColor = model.isSelected ? [UIColor redColor] : [UIColor blackColor] ;
    _selectFlag.hidden = !model.isSelected;
}

@end
