分享和转发朋友圈

onLoad(option) {var shopCode = option.shopCodeif (shopCode) {uni.setStorageSync("shopCode", shopCode)this.shopCode = shopCode} else {this.getUserInfo()}this.GetStatusBarHeight();uni.showShareMenu({withShareTicket: true,//设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击menus: ["shareAppMessage", "ShareTimeline"]})this.getnotice()},// #ifdef MP-WEIXINonShareTimeline: function(res) {return {title: '分享',query: "shopCode=" +this.shopCode,}},onShareAppMessage: function(res) {var that = this;//console.log('res=====',res);if (res.from === 'button') {//console.log('来自页面内转发按钮');} else if (res.from === 'menu') {//console.log('右上角菜单转发按钮');}// 返回数据return {title: '转发',path: "/pages/index/index?shopCode=" +that.shopCode,success: function(res) {// 转发成功,可以把当前页面的链接发送给后端,用于记录当前页面被转发了多少次或其他业务},fail: function(res) {// 转发失败}}},// #endif


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部