wx.showActionSheet()蒙层问题?

发布于 8 年前作者 chaotian807 次浏览最后编辑 8 年前来自 ask

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 回复
szeng
szeng1 楼6 年前

sucess下面加一句吧

if (res.tapIndex == undefined) return

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

xiayu
xiayu2 楼6 年前

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