怎么样让一个页面的右上角的胶囊和页面内的胶囊都实现转发功能?

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

我想让右上角胶囊和底部的分享都实现转发功能,用得是同一个方法,效果显示只有底部的转发能实现转发功能,右上角胶囊分享转发后却无参数传过去,页面显示的是服务器异常,那么我该怎么使右上角胶囊和底部的分享都实现转发功能?

2 回复
chaosong
chaosong1 楼6 年前

页面的js

onShareAppMessage: function (res) {
    if (res.from === 'menu') {
    return {
      title: '自定义转发标题',
      path: '/page/user?id=123'
    }

   }

    if (res.from === 'button') {
    return {
      title: '自定义转发标题',
      path: '/page/user?id=123'
    }

   }


  }
tgao
tgao2 楼4 年前

写个组件