IHFloorMapManager.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // IHFloorMapManager.swift
  3. // Inhealth
  4. //
  5. // Created by weclouds on 2019/12/13.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. import PKHUD
  10. class IHFloorMapManager: NSObject,IHViewManagerProtocolDelegate {
  11. // private var vc = UIViewController()
  12. private weak var vc : UIViewController?
  13. lazy var mainView: IHFloorMapView = {
  14. let mainView = Bundle.main.loadNibNamed("IHFloorMapView", owner: nil, options: nil)?.last as! IHFloorMapView
  15. return mainView
  16. }()
  17. func bindController(_ vc: UIViewController) {
  18. self.vc = vc
  19. createUI()
  20. }
  21. deinit {
  22. log.debug("IHFloorMapManager销毁")
  23. }
  24. func createUI() {
  25. mainView.frame = self.vc!.view.bounds
  26. self.vc?.view.addSubview(mainView)
  27. requestData(Intermediate.hotelId)
  28. }
  29. func requestData(_ hotelId:String?) {
  30. HUD.show(.progress)
  31. HUD.hide(afterDelay: 15) { (finish) in //设置超时时间
  32. }
  33. IHAreaService.share.getBuildNavData(hotelId: hotelId, requestSuccess: { (buildlist) in
  34. HUD.hide()
  35. if buildlist.count > 0{
  36. self.mainView.buildListData = buildlist
  37. }
  38. }) {
  39. HUD.flash(.error, delay: 1)
  40. }
  41. }
  42. }