12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- //
- // ModelRightCell.m
- // JSJPCoach
- //
- // Created by apple on 2017/3/23.
- // Copyright © 2017年 Danson. All rights reserved.
- //
- #import "ModelRightCell.h"
- @implementation ModelRightCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
- {
- self.backgroundColor = [UIColor clearColor];
- self.selectionStyle = UITableViewCellSelectionStyleNone;
-
- self.headImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 60)];
- [self.headImgView borderCornorRadios:5];
- [self.contentView addSubview:self.headImgView];
-
- self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 10, kSize.width - 40 - 80 - 70, 30)];
- [self.nameLabel setText:@"" Font:Font17 TextColor:newTitleColor];
- [self.contentView addSubview:self.nameLabel];
-
- self.RO_StateLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 12, kSize.width - 40 - 80 - 70 - 40, 26)];
- [self.RO_StateLabel setText:@"" Font:Font14 TextColor:defGreen Alignment:NSTextAlignmentRight];
- [self.contentView addSubview:self.RO_StateLabel];
-
- self.telLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 40, kSize.width - 40 -80 - 70, 30)];
- [self.nameLabel setText:@"" Font:Font17 TextColor:newSubTitleColor];
- [self.contentView addSubview:self.telLabel];
- }
- return self;
- }
- -(void)setDataDic:(NSDictionary *)dataDic
- {
- _dataDic = dataDic;
-
- NSString *imgpath = dataDic[@"PHOTO"];
- if (imgpath.length < 1) {
- imgpath = @"";
- }
- [self.headImgView sd_setImageWithURL:[NSURL URLWithString:imgpath] placeholderImage:[UIImage imageNamed:@"noHeadImg.png"]];
-
- self.nameLabel.text = dataDic[@"RI_USER_NAME"];
- self.telLabel.text = dataDic[@"RI_USER_TEL"];
-
- //已练过车
- if ([dataDic[@"RO_STATUS"] length] > 0) {
- _RO_StateLabel.hidden = NO;
- if ([dataDic[@"RO_STATUS"] isEqualToString:@"0"]) {
- //正在计时中
- _RO_StateLabel.text = @"正在带教中";
- }else{
- //订单已完成
- _RO_StateLabel.text = @"订单已完成";
- }
- }else{
- _RO_StateLabel.hidden = YES;
- }
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- self.contentView.backgroundColor = selected ? [UIColor colorWithWhite:0.9 alpha:0.2] : [UIColor clearColor];
- // Configure the view for the selected state
- }
- @end
|