Parcourir la source

修复图书馆馆藏搜索区布局错乱

补齐 tsg2.css 中缺失的馆藏搜索组件样式,恢复搜索触发区、资源类型标签、左侧检索入口和右侧搜索框的正常布局及主题色。\n\n增加 768px 以下移动端自适应:搜索入口与标签纵向排列,左侧检索菜单横向滚动,避免页面横向溢出。保留现有移动端页头图片修复,并升级 CSS 缓存版本。

Validation:\n- 浏览器注入本地 CSS,在 1440px 和 390px 下验证布局无横向溢出\n- 验证馆藏书目/知网检索切换及知网学术期刊标签切换正常
非繁 il y a 2 semaines
Parent
commit
e8348e0246

+ 307 - 2
WebRoot/main/dist/websites/css/tsg2.css

@@ -196,6 +196,235 @@ a:hover {
     /* margin-top: 30px; */
     /* margin-top: 30px; */
 }
 }
 
 
+/* 馆藏资源搜索组件 */
+:root {
+    --theme-color-1: #b4190f;
+    --theme-color-2: #343977;
+    --theme-color-3: #6c9350;
+    --theme-color-4: #de882f;
+}
+
+body[data-menu-type="1"] {
+    --current-theme-color: var(--theme-color-1);
+}
+
+body[data-menu-type="2"] {
+    --current-theme-color: var(--theme-color-2);
+}
+
+body[data-menu-type="3"] {
+    --current-theme-color: var(--theme-color-3);
+}
+
+body[data-menu-type="4"] {
+    --current-theme-color: var(--theme-color-4);
+}
+
+.search-container {
+    max-width: 1200px;
+    width: 100%;
+    position: relative;
+    margin: 0 auto;
+    box-sizing: border-box;
+}
+
+.search-panel {
+    top: 100%;
+    left: 0;
+    width: 100%;
+    background: #fff;
+    display: none;
+    box-sizing: border-box;
+    border-radius: 0 0 10px 10px;
+    overflow: hidden;
+}
+
+.left-menu {
+    width: 200px;
+    flex: 0 0 200px;
+    text-align: center;
+    background: #f8f8f8;
+}
+
+.left-menu ul {
+    list-style: none;
+    padding: 0;
+    margin: 0;
+}
+
+.left-menu li {
+    padding: 8px 20px;
+    cursor: pointer;
+    color: #333;
+}
+
+.left-menu li.active {
+    color: #fff;
+    background-color: var(--current-theme-color);
+}
+
+.right-search {
+    flex: 3;
+    min-width: 0;
+    padding: 20px;
+    background: var(--current-theme-color);
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+.search-title {
+    color: #fff;
+    font-size: 20px;
+    font-weight: bold;
+}
+
+.search-box {
+    display: flex;
+    margin: 15px 0;
+}
+
+.search-tip {
+    color: #fff;
+    font-size: 14px;
+    font-weight: 400;
+}
+
+.search-input {
+    flex: 1;
+    min-width: 0;
+    padding: 13px 15px;
+    border: none;
+    border-radius: 4px 0 0 4px;
+    font-size: 16px;
+}
+
+.search-input:focus {
+    outline: none;
+}
+
+.search-btn {
+    background: rgba(58, 58, 58, .5);
+    color: #fff;
+    border: none;
+    padding: 0 25px;
+    cursor: pointer;
+    border-radius: 0 4px 4px 0;
+    font-size: 16px;
+}
+
+.search-trigger-area {
+    position: relative;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    border-radius: 10px;
+    overflow: hidden;
+    background: #fff;
+    box-sizing: border-box;
+    height: 50px;
+}
+
+.search-trigger {
+    width: 200px;
+    flex: 0 0 200px;
+    background: #a63334;
+    color: #fff;
+    padding: 10px 15px;
+    font-size: 18px;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-sizing: border-box;
+    cursor: pointer;
+}
+
+.icon-search {
+    display: inline-block;
+    width: 20px;
+    height: 20px;
+    background: url(../images/icon/search.png) no-repeat;
+    background-size: 100%;
+    margin-right: 8px;
+    filter: brightness(0) invert(1);
+}
+
+.icon-arrow {
+    display: inline-block;
+    margin-left: 8px;
+    width: 8px;
+    height: 8px;
+    border-right: 2px solid #fff;
+    border-bottom: 2px solid #fff;
+    transform: rotate(45deg);
+    transition: transform .3s;
+}
+
+.search-panel-visible .icon-arrow {
+    transform: rotate(-135deg);
+}
+
+.search-tabs {
+    height: 100%;
+    flex: 3;
+    min-width: 0;
+    background: #ebebeb;
+    border-radius: 0 10px 0 0;
+    overflow-x: auto;
+}
+
+.search-tabs ul {
+    height: 100%;
+    display: flex;
+    align-items: center;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.search-tabs li {
+    padding: 12px 25px;
+    cursor: pointer;
+    color: #000;
+    position: relative;
+    transition: all .3s;
+    height: 100%;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    white-space: nowrap;
+}
+
+.search-tabs li.active {
+    color: var(--current-theme-color);
+}
+
+.search-tabs li.active::after {
+    content: '';
+    position: absolute;
+    bottom: 0;
+    left: 50%;
+    transform: translateX(-50%) rotate(180deg);
+    width: 0;
+    height: 0;
+    border-left: 6px solid transparent;
+    border-right: 6px solid transparent;
+    border-top: 8px solid var(--current-theme-color);
+    background: none;
+    opacity: 0;
+    transition: opacity .3s;
+}
+
+.search-panel-visible .search-tabs li.active::after {
+    opacity: 1;
+}
+
+.search-tabs li:hover {
+    color: var(--current-theme-color);
+}
+
+
 .banner{
 .banner{
     position: relative;
     position: relative;
 }
 }
@@ -646,7 +875,9 @@ a:hover {
     }
     }
 
 
     .header-img img {
     .header-img img {
-        height: 100%;
+        width: 100%;
+        height: auto;
+        display: block;
     }
     }
 
 
     .mobile-nav-icon {
     .mobile-nav-icon {
@@ -778,4 +1009,78 @@ a:hover {
     .crumbs {
     .crumbs {
         padding-top: 25px;
         padding-top: 25px;
     }
     }
-}
+}
+
+/* 馆藏资源搜索组件移动端 */
+@media screen and (max-width: 768px) {
+    .search-container {
+        width: 95%;
+    }
+
+    .search-trigger-area {
+        height: auto;
+        min-height: 50px;
+        flex-direction: column;
+        align-items: stretch;
+    }
+
+    .search-trigger {
+        width: 100%;
+        flex: 0 0 50px;
+        height: 50px;
+    }
+
+    .search-tabs {
+        width: 100%;
+        flex: none;
+        border-radius: 0;
+    }
+
+    .search-tabs ul {
+        width: 100%;
+        justify-content: flex-start;
+    }
+
+    .search-tabs li {
+        flex: 1 0 auto;
+        justify-content: center;
+        padding: 12px 10px;
+    }
+
+    .search-panel {
+        flex-direction: column;
+    }
+
+    .left-menu {
+        width: 100%;
+        flex: none;
+        overflow-x: auto;
+    }
+
+    .left-menu ul {
+        display: flex;
+        min-width: max-content;
+    }
+
+    .left-menu li {
+        flex: 1 0 auto;
+        white-space: nowrap;
+    }
+
+    .right-search {
+        width: 100%;
+        padding: 16px;
+    }
+
+    .search-title {
+        font-size: 18px;
+    }
+
+    .search-box {
+        margin: 12px 0;
+    }
+
+    .search-btn {
+        padding: 0 18px;
+    }
+}

+ 307 - 2
WebRoot/main/websiteTemplatePeview/gzhx/css/tsg2.css

@@ -196,6 +196,235 @@ a:hover {
     /* margin-top: 30px; */
     /* margin-top: 30px; */
 }
 }
 
 
+/* 馆藏资源搜索组件 */
+:root {
+    --theme-color-1: #b4190f;
+    --theme-color-2: #343977;
+    --theme-color-3: #6c9350;
+    --theme-color-4: #de882f;
+}
+
+body[data-menu-type="1"] {
+    --current-theme-color: var(--theme-color-1);
+}
+
+body[data-menu-type="2"] {
+    --current-theme-color: var(--theme-color-2);
+}
+
+body[data-menu-type="3"] {
+    --current-theme-color: var(--theme-color-3);
+}
+
+body[data-menu-type="4"] {
+    --current-theme-color: var(--theme-color-4);
+}
+
+.search-container {
+    max-width: 1200px;
+    width: 100%;
+    position: relative;
+    margin: 0 auto;
+    box-sizing: border-box;
+}
+
+.search-panel {
+    top: 100%;
+    left: 0;
+    width: 100%;
+    background: #fff;
+    display: none;
+    box-sizing: border-box;
+    border-radius: 0 0 10px 10px;
+    overflow: hidden;
+}
+
+.left-menu {
+    width: 200px;
+    flex: 0 0 200px;
+    text-align: center;
+    background: #f8f8f8;
+}
+
+.left-menu ul {
+    list-style: none;
+    padding: 0;
+    margin: 0;
+}
+
+.left-menu li {
+    padding: 8px 20px;
+    cursor: pointer;
+    color: #333;
+}
+
+.left-menu li.active {
+    color: #fff;
+    background-color: var(--current-theme-color);
+}
+
+.right-search {
+    flex: 3;
+    min-width: 0;
+    padding: 20px;
+    background: var(--current-theme-color);
+    display: flex;
+    flex-direction: column;
+    justify-content: flex-start;
+}
+
+.search-title {
+    color: #fff;
+    font-size: 20px;
+    font-weight: bold;
+}
+
+.search-box {
+    display: flex;
+    margin: 15px 0;
+}
+
+.search-tip {
+    color: #fff;
+    font-size: 14px;
+    font-weight: 400;
+}
+
+.search-input {
+    flex: 1;
+    min-width: 0;
+    padding: 13px 15px;
+    border: none;
+    border-radius: 4px 0 0 4px;
+    font-size: 16px;
+}
+
+.search-input:focus {
+    outline: none;
+}
+
+.search-btn {
+    background: rgba(58, 58, 58, .5);
+    color: #fff;
+    border: none;
+    padding: 0 25px;
+    cursor: pointer;
+    border-radius: 0 4px 4px 0;
+    font-size: 16px;
+}
+
+.search-trigger-area {
+    position: relative;
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+    border-radius: 10px;
+    overflow: hidden;
+    background: #fff;
+    box-sizing: border-box;
+    height: 50px;
+}
+
+.search-trigger {
+    width: 200px;
+    flex: 0 0 200px;
+    background: #a63334;
+    color: #fff;
+    padding: 10px 15px;
+    font-size: 18px;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    box-sizing: border-box;
+    cursor: pointer;
+}
+
+.icon-search {
+    display: inline-block;
+    width: 20px;
+    height: 20px;
+    background: url(../images/icon/search.png) no-repeat;
+    background-size: 100%;
+    margin-right: 8px;
+    filter: brightness(0) invert(1);
+}
+
+.icon-arrow {
+    display: inline-block;
+    margin-left: 8px;
+    width: 8px;
+    height: 8px;
+    border-right: 2px solid #fff;
+    border-bottom: 2px solid #fff;
+    transform: rotate(45deg);
+    transition: transform .3s;
+}
+
+.search-panel-visible .icon-arrow {
+    transform: rotate(-135deg);
+}
+
+.search-tabs {
+    height: 100%;
+    flex: 3;
+    min-width: 0;
+    background: #ebebeb;
+    border-radius: 0 10px 0 0;
+    overflow-x: auto;
+}
+
+.search-tabs ul {
+    height: 100%;
+    display: flex;
+    align-items: center;
+    list-style: none;
+    margin: 0;
+    padding: 0;
+}
+
+.search-tabs li {
+    padding: 12px 25px;
+    cursor: pointer;
+    color: #000;
+    position: relative;
+    transition: all .3s;
+    height: 100%;
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    white-space: nowrap;
+}
+
+.search-tabs li.active {
+    color: var(--current-theme-color);
+}
+
+.search-tabs li.active::after {
+    content: '';
+    position: absolute;
+    bottom: 0;
+    left: 50%;
+    transform: translateX(-50%) rotate(180deg);
+    width: 0;
+    height: 0;
+    border-left: 6px solid transparent;
+    border-right: 6px solid transparent;
+    border-top: 8px solid var(--current-theme-color);
+    background: none;
+    opacity: 0;
+    transition: opacity .3s;
+}
+
+.search-panel-visible .search-tabs li.active::after {
+    opacity: 1;
+}
+
+.search-tabs li:hover {
+    color: var(--current-theme-color);
+}
+
+
 .banner{
 .banner{
     position: relative;
     position: relative;
 }
 }
@@ -646,7 +875,9 @@ a:hover {
     }
     }
 
 
     .header-img img {
     .header-img img {
-        height: 100%;
+        width: 100%;
+        height: auto;
+        display: block;
     }
     }
 
 
     .mobile-nav-icon {
     .mobile-nav-icon {
@@ -778,4 +1009,78 @@ a:hover {
     .crumbs {
     .crumbs {
         padding-top: 25px;
         padding-top: 25px;
     }
     }
-}
+}
+
+/* 馆藏资源搜索组件移动端 */
+@media screen and (max-width: 768px) {
+    .search-container {
+        width: 95%;
+    }
+
+    .search-trigger-area {
+        height: auto;
+        min-height: 50px;
+        flex-direction: column;
+        align-items: stretch;
+    }
+
+    .search-trigger {
+        width: 100%;
+        flex: 0 0 50px;
+        height: 50px;
+    }
+
+    .search-tabs {
+        width: 100%;
+        flex: none;
+        border-radius: 0;
+    }
+
+    .search-tabs ul {
+        width: 100%;
+        justify-content: flex-start;
+    }
+
+    .search-tabs li {
+        flex: 1 0 auto;
+        justify-content: center;
+        padding: 12px 10px;
+    }
+
+    .search-panel {
+        flex-direction: column;
+    }
+
+    .left-menu {
+        width: 100%;
+        flex: none;
+        overflow-x: auto;
+    }
+
+    .left-menu ul {
+        display: flex;
+        min-width: max-content;
+    }
+
+    .left-menu li {
+        flex: 1 0 auto;
+        white-space: nowrap;
+    }
+
+    .right-search {
+        width: 100%;
+        padding: 16px;
+    }
+
+    .search-title {
+        font-size: 18px;
+    }
+
+    .search-box {
+        margin: 12px 0;
+    }
+
+    .search-btn {
+        padding: 0 18px;
+    }
+}

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

@@ -0,0 +1,28 @@
+<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<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=20261109-lib-search-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]-->