微信小程序中分享

1.分享

onShareAppMessage: (res) => {
    if (res.from === 'button') {
      console.log("来自页面内转发按钮");
      console.log(res.target);
    }
    else {
      console.log("来自右上角转发菜单")
      console.log(wx.getStorageSync("share"))
    }
    return {
      title: '520商城',
      path: '/pages/logs/logs?f_id=' + wx.getStorageSync("share"),
      imageUrl:'https://xiaocheng.zgydgk.com/public/images/share_pic.png'
    }
  },

2.取消分享

 wx.hideShareMenu()

 

你可能感兴趣的:(微信小程序中分享)