Commit aec821c3 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit '915fabf6' into xiezhaolin

parents 11b6677d 915fabf6
...@@ -28,7 +28,7 @@ class YHTabBarViewController: ESTabBarController { ...@@ -28,7 +28,7 @@ class YHTabBarViewController: ESTabBarController {
func addObservers() { func addObservers() {
NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(loginSuccess), name: YhConstant.YhNotification.didLoginSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccess), name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(clearAllUnreadMsg), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(clearAllUnreadBadge), name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(getTotalUnreadMsgCount), name: YhConstant.YhNotification.didRequestUnreadMsgTotalCountNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(getTotalUnreadMsgCount), name: YhConstant.YhNotification.didRequestUnreadMsgTotalCountNotification, object: nil)
} }
...@@ -53,7 +53,7 @@ extension YHTabBarViewController { ...@@ -53,7 +53,7 @@ extension YHTabBarViewController {
} }
@objc func clearAllUnreadMsg() { @objc func clearAllUnreadBadge() {
DispatchQueue.main.async { DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] { if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
msgListVC.tabBarItem.badgeValue = nil msgListVC.tabBarItem.badgeValue = nil
...@@ -67,7 +67,6 @@ extension YHTabBarViewController { ...@@ -67,7 +67,6 @@ extension YHTabBarViewController {
self.viewModel.requestTotalUnreadMsgCount { self.viewModel.requestTotalUnreadMsgCount {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if !success { return }
DispatchQueue.main.async { DispatchQueue.main.async {
if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] { if let vcs = self.viewControllers, let msgListVC = vcs[safe: 2] {
let count = self.viewModel.unreadTotalCount let count = self.viewModel.unreadTotalCount
......
...@@ -118,21 +118,15 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget ...@@ -118,21 +118,15 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
YHHUD.hide() YHHUD.hide()
if success {
DispatchQueue.main.async { DispatchQueue.main.async {
YHHUD.flash(message: "退出成功") YHHUD.flash(message: "退出成功")
YHLoginManager.shared.clearUserInfo() YHLoginManager.shared.clearUserInfo()
NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil) NotificationCenter.default.post(name: YhConstant.YhNotification.didLogoutSuccessNotifiction, object: nil)
// 发送清空所有未读消息通知
NotificationCenter.default.post(name: YhConstant.YhNotification.didMarkAllMessagesReadedNotifiction, object: nil)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
} }
return return
}
var msg = "退出失败"
if let error = error, !error.errorMsg.isEmpty {
msg = error.errorMsg
}
YHHUD.flash(message: msg)
} }
} }
} }
......
...@@ -182,7 +182,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -182,7 +182,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
self.msgViewModel.requestTotalUnreadMsgCount { self.msgViewModel.requestTotalUnreadMsgCount {
[weak self] success, error in [weak self] success, error in
guard let self = self else { return } guard let self = self else { return }
if !success { return }
DispatchQueue.main.async { DispatchQueue.main.async {
let count = self.msgViewModel.unreadTotalCount let count = self.msgViewModel.unreadTotalCount
for item in self.items { for item in self.items {
...@@ -259,9 +258,8 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -259,9 +258,8 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
} }
case .myTestCode://我的测评码 case .myTestCode://我的测评码
printLog("我的测评码") printLog("我的测评码")
YHHUD.flash(message: "还需要产品给图片链接")
let vc = YHHomeWebViewController() let vc = YHHomeWebViewController()
vc.url = "https://upload.cdn.galaxy-immi.com/sell/product/images/page-1686138671996.png" vc.url = "https://test-cdn-pub.galaxy-immi.com/5000000/2377716732943678766120240418180233.png"
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
case .appointGalaxyBay://预约银河湾 case .appointGalaxyBay://预约银河湾
......
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