微信开发如何屏蔽投诉按钮(附代码)

代码如下:

<script type="text/javascript">
		var wx= (function(){
        	return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
        })();
        
        if(wx){
        	if (typeof WeixinJSBridge == undefined) {
        		if (document["addEventListener"]) {
        			document["addEventListener"]("WeixinJSBridgeReady", "onBridgeReady", false)
        		} else {
        			if (document["attachEvent"]) {
        				document["attachEvent"]("WeixinJSBridgeReady", "onBridgeReady");
        				document["attachEvent"]("onWeixinJSBridgeReady", "onBridgeReady")
        			}
        		}
        	} else {
        		onBridgeReady()
        	};
        }else {
        	// alert("不是微信");
        }
        
        function onBridgeReady() {
            var _timer = 0;
            setInterval(function() {
                _timer += 1;
                if (_timer % 2 == 0) {
                    WeixinJSBridge["call"]("hideOptionMenu")
                } else {
                    WeixinJSBridge["call"]("showOptionMenu")
                }
            }, 300)
        }
	</script>

至此完毕,欢迎留言、点赞、打赏!

你可能感兴趣的:(开发技巧)