|
@@ -41,6 +41,27 @@ export default function wxShare(shareurl,title,desc,imgurl,hide){
|
|
|
|
|
|
wx.showOptionMenu();
|
|
|
|
|
|
+ wx.updateAppMessageShareData({
|
|
|
+ title, // 分享标题
|
|
|
+ desc, // 分享描述
|
|
|
+ link: shareurl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
+ imgUrl, // 分享图标
|
|
|
+ success: function () {
|
|
|
+ // 设置成功
|
|
|
+ console.log( "分享成功,当前链接:"+shareurl );
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ wx.updateTimelineShareData({
|
|
|
+ title, // 分享标题
|
|
|
+ link: shareurl, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
|
|
+ imgUrl, // 分享图标
|
|
|
+ success: function () {
|
|
|
+ // 设置成功
|
|
|
+ console.log( "分享成功,当前链接:"+shareurl );
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
wx.onMenuShareTimeline({
|
|
|
title:title, // 分享标题
|
|
|
link:shareurl, // 分享链接,该链接域名必须与当前企业的可信域名一致
|
|
@@ -70,6 +91,7 @@ export default function wxShare(shareurl,title,desc,imgurl,hide){
|
|
|
console.log('取消分享')
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
wx.hideMenuItems({
|
|
|
menuList: ['menuItem:share:qq','menuItem:share:weiboApp','menuItem:share:facebook','menuItem:share:QZone','menuItem:openWithSafari','menuItem:share:email'] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
|
|
|
});
|