分享给朋友
onShareAppMessage()函数
onShareAppMessage: function (res) {
return {
title: '自定义标题',
path: 'pages/demo/demo', // 显示的页面
imageUrl: "自定义分享封面地址",
success: function (res) {
// 转发成功
},
fail: function (res) {
// 转发失败
}
}
// }
}
分享到朋友圈
onShareTimeline()函数
onShareTimeline: function (res) {
return {
title: '自定义标题',
path: 'pages/demo/demo', // 显示的页面
imageUrl: "自定义分享封面地址",
success: function (res) {
// 转发成功
},
fail: function (res) {
// 转发失败
}
}
// }
}
注意:在分享朋友圈之前一定要有写上分享到朋友事件!