news.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>宝智达冷链官网</title>
  6. <meta content="width=device-width, initial-scale=1.0" name="viewport">
  7. <meta content="" name="keywords">
  8. <meta content="" name="description">
  9. <meta content="Author" name="WebThemez">
  10. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
  11. <!-- Favicons -->
  12. <link href="../static/img/favicon.png" rel="icon">
  13. <link href="../static/img/apple-touch-icon.png" rel="apple-touch-icon">
  14. <link href="/static/layui/css/layui.css" rel="stylesheet">
  15. <!--字体 -->
  16. <link
  17. href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800|Montserrat:300,400,700"
  18. rel="stylesheet">
  19. <!-- Bootstrap CSS File -->
  20. <link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  21. <!-- Libraries CSS Files -->
  22. <link href="../static/lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  23. <link href="../static/lib/animate/animate.min.css" rel="stylesheet">
  24. <link href="../static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
  25. <link href="../static/lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
  26. <link href="../static/lib/magnific-popup/magnific-popup.css" rel="stylesheet">
  27. <link href="../static/lib/ionicons/css/ionicons.min.css" rel="stylesheet">
  28. <!-- Main Stylesheet File -->
  29. <link href="../static/css/style.css" rel="stylesheet">
  30. </head>
  31. <body id="body">
  32. <!--==========================
  33. Header
  34. ============================-->
  35. <header id="header">
  36. <div class="container">
  37. <div id="logo" class="pull-left">
  38. <img src="../static/img/favicon.png" alt="Logo" class="logo-image"/>
  39. <h1><a href="/" class="scrollto"><span></span>宝智达冷链</a></h1>
  40. </div>
  41. <nav id="nav-menu-container">
  42. <ul class="layui-nav layui-bg-gray">
  43. <li class="layui-nav-item"><a href="/">首页</a></li>
  44. <li class="layui-nav-item"><a href="/about">关于我们</a></li>
  45. <li class="layui-nav-item">
  46. <a href="/news?types=industry">新闻</a>
  47. <dl class="layui-nav-child">
  48. <dd><a href="/news?types=firm">公司新闻</a></dd>
  49. <dd><a href="/news?types=industry">行业新闻</a></dd>
  50. </dl>
  51. </li>
  52. <li class="layui-nav-item"><a href="/services/">服务介绍</a></li>
  53. <li class="layui-nav-item">
  54. <a href="/product?ptype={{.productFirst}}">产品介绍</a>
  55. <dl class="layui-nav-child">
  56. {{range .productType}}
  57. <dd><a href="/product?ptype={{.Name}}">{{.Name}}</a></dd>
  58. {{end}}
  59. </dl>
  60. </li>
  61. <li class="layui-nav-item"><a href="/recruit">全国代理招募</a></li>
  62. <li class="layui-nav-item"><a href="/contact">联系我们</a></li>
  63. </ul>
  64. </nav>
  65. </div>
  66. </header>
  67. <!--==========================
  68. Page Banner Section
  69. ============================-->
  70. <section id="innerBanner">
  71. <div class="inner-content">
  72. <h2><span>新闻资讯</span></h2>
  73. <div>
  74. </div>
  75. </div>
  76. </section><!-- #Page Banner -->
  77. <main id="main" class="container-fluid">
  78. <div class="btn-group btn-group-lg" role="group" aria-label="Large button group" style="margin-top: 10px">
  79. <button type="button" class="btn btn-outline-primary" onclick="location.href = 'news?types=industry'">行业新闻
  80. </button>
  81. <button type="button" class="btn btn-outline-primary" onclick="location.href = 'news?types=firm'">公司新闻
  82. </button>
  83. </div>
  84. <section id="news" class="row wow fadeInUp" style="margin-top: 20px;">
  85. {{range .News}}
  86. <div class="col-md-4 col-sm-6 mb-4">
  87. <div class="card shadow-sm">
  88. <img src="{{.Image}}" class="card-img-top img-fluid" alt="{{.Title}}">
  89. <h5 class="card-title"><a href="/news/{{.ID}}">{{.Title}}</a></h5>
  90. <!-- <div class="card-body" id="custom-unaffected-card-body">-->
  91. <!-- </div>-->
  92. <div class="card-footer text-right text-muted">
  93. <small>发布时间:{{.UpdatedAt}}</small>
  94. </div>
  95. </div>
  96. </div>
  97. {{end}}
  98. </section>
  99. </main>
  100. <section id="call-to-action" class="wow fadeInUp">
  101. <div class="container">
  102. <div class="row">
  103. <div class="col-lg-9 text-center text-lg-left">
  104. <h3 class="cta-title">获取我们的服务</h3>
  105. <p class="cta-text">
  106. 欢迎随时与我们联系!无论您有关于产品的问题,需要技术支持,或是想要探讨合作机会,我们的团队都乐意为您提供帮助</p>
  107. </div>
  108. <div class="col-lg-3 cta-btn-container text-center">
  109. <a class="cta-btn align-middle" href="/contact">联系我们</a>
  110. </div>
  111. </div>
  112. </div>
  113. </section>
  114. <footer id="footer">
  115. <div class="container">
  116. <div class="copyright">
  117. Copyright &copy; 2018.Company name All rights reserved.<a target="_blank"
  118. href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
  119. </div>
  120. <div class="credits">
  121. </div>
  122. </div>
  123. </footer><!-- #footer -->
  124. <a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
  125. <!-- JavaScript -->
  126. <script src="../static/lib/jquery/jquery.min.js"></script>
  127. <script src="../static/lib/jquery/jquery-migrate.min.js"></script>
  128. <script src="../static/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
  129. <script src="../static/lib/easing/easing.min.js"></script>
  130. <script src="../static/lib/superfish/hoverIntent.js"></script>
  131. <script src="../static/lib/superfish/superfish.min.js"></script>
  132. <script src="../static/lib/wow/wow.min.js"></script>
  133. <script src="../static/lib/owlcarousel/owl.carousel.min.js"></script>
  134. <script src="../static/lib/magnific-popup/magnific-popup.min.js"></script>
  135. <script src="../static/lib/sticky/sticky.js"></script>
  136. <script src="../static/js/main.js"></script>
  137. <script src="/static/layui/layui.js"></script>
  138. <script>
  139. document.addEventListener('DOMContentLoaded', function () {
  140. // 假设你的DOM中有一个或多个元素包含需要格式化的日期
  141. let dateElements = document.querySelectorAll('.card-footer small');
  142. dateElements.forEach(function (element) {
  143. // 获取元素中的原始日期字符串,这里假设日期是ISO 8601格式(如"2023-04-01T12:00:00Z")
  144. let originalDateStr = element.textContent.trim().split(':')[1]; // 假定文本是"发布时间:2023-04-01T12:00:00Z"
  145. console.log(originalDateStr.toLocaleString().split(' ')[0], "===========================")
  146. // 将其转换为Date对象
  147. let originalDate = new Date(originalDateStr);
  148. // 格式化日期,例如只保留年月日
  149. let formattedDate = originalDate.toLocaleDateString();
  150. // 更新元素的文本内容
  151. element.textContent = '发布时间:' + originalDateStr.toLocaleString().split(' ')[0];
  152. });
  153. });
  154. </script>
  155. </body>
  156. </html>