微信小程序分享好友
相关链接:微信开发文档
wxml:
<button class="fixed-text fixed-button" open-type="share" title="分享" hover-class="none">分享好友</button>
js:
onShareAppMessage:function(res) { if (res.from == 'button') { console.log(res.target, res) } return { title:'这里是发送时候的标题', path:'/pages/home/index',//这里是被分享的人点击进来之后的页面 imageUrl: '../../images/icon-logo.png'//这里是图片的路径 } }