Просмотр исходного кода

恢复图书馆首页旧生产布局

补齐 tsg2.css 缺失的馆情动态双栏、右侧轮播、好书推荐、借阅排行及响应式规则,保持馆藏搜索近期修复不变。为无缩略图的馆情文章增加默认缩略图兜底,并更新样式版本号。

Validation:
- 1440/1024/980/768/640/390 六档无横向溢出
- 桌面端馆情动态轮播与列表双栏,移动端单列
- 首页空图、裂图均为 0,轮播第二篇默认图正常
- 正式内外网 CSS 与 JSP 哈希一致
非繁 2 недель назад
Родитель
Сommit
43693d19b3

+ 562 - 3
WebRoot/main/dist/websites/css/tsg2.css

@@ -196,6 +196,184 @@ a:hover {
     /* margin-top: 30px; */
 }
 
+.main-container {
+    display: flex;
+    max-width: 1200px;
+    margin: 30px auto 10px;
+    gap: 20px;
+}
+
+.news-section {
+    flex: 1;
+    width: 50%;
+}
+.news-content {
+    width: 100%;
+    margin-top: 6px;
+}
+.news-content h2 {
+    font-size: 20px;
+    margin-bottom: 15px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid #a63334;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+}
+.news-content h2 span {
+    color: #a63334;
+    font-weight: normal;
+}
+.news-content h2 a {
+    font-size: 14px;
+    color: #666;
+    text-decoration: none;
+}
+
+.news-inner {
+    display: flex;
+    justify-content: space-between;
+    min-height: 300px;
+}
+
+.news-carousel {
+    flex: 0 0 45%;
+}
+
+.news-list {
+    width: 55%;
+    padding-inline-start: 10px;
+    list-style: none;
+}
+.swiper-container-horizontal>.swiper-pagination-bullets{
+    bottom: 0;
+}
+/* .carousel-item {
+    position: absolute;
+    width: 100%;
+    height: auto;
+    opacity: 0;
+    transition: opacity 0.5s;
+}
+
+.carousel-item.active {
+    opacity: 1;
+    position: relative;
+} */
+
+.carousel-item a {
+    text-decoration: none;
+    color: #333;
+}
+
+.news-image {
+    margin-bottom: 15px;
+}
+
+.news-image img {
+    width: 100%;
+    height: 150px;
+    object-fit: cover;
+}
+
+.news-info h3 {
+    font-size: 18px;
+    margin-bottom: 10px;
+    width: 100%;
+    color: black;
+    white-space: nowrap; /* 强制单行显示 */
+    text-overflow: ellipsis; /* 超出部分省略号表示 */
+    overflow: hidden; /* 超出部分隐藏 */
+}
+
+.news-meta {
+    color: #334397;
+    font-weight: bold;
+    font-size: 14px;
+    margin-bottom: 10px;
+}
+
+.news-desc {
+    color: #666;
+    font-size: 14px;
+    line-height: 1.6;
+    display: -webkit-box;
+    -webkit-line-clamp: 3;
+    -webkit-box-orient: vertical;
+    overflow: hidden;
+}
+
+
+.news-list li:first-child{
+    margin-top: 12px;
+}
+
+.news-list li {
+    margin-bottom: 12px;
+    padding-bottom: 12px;
+    border-bottom: 1px solid #eee;
+    position: relative;
+    text-indent: 12px;
+}
+
+.news-list li a {
+    text-decoration: none;
+    color: #333;
+    display: flex;
+    justify-content: space-between;
+}
+.news-list li::before{
+    content: "";
+    display: block;
+    width: 4px;
+    height: 4px;
+    background-color: #334397;
+    position: absolute;
+    top: 30%;
+    left: 0;
+    /* transform: translateY(-100%) */
+}
+.news-list li a:hover {
+    color: #334397;
+}
+.news-title {
+    width: 65%;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap
+}
+.news-date {
+    color: #999;
+    font-size: 14px;
+}
+
+.banner-section {
+    flex: 1;
+    height: 385px;
+    overflow: hidden;
+
+}
+
+.banner-section img {
+    width: 100%;
+    height: 100%;
+    object-fit: cover;
+}
+.banner {
+    position: relative;
+}
+
+.banner
+{
+    width: 100%;
+
+}
+
+.banner img {
+    height: 350px;
+    object-fit: cover;
+}
+
 /* 馆藏资源搜索组件 */
 :root {
     --theme-color-1: #b4190f;
@@ -465,7 +643,7 @@ body[data-menu-type="5"] .search-tabs .tabs-duxiu {
 }
 
 .banner img {
-    height: 450px;
+    height: 350px;
     object-fit: cover;
 }
 
@@ -589,7 +767,7 @@ body[data-menu-type="5"] .search-tabs .tabs-duxiu {
     border: 1px solid #ccc;
     border-left: 0;
     border-bottom: 0;
-    margin: 65px auto;
+    margin: 40px auto;
     box-shadow: 0 0 12px rgba(0, 0, 0, .4);
 }
 
@@ -615,6 +793,321 @@ body[data-menu-type="5"] .search-tabs .tabs-duxiu {
     margin-top: 20px;
 }
 
+/* 容器样式调整 */
+.recommend-container {
+    display: flex;
+    gap: 10px;
+    flex-wrap: wrap;
+    justify-content: space-between;
+}
+
+.recommend-box {
+    flex: 1;
+    min-width: 300px;
+    max-width: 380px;
+    padding: 20px;
+    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+}
+
+/* 为每个区块设置不同的背景色 */
+.recommend-box:nth-child(1) {
+    background: #fff3d7;
+}
+
+.recommend-box:nth-child(2) {
+    background: #e9f0fe;
+}
+
+.recommend-box:nth-child(3) {
+    background: #ffffff;
+}
+
+/* 标题栏样式 */
+.box-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 15px;
+}
+
+.box-header h3 {
+    margin: 0;
+    font-size: 20px;
+    color: #333;
+    font-weight: normal;
+    position: relative;
+    padding-left: 12px;
+}
+
+.box-header h4 {
+    margin: 0;
+    font-size: 22px;
+    color: #333;
+    font-weight: normal;
+    position: relative;
+    font-weight: bold;
+    letter-spacing: 3px;
+
+}
+
+.box-header h4 span {
+    color: #b6000c;
+}
+
+.box-header h3:before {
+    content: '';
+    position: absolute;
+    left: 0;
+    top: 50%;
+    transform: translateY(-50%);
+    width: 4px;
+    height: 16px;
+    background: #ac3b3b;
+}
+
+.more {
+    color: #999;
+    text-decoration: none;
+    font-size: 14px;
+}
+
+/* 好书推荐样式 */
+.book-item {
+    height: 47px;
+    /* padding: 12px 0; */
+    border-bottom: 1px solid #eeeeee;
+}
+
+.book-item a {
+    height: 100%;
+    line-height: 47px;
+    text-decoration: none;
+    display: block;
+    color: #333;
+    font-size: 16px;
+}
+
+.book-item a:hover {
+    /* color: var(--current-theme-color); */
+}
+
+.book-item .book-title {
+    font-size: 14px;
+    color: #333;
+    margin-bottom: 4px;
+}
+
+.book-item .book-author {
+    font-size: 12px;
+    color: #999;
+}
+
+/* 借阅排行样式 */
+.rank-item {
+    display: flex;
+    align-items: center;
+    height: 47px;
+    border-bottom: 1px solid #eeeeee;
+}
+
+.rank-num {
+    min-width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    margin-right: 10px;
+    font-size: 14px;
+    font-weight: normal;
+}
+
+.rank-item a {
+    height: 100%;
+    line-height: 47px;
+    flex: 1;
+    font-size: 16px;
+    color: #333;
+    text-decoration: none;
+}
+
+.recommend-box a:hover{
+    color: #000 !important;
+}
+.rank-item a,.book-list a {
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: inline-block;
+}
+
+.borrow-count {
+    font-size: 14px;
+    color: #666;
+    margin-left: 10px;
+}
+
+
+.rank-1 {
+    background: url(/main/dist/websites/images/tsg/icon_rank1.png) no-repeat;
+    background-size: 100% 100%;
+    color: #fff;
+    border-radius: 4px;
+    font-size: 0px;
+}
+
+.rank-2 {
+    background: url(/main/dist/websites/images/tsg/icon_rank2.png) no-repeat;
+    background-size: 100% 100%;
+    color: #fff;
+    border-radius: 4px;
+    font-size: 0px;
+}
+
+.rank-3 {
+    background: url(/main/dist/websites/images/tsg/icon_rank3.png) no-repeat;
+    background-size: 100% 100%;
+    color: #fff;
+    border-radius: 4px;
+    font-size: 0px;
+}
+
+.rank-info .book-title {
+    font-size: 14px;
+    color: #333;
+    margin-bottom: 4px;
+}
+
+.borrow-count {
+    font-size: 16px;
+    color: #ac3b3b;
+}
+
+/* 每日一书样式 */
+
+
+/* 链接样式统一处理 */
+.recommend-box a {
+    text-decoration: none;
+    color: #333;
+}
+
+.recommend-box a:hover {
+    color: var(--current-theme-color);
+}
+
+
+/* 排行榜链接样式 */
+.rank-info a {
+    display: block;
+}
+
+.daily-book {
+    padding-right: 0;
+    padding-bottom: 0;
+}
+
+/* 每日一书链接样式 */
+.daily-book a {
+    display: flex;
+    flex-direction: column;
+    height: 100%;
+    /* justify-content: flex-end; */
+    color: #fff;
+}
+
+.daily-book a p {
+    margin: 10px 0;
+    font-size: 16px;
+    font-weight: normal;
+    padding-left: 10px;
+
+}
+
+.daily-book a:hover p {
+    color: #fff;
+}
+
+.daily-content {
+    height: calc(100% - 45px);
+    display: flex;
+}
+
+.book-cover {
+    height: 100%;
+}
+
+.book-info {
+    display: flex;
+    height: 355px;
+    flex: 1;
+    /* 添加最大宽度限制 */
+    max-width: calc(100% - 120px);
+    background-color: #ac3b3b;
+}
+
+.book-image {
+    width: 100%;
+    height: 60%;
+    overflow: hidden;
+    /* 防止图片溢出 */
+}
+
+.book-image img {
+    width: 100%;
+    height: 100%;
+    object-fit: cover;
+    /* 确保图片填充整个容器且不变形 */
+}
+
+.book-meta {
+    font-size: 12px;
+    color: #fff;
+    text-align: right;
+    padding-right: 10px;
+}
+
+
+.daily-swiper {
+    width: 100%;
+    height: 100%;
+    flex: 1;
+    overflow: hidden;
+}
+
+.daily-swiper .swiper-slide {
+    height: 100%;
+    width: 100% !important;
+    /* 确保宽度不会超出父容器 */
+}
+
+.daily-swiper .swiper-slide a {
+    height: 100%;
+    width: 100%;
+    display: flex;
+    flex-direction: column;
+}
+
+/* 响应式调整 */
+@media screen and (max-width: 1200px) {
+    .recommend-box {
+        min-width: 280px;
+    }
+}
+
+@media screen and (max-width: 768px) {
+    .search-container{
+        width: 95%;
+
+    }
+    .search-tabs li{
+        padding:12px 10px;
+    }
+    .recommend-box {
+        flex: 100%;
+        max-width: 95%;
+        margin: 0 auto;
+    }
+}
+
 /* 标签页 */
 .content-tabs h2{
     text-align: center;
@@ -849,7 +1342,7 @@ body[data-menu-type="5"] .search-tabs .tabs-duxiu {
 
 @media screen and (max-width: 1024px) {
     .banner img {
-        height: 400px;
+        height: 350px;
     }
 }
 
@@ -1116,3 +1609,69 @@ body[data-menu-type="5"] .search-tabs .tabs-duxiu {
         padding: 0 18px;
     }
 }
+
+/* 图书馆首页双栏与移动端布局(对齐旧生产) */
+@media screen and (max-width: 980px) {
+    .main-container {
+        flex-wrap: wrap;
+    }
+
+    .news-section {
+        flex: 0 0 100%;
+        width: 100%;
+    }
+
+    .news-inner {
+        flex-wrap: nowrap;
+    }
+
+    .news-carousel {
+        flex: 0 0 48%;
+    }
+
+    .news-list {
+        flex: 0 0 48%;
+    }
+
+    .banner-section {
+        flex: 0 0 100%;
+        width: 100%;
+        margin-top: 20px;
+    }
+}
+
+@media screen and (max-width: 640px) {
+    .main-container {
+        flex-direction: column;
+        padding: 0 10px;
+    }
+
+    .news-section {
+        width: 100%;
+    }
+
+    .news-inner {
+        flex-direction: column;
+    }
+
+    .news-carousel {
+        flex: 0 0 auto;
+        width: 95%;
+        margin: 0 auto;
+    }
+
+    .news-list {
+        flex: 0 0 auto;
+        width: 95%;
+        margin: 20px auto 0;
+    }
+
+    .banner-section {
+        width: 95%;
+        margin: 20px auto 0;
+    }
+
+    .news-title {
+        width: 70%;
+    }
+}

+ 26 - 0
WebRoot/web/subassembly/website/10077/10514/1007710514_edit.jsp

@@ -0,0 +1,26 @@
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="renderer" content="webkit">
+<meta name="force-rendering" content="webkit"/>
+<meta name=renderer content=webkit>
+<link rel="stylesheet" href="/main/dist/websites/plug-in/select2/select2.css">
+<link rel="stylesheet" href="/main/dist/websites/css/reset.css">
+<link rel="stylesheet" href="/main/dist/websites/plug-in/swiper/css/swiper.min.css">
+<link rel="stylesheet" href="/main/dist/websites/css/common.css">
+<link rel="stylesheet" href="/main/dist/websites/css/common-media.css">
+<link rel="stylesheet" href="/main/dist/websites/css/tsg2.css?v=20261112-lib-home-layout">
+<link rel="stylesheet" href="/main/dist/websites/css/zq-accessible-tabs.css">
+<script src="/main/dist/websites/plug-in/swiper/js/swiper.min.js"></script>
+
+<script src="/main/dist/websites/plug-in/jquery/jquery1.11.3.min.js"></script>
+<script src="/main/dist/websites/js/common.js"></script>
+<script src="/main/dist/websites/js/AdMove.js"></script>
+<script src="/main/dist/websites/plug-in/select2/select2.min.js"></script>
+<script src="/main/dist/websites/js/zq-accessible-tabs.js?v=20261022-security-3"></script>
+<link rel="icon" type="image/png" sizes="16x16" href="${website.seoIcon}">
+<!--[if lt IE 10]>
+     <script type="text/javascript">
+       document.write("<div style='position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; width: 100%; height: 100%; padding-top: 30px;  background-color: #fff;overflow: auto;'><div style='font-size: 26px; padding-left:60px'><p style='margin-bottom: 30px;font-size: 30px; text-align:center;'>您的浏览器版本太低了,为了达到最佳的浏览效果</p><p style='margin-bottom: 30px;'>一、请使用高版本IE浏览器或者谷歌浏览器!<img src='/apps/space/images/login/Chrome.jpg' style='width:50px;display:inline-block;vertical-align:middle;' /></p>二、若您使用双核浏览器,如360浏览器,请您切换“极速模式”浏览!<p style='margin-top: 30px;font-size: 22px;'>(1)点击地址栏的内核切换按钮,可以手动切换浏览模式。</p><p style='margin: 30px 0;'><img src='/apps/space/images/login/3601.png'style='width:980px' /></p><p style='margin: 30px 0;font-size: 22px;'>(2)选择“极速模式”</p><p style='margin-bottom: 30px;'><img src='/apps/space/images/login/3602.png' style='width:980px' /></p></div></div>")
+     </script>
+<![endif]-->

+ 1 - 1
WebRoot/web/subassembly/website/10077/10514/1007710514_run.jsp

@@ -11,7 +11,7 @@
 <link rel="stylesheet" href="/main/dist/websites/plug-in/swiper/css/swiper.min.css">
 <link rel="stylesheet" href="/main/dist/websites/css/common.css">
 <link rel="stylesheet" href="/main/dist/websites/css/common-media.css">
-<link rel="stylesheet" href="/main/dist/websites/css/tsg2.css?v=20261109-lib-search-layout-2">
+<link rel="stylesheet" href="/main/dist/websites/css/tsg2.css?v=20261112-lib-home-layout">
 <link rel="stylesheet" href="/main/dist/websites/css/zq-accessible-tabs.css">
 <script src="/main/dist/websites/plug-in/swiper/js/swiper.min.js"></script>
 

+ 1 - 1
WebRoot/web/subassembly/website/10077/10521/1007710521_edit.jsp

@@ -98,7 +98,7 @@
                                     <div class="swiper-slide carousel-item">
                                         <a href="${item.url}" target="${item.target}">
                                             <div class="news-image">
-                                                <img src="${item.thumbnail}" alt="" title="${item.title}">
+                                                <img src="${empty item.thumbnail ? '/main/images/article-default-thumbnail.jpg' : item.thumbnail}" alt="" title="${item.title}">
                                             </div>
                                             <div class="news-info">
                                                 <h3>${item.title}</h3>

+ 1 - 1
WebRoot/web/subassembly/website/10077/10521/1007710521_run.jsp

@@ -102,7 +102,7 @@
                                     <div class="swiper-slide carousel-item">
                                         <a href="${item.url}" target="${item.target}">
                                             <div class="news-image">
-                                                <img src="${item.thumbnail}" alt="" title="${item.title}">
+                                                <img src="${empty item.thumbnail ? '/main/images/article-default-thumbnail.jpg' : item.thumbnail}" alt="" title="${item.title}">
                                             </div>
                                             <div class="news-info">
                                                 <h3>${item.title}</h3>