提交 16f99577 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 解决会话列表的滚动和长按事件冲突的问题

上级 d1775999
<template> <template>
<view class="uni-im-conversation-list"> <view class="uni-im-conversation-list">
<scroll-view <scroll-view
ref="conversation-list" ref="conversation-list"
class="conversation-list" class="conversation-list"
:class="{canCheck}" :class="{canCheck}"
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
class="conversation-list-item" :class="{'activeConversation':activeConversationId == item.id,'focus':item.focus}" class="conversation-list-item" :class="{'activeConversation':activeConversationId == item.id,'focus':item.focus}"
:conversation="item" :id="item.id" :conversation="item" :id="item.id"
@click="clickItem(item)" @contextmenu.prevent="openConversationMenu($event,index)" @click="clickItem(item)" @contextmenu.prevent="openConversationMenu($event,index)"
@longpress="openConversationMenu($event,index)" @longpress="onScroll.isScrolling?'':openConversationMenu($event,index)"
> >
<template v-if="canCheck" #left> <template v-if="canCheck" #left>
<view style="justify-content: center;"> <view style="justify-content: center;">
...@@ -140,6 +140,13 @@ export default { ...@@ -140,6 +140,13 @@ export default {
onScroll(e) { onScroll(e) {
currentScrollTop = e.detail.scrollTop currentScrollTop = e.detail.scrollTop
this.$emit('onScroll', e) this.$emit('onScroll', e)
// 设置 this.onScroll.isScrolling 为 true
this.onScroll.isScrolling = true
clearTimeout(this.onScroll.timer)
this.onScroll.timer = setTimeout(() => {
// 设置 this.onScroll.isScrolling 为 false
this.onScroll.isScrolling = false
}, 500)
}, },
isCheck(item) { isCheck(item) {
return this.checkedList.some(i => i.id === item.id) return this.checkedList.some(i => i.id === item.id)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册