function goDecode(){ var y=document.getElementById('dy').value.trim(); var m=document.getElementById('dm').value.trim(); var d=document.getElementById('dd').value.trim(); if(!y||!m||!d){alert('请输入完整的出生年月日');return;} location.href='pages/decode.html?y='+encodeURIComponent(y)+'&m='+encodeURIComponent(m)+'&d='+encodeURIComponent(d); } ['dy','dm','dd'].forEach(function(id){ var el=document.getElementById(id); if(!el) return; el.addEventListener('keydown',function(e){ if(e.key==='Enter')goDecode(); }); });