IHHotelCell.swift 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // IHHotelCell.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2019/12/12.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. class IHHotelCell: UITableViewCell {
  10. var hotel : HotelViewData?{
  11. didSet{
  12. if let hotel = self.hotel {
  13. let letter = hotel.name! as NSString
  14. iconLabel.text = letter.substring(to: 1)
  15. nameLabel.text = hotel.name
  16. alarmCountLabel.text = hotel.alarmCount
  17. if hotel.type == "1"{
  18. lightCountLabel.text = hotel.classroomLightCount!
  19. cirCountLabel.text = hotel.blackboardLightCount!
  20. sensorCountLabel.text = hotel.panelDeviceCount!
  21. purifierCountLabel.text = hotel.curtainDeviceCount!
  22. gateWayCountLabel.text = hotel.netCount!
  23. }else{
  24. lightCountLabel.text = hotel.lightCount
  25. cirCountLabel.text = hotel.cicLightCount
  26. sensorCountLabel.text = hotel.sensorCount
  27. purifierCountLabel.text = hotel.airPurCount
  28. }
  29. }
  30. }
  31. }
  32. @IBOutlet weak var iconLabel: UILabel!
  33. @IBOutlet weak var nameLabel: UILabel!
  34. @IBOutlet weak var lightCountLabel: UILabel!
  35. @IBOutlet weak var cirCountLabel: UILabel!
  36. @IBOutlet weak var sensorCountLabel: UILabel!
  37. @IBOutlet weak var purifierCountLabel: UILabel!
  38. @IBOutlet weak var alarmCountLabel: UILabel!
  39. @IBOutlet weak var gateWayCountLabel: UILabel!
  40. override func awakeFromNib() {
  41. super.awakeFromNib()
  42. // Initialization code
  43. // addBottomDashView()
  44. }
  45. override func setSelected(_ selected: Bool, animated: Bool) {
  46. super.setSelected(selected, animated: animated)
  47. // Configure the view for the selected state
  48. }
  49. }