简单搞定了
<div>
<span id="time">5</span>
<span>秒后返回主页</span>
<a href="" onclick="go()">返回</a>
</div>
<script>
function go(){
history.go(-1);
}
var num=5;
function jishi(){
document.getElementById("time").innerText=num;
if(num==0){
window.open("https://www.baidu.com",'_blank','width:600','height:400');
clearInterval(insd);
}else{
num=num-1;
}
}
var insd=setInterval("jishi()",1000);
</script>