ソースを参照

修复新闻搜索排版并增强360浏览器兼容

站内搜索结果的标题摘要改为在左、日期固定在右,避免无摘要记录整体右移;日期统一输出 yyyy-MM-dd,列表页同步修正。\n\n为 360 浏览器兼容模式和旧 Chromium 增加运行时能力检测与降级样式,覆盖 CSS 变量、Grid、aspect-ratio 和 flex gap 不可用时的布局,并为头图、校园新闻轮播和侧栏图片补充高度兜底。\n\nValidation:\n- 1440/390 搜索页无横向溢出,无摘要结果标题仍在左侧、日期在右侧\n- 兼容模式桌面与手机无横向溢出\n- 校园新闻轮播容器高度正常,首页 15 张图片全部加载成功\n- 内外网文件 SHA-256 一致
非繁 2 週間 前
親
コミット
a26b9e5809

+ 49 - 0
WebRoot/main/ffkj-portal/news-red.css

@@ -794,3 +794,52 @@ body.screen-red-theme .screen-footer-philosophy span {
 .brand-logo{width:240px;max-width:100%;height:auto;margin-left:12px}
 .brand-logo{width:240px;max-width:100%;height:auto;margin-left:12px}
 .brand-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:18px;text-align:right}
 .brand-name{max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:18px;text-align:right}
 }
 }
