ws-zhangbo
onShareAppMessage(Object)

监听用户点击页面内转发按钮(<button> 组件 open-type="share")或右上角菜单“转发”按钮的行为,并自定义转发内容。
注意:只有定义了此事件处理函数,右上角菜单才会显示“转发”按钮

Page({
    onShareAppMessage: function (res) {
        if (res.from === \'button\') {
          // 来自页面内转发按钮
          console.log(res.target)
        }
     return {
        title: \'自定义转发标题\', //转发标题
        path: \'/page/user?id=123\', //转发路径,必须是以 / 开头的完整路径
     imageUrl: \'\' //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4。 } } })

分类:

技术点:

相关文章:

  • 2021-12-26
  • 2021-11-21
  • 2021-08-25
  • 2022-02-03
  • 2021-09-07
  • 2021-04-30
  • 2022-12-23
  • 2021-04-14
猜你喜欢
  • 2021-11-30
  • 2021-08-17
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
相关资源
相似解决方案