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就是分享界面的图片

TAG标签: 微信小程序小程序分享页面设置小程序分享

http://www.xiaochengxub.com/read-98185.html