官网文档:https://开发者。微信。QQ。com/mini program/dev/framework/open-ability/share。超文本标记语言
第一种情况点击小程序转发
不加入参数
//转发onShareAppMessage:函数(){让用户=wx。getstorage ync(' user ');if(RES . from==' button '){ }返回{ title : '转发,path : '/page/index/index ',success: function(res) {} }加入参数
//转发onShareAppMessage:函数(){让用户=wx。getstorage ync(' user ');if(RES . from==' button '){ }返回{ title : '转发,路径: '/页/索引/索引?from_uid=' users.id,success: function(res) {} }第二种分享
这个分享必须做成按钮且加上开放式='共享'
不加入参数
onShareAppMessage:函数(RES){ if(RES . from==' button '){ }返回{ title: '转发,路径: '/pages/index/community/topic/topic ',成功:函数(RES){ console。日志('成功,res) } } }加入参数
//转发onShareAppMessage:函数(RES){ if(RES . from==' button '){ }返回{ title: '转发,路径: '/页面/索引/社区/话题/话题?jsonStr=' this.data.list,success : function(RES){ console。日志('成功,RES)} } }
提醒:
这里转发的参数要在装载的选择运用
总结
以上所述是小编给大家介绍的微信小程序开发之转发分享功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对我们网站的支持!如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!