解决解散等场景下会出现已读/未读/总人数为-1的情况
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 15:20:24 +08:00
parent dd0ccb9818
commit 02999dc782

View File

@ -226,7 +226,7 @@
>
<span v-if="talkParams.type === 1">未读</span>
<span v-if="talkParams.type === 2">
已读 (0/{{ (Number(talkParams.num)-1) }})
已读 (0/{{ (Number(talkParams.num)-1) > 0 ? Number(talkParams.num)-1 : 0 }})
</span>
</div>
@ -833,7 +833,7 @@ watch(
readNumElement.textContent = readNum > 0 ? '已读' : '未读'
} else {
readNumElement.textContent =
'已读 (' + readNum + '/' + (Number(talkParams.num) - 1) + ')'
'已读 (' + readNum + '/' + (Number(talkParams.num) - 1 > 0 ? Number(talkParams.num) - 1 : 0) + ')'
}
}
}
@ -2527,12 +2527,12 @@ const getMessageReadDetail = (isUnread) => {
if (code == 200) {
if (Number(isUnread) === 0) {
state.value.msgReadDetailTabs[0].title =
'未读 ' + (Number(talkParams.num) - 1 - data.count) + ''
'未读 ' + (Number(talkParams.num) - 1 - data.count > 0 ? Number(talkParams.num) - 1 - data.count : 0) + ''
state.value.msgReadDetailTabs[1].title = '已读 ' + data.count + ''
} else if (Number(isUnread) === 1) {
state.value.msgReadDetailTabs[0].title = '未读 ' + data.count + ''
state.value.msgReadDetailTabs[1].title =
'已读 ' + (Number(talkParams.num) - 1 - data.count) + ''
'已读 ' + (Number(talkParams.num) - 1 - data.count > 0 ? Number(talkParams.num) - 1 - data.count : 0) + ''
}
if (state.value.readNumPage === 1) {
state.value.msgReadOrNotDetail = data.data