diff --git a/backend/src/main/java/com/banben/modules/resource/entity/VersionResource.java b/backend/src/main/java/com/banben/modules/resource/entity/VersionResource.java index 62fad6b..b5cc193 100644 --- a/backend/src/main/java/com/banben/modules/resource/entity/VersionResource.java +++ b/backend/src/main/java/com/banben/modules/resource/entity/VersionResource.java @@ -66,7 +66,8 @@ public class VersionResource implements Serializable { @Schema(description = "所属任务年份(必备)") private String taskYear; - @Schema(description = "来源馆(必备)") + @TableField("source_library") + @Schema(description = "来源馆(必备),对应 version_resource.source_library") private String sourceLibrary; @Schema(description = "来源馆地址(必备,IP:端口或域名)") diff --git a/backend/src/main/java/com/banben/modules/special/dto/SpecialRecommendVO.java b/backend/src/main/java/com/banben/modules/special/dto/SpecialRecommendVO.java index 6d85d30..1a39872 100644 --- a/backend/src/main/java/com/banben/modules/special/dto/SpecialRecommendVO.java +++ b/backend/src/main/java/com/banben/modules/special/dto/SpecialRecommendVO.java @@ -44,6 +44,9 @@ public class SpecialRecommendVO implements Serializable { @Schema(description = "下载/电子版地址(special_resource.ebook_url,version_resource 场景取全文地址)") private String ebookUrl; + @Schema(description = "来源馆(version_resource.source_library)") + private String sourceLibrary; + @Schema(description = "数据来源:VERSION=version_resource特藏标记 / MANUAL=special_resource手工维护") private String source; } diff --git a/backend/src/main/java/com/banben/modules/special/entity/SpecialResource.java b/backend/src/main/java/com/banben/modules/special/entity/SpecialResource.java index a8c823c..32db132 100644 --- a/backend/src/main/java/com/banben/modules/special/entity/SpecialResource.java +++ b/backend/src/main/java/com/banben/modules/special/entity/SpecialResource.java @@ -40,6 +40,10 @@ public class SpecialResource implements Serializable { @Schema(description = "电子版下载地址") private String ebookUrl; + @TableField("source_library") + @Schema(description = "来源馆,对应 special_resource.source_library") + private String sourceLibrary; + @Schema(description = "排序号") private Integer sortNo; diff --git a/backend/src/main/java/com/banben/modules/special/service/impl/SpecialServiceImpl.java b/backend/src/main/java/com/banben/modules/special/service/impl/SpecialServiceImpl.java index f1b8998..cc5b874 100644 --- a/backend/src/main/java/com/banben/modules/special/service/impl/SpecialServiceImpl.java +++ b/backend/src/main/java/com/banben/modules/special/service/impl/SpecialServiceImpl.java @@ -129,6 +129,7 @@ public class SpecialServiceImpl extends ServiceImpl hoverIndex.value) return { transform: 'translateX(40px)' } +/* X 轴推挤:悬停某本书时,同一排左侧书本左推、右侧书本右推 */ +function wrapperStyle(copy: number, i: number) { + const prefix = `${copy}-` + if (!hoverKey.value.startsWith(prefix)) return {} + const hi = Number(hoverKey.value.slice(prefix.length)) + if (i < hi) return { transform: 'translateX(-40px)' } + if (i > hi) return { transform: 'translateX(40px)' } return { transform: 'translateX(0px)' } } @@ -213,15 +220,27 @@ onBeforeUnmount(pause) - -
+ +
+
+
@@ -234,13 +253,22 @@ onBeforeUnmount(pause) }" > -
- {{ titleOf(e) }} +
+
+ {{ titleOf(e) }} + {{ sourceOf(e) }} +
+
+

暂无特藏推荐,可在资源管理中将版本资源标记为特藏

@@ -513,17 +541,40 @@ onBeforeUnmount(pause) color: rgba(255, 255, 255, 0.45); } -/* ---------- 快捷入口:3D 悬浮书架 ---------- */ +/* ---------- 快捷入口:3D 悬浮书架,横向循环滚动 ---------- */ .shelf { + margin-top: 30px; + overflow: hidden; + mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); +} + +.shelf-track { + display: flex; + width: max-content; + animation: shelfMarquee 36s linear infinite; + + &.paused { + animation-play-state: paused; + } +} + +.shelf-group { display: flex; - justify-content: center; align-items: flex-end; gap: 18px; - margin-top: 30px; - padding: 30px 16px 0; + padding: 36px 9px 0; perspective: 1200px; } +@keyframes shelfMarquee { + from { + transform: translateX(0); + } + to { + transform: translateX(-50%); + } +} + /* 外层:仅负责悬停时的 X 轴推挤位移 */ .book-wrapper { flex: none; @@ -594,22 +645,30 @@ onBeforeUnmount(pause) box-shadow: 0 34px 64px rgba(0, 0, 0, 0.6); } -/* 竖排烫金书名(楷体 + 锐利金属倒角),过长自动截断 */ -.book-title { +/* 书脊文字:书名竖排在上,来源在书名下侧横向居中 */ +.book-copy { position: absolute; - inset: 0; + inset: 10px 4px; display: flex; + flex-direction: column; align-items: center; justify-content: center; + gap: 6px; + min-height: 0; +} + +.book-title { + flex: 0 1 auto; + max-height: 100%; + min-height: 0; + overflow: hidden; /* vertical-lr:每列自上而下,多列时从左往右排(rl 会把开头那列放到最右,看着像反了) */ writing-mode: vertical-lr; font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif; font-size: 15px; + line-height: 1.15; letter-spacing: 5px; color: var(--brand-gold); - overflow: hidden; - text-overflow: ellipsis; - padding: 10px 0; text-shadow: -0.5px -0.5px 0px rgba(255, 255, 255, 0.8), 1px 1px 0px #704e10, @@ -617,6 +676,28 @@ onBeforeUnmount(pause) 2px 2px 3px rgba(0, 0, 0, 0.9); } +.has-source .book-title { + max-height: 62%; +} + +.book-source { + flex: 0 0 auto; + width: 100%; + writing-mode: horizontal-tb; + text-align: center; + font-size: 10px; + line-height: 1.25; + letter-spacing: 0; + color: rgba(255, 248, 220, 0.9); + border-top: 1px solid rgba(232, 201, 122, 0.55); + padding-top: 4px; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + word-break: break-all; +} + .shelf-empty { margin: 30px 0 0; text-align: center; @@ -743,6 +824,7 @@ onBeforeUnmount(pause) /* ---------- 响应式 ---------- */ @media (prefers-reduced-motion: reduce) { + .shelf-track, .book-inner, .book-shadow::before, .hero-text h1, @@ -754,9 +836,8 @@ onBeforeUnmount(pause) } @media (max-width: 1080px) { - .shelf { - flex-wrap: wrap; - row-gap: 22px; + .shelf-track { + animation-duration: 28s; } } @@ -774,7 +855,7 @@ onBeforeUnmount(pause) display: none; } - .shelf { + .shelf-group { gap: 12px; } @@ -788,7 +869,11 @@ onBeforeUnmount(pause) .book-title { font-size: 13px; - letter-spacing: 5px; + letter-spacing: 3px; + } + + .book-source { + font-size: 9px; } }