This commit is contained in:
谢宇宁
2026-09-29 15:30:33 +07:00
parent 0fbdba5ccf
commit 9abe0b1b76
181 changed files with 608 additions and 18501 deletions
+30 -49
View File
@@ -6,7 +6,7 @@
<title>{{.metaTitle}}</title>
{{template "seoCommon" .}}
<link rel="stylesheet" href="/static/css/base.css?v=3">
<link rel="stylesheet" href="/static/css/index.css?v=14">
<link rel="stylesheet" href="/static/css/index.css?v=17">
</head>
<body>
{{template "header" .}}
@@ -35,9 +35,9 @@
</div>
<h2 class="hero__title">{{if $item.PlayName}}{{$item.PlayName}}{{else}}{{$item.Title}}{{end}}</h2>
<p class="hero__attrs">
{{range $ti, $t := $item.ThemeNames}}{{if $ti}} {{end}}{{$t}}{{end}}
{{if $item.TotalEpisode}} 全 {{$item.TotalEpisode}} 集{{end}}
{{if $item.Anchor}} 主演 {{$item.Anchor}}{{end}}
{{template "cardEpChip" $item}}
{{with $item.ThemeNames}}<span>{{range $ti, $t := .}}{{if $ti}} · {{end}}{{$t}}{{end}}</span>{{end}}
{{with usableAnchor $item.Anchor}}{{if and (ne . "原创") (ne . "已注销")}}<span>主演 {{.}}</span>{{end}}{{end}}
</p>
<p class="hero__desc">{{$item.Desc}}</p>
<div class="hero__actions">
@@ -87,8 +87,9 @@
<div class="page">
<main class="main">
<!-- 公告:GET /api/app/playlet/home → announcements;无数据不渲染 -->
{{if .announcements}}
<!-- 公告:GET /api/app/playlet/home → announcements,其后追加官方访问地址;两者都没有时不渲染 -->
{{$cfg := .appConfig}}
{{if or .announcements $cfg.ForeverURLAddr $cfg.NewURLAddr $cfg.NewURLAddr1 $cfg.NewURLAddr2}}
<section class="announce" aria-label="公告">
<div class="announce__label">
<img decoding="async" loading="lazy" class="icon" src="/static/images/placeholder.png?v=2" data-src="/static/images/bell.svg" alt="更新提醒">
@@ -96,20 +97,8 @@
</div>
<div class="announce__track">
<div class="announce__marquee">
<div class="announce__marquee-group">
{{range $i, $a := .announcements}}
{{if $i}}<span class="announce__sep" aria-hidden="true"></span>{{end}}
<p>{{if $a.Title}}{{$a.Title}}:{{end}}{{$a.Content}}</p>
{{end}}
<span class="announce__sep" aria-hidden="true"></span>
</div>
<div class="announce__marquee-group" aria-hidden="true">
{{range $i, $a := .announcements}}
{{if $i}}<span class="announce__sep" aria-hidden="true"></span>{{end}}
<p>{{if $a.Title}}{{$a.Title}}:{{end}}{{$a.Content}}</p>
{{end}}
<span class="announce__sep" aria-hidden="true"></span>
</div>
<div class="announce__marquee-group">{{template "announceItems" .}}</div>
<div class="announce__marquee-group" aria-hidden="true">{{template "announceItems" .}}</div>
</div>
</div>
</section>
@@ -123,33 +112,6 @@
{{end}}
</nav>
<!-- 继续观看:GET /api/app/playlet/history/list?pageNum=1&pageSize=6;无数据不渲染 -->
{{if .continueWatch}}
<section class="block block--continue">
<header class="block__head">
<div class="block__titles">
<h2 class="block__title">继续观看</h2>
<p class="block__subtitle">上次看到</p>
</div>
<a class="block__more" href="/history">
观看历史
<img decoding="async" loading="lazy" class="icon icon--sm" src="/static/images/placeholder.png?v=2" data-src="/static/images/chevron-right.svg" alt="前往下一项">
</a>
</header>
<div class="grid grid--6">
{{range $item := .continueWatch}}
<article class="card">
<a class="card__cover lazy" href="{{historyPlayURL $item}}" style="{{cssCoverPlaceholder}}" data-src="{{$item.Cover}}">
<span class="card__progress" style="--p:{{historyProgressPct $item}}"></span>
</a>
<h3 class="card__title"><a href="{{historyPlayURL $item}}">{{if $item.PlayName}}{{$item.PlayName}}{{else}}{{$item.Title}}{{end}}</a></h3>
<p class="card__meta">{{historyContinueMeta $item}}</p>
</article>
{{end}}
</div>
</section>
{{end}}
<!--
homeConfigData:按接口顺序渲染;type 1短剧 / 2视频 / 3题材;
名称为「热播榜」时用热播榜专用 UI;除 type=3 外下方插入 advitise.detailbannerList(每次 2 条)
@@ -216,11 +178,10 @@
{{range $item := $cfg.List}}
<article class="card">
<a class="card__cover lazy" href="{{playURL $item.Slug $item.ID}}" style="{{cssCoverPlaceholder}}" data-src="{{$item.Cover}}">
{{if $item.TotalEpisode}}<span class="card__ep">全 {{$item.TotalEpisode}} 集</span>{{end}}
{{if $item.IsFeatured}}<span class="badge badge--hot">爆剧</span>{{else if eq $item.Anchor "原创"}}<span class="badge badge--original">原创</span>{{end}}
</a>
<h3 class="card__title"><a href="{{playURL $item.Slug $item.ID}}">{{if $item.PlayName}}{{$item.PlayName}}{{else}}{{$item.Title}}{{end}}</a></h3>
<p class="card__meta">{{range $ti, $tag := cardTags $item}}{{if $ti}} {{end}}{{if $tag.URL}}<a href="{{$tag.URL}}" {{externalLinkAttrs $tag.URL}}>{{$tag.Name}}</a>{{else}}{{$tag.Name}}{{end}}{{end}}</p>
<p class="card__meta card__meta--ep">{{template "cardEpChip" $item}}<span class="card__meta-tags">{{range $ti, $tag := cardTags $item}}{{if $ti}} {{end}}{{if $tag.URL}}<a href="{{$tag.URL}}" {{externalLinkAttrs $tag.URL}}>{{$tag.Name}}</a>{{else}}{{$tag.Name}}{{end}}{{end}}</span></p>
</article>
{{end}}
</div>
@@ -340,3 +301,23 @@
</body>
</html>
{{/* 跑马灯内容:后台公告在前,随后是官方访问地址(以胶囊链接展示) */}}
{{define "announceItems"}}{{$cfg := .appConfig}}
{{range $i, $a := .announcements}}
{{if $i}}<span class="announce__sep" aria-hidden="true"></span>{{end}}
<p>{{if $a.Title}}{{$a.Title}}:{{end}}{{$a.Content}}</p>
{{end}}
{{if or $cfg.ForeverURLAddr $cfg.NewURLAddr $cfg.NewURLAddr1 $cfg.NewURLAddr2}}
{{if .announcements}}<span class="announce__sep" aria-hidden="true"></span>{{end}}
<p class="announce__addrs">
<span>官方地址</span>
{{if $cfg.ForeverURLAddr}}<a class="announce__addr" href="{{$cfg.ForeverURLAddr}}" target="_blank" rel="sponsored nofollow noopener">永久 · {{navDisplayURL $cfg.ForeverURLAddr}}</a>{{end}}
{{if $cfg.NewURLAddr}}<a class="announce__addr" href="{{$cfg.NewURLAddr}}" target="_blank" rel="sponsored nofollow noopener">最新 · {{navDisplayURL $cfg.NewURLAddr}}</a>{{end}}
{{if $cfg.NewURLAddr1}}<a class="announce__addr" href="{{$cfg.NewURLAddr1}}" target="_blank" rel="sponsored nofollow noopener">备用 · {{navDisplayURL $cfg.NewURLAddr1}}</a>{{end}}
{{if $cfg.NewURLAddr2}}<a class="announce__addr" href="{{$cfg.NewURLAddr2}}" target="_blank" rel="sponsored nofollow noopener">备用 · {{navDisplayURL $cfg.NewURLAddr2}}</a>{{end}}
<span>收藏防迷路</span>
</p>
{{end}}
<span class="announce__sep" aria-hidden="true"></span>
{{end}}