设置wx.setTabBarBadge(Object object)角标
if (app.globalData.goodsNum > 99) {
wx.setTabBarBadge({
index: 2,
text: '99+'
})
} else if (app.globalData.goodsNum <= 0) {
wx.hideTabBarRedDot({
index: 2,
})
} else {
wx.setTabBarBadge({
index: 2,
text: ''+ app.globalData.goodsNum
})
}
网友评论