收藏
回答

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 个回答

  • 社区技术运营专员--阳光
    社区技术运营专员--阳光
    2025-01-22

    请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    2025-01-22
    有用
    回复
  • 智能回答 智能回答 该问答由AI生成
    2025-01-20
    有用
登录 后发表内容