微信 禁止分享朋友圈

  微信禁用右上角的分享按钮,WeixinJSBridge API以及隐藏分享的子按钮等菜单项:
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
wx.config({
appId: '{$appid}', //微信公众号id
timestamp: '{$timestamp}',
nonceStr: '{$nonceStr}',
signature: '{$signature}',
//debug: true,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage',
'hideMenuItems',
]
});
wx.ready(function () {
shareWeixin();
});
function shareWeixin(){

wx.hideMenuItems({
menuList: ["menuItem:share:timeline", "menuItem:copyUrl", "menuItem:share:appMessage", "menuItem:share:qq", "menuItem:share:weiboApp", "menuItem:favorite", "menuItem:share:facebook", "menuItem:share:QZone", "menuItem:editTag", "menuItem:delete", "menuItem:copyUrl", "menuItem:originPage", "menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email", "menuItem:share:brand"] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮
});
}

</script>

0 个评论

要回复文章请先登录注册