zhengCeFaGui.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php
  2. // 轮播图数据 - 修改为单张图片
  3. $carouselItems = [
  4. [
  5. "image" => "/images/test-header-7.png",
  6. "alt" => "政策法规"
  7. ]
  8. ];
  9. // 政策法规数据
  10. $policyItems = [
  11. ["title" => "文字占位符", "date" => "2025-12-07"],
  12. ["title" => "文字占位符", "date" => "2025-12-07"],
  13. ["title" => "文字占位符", "date" => "2025-12-07"],
  14. ["title" => "文字占位符", "date" => "2025-12-07"],
  15. ["title" => "文字占位符", "date" => "2025-12-07"],
  16. ["title" => "文字占位符", "date" => "2025-12-07"],
  17. ["title" => "文字占位符", "date" => "2025-12-07"],
  18. ["title" => "文字占位符", "date" => "2025-12-07"],
  19. ["title" => "文字占位符", "date" => "2025-12-07"],
  20. ["title" => "文字占位符", "date" => "2025-12-07"],
  21. ["title" => "文字占位符", "date" => "2025-12-07"],
  22. ["title" => "文字占位符", "date" => "2025-12-07"]
  23. ];
  24. // 分页数据
  25. $totalPages = 5;
  26. $currentPage = 1;
  27. ?>
  28. <!DOCTYPE html>
  29. <html lang="zh-CN">
  30. <head>
  31. <meta charset="UTF-8">
  32. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  33. <title>厦门市文化遗产保护中心 - 政策法规</title>
  34. <link rel="stylesheet" href="/css/fonts.css">
  35. <link rel="stylesheet" href="/css/fontawesome.min.css">
  36. <link rel="stylesheet" href="/css/bootstrap.min.css">
  37. <link rel="stylesheet" href="/css/swiper-bundle.min.css">
  38. <link rel="stylesheet" href="/css/style.css">
  39. <script src="/js/jquery-3.7.1.js"></script>
  40. <script src="/js/bootstrap.bundle.js"></script>
  41. <script src="/js/swiper-bundle.min.js"></script>
  42. </head>
  43. <body>
  44. <?php include __DIR__ . '/components/navbar.php'; ?>
  45. <!-- 轮播图 -->
  46. <div class="swiper mySwiper" style="width: 100%; height: 400px;">
  47. <div class="swiper-wrapper">
  48. <?php foreach ($carouselItems as $item): ?>
  49. <div class="swiper-slide">
  50. <img src="<?php echo $item['image']; ?>" alt="<?php echo $item['alt']; ?>" style="width: 100%; height: 100%; object-fit: cover;">
  51. </div>
  52. <?php endforeach; ?>
  53. </div>
  54. <div class="swiper-pagination"></div>
  55. <div class="swiper-button-prev"></div>
  56. <div class="swiper-button-next"></div>
  57. </div>
  58. <!-- 主要内容 -->
  59. <div class="main-content">
  60. <div class="container">
  61. <div class="row">
  62. <!-- 右侧内容 -->
  63. <div class="col-12">
  64. <div class="content">
  65. <div class="section-title center large">
  66. <h2 class="icon">政策法规</h2>
  67. </div>
  68. <!-- 搜索区域 -->
  69. <div class="d-flex justify-content-center align-items-center gap-3 mb-4">
  70. <button class="bordered active">国家法律法规</button>
  71. <button class="bordered">地方政策文件</button>
  72. <div class="bordered-input">
  73. <input type="text" placeholder="输入关键字搜索政策法规">
  74. </div>
  75. <button class="bordered active">搜索</button>
  76. </div>
  77. <!-- 文章列表 -->
  78. <div class="news-list">
  79. <?php foreach ($policyItems as $item): ?>
  80. <div class="news-item dark">
  81. <a href="./xinWenXiangQing.php?id=<?php echo urlencode($item['title']); ?>" class="title"><?php echo $item['title']; ?></a>
  82. <span class="date"><?php echo $item['date']; ?></span>
  83. </div>
  84. <?php endforeach; ?>
  85. </div>
  86. <!-- 分页 -->
  87. <nav aria-label="List Page navigation">
  88. <ul class="pagination mt-4">
  89. <?php for ($i = 1; $i <= $totalPages; $i++): ?>
  90. <li class="<?php echo $i == $currentPage ? 'active' : ''; ?>"><a href="?page=<?php echo $i?>"><?php echo $i; ?></a></li>
  91. <?php endfor; ?>
  92. </ul>
  93. </nav>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <?php include __DIR__ . '/components/footer.php'; ?>
  100. <script>
  101. $(document).ready(function() {
  102. // 初始化 Swiper
  103. const swiper = new Swiper(".mySwiper", {
  104. slidesPerView: 1,
  105. spaceBetween: 30,
  106. loop: true,
  107. pagination: {
  108. el: ".swiper-pagination",
  109. clickable: true,
  110. },
  111. navigation: {
  112. nextEl: ".swiper-button-next",
  113. prevEl: ".swiper-button-prev",
  114. },
  115. autoplay: {
  116. delay: 5000,
  117. disableOnInteraction: false,
  118. },
  119. });
  120. });
  121. </script>
  122. </body>
  123. </html>