```html
body {
fontfamily: Arial, sansserif;
lineheight: 1.6;
margin: 20px;
}
h1 {
textalign: center;
}
form {
maxwidth: 600px;
margin: 0 auto;
textalign: center;
}
input[type="text"] {
width: 70%;
padding: 10px;
margin: 10px;
fontsize: 16px;
}
input[type="submit"] {
padding: 10px 20px;
fontsize: 16px;
backgroundcolor: 4CAF50;
color: white;
border: none;
cursor: pointer;
}
input[type="submit"]:hover {
backgroundcolor: 45a049;
}
report {
maxwidth: 800px;
margin: 20px auto;
padding: 20px;
border: 1px solid ddd;
borderradius: 5px;
backgroundcolor: f9f9f9;
}
区块链行业周报查询系统
周报
这里显示周报内容...
document.getElementById('searchForm').addEventListener('submit', function(event) {
event.preventDefault();
const keywords = document.getElementById('keywords').value;
fetch(`/api/reports?keywords=${keywords}`)
.then(response => response.json())
.then(data => {
if (data.title && data.content) {
document.getElementById('reportTitle').innerText = data.title;
document.getElementById('reportContent').innerText = data.content;
} else {
document.getElementById('reportTitle').innerText = '未找到相关周报';
document.getElementById('reportContent').innerText = '抱歉,未找到与您搜索相关的周报内容。';
}
})
.catch(error => {
console.error('Error fetching ', error);
document.getElementById('reportTitle').innerText = '错误';
document.getElementById('reportContent').innerText = '抱歉,发生了错误,请稍后再试。';
});
});