RQSimulationResultsListCell.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // RQSimulationResultsListCell.m
  3. // SDJK
  4. //
  5. // Created by 张嵘 on 2021/8/11.
  6. //
  7. #import "RQSimulationResultsListCell.h"
  8. @interface RQSimulationResultsListCell ()
  9. @property (nonatomic, readwrite, strong) RQSimulationResultsListItemViewModel *viewModel;
  10. @property (weak, nonatomic) IBOutlet UILabel *carTypeLabel;
  11. @property (weak, nonatomic) IBOutlet UILabel *subjectLabel;
  12. @property (weak, nonatomic) IBOutlet UILabel *scoreLabel;
  13. @property (weak, nonatomic) IBOutlet UILabel *dateLabel;
  14. @end
  15. @implementation RQSimulationResultsListCell
  16. #pragma mark - PublicMethods
  17. + (instancetype)cellWithTableView:(UITableView *)tableView {
  18. static NSString *ID = @"RQSimulationResultsListCell";
  19. RQSimulationResultsListCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  20. if (!cell) {
  21. cell = [self rq_viewFromXib];
  22. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  23. }
  24. return cell;
  25. }
  26. - (void)bindViewModel:(RQSimulationResultsListItemViewModel *)viewModel {
  27. _viewModel = viewModel;
  28. self.carTypeLabel.text = viewModel.scoreRecordModel.type;
  29. self.subjectLabel.text = viewModel.scoreRecordModel.kskm;
  30. self.scoreLabel.text = [NSString stringWithFormat:@"%ld",viewModel.scoreRecordModel.score];
  31. self.dateLabel.text = viewModel.scoreRecordModel.createTime;
  32. }
  33. #pragma mark - SystemMethods
  34. - (void)awakeFromNib {
  35. [super awakeFromNib];
  36. // Initialization code
  37. }
  38. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  39. [super setSelected:selected animated:animated];
  40. // Configure the view for the selected state
  41. }
  42. @end