小程序分享页面设置-小程序单个页面分享+自定义分享按钮-小程序分享
1.
viewclass="share-box"imagedata-id="{{article.id}}"bindtap="videoShare"class='video-share'src='/images/icon/class/share2.png'/buttondata-id="{{article.id}}"class='video-share-btn'plain="{{true}}"open-type="share"/button/view//分享onShareAppMessage:function(id){return{title:'孕育课堂',path:'/pages/pregnantClass/detail/index?id='+id,//分享的页面所需要的idimageUrl:this.data.article.video_img//分享界面的图片}},注意2.样式:
3.1.onShareAppMessage方法,必须使用buttonopen-type="share",open-type="share"放在别的组件上无效
4.2.button有个属性plain设置为true,然后用定位将自己的图片和button重合在一起即可
5.分享:
6.1.onShareAppMessage方法中path后面的id,是你需要分享的页面所需要的id,传过去即
7.可,onLoad(options)可以接收到,如果不需要id,就传个空或者随便123都行
8.2.onShareAppMessage方法中的imageUrl就是分享界面的图片
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

