diff --git a/app/service/playletser/home.go b/app/service/playletser/home.go index 5a4b19e..917f157 100644 --- a/app/service/playletser/home.go +++ b/app/service/playletser/home.go @@ -31,9 +31,23 @@ func FetchHome(c *gin.Context) (*HomePlayletResponse, error) { if env.Code != 200 { return nil, fmt.Errorf("playlet home code=%d msg=%s", env.Code, env.Msg) } + dropHomePlayletSlugs(&env.Data) return &env.Data, nil } +// dropHomePlayletSlugs 首页接口下发的短剧 slug 与本站详情接口不一致(详情按 slug 查询会 404), +// 清空后链接回退为 /detail/{id}/,由详情页 301 到本站正确的 slug。后端修正后可移除。 +func dropHomePlayletSlugs(data *HomePlayletResponse) { + for i := range data.HomeTodayUpdateData { + data.HomeTodayUpdateData[i].Slug = "" + } + for i := range data.HomeCategoryData { + for j := range data.HomeCategoryData[i].List { + data.HomeCategoryData[i].List[j].Slug = "" + } + } +} + // FetchHomeOrEmpty 带短缓存;失败时打日志并返回空结构,保证 SSR 页面可渲染。 func FetchHomeOrEmpty(c *gin.Context) *HomePlayletResponse { homeMu.Lock() diff --git a/app/static/css/detailHero.css b/app/static/css/detailHero.css index 34907b7..4f5e6ad 100644 --- a/app/static/css/detailHero.css +++ b/app/static/css/detailHero.css @@ -555,3 +555,275 @@ body.is-detail-page .content-official-info a { line-height: 22px; } } + +/* ---------- 本站详情页外观:封面右置渐变信息卡、下划线分段选集、热门短剧横排置底 ---------- */ +.dh-card { + border: 0; + border-radius: 12px; + background: #181818; +} + +.dh-hero { + background: linear-gradient(120deg, rgba(236, 35, 127, 0.16) 0%, rgba(24, 24, 24, 0) 55%), #181818; +} + +.dh-brand { + color: rgba(255, 255, 255, 0.7); + font-size: 13px; +} + +.dh-intro-title { + color: #EC237F; + font-size: 14px; + font-weight: 500; + line-height: 20px; +} + +.dh-tag { + padding: 3px 12px; + background: transparent; + border: 1px solid rgba(255, 255, 255, 0.18); + color: rgba(255, 255, 255, 0.8); +} + +.dh-tag::before { + content: "#"; + margin-right: 2px; + opacity: 0.6; +} + +.dh-theme { + border-radius: 4px; + border-color: transparent; + background: rgba(236, 35, 127, 0.14); +} + +.dh-btn { + border-radius: 8px; +} + +.dh-episodes-head { + padding-left: 12px; + border-left: 4px solid #EC237F; +} + +.dh-episodes-title { + font-size: 18px; + line-height: 26px; +} + +.dh-ranges { + gap: 24px; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); +} + +.dh-range { + height: 36px; + padding: 0 2px; + background: transparent; + border-radius: 0; + border-bottom: 2px solid transparent; + color: rgba(255, 255, 255, 0.55); + font-size: 14px; +} + +.dh-range.is-active { + background: transparent; + border-bottom-color: #EC237F; + color: #FFFFFF; + font-weight: 600; +} + +.dh-ep { + background: transparent; + border: 1px solid rgba(255, 255, 255, 0.12); + border-radius: 6px; + box-sizing: border-box; +} + +.dh-ep:hover { + background: transparent; + border-color: rgba(236, 35, 127, 0.6); +} + +.dh-ep-lock { + top: 3px; + right: 3px; + border-radius: 3px; +} + +body.is-detail-page .content-official-info { + outline: 0; + border-radius: 12px; + background: #181818; +} + +body.is-detail-page .content-official-info::before { + padding-left: 12px; + border-left: 4px solid #EC237F; +} + +@media (min-width: 768px) { + .dh-hero { + flex-direction: row-reverse; + align-items: stretch; + gap: 40px; + } + + .dh-poster { + flex-basis: 250px; + align-self: flex-start; + border-radius: 10px; + box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); + } + + .dh-title { + font-size: 34px; + line-height: 44px; + } + + .dh-actions { + margin-top: auto; + padding-top: 8px; + } + + .dh-ep-grid { + grid-template-columns: repeat(10, minmax(0, 1fr)); + gap: 10px; + } + + /* 热门短剧:由右侧竖栏改为页面底部横排 */ + .detail-layout { + grid-template-columns: minmax(0, 1fr); + gap: calc(40px * var(--detail-s)); + } + + .detail-layout > .content-column-divider { + display: none; + } + + .detail-sidebar, + .detail-sidebar .detail-related { + width: 100%; + } + + .detail-sidebar .detail-related-title { + height: auto; + padding-left: calc(12px * var(--detail-s)); + border-left: calc(4px * var(--detail-s)) solid #EC237F; + line-height: calc(30px * var(--detail-s)); + } + + .detail-sidebar .detail-related .card-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: calc(20px * var(--detail-s)); + } + + .detail-sidebar .detail-related .poster-card { + width: auto; + border-radius: calc(8px * var(--detail-s)); + } + + .detail-sidebar .detail-related .poster-cover { + aspect-ratio: 3 / 4; + border-radius: calc(8px * var(--detail-s)); + } + + .detail-sidebar .detail-related .poster-card-body { + min-height: 0; + padding: calc(10px * var(--detail-s)) calc(2px * var(--detail-s)); + background: transparent; + } +} + +@media (max-width: 767px) { + /* 小封面在左,品牌、标题、元信息在右,其余内容通栏 */ + .dh-hero { + display: grid; + grid-template-columns: 112px minmax(0, 1fr); + /* 第 4 行吸收封面多出的高度,避免右侧三行被拉开 */ + grid-template-rows: auto auto auto 1fr; + column-gap: 14px; + row-gap: 10px; + align-items: start; + } + + .dh-info { + display: contents; + } + + .dh-info > * { + grid-column: 1 / -1; + } + + .dh-poster { + grid-column: 1; + grid-row: 1 / span 4; + width: 112px; + border-radius: 8px; + } + + .dh-poster-play { + width: 36px; + height: 36px; + } + + .dh-poster-play img { + width: 14px; + height: 14px; + } + + .dh-poster-badge, + .dh-poster-eps { + padding: 0 6px; + font-size: 11px; + } + + .dh-info > .dh-brand, + .dh-info > .dh-title, + .dh-info > .dh-meta { + grid-column: 2; + } + + .dh-info > .dh-brand { + grid-row: 1; + } + + .dh-info > .dh-title { + grid-row: 2; + font-size: 20px; + line-height: 28px; + } + + .dh-info > .dh-meta { + grid-row: 3; + } + + .dh-ranges { + gap: 18px; + } + + .dh-ep-grid { + grid-template-columns: repeat(6, minmax(0, 1fr)); + gap: 8px; + } + + .dh-ep { + height: 38px; + font-size: 13px; + } + + .dh-info > .dh-intro-toggle { + justify-self: start; + } + + /* 格子较窄,APP 角标移到格子外角,避免盖住集数 */ + .dh-ep-lock { + top: -6px; + right: -4px; + padding: 0 3px; + font-size: 9px; + line-height: 13px; + } +} diff --git a/app/static/css/dramaTile.css b/app/static/css/dramaTile.css new file mode 100644 index 0000000..268d2db --- /dev/null +++ b/app/static/css/dramaTile.css @@ -0,0 +1,101 @@ +/* 短剧卡片统一外观:小圆角封面、底部渐变、集数角标置左上、信息区无底色、话题式标签。 + 选择器带 a 标签提高优先级,覆盖各页面对卡片的局部样式。 */ + +a.poster-card { + border-radius: 6px; + background: transparent; + overflow: visible; +} + +a.poster-card > .poster-cover { + border-radius: 6px; + overflow: hidden; + background: #1a1a1a; +} + +a.poster-card > .poster-cover::after { + content: ""; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 36%; + background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0)); + pointer-events: none; + z-index: 1; +} + +a.poster-card .poster-cover-img { + transition: transform 0.35s ease; +} + +a.poster-card:hover .poster-cover-img { + transform: scale(1.04); +} + +a.poster-card .episode-badge { + left: 6px; + right: auto; + top: 6px; + bottom: auto; + height: 20px; + padding: 0 6px; + border-radius: 3px; + background: rgba(0, 0, 0, 0.55); + font-size: 11px; + line-height: 20px; + z-index: 2; +} + +a.poster-card .episode-badge .text-white-xs { + font-size: inherit; + line-height: inherit; +} + +a.poster-card .poster-corner-badges { + top: 6px; + right: 6px; +} + +a.poster-card > .poster-card-body { + padding: 8px 2px 2px; + background: transparent; + gap: 3px; +} + +a.poster-card .poster-card-title { + margin: 0; + font-weight: 600; +} + +a.poster-card:hover .poster-card-title { + color: #ec237f; +} + +a.poster-card .poster-card-subtitle { + margin: 0; + color: #8c8c8c; +} + +a.poster-card .poster-card-tag { + padding: 0; + background: transparent; + border: 0; + color: #9a9a9a; +} + +a.poster-card .poster-card-tag::before { + content: "#"; + margin-right: 1px; + opacity: 0.7; +} + +a.poster-card .poster-card-heat { + flex-shrink: 0; + white-space: nowrap; +} + +/* 侧栏卡片较窄,标签不加 # 前缀以免被截断 */ +.detail-related a.poster-card .poster-card-tag::before { + content: none; +} diff --git a/app/static/css/play.css b/app/static/css/play.css index 5b3d413..2a3cfe8 100644 --- a/app/static/css/play.css +++ b/app/static/css/play.css @@ -2821,3 +2821,260 @@ a.play-info-tag:focus-visible { .play-speed-sheet-option.is-active, .play-ep-sheet-tab--active { color: #ec237f; } } + +/* 本站播放页布局:PC 播放器右侧选集面板、热门短剧横排置底;H5 圆底按钮与粉色选集栏 */ +@media (min-width: 768px) { + .play-breadcrumb-sep { + padding: 0 calc(2px * var(--play-s)); + color: rgba(255, 255, 255, 0.35); + } + + .play-layout { + grid-template-columns: minmax(0, 1fr); + gap: calc(40px * var(--play-s)); + } + + .content-column-divider { + display: none; + } + + .play-main { + display: grid; + grid-template-columns: minmax(0, 1fr) calc(400px * var(--play-s)); + column-gap: calc(20px * var(--play-s)); + row-gap: calc(28px * var(--play-s)); + align-items: start; + } + + .play-main > * { + grid-column: 1 / -1; + } + + .play-main > .play-player { + grid-column: 1; + grid-row: 1; + border-radius: calc(12px * var(--play-s)); + } + + .play-main > .play-episodes { + grid-column: 2; + grid-row: 1; + /* 高度不参与行高计算,跟随播放器,集数多时面板内滚动 */ + height: 0; + min-height: 100%; + padding: calc(20px * var(--play-s)); + border-radius: calc(12px * var(--play-s)); + background: #181818; + box-sizing: border-box; + overflow: hidden; + } + + .play-episodes-label { + display: flex; + flex-direction: column; + gap: calc(6px * var(--play-s)); + width: 100%; + margin: 0; + padding-bottom: calc(14px * var(--play-s)); + border-bottom: 1px solid rgba(255, 255, 255, 0.08); + font-size: calc(20px * var(--play-s)); + font-weight: 600; + line-height: calc(26px * var(--play-s)); + } + + .play-episodes-count { + color: rgba(255, 255, 255, 0.45); + font-size: calc(14px * var(--play-s)); + font-weight: 400; + line-height: calc(20px * var(--play-s)); + } + + .play-ep-grid { + flex: 1 1 auto; + min-height: 0; + grid-template-columns: repeat(5, minmax(0, 1fr)); + justify-content: stretch; + align-content: start; + gap: calc(10px * var(--play-s)); + overflow-y: auto; + scrollbar-width: thin; + } + + .play-ep { + width: auto; + min-width: 0; + height: calc(44px * var(--play-s)); + border-radius: calc(6px * var(--play-s)); + border: 1px solid rgba(255, 255, 255, 0.12); + background: transparent; + font-size: calc(16px * var(--play-s)); + transition: border-color 0.2s ease, color 0.2s ease; + } + + a.play-ep:hover { + border-color: rgba(236, 35, 127, 0.6); + color: #ec237f; + } + + .play-ep-num { + width: auto; + } + + .play-ep--active, + .play-ep--active .play-ep-num { + border-color: #ec237f; + background: #ec237f; + color: #fff; + } + + .play-ep-lock { + top: calc(3px * var(--play-s)); + right: calc(3px * var(--play-s)); + } + + .play-info { + padding: calc(24px * var(--play-s)); + border-radius: calc(12px * var(--play-s)); + background: #181818; + box-sizing: border-box; + } + + .play-info-title { + font-size: calc(28px * var(--play-s)); + line-height: calc(36px * var(--play-s)); + } + + .play-info-tags { order: 2; } + .play-info-meta { order: 3; } + .play-info-desc { order: 4; } + + .play-info-tags::before { + content: none; + } + + .play-info-tag { + padding: calc(4px * var(--play-s)) calc(12px * var(--play-s)); + border: 1px solid rgba(255, 255, 255, 0.18); + border-radius: 999px; + background: transparent; + color: rgba(255, 255, 255, 0.8); + } + + .play-info-tag::before { + content: "#"; + margin-right: 2px; + opacity: 0.6; + } + + .play-info-meta span + span::before { + content: "·"; + margin-right: calc(18px * var(--play-s)); + opacity: 0.6; + } + + .play-info-desc::before { + content: "剧情:"; + } + + /* 热门短剧:由右侧竖栏改为页面底部横排 */ + .play-sidebar, + .play-sidebar .detail-related { + width: 100%; + } + + .play-sidebar .detail-related-title { + padding-left: calc(12px * var(--play-s)); + border-left: calc(4px * var(--play-s)) solid #ec237f; + height: auto; + line-height: calc(30px * var(--play-s)); + } + + .play-sidebar .detail-related .card-grid { + display: grid; + grid-template-columns: repeat(5, minmax(0, 1fr)); + gap: calc(20px * var(--play-s)); + } + + .play-sidebar .detail-related .poster-card { + width: auto; + border-radius: calc(8px * var(--play-s)); + } + + .play-sidebar .detail-related .poster-cover { + aspect-ratio: 3 / 4; + border-radius: calc(8px * var(--play-s)); + } + + .play-sidebar .detail-related .poster-card-body { + min-height: 0; + padding: calc(10px * var(--play-s)) calc(2px * var(--play-s)); + background: transparent; + } +} + +@media (max-width: 767px) { + .play-h5-top { + background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); + } + + .play-h5-ep { + flex: 0 0 auto; + margin-right: auto; + padding: 2px 10px; + border-radius: 999px; + background: rgba(236, 35, 127, 0.9); + font-size: 14px; + line-height: 22px; + } + + .play-h5-side { + gap: 14px; + } + + .play-h5-side-item { + gap: 4px; + color: rgba(255, 255, 255, 0.85); + } + + .play-h5-side-item img { + width: 44px; + height: 44px; + padding: 10px; + border-radius: 50%; + background: rgba(0, 0, 0, 0.38); + box-sizing: border-box; + } + + .play-h5-meta-title button { + font-size: 17px; + } + + .play-h5-meta-tag { + padding: 0; + background: transparent; + color: rgba(255, 255, 255, 0.85); + } + + .play-h5-meta-tag::before { + content: "#"; + margin-right: 1px; + } + + .play-h5-meta-intro { + padding-left: 8px; + border-left: 2px solid rgba(236, 35, 127, 0.8); + } + + .play-h5-bottom { + background: #111; + border-top: 1px solid rgba(255, 255, 255, 0.06); + } + + .play-h5-ep-picker { + padding: 8px 14px; + border-radius: 999px; + background: rgba(236, 35, 127, 0.14); + color: #ff6aa8; + font-weight: 500; + } +} diff --git a/app/templates/page/categoryDetail.html b/app/templates/page/categoryDetail.html index 8068e70..27ef54c 100644 --- a/app/templates/page/categoryDetail.html +++ b/app/templates/page/categoryDetail.html @@ -14,6 +14,7 @@ + {{template "header" .}} diff --git a/app/templates/page/detail.html b/app/templates/page/detail.html index fb2d77f..8ae3a0d 100644 --- a/app/templates/page/detail.html +++ b/app/templates/page/detail.html @@ -21,7 +21,8 @@ {{end}} - + + diff --git a/app/templates/page/index.html b/app/templates/page/index.html index cefc205..2aee56c 100644 --- a/app/templates/page/index.html +++ b/app/templates/page/index.html @@ -18,6 +18,7 @@ {{end}} + {{/* PC 需要 Swiper 样式;H5 延后按需注入,避免首屏下载与强制重排 */}} diff --git a/app/templates/page/list.html b/app/templates/page/list.html index d34c70c..8d4751c 100644 --- a/app/templates/page/list.html +++ b/app/templates/page/list.html @@ -15,6 +15,7 @@ {{end}} + diff --git a/app/templates/page/more.html b/app/templates/page/more.html index f5454b2..380d2c2 100644 --- a/app/templates/page/more.html +++ b/app/templates/page/more.html @@ -31,6 +31,7 @@ {{end}} + {{template "header" .}} diff --git a/app/templates/page/play.html b/app/templates/page/play.html index 4dbab38..4b7903b 100644 --- a/app/templates/page/play.html +++ b/app/templates/page/play.html @@ -27,7 +27,8 @@ {{end}} - + + @@ -65,16 +66,16 @@ > @@ -173,6 +174,34 @@ +
+

