js是这样的window.onunload = function(){alert('走罗');}
window.on('beforehide',function(){ alert('关闭')})或者window.on('beforeclose',function(){ alert('关闭')})