微信公众号监听返回事件

 $(function(){
        if (window.history && window.history.pushState) {
            window.addEventListener("popstate", function (e) {  //回调函数中实现需要的功能
                // alert("我监听到了浏览器的返回按钮事件啦");
                window.location.href = 'index.html?id=' + F_EmployeeId + '&AppId=' + localStorage.getItem('AppId');  //在这里指定其返回的地址
            }, false);

            !function () {

                var state = {
                    title: "title",
                    url: "#"
                };
                window.history.pushState(state, "url", "#");
            }();

        }

    });

原文地址:https://www.cnblogs.com/zhouxiaobai/p/11935200.html