|
@@ -84,6 +84,7 @@
|
|
|
import {
|
|
|
useAuthStore
|
|
|
} from '@/store/authStore'
|
|
|
+ import { count } from '@/api/chat.js'
|
|
|
const authStore = useAuthStore()
|
|
|
// 屏幕状态栏高度
|
|
|
const statusBarHeight = ref(0)
|
|
@@ -267,10 +268,13 @@
|
|
|
})
|
|
|
})
|
|
|
onLoad(() => {
|
|
|
- console.log(isLogin);
|
|
|
- uni.setTabBarBadge({ //显示数字
|
|
|
- index: 1, //tabbar下标
|
|
|
- text: '999' //数字
|
|
|
+ count().then(res => {
|
|
|
+ if (res && res.message === 'success') {
|
|
|
+ uni.setTabBarBadge({ //显示数字
|
|
|
+ index: 1, //tabbar下标
|
|
|
+ text: `${res.data.amount}` ?? '0' //数字
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
</script>
|