OOAttendanceScheduleViewCell.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // OOAttendanceScheduleViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2020/7/21.
  6. // Copyright © 2020 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class OOAttendanceScheduleViewCell: UICollectionViewCell {
  10. @IBOutlet weak var checkInTypeLabel: UILabel!
  11. @IBOutlet weak var updateCheckInBtn: UIButton!
  12. @IBOutlet weak var checkInStatusLabel: UILabel!
  13. @IBOutlet weak var checkInTimeLabel: UILabel!
  14. override func awakeFromNib() {
  15. super.awakeFromNib()
  16. // Initialization code
  17. }
  18. func setData(info: OOAttandanceMobileScheduleInfo, isLastRecord: Bool) {
  19. self.checkInTypeLabel.text = info.checkinType
  20. self.checkInTimeLabel.text = info.signTime
  21. self.checkInStatusLabel.text = info.checkinStatus
  22. self.updateCheckInBtn.isHidden = true
  23. if info.checkinStatus == "已打卡" {
  24. if let time = info.checkinTime {
  25. self.checkInStatusLabel.text = time.subString(from: 0, to: 5) + (info.checkinStatus ?? "")
  26. }
  27. if isLastRecord {
  28. self.updateCheckInBtn.isHidden = false
  29. }
  30. }
  31. }
  32. }