主线程更新UI

This commit is contained in:
DDIsFriend
2023-11-13 11:11:51 +08:00
parent 048e9df9cf
commit dd060e4341
13 changed files with 229 additions and 188 deletions

View File

@@ -21,20 +21,25 @@ open class AcceptOrderTool : NSObject {
acceptOrderView.contentLabel.text = TOOL.getOrderString(userInfo: userInfo)
acceptOrderView.readButton.setTitle("查看", for: .normal)
acceptOrderView.readButton.rx.tap
.observe(on: MainScheduler.instance)
.subscribe(onNext: {
ENTRY.dismiss(name: acceptOrderViewEntry) {
//
TOOL.stopVoice()
// -
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? MainTabBarController
let currentNav = tabBarVc?.selectedViewController as? UINavigationController
currentNav?.popToRootViewController(animated: false)
tabBarVc?.selectedIndex = 0
let nav = tabBarVc?.children.first as? UINavigationController
let vc = nav?.children.first as? RescueController
vc?.categoryView.selectItem(at: 0)
DispatchQueue.main.async {
//
TOOL.stopVoice()
// -
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? MainTabBarController
let currentNav = tabBarVc?.selectedViewController as? UINavigationController
currentNav?.popToRootViewController(animated: false)
tabBarVc?.selectedIndex = 0
let nav = tabBarVc?.children.first as? UINavigationController
let vc = nav?.children.first as? RescueController
vc?.categoryView.selectItem(at: 0)
}
}
}).disposed(by: disposeBag)
})
.disposed(by: disposeBag)
ENTRY.showAcceptOrderEntry(view: acceptOrderView,name: acceptOrderViewEntry)
}
}