ApexDriverUploadCell.m 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //
  2. // ApexDriverUploadCell.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/6.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "ApexDriverUploadCell.h"
  9. @interface ApexDriverUploadCell ()
  10. @property (strong, nonatomic) IBOutlet UILabel *orderNoLabel;
  11. @property (strong, nonatomic) IBOutlet UILabel *actionLabel;
  12. @property (strong, nonatomic) IBOutlet UILabel *dateLabel;
  13. @property (strong, nonatomic) IBOutlet UILabel *statusLabel;
  14. @property (strong, nonatomic) IBOutlet UILabel *progressLabel;
  15. @property (strong, nonatomic) IBOutlet UILabel *tipsLabel;
  16. @property (strong, nonatomic) IBOutlet UIProgressView *progressView;
  17. @end
  18. @implementation ApexDriverUploadCell
  19. - (void)awakeFromNib {
  20. [super awakeFromNib];
  21. // Initialization code
  22. [self reset];
  23. }
  24. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  25. [super setSelected:selected animated:animated];
  26. // Configure the view for the selected state
  27. }
  28. - (void)prepareForReuse {
  29. [super prepareForReuse];
  30. [self reset];
  31. }
  32. - (void)reset {
  33. self.orderID = nil;
  34. self.action = nil;
  35. self.datetime = nil;
  36. self.progress = 0;
  37. self.status = nil;
  38. self.errMsg = nil;
  39. }
  40. - (void)setProgress:(float)progress {
  41. if (progress < 0) {
  42. progress = 0.0f;
  43. }
  44. if (progress > 1) {
  45. progress = 1.0f;
  46. }
  47. _progress = progress;
  48. self.progressView.progress = progress;
  49. progress = progress * 100;
  50. self.progressLabel.text = [NSString stringWithFormat:@"%.1f%%",progress];
  51. }
  52. - (void)setStatus:(NSString *)status {
  53. _status = status;
  54. self.statusLabel.text = _status;
  55. }
  56. - (void)setErrMsg:(NSString *)errMsg {
  57. _errMsg = errMsg;
  58. if (errMsg.length) {
  59. self.tipsLabel.hidden = NO;
  60. self.tipsLabel.text = errMsg;
  61. } else {
  62. self.tipsLabel.hidden = YES;
  63. self.tipsLabel.text = nil;
  64. }
  65. }
  66. - (void)setOrderID:(NSString *)orderID {
  67. _orderID = orderID;
  68. self.orderNoLabel.text = orderID;
  69. }
  70. - (void)setAction:(NSString *)action {
  71. _action = action;
  72. self.actionLabel.text = action;
  73. }
  74. - (void)setDatetime:(NSString *)datetime {
  75. _datetime = datetime;
  76. self.dateLabel.text = datetime;
  77. }
  78. @end