+
+
+/* 站内搜索结果:标题摘要在左、日期固定在右,不能因无摘要而整体右移 */
+.news-search-page .article-list .article-copy{flex:1 1 auto;min-width:0}
+.news-search-page .article-list time{flex:0 0 112px;margin-left:auto;white-space:nowrap}
+
+
+/* 360 浏览器兼容模式及旧 Chromium:CSS 变量、Grid、aspect-ratio、flex-gap 不可用时启用 */
+.news-compat body{color:#222}
+.news-compat .head-inner,.news-compat .main-nav ul,.news-compat main,.news-compat .news-footer-inner{width:1200px;max-width:calc(100% - 40px)}
+.news-compat .hero-head{background:#8f0c21 url('/main/ffkj-portal/news-red/hero-building.jpg') center center no-repeat;background-size:cover}
+.news-compat .main-nav a.active,.news-compat .main-nav a:hover,
+.news-compat .article-list a:hover strong{color:#9b1a30}
+.news-compat .main-nav a.active,.news-compat .main-nav a:hover{border-color:#9b1a30}
+.news-compat .section-title:before{background-color:#9b1a30}
+.news-compat .feature,.news-compat .two-col,.news-compat .bottom-grid{display:block}
+.news-compat .feature>*,.news-compat .two-col>*,.news-compat .bottom-grid>*{display:block;width:100%;margin-bottom:28px}
+.news-compat .media-grid,.news-compat .catalog-grid,.news-compat .article-list-media{display:block}
+.news-compat .media-card,.news-compat .catalog-card,.news-compat .article-list-media>li{display:block;width:100%;margin-bottom:22px}
+.news-compat .news-list-layout{display:block}
+.news-compat .news-sidebar{float:left;width:270px}
+.news-compat .news-list-panel{margin-left:306px;min-width:0}
+.news-compat .news-list-layout:after{display:table;clear:both;content:""}
+.news-compat .news-sidebar-media{height:90px}
+.news-compat .news-sidebar-media img{height:90px}
+.news-compat .article-list a{display:block;position:relative;min-height:68px;padding:20px 136px 20px 0}
+.news-compat .article-list .article-copy{display:block;width:100%;min-width:0}
+.news-compat .article-list time{position:absolute;top:20px;right:0;width:112px;margin:0;text-align:right;white-space:nowrap}
+.news-compat .article-list p{display:block;max-height:44px;overflow:hidden}
+.news-compat .article-list-graphic img,.news-compat .article-list-media img,.news-compat .media-card img{width:100%;height:auto}
+.news-compat #campus .campus-feature-images{height:0;padding-bottom:56.25%}
+.news-compat #campus .campus-feature-slide .feature-image{position:absolute;top:0;left:0;width:100%;height:100%}
+.news-compat #campus .campus-feature-dots button+button{margin-left:7px}
+.news-compat .screen-footer-main{display:block}
+.news-compat .footer-address,.news-compat .footer-philosophy{width:100%;max-width:620px;margin:0 auto 22px;text-align:center}
+.news-compat .footer-logo{display:block;width:360px;max-width:78vw;margin:0 auto 20px}
+.news-compat .department-footer-link-list a{display:inline-block;margin:4px 8px}
+.news-compat .copyright .wrap{display:block;text-align:center}
+@media (min-width:901px){
+.news-compat .main-nav ul{display:block;text-align:center;white-space:nowrap}
+.news-compat .main-nav li{display:inline-block;height:100%;vertical-align:middle}
+.news-compat .main-nav li+li{margin-left:24px}
+}
+@media (max-width:900px){
+.news-compat .news-sidebar{display:none}
+.news-compat .news-list-panel{margin-left:0}
+.news-compat .article-list a{padding-right:92px}
+.news-compat .article-list time{width:78px;font-size:12px}
+}

+ 1 - 1
WebRoot/web/upload/ffkj-template/news-red-catalog.jsp

@@ -10,7 +10,7 @@
 	<meta charset="UTF-8">
 	<meta charset="UTF-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<title>${navigation.name}_${website.seoTitle}</title>
 	<title>${navigation.name}_${website.seoTitle}</title>
-	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-top-right-8">
+	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20261110-search-compat-2">
 </head>
 </head>
 <body class="screen-red-theme screen-list-page">
 <body class="screen-red-theme screen-list-page">
 	<%@ include file="news-red-header.jsp"%>
 	<%@ include file="news-red-header.jsp"%>

+ 13 - 1
WebRoot/web/upload/ffkj-template/news-red-details.jsp

@@ -7,7 +7,8 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="description" content="${articleDescription}">
 	<meta name="description" content="${articleDescription}">
 	<title>${articleTitle}_${navigation.name}_${website.seoTitle}</title>
 	<title>${articleTitle}_${navigation.name}_${website.seoTitle}</title>
-	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-top-right-8">
+	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20261110-search-compat-2">
+	<script src="/main/dist/websites/plug-in/jquery/jquery1.11.3.min.js?v=20261109-news-detail-lazyload"></script>
 </head>
 </head>
 <body class="screen-red-theme">
 <body class="screen-red-theme">
 	<%@ include file="news-red-header.jsp"%>
 	<%@ include file="news-red-header.jsp"%>
@@ -20,6 +21,17 @@
 					<div class="article-detail-meta"><span>${navigation.name}</span><time>${articleReleaseTime}</time><span>来源:${articleSource}</span></div>
 					<div class="article-detail-meta"><span>${navigation.name}</span><time>${articleReleaseTime}</time><span>来源:${articleSource}</span></div>
 				</header>
 				</header>
 				<div class="article-detail-body">${articleContent}</div>
 				<div class="article-detail-body">${articleContent}</div>
+				<script>
+				(function () {
+					function hydrateArticleImages() {
+						Array.prototype.forEach.call(document.querySelectorAll('.article-detail-body img[data-original]'), function (img) {
+							if (!img.getAttribute('src')) img.setAttribute('src', img.getAttribute('data-original'));
+						});
+					}
+					if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', hydrateArticleImages);
+					else hydrateArticleImages();
+				})();
+				</script>
 			</article>
 			</article>
 		</div></section>
 		</div></section>
 	</main>
 	</main>

+ 15 - 0
WebRoot/web/upload/ffkj-template/news-red-header.jsp

@@ -1,6 +1,21 @@
 <%@ page pageEncoding="UTF-8"%>
 <%@ page pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <c:set var="headerBackgroundImage" value="/main/ffkj-portal/news-red/hero-building.jpg"/>
 <c:set var="headerBackgroundImage" value="/main/ffkj-portal/news-red/hero-building.jpg"/>
+<script>
+(function () {
+	var root = document.documentElement;
+	var supported = false;
+	try {
+		supported = !!(window.CSS && CSS.supports && CSS.supports('display', 'grid')
+			&& CSS.supports('aspect-ratio', '16 / 9') && CSS.supports('gap', '1px'));
+	} catch (e) {
+		supported = false;
+	}
+	if (!supported && root.className.indexOf('news-compat') === -1) {
+		root.className += ' news-compat';
+	}
+})();
+</script>
 <header class="hero-head" style="--hero-bg:url('${headerBackgroundImage}')">
 <header class="hero-head" style="--hero-bg:url('${headerBackgroundImage}')">
 	<div class="head-inner">
 	<div class="head-inner">
 		<div class="top-links">
 		<div class="top-links">

+ 1 - 1
WebRoot/web/upload/ffkj-template/news-red-index.jsp

@@ -12,7 +12,7 @@
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<title>${website.seoTitle}</title>
 	<title>${website.seoTitle}</title>
 	<meta name="description" content="${website.seoDescription}">
 	<meta name="description" content="${website.seoDescription}">
-	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-top-right-8">
+	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20261110-search-compat-2">
 </head>
 </head>
 <body class="screen-red-theme">
 <body class="screen-red-theme">
 	<%@ include file="news-red-header.jsp"%>
 	<%@ include file="news-red-header.jsp"%>

+ 3 - 3
WebRoot/web/upload/ffkj-template/news-red-list.jsp

@@ -1,6 +1,6 @@
 <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
 <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <c:set var="assetBase" value="/main/ffkj-portal/news-red"/>
 <c:set var="assetBase" value="/main/ffkj-portal/news-red"/>
 <c:set var="defaultListImage" value="/main/ffkj-portal/news-red/hero-building.jpg"/>
 <c:set var="defaultListImage" value="/main/ffkj-portal/news-red/hero-building.jpg"/>
 <c:set var="websiteDisplayTitle" value="${empty website.seoTitle ? website.name : website.seoTitle}"/>
 <c:set var="websiteDisplayTitle" value="${empty website.seoTitle ? website.name : website.seoTitle}"/>
@@ -13,7 +13,7 @@
 	<meta charset="UTF-8">
 	<meta charset="UTF-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<title>${navigation.name}_${website.seoTitle}</title>
 	<title>${navigation.name}_${website.seoTitle}</title>
-	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-top-right-8">
+		<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20261110-search-compat-2">
 </head>
 </head>
 <body class="screen-red-theme screen-list-page">
 <body class="screen-red-theme screen-list-page">
 	<%@ include file="news-red-header.jsp"%>
 	<%@ include file="news-red-header.jsp"%>
@@ -40,7 +40,7 @@
 					<c:when test="${empty articleList}"><div class="empty-line">暂无内容</div></c:when>
 					<c:when test="${empty articleList}"><div class="empty-line">暂无内容</div></c:when>
 					<c:otherwise>
 					<c:otherwise>
 						<ul class="article-list">
 						<ul class="article-list">
-							<c:forEach items="${articleList}" var="item"><li><a href="${item.url}" target="${item.target}"><strong>${item.title}</strong><time><fmt:formatDate value="${item.release_time}" pattern="yyyy-MM-dd"/></time></a></li></c:forEach>
+							<c:forEach items="${articleList}" var="item"><li><a href="${item.url}" target="${item.target}"><strong>${item.title}</strong><time>${fn:substring(item.release_time, 0, 10)}</time></a></li></c:forEach>
 						</ul>
 						</ul>
 					</c:otherwise>
 					</c:otherwise>
 				</c:choose>
 				</c:choose>

+ 4 - 4
WebRoot/web/upload/ffkj-template/news-red-search.jsp

@@ -1,6 +1,6 @@
 <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
 <%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
 <c:set var="searchLabel" value="${empty str ? '请输入关键词' : '关键词:'}${str}"/>
 <c:set var="searchLabel" value="${empty str ? '请输入关键词' : '关键词:'}${str}"/>
 <!doctype html>
 <!doctype html>
 <html lang="zh-CN">
 <html lang="zh-CN">
@@ -8,14 +8,14 @@
 	<meta charset="UTF-8">
 	<meta charset="UTF-8">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<meta name="viewport" content="width=device-width, initial-scale=1">
 	<title>站内搜索_${website.seoTitle}</title>
 	<title>站内搜索_${website.seoTitle}</title>
-	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20260922-top-right-8">
+	<link rel="stylesheet" href="/main/ffkj-portal/news-red.css?v=20261110-search-compat-2">
 </head>
 </head>
-<body class="screen-red-theme">
+<body class="screen-red-theme screen-list-page news-search-page">
 	<%@ include file="news-red-header.jsp"%>
 	<%@ include file="news-red-header.jsp"%>
 	<main>
 	<main>
 		<section class="section"><div class="wrap news-list-panel">
 		<section class="section"><div class="wrap news-list-panel">
 			<div class="news-list-head"><h1>站内搜索</h1><span>${searchLabel}</span></div>
 			<div class="news-list-head"><h1>站内搜索</h1><span>${searchLabel}</span></div>
-			<c:choose><c:when test="${empty articleList}"><div class="empty-line">没有找到匹配内容</div></c:when><c:otherwise><ul class="article-list"><c:forEach items="${articleList}" var="item"><li><a href="${item.url}" target="${item.target}"><time><fmt:formatDate value="${item.release_time}" pattern="yyyy-MM-dd"/></time><div class="article-copy"><strong>${item.title}</strong><p>${item.desc}</p></div></a></li></c:forEach></ul></c:otherwise></c:choose>
+			<c:choose><c:when test="${empty articleList}"><div class="empty-line">没有找到匹配内容</div></c:when><c:otherwise><ul class="article-list"><c:forEach items="${articleList}" var="item"><li><a href="${item.url}" target="${item.target}"><div class="article-copy"><strong>${item.title}</strong><c:if test="${not empty item.desc}"><p>${item.desc}</p></c:if></div><time>${fn:substring(item.release_time, 0, 10)}</time></a></li></c:forEach></ul></c:otherwise></c:choose>
 		</div></section>
 		</div></section>
 	</main>
 	</main>
 	<%@ include file="news-red-footer.jsp"%>
 	<%@ include file="news-red-footer.jsp"%>