ModelRightCell.m 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //
  2. // ModelRightCell.m
  3. // JSJPCoach
  4. //
  5. // Created by apple on 2017/3/23.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "ModelRightCell.h"
  9. @implementation ModelRightCell
  10. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
  13. {
  14. self.backgroundColor = [UIColor clearColor];
  15. self.selectionStyle = UITableViewCellSelectionStyleNone;
  16. self.headImgView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 60)];
  17. [self.headImgView borderCornorRadios:5];
  18. [self.contentView addSubview:self.headImgView];
  19. self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 10, kSize.width - 40 - 80 - 70, 30)];
  20. [self.nameLabel setText:@"" Font:Font17 TextColor:newTitleColor];
  21. [self.contentView addSubview:self.nameLabel];
  22. self.RO_StateLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 12, kSize.width - 40 - 80 - 70 - 40, 26)];
  23. [self.RO_StateLabel setText:@"" Font:Font14 TextColor:defGreen Alignment:NSTextAlignmentRight];
  24. [self.contentView addSubview:self.RO_StateLabel];
  25. self.telLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 40, kSize.width - 40 -80 - 70, 30)];
  26. [self.nameLabel setText:@"" Font:Font17 TextColor:newSubTitleColor];
  27. [self.contentView addSubview:self.telLabel];
  28. }
  29. return self;
  30. }
  31. -(void)setDataDic:(NSDictionary *)dataDic
  32. {
  33. _dataDic = dataDic;
  34. NSString *imgpath = dataDic[@"PHOTO"];
  35. if (imgpath.length < 1) {
  36. imgpath = @"";
  37. }
  38. [self.headImgView sd_setImageWithURL:[NSURL URLWithString:imgpath] placeholderImage:[UIImage imageNamed:@"noHeadImg.png"]];
  39. self.nameLabel.text = dataDic[@"RI_USER_NAME"];
  40. self.telLabel.text = dataDic[@"RI_USER_TEL"];
  41. //已练过车
  42. if ([dataDic[@"RO_STATUS"] length] > 0) {
  43. _RO_StateLabel.hidden = NO;
  44. if ([dataDic[@"RO_STATUS"] isEqualToString:@"0"]) {
  45. //正在计时中
  46. _RO_StateLabel.text = @"正在带教中";
  47. }else{
  48. //订单已完成
  49. _RO_StateLabel.text = @"订单已完成";
  50. }
  51. }else{
  52. _RO_StateLabel.hidden = YES;
  53. }
  54. }
  55. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  56. [super setSelected:selected animated:animated];
  57. self.contentView.backgroundColor = selected ? [UIColor colorWithWhite:0.9 alpha:0.2] : [UIColor clearColor];
  58. // Configure the view for the selected state
  59. }
  60. @end