选集{{if and $playlet $playlet.TotalEpisode}}全{{$playlet.TotalEpisode}}集 · {{updateStatusText $playlet.UpdateStatus}}{{end}}

+ {{with $.episodeRanges}} +
+ {{range $i, $r := .}} + + {{end}} +
+ {{end}} +
+ {{range $.chapters}} + {{$active := and $chapter (eq .ID $chapter.ID)}} + {{if .AllowWatch}} + + {{.CurrentEpisode}} + + {{else}} + + {{.CurrentEpisode}} + + + {{end}} + {{else}} +
暂无剧集
+ {{end}} +
+
+ {{template "contentPromo" $}}
@@ -193,8 +222,8 @@
{{if $playlet}}
- 集数:{{$playlet.TotalEpisode}}集 - 上线时间 : {{playletDateText $playlet.OnlineAt $playlet.MediaCreatedAt $playlet.CreatedAt}} + {{if $playlet.TotalEpisode}}全{{$playlet.TotalEpisode}}集{{end}} + {{playletDateText $playlet.OnlineAt $playlet.MediaCreatedAt $playlet.CreatedAt}} 上线

{{if $playlet.Desc}}{{$playlet.Desc}}{{else}}暂无简介{{end}}

{{end}} @@ -221,33 +250,6 @@ >下载APP -
-

