Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into test
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user