1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // IHFloorMapManager.swift
- // Inhealth
- //
- // Created by weclouds on 2019/12/13.
- // Copyright © 2019 weclouds. All rights reserved.
- //
- import UIKit
- import PKHUD
- class IHFloorMapManager: NSObject,IHViewManagerProtocolDelegate {
- // private var vc = UIViewController()
- private weak var vc : UIViewController?
- lazy var mainView: IHFloorMapView = {
- let mainView = Bundle.main.loadNibNamed("IHFloorMapView", owner: nil, options: nil)?.last as! IHFloorMapView
- return mainView
- }()
-
- func bindController(_ vc: UIViewController) {
- self.vc = vc
- createUI()
- }
- deinit {
- log.debug("IHFloorMapManager销毁")
- }
- func createUI() {
- mainView.frame = self.vc!.view.bounds
- self.vc?.view.addSubview(mainView)
- requestData(Intermediate.hotelId)
- }
-
- func requestData(_ hotelId:String?) {
- HUD.show(.progress)
- HUD.hide(afterDelay: 15) { (finish) in //设置超时时间
-
- }
- IHAreaService.share.getBuildNavData(hotelId: hotelId, requestSuccess: { (buildlist) in
- HUD.hide()
- if buildlist.count > 0{
- self.mainView.buildListData = buildlist
- }
- }) {
- HUD.flash(.error, delay: 1)
- }
- }
-
- }
|