wx.ready(function () {
setTimeout(() => {
const link = location.href;
const imgSrc = imgUrl.includes('http') ? imgUrl : `${ENV.wxShareCardImgUrl}/${imgUrl}`
wx.hideMenuItems({
menuList: [
// 'menuItem:copyUrl',
"menuItem:share:qq",
"menuItem:share:weiboApp",
"menuItem:favorite",
"menuItem:share:facebook",
"menuItem:share:QZone",
] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3
});
// 分享给朋友
wx.updateAppMessageShareData({
title, // 分享标题
desc, // 分享描述
link,
imgUrl: imgSrc, // 分享图标
success: function () {
// 设置成功
}
});
// 分享到朋友圈
wx.updateTimelineShareData({
title, // 分享标题
link,
imgUrl: imgSrc, // 分享图标
success: function () {
// 设置成功
}
})
})
目前不可以,分享是需要手动前往右上角三个点触发。