新增收起应用时同时停止已读未读定时器,并在恢复后打开;解决群聊踢人后自己也看不到右上角的管理按钮问题
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wangyifeng 2025-04-22 14:49:08 +08:00
parent 71d97f069f
commit dd0ccb9818
2 changed files with 50 additions and 2 deletions

View File

@ -244,7 +244,15 @@ class Talk extends Base {
//群成员被移出时,需要更新群成员权限
if ([1104, 1115].includes(record.msg_type)) {
useDialogueStore().updateQuit()
console.error(this.resource.extra.members, 'this.resource.extra.members')
if (this.resource?.extra?.members?.length > 0) {
const isMeQuit = this.resource.extra.members.find(
(item) => item.user_id === this.getAccountId(),
)
if (isMeQuit) {
useDialogueStore().updateQuit()
}
}
}
//群禁言变化时,需要更新群禁言状态——即更新群成员列表

View File

@ -704,7 +704,12 @@ import zu6053 from '@/static/image/chatList/zu6053@2x.png'
import deepBubble from '@/components/deep-bubble/deep-bubble.vue'
import { isRevoke } from './menu'
import useConfirm from '@/components/x-confirm/useConfirm.js'
import { onLoad as uniOnload, onUnload as uniOnUnload } from '@dcloudio/uni-app'
import {
onLoad as uniOnload,
onUnload as uniOnUnload,
onShow,
onHide,
} from '@dcloudio/uni-app'
import ws from '@/connect'
Quill.register('formats/emoji', EmojiBlot)
@ -807,6 +812,7 @@ const state = ref({
currentIsUnread: 1, //
readDetailHeight: 400, //
isFirstEnter: true, //
isFromHide: false, //hide
})
// Map
@ -2382,6 +2388,40 @@ onUnmounted(() => {
}
})
onShow(() => {
if (state.value.isFromHide) {
if (state.value.setMessageReadInterval) {
clearInterval(state.value.setMessageReadInterval)
state.value.setMessageReadInterval = null
}
state.value.setMessageReadInterval = setInterval(() => {
checkVisibleElements()
}, 2000)
if (state.value.setOutMessageReadInterval) {
clearInterval(state.value.setOutMessageReadInterval)
state.value.setOutMessageReadInterval = null
}
state.value.setOutMessageReadInterval = setInterval(() => {
checkVisibleOutElements()
}, 2000)
state.value.isFromHide = false
}
})
onHide(() => {
state.value.isFromHide = true
if (state.value.setMessageReadInterval) {
clearInterval(state.value.setMessageReadInterval)
state.value.setMessageReadInterval = null
checkVisibleElements()
}
if (state.value.setOutMessageReadInterval) {
clearInterval(state.value.setOutMessageReadInterval)
state.value.setOutMessageReadInterval = null
checkVisibleOutElements()
}
})
//
const showMentionSelectDebounced = (quill) => {
const text = quill.getText()