Commit 0b397d4c authored by Alex朱枝文's avatar Alex朱枝文

IM相关调整

parent 4fa16fab
...@@ -41,9 +41,9 @@ class YHTencentDeskManager: NSObject { ...@@ -41,9 +41,9 @@ class YHTencentDeskManager: NSObject {
/// 需要隐藏已读未读 /// 需要隐藏已读未读
TUIConfig.default().needHideReadReceipt = true TUIConfig.default().needHideReadReceipt = true
/// 需要隐藏聊天页点击用户头像显示用户信息 /// 需要隐藏聊天页点击用户头像显示用户信息
TUIChatConfig.default().needHideShowUserInfoPage = false TUIChatConfig.default().needHideShowUserInfoPage = true
/// 需要隐藏显示聊天页rightBarButton按钮 /// 需要隐藏显示聊天页rightBarButton按钮
TUIChatConfig.default().needHideNaviMore = false TUIChatConfig.default().needHideNaviMore = true
} }
func loginSDK() { func loginSDK() {
......
...@@ -502,7 +502,18 @@ private extension YHResourceViewController { ...@@ -502,7 +502,18 @@ private extension YHResourceViewController {
guard let self = self else { guard let self = self else {
return return
} }
self.messageHandler.gotoChatVC(senderID: "") YHHUD.show(.progress(message: "加载中..."))
self.viewModel.getDemandYhId { [weak self] id in
guard let self = self else {
return
}
YHHUD.hide()
if id.isEmpty {
YHHUD.flash(message: "获取银河ID失败")
return
}
self.messageHandler.gotoChatVC(senderID: id)
}
} }
} }
......
...@@ -161,13 +161,20 @@ class YHResourceViewModel: NSObject { ...@@ -161,13 +161,20 @@ class YHResourceViewModel: NSObject {
} }
} }
/// 切换收藏状态(如果有收藏功能的话) func getDemandYhId(callback: @escaping (String) -> Void) {
/// - Parameters: let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Resource.yhManagerId + "?mode=1"
/// - resourceId: 资源ID _ = YHNetRequest.getRequest(url: strUrl) { json, _ in
/// - completion: 完成回调 if json.code == 200 {
func toggleFavorite(resourceId: String, completion: @escaping (Bool, String?) -> Void) { guard let dic = json.data?.peel as? [String: Any], let result = ActiticyIdModel.deserialize(from: dic) else {
// TODO: 如果后端提供收藏接口,在这里实现 return
// 目前暂时不支持收藏功能 }
completion(false, "暂不支持收藏功能") callback(result.yh_id)
} else {
callback("")
}
} failBlock: { _ in
callback("")
}
} }
} }
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