// 兼容处理
function closeWindow() {
if (document.addEventListener) {
document.addEventListener(
"WeixinJSBridgeReady",
function () {
window.WeixinJSBridge && window.WeixinJSBridge.call("closeWindow")
parent.WeixinJSBridge.call('closeWindow')
},
false
);
} else if (document.attachEvent) {
document.attachEvent(
"onWeixinJSBridgeReady", function () {
//这个可以关闭ios系统的手机
window.WeixinJSBridge && window.WeixinJSBridge.call("closeWindow");
}
);
}
window.WeixinJSBridge && window.WeixinJSBridge.call("closeWindow")
window.close && window.close() // pc端关闭
window.wx && window.wx.closeWindow()
}