H5网页后在返回到微信公众平台自定义菜单

<p class="success">订阅成功!</p>
<div class="btn" @click="finish">完成</div>

finish:function(){
    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', weixin_ClosePage, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', weixin_ClosePage);
            document.attachEvent('onWeixinJSBridgeReady', weixin_ClosePage);
        }
    } else {
        WeixinJSBridge.call('closeWindow');
    }
}


参考:https://q.cnblogs.com/q/77134/

posted @ 2018-11-15 22:18  Y.anCy  阅读(1416)  评论(0编辑  收藏  举报