This commit is contained in:
2025-12-10 15:38:37 +08:00
11 changed files with 377 additions and 11 deletions

View File

@@ -151,6 +151,7 @@ import { APIhomehomePageUp, APIhome } from '@/common/api/index/index.js';
import { APIgeocodelocation } from '@/common/api/api.js';
import { useNavbarStore } from '@/stores/navbarStore';
import { productStore } from '@/stores/user.js';
import { getUnReadCountReq } from '../../common/api/account/message';
const store = useNavbarStore();
const storeuser = productStore();
store.updateNavbarConfig({
@@ -352,9 +353,27 @@ onShow(async () => {
const showPageLoading = ref(true);
const getUnReadMsgCount = async () => {
let res = await getUnReadCountReq()
let badge = Number(res)
if (badge > 0) {
uni.setTabBarBadge({
index: 2,
text: badge.toString()
})
} else {
uni.removeTabBarBadge({
index: 2
})
}
}
onMounted(async () => {
setTimeout(() => {
showPageLoading.value = false;
getUnReadMsgCount();
}, 800);
});