123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- //
- // TrainPriceListCell.m
- // LN_School
- //
- // Created by EchoShacolee on 2017/4/19.
- // Copyright © 2017年 Danson. All rights reserved.
- //
- #import "TrainPriceListCell.h"
- @implementation TrainPriceListCell
- - (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
- }
- -(void)upDataWithDic:(NSDictionary *)dic{
- _type.text = [NSString stringWithFormat:@"培训车型:%@",dic[@"CSI_VEHICLETYPE"]];
-
- NSString *priceStr = [NSString stringWithFormat:@"培训价格:%@元",dic[@"CSI_PRICE"]];
- NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:priceStr];
- //获取要调整颜色的文字位置,调整颜色
- NSRange range1={5,priceStr.length-5};
- [hintString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range1];
- _price.attributedText=hintString;
- _record.text = [NSString stringWithFormat:@"备案日期:%@",dic[@"CSI_RECORD_DATE"]];
-
- //@"一次性收费",@"计时收费",@"分段式收费",@"其他",
- switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_CHARGEMODE"]] integerValue]) {
- case 1:
- {
- _shoufei.text = @"收费模式:一次性收费";
- }
- break;
- case 2:
- {
- _shoufei.text = @"收费模式:计时收费";
- }
- break;
- case 3:
- {
- _shoufei.text = @"收费模式:分段式收费";
- }
- break;
- case 9:
- {
- _shoufei.text = @"收费模式:其它";
- }
- break;
-
- default:
- break;
- }
-
- //@"普通时段",@"高峰时段",@"节假日时段"
- switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_TRAINNINGTIME"]] integerValue]) {
- case 1:
- {
- _trainTime.text = @"培训时段:普通时段";
- }
- break;
- case 2:
- {
- _trainTime.text = @"培训时段:高峰时段";
- }
- break;
- case 3:
- {
- _trainTime.text = @"培训时段:节假日时段";
- }
- break;
-
- default:
- break;
- }
-
- //@[@"定时培训",@"预约培训",@"其它"]
- switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_TRAINNINGMODE"]] integerValue]) {
- case 1:
- {
- _train.text = @"培训模式:定时培训";
- }
- break;
- case 2:
- {
- _train.text = @"培训模式:预约培训";
- }
- break;
- case 9:
- {
- _train.text = @"培训模式:其它";
- }
- break;
-
- default:
- break;
- }
-
- switch ([[NSString stringWithFormat:@"%@",dic[@"CSI_SUBJECT"]] integerValue]) {
- case 1:
- {
- _subject.text = @"培训部分及方式:第一部份集中教学";
- }
- break;
- case 2:
- {
- _subject.text = @"培训部分及方式:第一部份网络教学";
- }
- break;
- case 3:
- {
- _subject.text = @"培训部分及方式:第四部份集中教学";
- }
- break;
- case 4:
- {
- _subject.text = @"培训部分及方式:第四部份网络教学";
- }
- break;
- case 5:
- {
- _subject.text = @"培训部分及方式:模拟器教学";
- }
- break;
- case 6:
- {
- _subject.text = @"培训部分及方式:第二部份普通教学";
- }
- break;
- case 7:
- {
- _subject.text = @"培训部分及方式:第二部份智能教学";
- }
- break;
- case 8:
- {
- _subject.text = @"培训部分及方式:第三部份普通教学";
- }
- break;
- case 9:
- {
- _subject.text = @"培训部分及方式:第三部份智能教学";
- }
- break;
-
- default:
- break;
- }
-
- }
- - (void)layoutSubviews
- {
- [super layoutSubviews];
- for (UIControl *control in self.subviews) {
- if (![control isMemberOfClass:NSClassFromString(@"UITableViewCellEditControl")]){
- continue;
- }
-
- for (UIView *subView in control.subviews) {
- if (![subView isKindOfClass: [UIImageView class]]) {
- continue;
- }
-
- //
- [subView setValue:RQMianColor forKey:@"tintColor"];
-
- // UIImageView *imageView = (UIImageView *)subView;
- // if (self.selected) {
- // imageView.image = [UIImage imageNamed:@"ic_squSelect_h"]; // 选中时的图片
- // } else {
- // imageView.image = [UIImage imageNamed:@"ic_squSelect"]; // 未选中时的图片
- // }
- }
- }
- }
- @end
|