src/pages/login.vue
@@ -178,7 +178,7 @@ sendClientIdToServer(); // 启动定时获取未读消息数量的定时器 startNoticeCountTimer(userId); uni.switchTab({ url: "/pages/index" }); uni.switchTab({ url: "/pages/works" }); }); } @@ -201,12 +201,12 @@ // 更新tabbar的角标 if (count > 0) { uni.setTabBarBadge({ index: 2, // 消息标签页的索引 index: 1, // 消息标签页的索引 text: count.toString(), }); } else { uni.removeTabBarBadge({ index: 2, index: 1, }); } })