Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
水玉婷
ai-wechat
Commits
cdb9ca29
Commit
cdb9ca29
authored
Mar 10, 2026
by
水玉婷
Browse files
feat:修复历史记录刷新跟点击之间的bug
parent
8344d1e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/views/History.vue
View file @
cdb9ca29
...
@@ -256,7 +256,14 @@ const getChatRecordList = async (isLoadMore = false) => {
...
@@ -256,7 +256,14 @@ const getChatRecordList = async (isLoadMore = false) => {
};
};
// 通用的开始事件处理
// 通用的开始事件处理
const
handleStart
=
(
clientY
:
number
,
target
:
HTMLElement
)
=>
{
const
handleStart
=
(
clientY
:
number
,
target
:
HTMLElement
,
event
:
Event
)
=>
{
// 检查是否点击了历史记录项(阻止下拉刷新)
const
historyItem
=
(
event
.
target
as
HTMLElement
).
closest
(
'
.history-item
'
);
if
(
historyItem
)
{
// 点击了历史记录项,不触发下拉刷新
return
;
}
// 只有在顶部且没有在滚动时才允许下拉刷新
// 只有在顶部且没有在滚动时才允许下拉刷新
if
(
target
.
scrollTop
===
0
&&
!
isRefreshing
.
value
)
{
if
(
target
.
scrollTop
===
0
&&
!
isRefreshing
.
value
)
{
pullDownStartY
.
value
=
clientY
;
pullDownStartY
.
value
=
clientY
;
...
@@ -267,7 +274,7 @@ const handleStart = (clientY: number, target: HTMLElement) => {
...
@@ -267,7 +274,7 @@ const handleStart = (clientY: number, target: HTMLElement) => {
// 下拉刷新触摸事件处理
// 下拉刷新触摸事件处理
const
handleTouchStart
=
(
event
:
TouchEvent
)
=>
{
const
handleTouchStart
=
(
event
:
TouchEvent
)
=>
{
const
target
=
event
.
currentTarget
as
HTMLElement
;
const
target
=
event
.
currentTarget
as
HTMLElement
;
handleStart
(
event
.
touches
[
0
].
clientY
,
target
);
handleStart
(
event
.
touches
[
0
].
clientY
,
target
,
event
);
};
};
// 通用的移动事件处理
// 通用的移动事件处理
...
@@ -307,7 +314,7 @@ const handleTouchEnd = () => {
...
@@ -307,7 +314,7 @@ const handleTouchEnd = () => {
// PC端鼠标事件处理
// PC端鼠标事件处理
const
handleMouseDown
=
(
event
:
MouseEvent
)
=>
{
const
handleMouseDown
=
(
event
:
MouseEvent
)
=>
{
const
target
=
event
.
currentTarget
as
HTMLElement
;
const
target
=
event
.
currentTarget
as
HTMLElement
;
handleStart
(
event
.
clientY
,
target
);
handleStart
(
event
.
clientY
,
target
,
event
);
isMouseDown
.
value
=
true
;
isMouseDown
.
value
=
true
;
};
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment