1.js里必须定义onShareAppMessage事件处理函数
2.wxml不能使用view等标签去写事件方法去调用分享
3.wxml button 设置 open-type=“share” 即可
列如
<button open-type="share">点我分享给朋友</button>
微信开放文档分享功能链接
https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onShareAppMessage