收藏
回答

wx.setTabbarItem与wx.setTabbarStyle真机测试不执行?

async onLaunch() {
    const cart = new Cart()
    if (!cart.isEmpty()) {
        wx.setTabBarBadge({
            index: 2,
            text: String(cart.getCartItemTotalSkuCount())
        })
    }

    const token = new Token()
    await token.checkOrGet()
    const isSuperMember = await IStore.checkIsSuperMember()
    if (isSuperMember) {
        wx.setTabBarItem({
            index: 4,
            text: '我的',
            iconPath: '/images/tabbar/my@dis.png',
            selectedIconPath: imagePath.tangerineTabbarVip,
            success: () => {
                console.log('setTabbarItemSuccess')
            }
        })
        wx.setTabBarStyle({
            color: '#333333',
            selectedColor: '#B78E61',
            backgroundColor: '#FFF7EB',
            success: () => {
                console.log('setTabbarStyleSuccess')
            }
        })
    }
    this.checkUpdate()
},


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容