Files
web_huangguo2_h5/app/template/base/ads.html
T
谢宇宁andClaude Opus 5.5 0fbdba5ccf Initial commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 11:47:47 +07:00

16 lines
1.3 KiB
HTML

{{define "ads"}}
{{/* 入参为 advitise.detailbannerList 的切片,字段与接口一致:images / link / title
类名避免 ads/ad-slot:夸克等浏览器内置广告拦截会隐藏这类选择器 */}}
{{if .}}
<link rel="stylesheet" href="/static/css/promo.css?v=1">
<section class="promo-rail" aria-label="推荐">
{{range .}}
<a class="promo-card" href="{{if .Link}}{{.Link}}{{else}}#{{end}}" data-track-ad="external"{{if .Link}} data-ad-clickable="1"{{end}} data-ad-id="{{if .AdvertiseCode}}{{.AdvertiseCode}}{{else}}{{.ID}}{{end}}" data-creative-id="" data-ad-location="{{.Location}}" data-ad-slot-key="{{if .AdvertiseLocationCode}}{{.AdvertiseLocationCode}}{{else if .Location}}{{.Location}}{{end}}" data-ad-slot-name="{{if .AdvertiseLocationName}}{{.AdvertiseLocationName}}{{else if .Location}}广告位{{.Location}}{{end}}" data-ad-title="{{if .Title}}{{.Title}}{{else}}推荐{{end}}" data-ad-type="banner"{{if .Link}} target="_blank" rel="sponsored nofollow noopener"{{end}}>
<img decoding="async" loading="eager" class="lazy" src="/static/images/placeholder.png?v=2" data-src="{{.Images}}" data-lazy-eager="1" alt="{{if .Title}}{{.Title}}{{else}}推荐{{end}}">
<span class="tag tag--dark promo-card__tag">广告</span>
</a>
{{end}}
</section>
{{end}}
{{end}}