Commit 1a348bec authored by Steven杜宇's avatar Steven杜宇

// 添加H5交互方法, 切换服务页的index

parent a69a2f0d
...@@ -16,6 +16,11 @@ class YHServerCenterHoldViewController: UIViewController { ...@@ -16,6 +16,11 @@ class YHServerCenterHoldViewController: UIViewController {
var mobile: String = "" var mobile: String = ""
var orderType: Int = 0 var orderType: Int = 0
var productInfoMode: YHContactItemModel = YHContactItemModel() var productInfoMode: YHContactItemModel = YHContactItemModel()
var defaultSelectedIndex: Int = 0 {
didSet {
segmentedView.defaultSelectedIndex = defaultSelectedIndex
}
}
var orderId: Int = 0 { var orderId: Int = 0 {
didSet { didSet {
for i in 0..<arrItemTitles.count { for i in 0..<arrItemTitles.count {
......
...@@ -75,7 +75,7 @@ class YHServiceCenterViewController: YHBaseViewController { ...@@ -75,7 +75,7 @@ class YHServiceCenterViewController: YHBaseViewController {
didSet { didSet {
DispatchQueue.global().asyncAfter(wallDeadline: .now() ) {[weak self] in DispatchQueue.global().asyncAfter(wallDeadline: .now() ) {[weak self] in
DispatchQueue.main.async { DispatchQueue.main.async {
// self?.cellView.myDefaultNavItemIndex = self?.myDefaultIndex ?? 0 self?.cellView.defaultSelectedIndex = self?.myDefaultIndex ?? 0
} }
} }
} }
...@@ -124,6 +124,8 @@ class YHServiceCenterViewController: YHBaseViewController { ...@@ -124,6 +124,8 @@ class YHServiceCenterViewController: YHBaseViewController {
NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name: Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(endDragging), name: Notification.Name(rawValue: "scrollViewDidEndDragging0"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didJumpToServiceProgess(_:)), name: YhConstant.YhNotification.didJumpToServiceProgressNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(didJumpToServiceProgess(_:)), name: YhConstant.YhNotification.didJumpToServiceProgressNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(didSwitchIndex(_:)), name: YhConstant.YhNotification.didJumpToServicePageSwitchIndexNotification, object: nil)
} }
private func goToServiceProgressVC() { private func goToServiceProgressVC() {
...@@ -154,6 +156,13 @@ class YHServiceCenterViewController: YHBaseViewController { ...@@ -154,6 +156,13 @@ class YHServiceCenterViewController: YHBaseViewController {
} }
} }
@objc func didSwitchIndex(_ notification: Notification) {
if let userInfo = notification.userInfo, let status = userInfo["status"] as? String {
let index = Int(status) ?? 0
self.myDefaultIndex = index
}
}
@objc func logoutSuccess() { @objc func logoutSuccess() {
self.model = YHContactItemModel() self.model = YHContactItemModel()
self.oldModel = YHContactItemModel() self.oldModel = YHContactItemModel()
......
...@@ -818,4 +818,13 @@ extension YHJsApi { ...@@ -818,4 +818,13 @@ extension YHJsApi {
} }
} }
} }
@objc func goServiceStatus(_ status: String) {
DispatchQueue.main.async {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .service)
NotificationCenter.default.post(name: YhConstant.YhNotification.didJumpToServicePageSwitchIndexNotification, object: nil, userInfo: ["status": status])
}
}
} }
...@@ -411,6 +411,7 @@ extension YhConstant { ...@@ -411,6 +411,7 @@ extension YhConstant {
public static let closeShareUIInLiveRoomNotifiction = Notification.Name(rawValue: "com.yinhe.app.close.share.ui") public static let closeShareUIInLiveRoomNotifiction = Notification.Name(rawValue: "com.yinhe.app.close.share.ui")
// 跳转到服务Tab 中的 服务进度 // 跳转到服务Tab 中的 服务进度
public static let didJumpToServiceProgressNotification = Notification.Name(rawValue: "com.yinhe.service.tab.serviceprogress") public static let didJumpToServiceProgressNotification = Notification.Name(rawValue: "com.yinhe.service.tab.serviceprogress")
public static let didJumpToServicePageSwitchIndexNotification = Notification.Name(rawValue: "com.yinhe.service.tab.switch")
// txIM未读消息数量变化 // txIM未读消息数量变化
public static let didTxIMUnReadMsgCountChangeNotification = Notification.Name(rawValue: "com.yinhe.txIM.unReadMsgCountChange") public static let didTxIMUnReadMsgCountChangeNotification = Notification.Name(rawValue: "com.yinhe.txIM.unReadMsgCountChange")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment