小程序自定义按钮在页面上分享朋友圈功能不生效???请问可以实现这种方式吗??(uniapp)
<button open-type="share" class="botpic">
<image :src="getIcon('app/sharePage-wx.png')"></image>
<text>微信好友</text>
</button>
<button open-type="share" class="botpic">
<image :src="getIcon('app/sharePage-pengyou.png')"></image>
<text>分享朋友圈</text>
</button>
分享朋友圈 open-type="share-timeline" 和 open-type="share"都试过了,点击了无反应
onShareAppMessage(res) {
return {
title: '无忧**',
path: `pages/index/index?shopid=${this.userInfo.customerStoreId}&referrer=${this.userInfo.customerUserId}`
}
},
// 分享到朋友圈
onShareTimeline() {
return {
title: '无忧**',
imageUrl: '',
query: 'pages/index/index?shopid=${this.userInfo.customerStoreId}&referrer=${this.userInfo.customerUserId}',
};
},
分享好友可以实现,分享朋友圈不能调用
open-type
中不存在合法值share-timeline
,所以open-type="share-timeline"
不会生效;onShareTimeline
方法仅能监听右上角菜单的分享朋友圈,无法对按钮生效根据这些资料 没办法实现点击按钮分享到朋友圈功能