剧集

- {{with $.episodeRanges}} -
- {{range $i, $r := .}} - - {{end}} -
- {{end}} -
- {{range $.chapters}} - {{$active := and $chapter (eq .ID $chapter.ID)}} - {{if .AllowWatch}} - - {{.CurrentEpisode}} - - {{else}} - - {{.CurrentEpisode}} - - - {{end}} - {{else}} -
暂无剧集
- {{end}} -
-
{{template "contentOfficialInfo" $}} {{template "contentAds" $}} diff --git a/app/templates/page/rank.html b/app/templates/page/rank.html index d475b69..457fcd2 100644 --- a/app/templates/page/rank.html +++ b/app/templates/page/rank.html @@ -15,6 +15,7 @@ {{end}} + diff --git a/app/templates/page/search.html b/app/templates/page/search.html index bd70436..768dda5 100644 --- a/app/templates/page/search.html +++ b/app/templates/page/search.html @@ -27,6 +27,7 @@ /> + {{template "header" .}} diff --git a/app/templates/page/series.html b/app/templates/page/series.html index ad87a9b..1dfaae1 100644 --- a/app/templates/page/series.html +++ b/app/templates/page/series.html @@ -15,6 +15,7 @@ {{end}} + {{template "header" .}} diff --git a/app/templates/page/tagList.html b/app/templates/page/tagList.html index 5b75db3..8988675 100644 --- a/app/templates/page/tagList.html +++ b/app/templates/page/tagList.html @@ -16,6 +16,7 @@ + {{template "header" .}} diff --git a/app/templates/page/todayUpdate.html b/app/templates/page/todayUpdate.html index d4547a5..4282518 100644 --- a/app/templates/page/todayUpdate.html +++ b/app/templates/page/todayUpdate.html @@ -15,6 +15,7 @@ {{end}} +