处理未读消息数量场景补全情况
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, index_name: talkParams.index_name,
unread_num: 0, unread_num: 0,
}) })
dialogueStore.clearUnreadNum()
}) })
}) })
const handleEmojiPanel = () => { const handleEmojiPanel = () => {

View File

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

View File

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

View File

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