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

修复 App 端,“会话操作菜单”弹出后,侧滑返回没有关闭菜单直接关闭会话页面的问题

上级 872f6251
......@@ -11,7 +11,7 @@
@scroll="onScroll"
>
<uni-im-conversation v-for="(item,index) in conversationList" :key="item.id"
class="conversation-list-item" :class="{'activeConversation':activeConversationId == item.id,'focus':item.focus}"
class="conversation-list-item" :class="{'activeConversation':activeConversationId == item.id,'focus':focusConversationId === item.id}"
:conversation="item" :id="item.id"
@click="clickItem(item)" @contextmenu.prevent="openConversationMenu($event,index)"
@longpress="onScroll.isScrolling?'':openConversationMenu($event,index)"
......@@ -74,6 +74,7 @@ export default {
data() {
return {
listScrollTop: 0,
focusConversationId: ''
}
},
computed: {
......@@ -166,7 +167,7 @@ export default {
},
openConversationMenu(e, index) {
let conversation = this.conversationList[index]
conversation.focus = true
this.focusConversationId = conversation.id
const myContextmenu = this.$refs['uni-im-contextmenu']
const clientY = e.clientY || e.changedTouches[0].clientY
......@@ -226,9 +227,13 @@ export default {
]
myContextmenu.show(position, menuList)
myContextmenu.onClose(() => {
conversation.focus = false
this.focusConversationId = ''
})
},
closeConversationMenu(){
const myContextmenu = this.$refs['uni-im-contextmenu']
myContextmenu.closeMe()
},
async loadMore() {
let data = await uniIm.conversation.loadMore()
// console.log('加载到新的会话数据',data);
......
......@@ -305,6 +305,13 @@
},
onUnload() {
},
onBackPress(e) {
const clRef = this.$refs['uni-im-conversation-list']
if(clRef.focusConversationId){
clRef.closeConversationMenu()
return true
}
},
onHide() {},
methods: {
clickMenu(data) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册