转发给朋友 onShareAppMessage
分享朋友圈 onShareTimeline
onShareAppMessage: function () {return {title: "标题",path: "路径(可加路径)",imageUrl: "图片路径"};},
onShareTimeline: function () {return {title: "标题",query: "路径(可加路径)",imageUrl: "图片路径"};},
携带id如:“/pages/index/index?user_id=” + this.globalData.userInfo.id,
全局设置在app.js,然后在各页面使用方法
onShareAppMessage: app.onShareAppMessage,//转发朋友onShareTimeline: app.onShareTimeline,//分享朋友圈
如果觉得《微信小程序转发朋友与分享朋友圈》对你有帮助,请点赞、收藏,并留下你的观点哦!