// // PriceCell.m // JSJPCoach // // Created by apple on 2017/3/27. // Copyright © 2017年 Danson. All rights reserved. // #import "PriceCell.h" @implementation PriceCell - (void)awakeFromNib { [super awakeFromNib]; } -(void)setPriceDic:(NSDictionary *)priceDic { _priceDic = priceDic; NSString *strSD = @""; switch ([priceDic[@"CSI_TRAINNINGTIME"] integerValue]) { case 0: strSD = @"全时段"; break; case 1: strSD = @"普通时段"; break; case 2: strSD = @"高峰时段"; break; case 3: strSD = @"节假日"; break; default: break; } NSString *priceString = [NSString stringWithFormat:@"%@元/时",priceDic[@"CSI_PRICE"]]; if ([priceString containsString:@"免费"]) { priceString = @"免费"; } [_carTypeLabel setText:priceDic[@"CSI_VEHICLETYPE"] Font:Font16 TextColor:newTitleColor Alignment:NSTextAlignmentLeft]; [_priceLabel setText:priceString Font:Font16 TextColor:newTitleColor Alignment:NSTextAlignmentLeft]; [_timeLabel setText:strSD Font:Font16 TextColor:newTitleColor Alignment:NSTextAlignmentLeft]; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; self.contentView.backgroundColor = selected ? [UIColor colorWithWhite:0 alpha:0.2] : [UIColor clearColor]; } @end