收藏
回答

分享成功以后调用API不工作,但是开发版本可以工作

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug onShareAppMessage 客户端 6.7.2 2.3.0


onShareAppMessage: function () {
    const id = this.data.id;
    return {
      ...this.data.shareData,
      success: res => {
        // 转发成功
        wx.showLoading({
          title: "复活中...",
          mask: true
        });
        service({
          ...Share,
          data: {
            id: id
          }
        })
        .then(resp => {
          wx.hideLoading();
          wx.redirectTo({
            url: "../index?id=" + id
          });
        })
        .catch(error => {
          wx.hideLoading();
          wx.showToast({
            title: "复活失败",
            icon: "none"
          });
        });
      },
      fail: res => {
        // 转发失败
        wx.showToast({
          title: "复活失败",
          icon: "none"
        });
      }
    };
  }

如题,代码如上,为什么我开发环境可以工作,但是发布以后就不能工作了

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

1 个回答

登录 后发表内容