0430_公告功能
This commit is contained in:
parent
adedf8d00f
commit
cdd3ea3ffd
183
announcement.html
Normal file
183
announcement.html
Normal file
@ -0,0 +1,183 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-Hant">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<title>公告列表 - 社區管理 App</title>
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: 'Noto Sans TC', sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #f7f8fa;
|
||||
color: #333;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
|
||||
header {
|
||||
background-color: #9eaf9f;
|
||||
color: #fff;
|
||||
padding: 16px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.back-button {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.back-button img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
|
||||
.section {
|
||||
background-color: #fff;
|
||||
margin: 12px 16px;
|
||||
padding: 16px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.parcel-item {
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.parcel-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.parcel-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.parcel-info span {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.footer-nav {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #ddd;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.footer-nav a {
|
||||
text-decoration: none;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.footer-nav img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<header>
|
||||
<div class="back-button">
|
||||
<img src="https://img.icons8.com/ios-filled/50/ffffff/left.png" alt="返回" title="回上一頁" onclick="history.back()" />
|
||||
</div>
|
||||
公告列表
|
||||
</header>
|
||||
|
||||
<!-- 公告列表區塊 -->
|
||||
<!-- 公告列表區塊 -->
|
||||
<section class="section">
|
||||
<h3 style="font-size: 16px; margin-bottom: 12px;">📢 最新公告</h3>
|
||||
|
||||
<div class="parcel-item" onclick="showAnnouncement('水塔清洗通知', '本社區將於 2025/05/05 進行水塔清洗作業,請住戶提前儲水,造成不便敬請見諒。')">
|
||||
<div class="parcel-info">
|
||||
<span>2025/04/28</span>
|
||||
<span>水塔清洗通知</span>
|
||||
</div>
|
||||
<div style="font-size: 13px; color: #777; margin-top: 6px;">
|
||||
本社區將於 2025/05/05 進行水塔清洗作業,請住戶提前儲水...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="parcel-item" onclick="showAnnouncement('停電通知', '台電預計於 2025/05/01 08:00~12:00 進行電路維修,期間將暫時停電,請提前準備。')">
|
||||
<div class="parcel-info">
|
||||
<span>2025/04/25</span>
|
||||
<span>停電通知</span>
|
||||
</div>
|
||||
<div style="font-size: 13px; color: #777; margin-top: 6px;">
|
||||
台電預計於 5/1 上午進行電路維修,期間將暫時停電,請提前準備...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="parcel-item" onclick="showAnnouncement('消防演練公告', '消防演練將於 2025/05/10 下午 3 點舉行,請各位住戶配合參與。')">
|
||||
<div class="parcel-info">
|
||||
<span>2025/04/20</span>
|
||||
<span>消防演練公告</span>
|
||||
</div>
|
||||
<div style="font-size: 13px; color: #777; margin-top: 6px;">
|
||||
消防演練將於 5/10 下午舉行,請住戶配合參與並聆聽安全說明...
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 底部選單 -->
|
||||
<nav class="navbar fixed-bottom navbar-light bg-light border-top">
|
||||
<div class="container justify-content-around">
|
||||
<a class="nav-link text-center" href="main.html"><div>🏠<br>首頁</div></a>
|
||||
<a class="nav-link text-center" href="#"><div>🚪<br>出入</div></a>
|
||||
<a class="nav-link text-center" href="message.html"><div>💬<br>訊息</div></a>
|
||||
<a class="nav-link text-center" href="#"><div>👤<br>住戶</div></a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- 公告詳細 Modal -->
|
||||
<div class="modal fade" id="announcementModal" tabindex="-1" aria-labelledby="announcementModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="announcementModalLabel">公告標題</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="關閉"></button>
|
||||
</div>
|
||||
<div class="modal-body" id="announcementModalBody">
|
||||
公告內容
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
function showAnnouncement(title, content) {
|
||||
document.getElementById('announcementModalLabel').textContent = title;
|
||||
document.getElementById('announcementModalBody').textContent = content;
|
||||
const modal = new bootstrap.Modal(document.getElementById('announcementModal'));
|
||||
modal.show();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
56
main.html
56
main.html
@ -72,14 +72,58 @@
|
||||
</nav>
|
||||
|
||||
<div class="container mt-3">
|
||||
<!-- 公告區塊 -->
|
||||
<h5>📢 重要公告</h5>
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">4/20 水塔清洗通知</h6>
|
||||
<p class="card-text">本週六早上9:00至下午3:00進行清洗,請提前儲水。</p>
|
||||
<!-- 📢 最新公告 -->
|
||||
<h5 class="mb-3">
|
||||
📢 最新公告
|
||||
<a href="announcement.html" class="btn btn-sm btn-outline-primary float-end" style="border-radius: 20px; font-size: 14px;">更多</a>
|
||||
</h5>
|
||||
|
||||
<!-- 公告卡片(可點擊) -->
|
||||
<div class="card shadow-sm mb-4" style="cursor: pointer;" data-bs-toggle="modal" data-bs-target="#announcementModal">
|
||||
<div class="card-body">
|
||||
<h6 class="card-title">4/20 水塔清洗通知</h6>
|
||||
<p class="card-text text-truncate">
|
||||
本週六早上9:00至下午3:00進行清洗,請提前儲水。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 💬 Modal 彈出視窗 -->
|
||||
<div class="modal fade" id="announcementModal" tabindex="-1" aria-labelledby="announcementModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content rounded-3">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="announcementModalLabel">4/20 水塔清洗通知</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="關閉"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
本週六早上9:00至下午3:00將進行水塔清洗作業,請提前儲水並配合管理員指示,謝謝配合。
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 公告內容 Modal -->
|
||||
<div class="modal fade" id="announcementModal" tabindex="-1" aria-labelledby="announcementModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="announcementModalLabel">4/20 水塔清洗通知</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="關閉"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
本週六早上9:00至下午3:00將進行水塔清洗作業,清洗期間可能會暫停供水,請住戶提前儲水並配合管理員指示,謝謝配合。
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">關閉</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 功能快捷 -->
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user