Ver código fonte

调整华夏部门模板首页栏目展示

隐藏首页新闻动态模块,保留后台栏目和文章数据不变。学院风采改为校园图片卡片,标题固定叠在图片底部,并使用淡黑色半透明底色;文章无缩略图时使用模板校园图兜底。

Validation:\n- 本机完整环境启动成功,首页返回 HTTP 200\n- Playwright 核验桌面与移动端:新闻动态已移除,学院风采四张图片卡片及标题层正常\n- 首页无资源加载失败或前端运行错误
非繁 1 mês atrás
pai
commit
bc5a6a2f85

+ 15 - 7
WebRoot/main/ffkj-portal/dept-red.css

@@ -860,9 +860,6 @@ body.screen-red-theme .screen-footer-philosophy span {
 .dept-notice-list li a time{margin-left:auto;color:#9299a2;font-size:13px;white-space:nowrap}
 .dept-notice-list li a time{margin-left:auto;color:#9299a2;font-size:13px;white-space:nowrap}
 .dept-notice-list li a:hover{color:var(--red)}
 .dept-notice-list li a:hover{color:var(--red)}
 
 
-/* 新闻动态标题固定单行 */
-.is-dept-news .dept-card strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-line-clamp:initial}
-
 @media (max-width:900px){
 @media (max-width:900px){
   .dept-hero-notice-grid{grid-template-columns:minmax(0,1fr);gap:20px}
   .dept-hero-notice-grid{grid-template-columns:minmax(0,1fr);gap:20px}
   .dept-hero-notice-grid .dept-hero-slides{aspect-ratio:16/9}
   .dept-hero-notice-grid .dept-hero-slides{aspect-ratio:16/9}
@@ -881,13 +878,24 @@ body.screen-red-theme .screen-footer-philosophy span {
 .dept-side-list li a{display:flex;align-items:center;width:100%;color:#333;text-decoration:none}
 .dept-side-list li a{display:flex;align-items:center;width:100%;color:#333;text-decoration:none}
 .dept-side-list li a time{margin-left:auto;color:#9299a2;font-size:13px;white-space:nowrap}
 .dept-side-list li a time{margin-left:auto;color:#9299a2;font-size:13px;white-space:nowrap}
 .dept-side-list li a:hover{color:var(--red)}
 .dept-side-list li a:hover{color:var(--red)}
-.dept-showcase-grid{flex:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:16px;margin-top:0;margin-bottom:0}
-.dept-showcase-grid .dept-card>span{padding:14px 15px 16px}
-.dept-showcase-grid .dept-card strong{font-size:15px}
+.dept-showcase-grid{flex:1;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:12px;margin-top:0;margin-bottom:0}
+.dept-showcase-card{position:relative;display:block;min-height:150px;overflow:hidden;background-color:#e7e3de;background-position:center;background-size:cover}
+.dept-showcase-card:nth-child(1){background-image:url("/main/ffkj-portal/assets/official/view-1.jpg")}
+.dept-showcase-card:nth-child(2){background-image:url("/main/ffkj-portal/assets/official/view-2.jpg")}
+.dept-showcase-card:nth-child(3){background-image:url("/main/ffkj-portal/assets/official/view-3.jpg")}
+.dept-showcase-card:nth-child(4){background-image:url("/main/ffkj-portal/assets/official/campus-4.jpg")}
+.dept-showcase-card>img{width:100%;height:100%;aspect-ratio:auto;object-fit:cover;transition:transform .35s ease}
+.dept-showcase-card:hover{color:#fff}
+.dept-showcase-card:hover>img{transform:scale(1.03)}
+.dept-showcase-card>span{position:absolute;left:0;right:0;bottom:0;display:block;flex:none;padding:13px 15px 14px;color:#fff;background:rgba(0,0,0,.48)}
+.dept-showcase-card strong{display:-webkit-box;overflow:hidden;color:#fff;font-size:15px;line-height:1.5;-webkit-box-orient:vertical;-webkit-line-clamp:2}
 @media (max-width:900px){
 @media (max-width:900px){
   .dept-major-showcase-section{margin-top:36px}
   .dept-major-showcase-section{margin-top:36px}
   .dept-two-module-grid{grid-template-columns:minmax(0,1fr);gap:36px}
   .dept-two-module-grid{grid-template-columns:minmax(0,1fr);gap:36px}
-  .dept-showcase-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
+  .dept-showcase-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
+  .dept-showcase-card{min-height:170px}
+  .dept-showcase-card>span{padding:11px 12px 12px}
+  .dept-showcase-card strong{font-size:14px}
   .dept-side-list li a{display:block}
   .dept-side-list li a{display:block}
   .dept-side-list li a time{display:block;float:none;margin:5px 0 0}
   .dept-side-list li a time{display:block;float:none;margin:5px 0 0}
 }
 }

+ 5 - 5
WebRoot/web/upload/ffkj-template/dept-red-index.jsp

@@ -10,7 +10,7 @@
 	<meta name="keywords" content="${website.seoKeywords}">
 	<meta name="keywords" content="${website.seoKeywords}">
 	<meta name="description" content="${website.seoDescription}">
 	<meta name="description" content="${website.seoDescription}">
 	<title>${website.seoTitle}</title>
 	<title>${website.seoTitle}</title>
-	<link rel="stylesheet" href="/main/ffkj-portal/dept-red.css?v=20261017-dept-nav-1">
+	<link rel="stylesheet" href="/main/ffkj-portal/dept-red.css?v=20261019-dept-showcase-1">
 </head>
 </head>
 <body class="screen-red-theme dept-red-page">
 <body class="screen-red-theme dept-red-page">
 	<%@ include file="dept-red-header.jsp"%>
 	<%@ include file="dept-red-header.jsp"%>
@@ -79,9 +79,9 @@
 							</div>
 							</div>
 							<div class="dept-card-grid dept-showcase-grid">
 							<div class="dept-card-grid dept-showcase-grid">
 								<c:forEach items="${deptShowcaseNmv.articleList}" var="item">
 								<c:forEach items="${deptShowcaseNmv.articleList}" var="item">
-									<a class="dept-card" href="${item.url}" target="${item.target}">
+									<a class="dept-card dept-showcase-card" href="${item.url}" target="${item.target}">
 										<c:if test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:if>
 										<c:if test="${not empty item.thumbnail}"><img src="${item.thumbnail}" alt="${item.title}"></c:if>
-										<span><strong>${item.title}</strong><time>${fn:substring(item.release_time, 0, 10)}</time></span>
+										<span><strong>${item.title}</strong></span>
 									</a>
 									</a>
 								</c:forEach>
 								</c:forEach>
 							</div>
 							</div>
@@ -90,8 +90,8 @@
 					</div>
 					</div>
 				</section>
 				</section>
 			</c:if>
 			</c:if>
-			<c:if test="${sectionNav.idcard ne 'FFKJ_DEPT_HOME_HERO' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_NOTICE' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_MAJOR' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_SHOWCASE'}">
-				<section class="section dept-home-section dept-section-${sectionNav.idcard}${sectionNav.idcard eq 'FFKJ_DEPT_HOME_NEWS' ? ' is-dept-news' : ''}" id="section-${sectionVs.index}">
+			<c:if test="${sectionNav.idcard ne 'FFKJ_DEPT_HOME_HERO' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_NOTICE' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_NEWS' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_MAJOR' and sectionNav.idcard ne 'FFKJ_DEPT_HOME_SHOWCASE'}">
+				<section class="section dept-home-section dept-section-${sectionNav.idcard}" id="section-${sectionVs.index}">
 					<div class="section-title">
 					<div class="section-title">
 						<h2>${sectionNav.name}</h2>
 						<h2>${sectionNav.name}</h2>
 						<em>${empty sectionNav.nameAssistant ? 'DEPARTMENT' : sectionNav.nameAssistant}</em>
 						<em>${empty sectionNav.nameAssistant ? 'DEPARTMENT' : sectionNav.nameAssistant}</em>