Commit 42a898b1 authored by Steven杜宇's avatar Steven杜宇

// AI

parent c15f3219
......@@ -111,7 +111,7 @@ class YHAIMainChatViewController: YHBaseViewController {
self.tableView.reloadData()
if canTriggerProgrammaticScroll() {
if disableScrollToBottom {
return
}
......@@ -224,7 +224,9 @@ class YHAIMainChatViewController: YHBaseViewController {
} callBack: {
self.manager.clearGlobalConverastionId()
YHHUD.flash(message: "删除历史记录中...")
self.viewModel.requestConversationId { sessionId in
YHHUD.hide()
if !sessionId.isEmpty {
self.conversationId = sessionId
self.manager.saveGlobalConverastionId(sessionId)
......@@ -417,11 +419,6 @@ extension YHAIMainChatViewController: UITableViewDelegate, UITableViewDataSource
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
}
// 检查是否可以执行代码触发的滚动
func canTriggerProgrammaticScroll() -> Bool {
return !disableScrollToBottom
}
}
extension YHAIMainChatViewController: JXSegmentedListContainerViewListDelegate {
......
......@@ -183,14 +183,16 @@ class YHAIRobotChatViewController: YHBaseViewController {
self.tableView.reloadData()
if canTriggerProgrammaticScroll() {
return
}
DispatchQueue.main.async {
[weak self] in
guard let self = self else { return }
if disableScrollToBottom {
return
}
// 使用 UIView.animate 实现更丝滑的滚动效果
UIView.animate(withDuration: 0.5,
delay: 0,
......@@ -304,7 +306,9 @@ class YHAIRobotChatViewController: YHBaseViewController {
} callBack: {
self.manager.clearLobalSubRobotConversationIdForListItemId("\(self.listItemId)")
YHHUD.flash(message: "删除历史记录中...")
self.viewModel.requestConversationId { sessionId in
YHHUD.hide()
if !sessionId.isEmpty {
self.conversationId = sessionId
self.manager.saveLobalSubRobotConversationId(sessionId, listItemId: "\(self.listItemId)")
......@@ -549,6 +553,7 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
}
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
printLog("DisableScrollToBottom")
disableScrollToBottom = true
self.bottomInputView.showKeyBoard(false)
}
......@@ -561,11 +566,6 @@ extension YHAIRobotChatViewController: UITableViewDelegate, UITableViewDataSourc
func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
}
// 检查是否可以执行代码触发的滚动
func canTriggerProgrammaticScroll() -> Bool {
return !disableScrollToBottom
}
}
extension YHAIRobotChatViewController: JXSegmentedListContainerViewListDelegate {
......
......@@ -207,7 +207,8 @@ extension YHAIServiceListViewController: UICollectionViewDelegate, UICollectionV
headerView.updateGreetingText()
return headerView
}
return UICollectionReusableView()
return UICollectionReusableView(frame: CGRectMake(0, 0, KScreenWidth, 42.0))
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection:Int) -> CGSize {
......
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