广告修改

This commit is contained in:
谢宇宁
2026-10-28 17:40:27 +07:00
parent 41a45c8975
commit 9c0695b305
22 changed files with 516 additions and 186 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
{{define "ads"}}
{{/* 入参为 advitise.detailbannerList 的切片,字段与接口一致:images / link / title
{{/* 详情横幅(后台位置 3,本站字段 videoTopList)的切片,字段:images / link / title
类名避免 ads/ad-slot:夸克等浏览器内置广告拦截会隐藏这类选择器 */}}
{{if .}}
<link rel="stylesheet" href="/static/css/promo.css?v=1">
<link rel="stylesheet" href="/static/css/promo.css?v=2">
<section class="promo-rail" aria-label="推荐">
{{range .}}
<a class="promo-card" href="{{if .Link}}{{.Link}}{{else}}#{{end}}"{{if .Link}} target="_blank" rel="sponsored nofollow noopener"{{end}}>
+18
View File
@@ -0,0 +1,18 @@
{{define "appIcons"}}
{{/* 小方块推荐:首页小图标(后台位置 13,BList)/ 播放页小图标(后台位置 12,AList)
入参 dict "Items" 列表 "Label" 无障碍名称;类名避免 ads/ad-slot(夸克等浏览器会拦截) */}}
{{if .Items}}
<link rel="stylesheet" href="/static/css/appIcons.css?v=1">
<section class="app-icons" aria-label="{{if .Label}}{{.Label}}{{else}}推荐{{end}}">
<span class="app-icons__label">推广</span>
<div class="app-icons__row">
{{range .Items}}
<a class="app-icons__item" href="{{if .Link}}{{.Link}}{{else}}#{{end}}"{{if .Link}} target="_blank" rel="sponsored nofollow noopener"{{end}} title="{{.Title}}">
<img decoding="async" class="lazy app-icons__img" src="/static/images/placeholder.png?v=2" data-src="{{.Images}}" data-lazy-eager="1" alt="{{if .Title}}{{.Title}}{{else}}推荐{{end}}">
<span class="app-icons__name">{{if .Title}}{{.Title}}{{else}}推荐{{end}}</span>
</a>
{{end}}
</div>
</section>
{{end}}
{{end}}
+1 -1
View File
@@ -51,6 +51,6 @@
</div>
{{end}}
</div>
<script defer src="/static/js/pages/dialogAd.js?v=9"></script>
<script defer src="/static/js/pages/dialogAd.js?v=10"></script>
{{end}}
{{end}}
+1
View File
@@ -163,6 +163,7 @@
{{template "eighteen" .}}
{{template "dialogAd" .}}
{{template "nineGridDialog" .}}
{{template "toast" .}}
<script defer src="/static/js/common/sharePage.js?v=1"></script>
{{end}}
+28
View File
@@ -0,0 +1,28 @@
{{define "nineGridDialog"}}
{{/* 九宫格弹窗:后台位置 2(nineGridList),在年龄确认、弹窗广告之后弹出 */}}
{{if .appConfig.NineGridList}}
<link rel="stylesheet" href="/static/css/nineGridDialog.css?v=1" />
<div class="nine-grid-mask" id="nineGridDialog" data-nine-grid hidden>
<div class="nine-grid-panel" role="dialog" aria-modal="true" aria-label="推荐应用">
<div class="nine-grid-list">
{{range $ad := .appConfig.NineGridList}}
<a
class="nine-grid-item"
{{if $ad.Link}}href="{{$ad.Link}}" target="_blank" rel="sponsored nofollow noopener noreferrer"{{else}}aria-disabled="true"{{end}}
data-nine-grid-item
data-creative-id="{{$ad.ID}}"
hidden
>
<img class="nine-grid-icon" src="/static/images/placeholder.png?v=2" data-nine-grid-src="{{$ad.Images}}" alt="{{$ad.Title}}" title="{{$ad.Title}}" decoding="async" />
<span class="nine-grid-name">{{if $ad.Title}}{{$ad.Title}}{{else}}推荐应用{{end}}</span>
</a>
{{end}}
</div>
<button class="nine-grid-close" type="button" data-nine-grid-close aria-label="关闭">
<svg viewBox="0 0 36 36" width="36" height="36" aria-hidden="true"><circle cx="18" cy="18" r="16" fill="none" stroke="#fff" stroke-width="2"/><path d="M12.5 12.5l11 11M23.5 12.5l-11 11" stroke="#fff" stroke-width="2" stroke-linecap="round"/></svg>
</button>
</div>
</div>
<script defer src="/static/js/pages/nineGridDialog.js?v=1"></script>
{{end}}
{{end}}