uni小程序分享到朋友圈朋友,uniapp分享给好友,通过小程序打开分享界面
app分享好友界面

微信
小程序是自带分享朋友圈和好友,但是需要在onLoad中允许

onLoad(options) {//#ifdef MP-WEIXINwx.showShareMenu({withShareTicket: true,//设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击menus: ["shareAppMessage", "shareTimeline"]})//#endif
}
触发的方法methods
methods: {
//app分享weixin() {this.ShareAppMessage();},// 微信好友分享ShareAppMessage() {//#ifdef MP-WEIXINreturn {title: this.beizu+':'+this.title,imageUrl: this.img,path: '/pages/product/product?id=' + this.id + '&group_buy_no=' + this.share}//#endif//#ifdef APP-PLUSuni.share({provider: 'weixin',scene: "WXSceneSession",type: 5,title: this.beizu+':'+this.title,imageUrl: this.img,miniProgram: {id: 'gh_bccd28377f05',// +'&goods=' + JSON.stringify(this.goodsdetails)path: '/pages/product/product?id=' + this.id + '&group_buy_no=' + this.share,type: 0,webUrl: 'https://bjetxgzv.cdn.bspapp.com/index.html'},success: ret => {console.log(JSON.stringify(ret));}});//#endif},// 微信朋友圈ShareTimeline() {//#ifdef MP-WEIXINlet dec='欢迎一起购'+this.title;return {title: this.beizu+':'+this.title,query: 'id=' + this.id + '&group_buy_no=' + this.share+'&flag='+true+"&img=" + this.img+"&price="+this.price+"&sales=" + this.sales+'&stock='+this.stock+ '&title='+this.title+'&dec='+dec,imageUrl: this.img}//#endif//#ifdef APP-PLUSuni.share({provider: "weixin",scene: "WXSenceTimeline",type: 0,href: 'https://bjetxgzv.cdn.bspapp.com/index.html?id=' + this.id + '&group_buy_no=' + this.share+'&goods=' + JSON.stringify(this.goodsdetails),title: this.beizu+':'+this.title,// summary: this.title,imageUrl: this.img,success: function(res) {console.log("success:" + JSON.stringify(res));},fail: function(err) {console.log("fail:" + JSON.stringify(err));}});//#endif},}
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
