微信最新发布了分享朋友圈功能,据我所用的有两种写法
第一种:(这种写法在大多时候管用,但是我的其中一个页面在开发工具上显示可以分享朋友圈,但是在手机上显示不能分享)
onShow: function() { wx.showShareMenu({ withShareTicket:true, menus:['shareAppMessage','shareTimeline'] }) },
第二种:
onShareAppMessage: function() { wx.showShareMenu({ withShareTicket: true, menus: ['shareAppMessage', 'shareTimeline'] }) }, onShareTimeline: function () { return { title: '', query: { key: value }, imageUrl: '' } },
推荐使用第二种写法