综述: 优化内容区域显示逻辑和页面结构

- 修改内容区域样式:移除内边距和滚动条设置,使页面布局更加紧凑和统一
- 调整iframe高度:从calc(100vh - 140px)改为100vh,充分利用视窗高度
- 恢复内容区域标题显示:将.content-header元素的display属性从none改为block
- 更新首页链接:将首页的URL从'index.html'更新为'首页.html'以匹配实际文件名
- 优化默认内容显示:为未指定菜单项的默认内容添加标题显示功能
This commit is contained in:
linbin 2025-09-06 00:14:57 +08:00
parent 8a510c4559
commit db865f0436
2 changed files with 138 additions and 7 deletions

View File

@ -106,8 +106,8 @@
/* 内容区域样式 */
.content {
flex: 1;
padding: 20px;
overflow-y: auto;
padding: 0;
overflow-y: hidden;
background-color: #fff;
}
@ -147,7 +147,7 @@
/* iframe样式 */
.content-iframe {
width: 100%;
height: calc(100vh - 140px);
height: 100vh;
border: none;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
@ -367,8 +367,8 @@
function updateContent(title) {
const contentBody = document.querySelector('.content-body');
// 移除内容区域的标题显示
document.querySelector('.content-header').style.display = 'none';
// 恢复内容区域的标题显示
document.querySelector('.content-header').style.display = 'block';
// 如果是权限编辑或市场经营者创建显示iframe
if (title === '权限编辑') {
@ -384,7 +384,7 @@
let url = '';
switch(title) {
case '首页':
url = 'index.html';
url = '首页.html';
break;
case '新增产品':
url = '产品管理/新增产品.html';
@ -414,9 +414,10 @@
url = '权限管理/产品分析.html';
break;
default:
// 对于未指定的菜单项,显示默认内容(包含标题)
// 对于未指定的菜单项,显示默认内容(包含标题)
contentBody.innerHTML = `
<div class="content-section">
<h2>${title}</h2>
<p>您已选择"${title}"菜单项。在这里可以展示与该菜单项相关的详细内容。</p>
<p>这是一个内容展示容器,您可以根据实际需求添加任何内容,包括文本、图片、表格等。</p>
</div>

130
平台端web/首页.html Normal file
View File

@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>首页</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background-color: #f8f9fa;
}
.welcome-section {
text-align: center;
padding: 40px 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 10px;
margin-bottom: 30px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.welcome-section h1 {
font-size: 2.5rem;
margin-bottom: 20px;
}
.welcome-section p {
font-size: 1.2rem;
max-width: 800px;
margin: 0 auto;
line-height: 1.6;
}
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.feature-card {
background: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}
.feature-card h2 {
color: #3498db;
margin-bottom: 15px;
font-size: 1.5rem;
}
.feature-card p {
color: #555;
line-height: 1.6;
}
.statistics-section {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.statistics-section h2 {
color: #2c3e50;
text-align: center;
margin-bottom: 25px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
text-align: center;
}
.stat-item {
padding: 20px;
}
.stat-item .number {
font-size: 2.5rem;
font-weight: bold;
color: #3498db;
margin-bottom: 10px;
}
.stat-item .label {
color: #7f8c8d;
font-size: 1.1rem;
}
</style>
</head>
<body>
<div class="welcome-section">
<h1>欢迎使用大妈系统平台</h1>
<p>这是一个功能强大且易于使用的系统平台,为您提供全方位的服务和支持。</p>
</div>
<div class="features-grid">
<div class="feature-card">
<h2>权限管理</h2>
<p>集中管理用户权限,灵活分配角色和访问控制,确保系统安全可靠。</p>
</div>
<div class="feature-card">
<h2>产品管理</h2>
<p>完整的产品信息管理功能,支持产品添加、编辑、删除等操作。</p>
</div>
<div class="feature-card">
<h2>用户管理</h2>
<p>方便的用户信息维护,包括用户列表查看、权限设置等功能。</p>
</div>
</div>
<div class="statistics-section">
<h2>系统统计</h2>
<div class="stats-grid">
<div class="stat-item">
<div class="number">128</div>
<div class="label">产品数量</div>
</div>
<div class="stat-item">
<div class="number">56</div>
<div class="label">用户数量</div>
</div>
<div class="stat-item">
<div class="number">24</div>
<div class="label">系统功能</div>
</div>
</div>
</div>
</body>
</html>