From 2903af3fff19cc062f3e85e12fe94e75e2db3b9a Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Mon, 23 Jun 2025 10:34:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E5=B0=8F=E7=BA=A2=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 4 ++-- pages/NEUIKit/utils/msg.ts | 15 --------------- pages/person/index.vue | 14 ++------------ root/NEUIKit/utils/msg.ts | 19 ++----------------- 4 files changed, 6 insertions(+), 46 deletions(-) diff --git a/App.vue b/App.vue index d746164..4016486 100644 --- a/App.vue +++ b/App.vue @@ -269,12 +269,12 @@ export default { console.log("获取待处理数量:", res); if (res.approvePassHasNotRed > 0) { uni.setTabBarBadge({ - index: 1, + index: 3, text: String(res.approvePassHasNotRed), }); } else { uni.removeTabBarBadge({ - index: 1, + index: 3, }); } }); diff --git a/pages/NEUIKit/utils/msg.ts b/pages/NEUIKit/utils/msg.ts index f600d39..fc9f138 100644 --- a/pages/NEUIKit/utils/msg.ts +++ b/pages/NEUIKit/utils/msg.ts @@ -85,21 +85,6 @@ export const setTabUnread = (val): void => { index: 3, //tabbar下标 }) } - /** - * 此为展示tabbar的未读消息数字的写法 - if (unread === 0) { - uni.removeTabBarBadge({ - //隐藏数字 - index: 0, //tabbar下标 - }) - } else { - uni.setTabBarBadge({ - //显示数字 - index: 0, //tabbar下标 - text: unread > 99 ? '99+' : unread.toString(), //显示的数字 - }) - } - */ } export const setContactTabUnread = (): void => { diff --git a/pages/person/index.vue b/pages/person/index.vue index 1bf50e8..0386f43 100644 --- a/pages/person/index.vue +++ b/pages/person/index.vue @@ -485,16 +485,6 @@ export default { type: 2, }, (res) => { - // if (res.total > 0) { - // uni.setTabBarBadge({ - // index: 2, - // text: String(res.total), - // }); - // } else { - // uni.removeTabBarBadge({ - // index: 2, - // }); - // } that.waitNum_ups = res.total; that.getDetail(); } @@ -762,13 +752,13 @@ export default { console.log("获取待处理数量:", res); if (res.approvePassHasNotRed > 0) { uni.setTabBarBadge({ - index: 1, + index: 3, text: String(res.approvePassHasNotRed), }); that.readed = false; } else { uni.removeTabBarBadge({ - index: 1, + index: 3, }); that.readed = true; } diff --git a/root/NEUIKit/utils/msg.ts b/root/NEUIKit/utils/msg.ts index 8a0ac58..86f4c29 100644 --- a/root/NEUIKit/utils/msg.ts +++ b/root/NEUIKit/utils/msg.ts @@ -73,28 +73,13 @@ export const setTabUnread = (): void => { if (unread === 0) { uni.hideTabBarRedDot({ //隐藏数字 - index: 3, //tabbar下标 + index: 2, //tabbar下标 }) } else { uni.showTabBarRedDot({ - index: 3, //tabbar下标 - }) - } - /** - * 此为展示tabbar的未读消息数字的写法 - if (unread === 0) { - uni.removeTabBarBadge({ - //隐藏数字 - index: 0, //tabbar下标 - }) - } else { - uni.setTabBarBadge({ - //显示数字 - index: 0, //tabbar下标 - text: unread > 99 ? '99+' : unread.toString(), //显示的数字 + index: 2, //tabbar下标 }) } - */ } export const setContactTabUnread = (): void => {