OOAttanceItemCell.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // OOAttanceItemCell.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 2018/5/15.
  6. // Copyright © 2018年 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class OOAttanceItemCell: UITableViewCell,Configurable {
  10. @IBOutlet weak var topLineImageView: UIImageView!
  11. @IBOutlet weak var bottomLineImageView: UIImageView!
  12. @IBOutlet weak var checkTimeLabel: UILabel!
  13. @IBOutlet weak var checkLocationLabel: UILabel!
  14. @IBOutlet weak var checkStatusImageView: UIImageView!
  15. override func awakeFromNib() {
  16. super.awakeFromNib()
  17. // Initialization code
  18. }
  19. override func setSelected(_ selected: Bool, animated: Bool) {
  20. super.setSelected(selected, animated: animated)
  21. // Configure the view for the selected state
  22. }
  23. func config(withItem item: Any?) {
  24. guard let model = item as? OOAttandanceMobileDetail else {
  25. return
  26. }
  27. var showTime = ""
  28. if let time = model.signTime {
  29. if time.length > 5 {
  30. showTime = time.subString(from: 0, to: 5)
  31. }else {
  32. showTime = time
  33. }
  34. }
  35. if let type = model.checkin_type {
  36. checkTimeLabel.text = "\(type): \(showTime)"
  37. }else {
  38. checkTimeLabel.text = "打开时间: \(showTime)"
  39. }
  40. checkLocationLabel.text = "\(model.recordAddress ?? "")"
  41. }
  42. }