wx.showActionSheet()蒙层问题?
发布于 6 年前 作者 chaotian 698 次浏览 来自 问答

wx.showActionSheet()点击蒙层为什么也会跳转页面?

wx.showActionSheet({

      itemList: [that.data.markName],

      success: function (res) {

        console.log(res.tapIndex)

        wx.navigateTo({

          url: ‘…/shop/detail?id=’ + that.data.markId

        })

      },

      fail: function (res) {

        console.log(res.errMsg)

      }

    })

2 回复

sucess下面加一句吧

if (res.tapIndex == undefined) return

以前我也遇到过,后来都这么处理了

现在貌似还有这个问题。我先加上你这个判断,感谢

回到顶部