处理未读消息数量场景补全情况
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-03-25 10:33:30 +08:00
parent fa2098c565
commit 04dcbdf331
4 changed files with 26 additions and 20 deletions

View File

@ -603,6 +603,7 @@ uniOnUnload(() => {
index_name: talkParams.index_name,
unread_num: 0,
})
dialogueStore.clearUnreadNum()
})
})
const handleEmojiPanel = () => {

View File

@ -135,16 +135,16 @@ const cellClick = () => {
//
if (props.data.unread_num > 0) {
//
// ServeClearTalkUnreadNum({
// talk_type: props.data.talk_type,
// receiver_id: props.data.receiver_id,
// },dialogueParams.unReadNum).then(() => {
// talkStore.updateItem({
// index_name: props.data.index_name,
// unread_num: 0,
// })
// })
ServeClearTalkUnreadNum({
talk_type: props.data.talk_type,
receiver_id: props.data.receiver_id,
},dialogueParams.unReadNum).then(() => {
talkStore.updateItem({
index_name: props.data.index_name,
unread_num: 0,
})
dialogueStore.clearUnreadNum()
})
}
uni.navigateTo({
url: `/pages/dialog/index?sessionId=${props.data.id}`,

View File

@ -244,16 +244,16 @@ onLoad((options) => {
setTimeout(() => {
dialogueStore.setDialogue(openSession)
if (openSession.unread_num > 0) {
//
// ServeClearTalkUnreadNum({
// talk_type: openSession.talk_type,
// receiver_id: openSession.receiver_id,
// },dialogueParams.unReadNum).then(() => {
// talkStore.updateItem({
// index_name: openSession.index_name,
// unread_num: 0,
// })
// })
ServeClearTalkUnreadNum({
talk_type: openSession.talk_type,
receiver_id: openSession.receiver_id,
},dialogueParams.unReadNum).then(() => {
talkStore.updateItem({
index_name: openSession.index_name,
unread_num: 0,
})
dialogueStore.clearUnreadNum()
})
}
uni.navigateTo({
url: `/pages/dialog/index?sessionId=${openSession.id}`,

View File

@ -93,6 +93,11 @@ export const useDialogueStore = defineStore('dialogue', {
this.online = status
},
// 更新未读消息数量-清空未读
clearUnreadNum() {
this.unreadNum = 0
},
// 更新对话信息
setDialogue(data = {}) {
this.online = data.is_online == 1