215 lines
9.3 KiB
HTML
215 lines
9.3 KiB
HTML
{extend name="base" /}
|
|
|
|
{block name="get-data"}
|
|
{video:seocopy scene="home" export_name="seoCopy" /}
|
|
|
|
{php}
|
|
$strHomeIntroTitle = trim((string)($DomainModel->d_name ?? ''));
|
|
if ($strHomeIntroTitle === '') {
|
|
$strHomeIntroTitle = '影视内容推荐';
|
|
}
|
|
|
|
$strHomeIntroText = trim((string)($seoCopy['intro_text'] ?? $seoCopy['category_intro'] ?? ''));
|
|
if ($strHomeIntroText === '') {
|
|
$strHomeIntroText = trim((string)($seoCopy['description'] ?? ''));
|
|
}
|
|
if ($strHomeIntroText === '') {
|
|
$strHomeIntroText = $strHomeIntroTitle . '首页整理了电影、剧集、综艺、动漫等常见入口,适合先看首屏推荐,再继续按分类、榜单和搜索缩小范围。';
|
|
}
|
|
|
|
$strHomeIntroMeta = trim((string)($seoCopy['intro_meta'] ?? $seoCopy['faq_content'] ?? ''));
|
|
if ($strHomeIntroMeta === '') {
|
|
$strHomeIntroMeta = '建议先看首屏推荐,再根据题材、热度和搜索词继续深入浏览。';
|
|
}
|
|
|
|
$arrHomeCategoryNames = array_values(array_filter(array_map(static function ($arrCategory): string {
|
|
return trim((string)($arrCategory['name'] ?? ''));
|
|
}, (array)($TpStyle['template_cfg']['pages']['home']['categories'] ?? [])), static function (string $strName): bool {
|
|
return $strName !== '';
|
|
}));
|
|
$strHomeCategorySummary = implode('、', array_slice($arrHomeCategoryNames, 0, 3));
|
|
if ($strHomeCategorySummary === '') {
|
|
$strHomeCategorySummary = '电影、剧集、综艺';
|
|
}
|
|
|
|
$arrHomeSlotKeys = array_values(array_filter(array_map(static function ($arrSlot): string {
|
|
return trim((string)($arrSlot['layout_key'] ?? ''));
|
|
}, (array)($TpStyle['template_cfg']['pages']['home']['slots'] ?? [])), static function (string $strKey): bool {
|
|
return $strKey !== '';
|
|
}));
|
|
$strHomePrimarySlot = $arrHomeSlotKeys[0] ?? 'news';
|
|
$arrHomePrimarySlotLabelMap = [
|
|
'news' => '更新区',
|
|
'rank' => '榜单区',
|
|
'tuijian' => '推荐区',
|
|
'update' => '更新区',
|
|
'piaofang' => '热度区',
|
|
'lunli' => '内容区',
|
|
];
|
|
$strHomePrimarySlotLabel = $arrHomePrimarySlotLabelMap[$strHomePrimarySlot] ?? '推荐区';
|
|
|
|
$intHomeTopSlotCount = count((array)($TpStyle['template_cfg']['pages']['home']['slots'] ?? []));
|
|
$intHomeCategoryCount = count((array)($TpStyle['template_cfg']['pages']['home']['categories'] ?? []));
|
|
|
|
$arrHomeQuickSignals = [
|
|
['label' => '首屏主区', 'text' => '先看' . $strHomePrimarySlotLabel],
|
|
['label' => '频道方向', 'text' => $strHomeCategorySummary],
|
|
['label' => '内容覆盖', 'text' => '当前约有' . (1 + $intHomeTopSlotCount + $intHomeCategoryCount) . '组入口区块'],
|
|
['label' => '浏览节奏', 'text' => '首屏吸引 -> 详情判断 -> 播放选择'],
|
|
];
|
|
|
|
$arrHomeGuideCards = array_values(array_filter((array)($seoCopy['guide_cards'] ?? []), static function ($arrCard): bool {
|
|
return is_array($arrCard)
|
|
&& (
|
|
trim((string)($arrCard['title'] ?? '')) !== ''
|
|
|| trim((string)($arrCard['text'] ?? '')) !== ''
|
|
);
|
|
}));
|
|
|
|
if (empty($arrHomeGuideCards)) {
|
|
$arrHomeGuideCards = [
|
|
[
|
|
'title' => '首屏入口',
|
|
'text' => '首页第一屏更适合先看' . $strHomePrimarySlotLabel . '和刚刚更新,快速判断当前最值得点开的内容。',
|
|
],
|
|
[
|
|
'title' => '内容范围',
|
|
'text' => '当前首页已经把' . $strHomeCategorySummary . '等入口串起来,适合横向切换不同内容类型。',
|
|
],
|
|
[
|
|
'title' => '搜索建议',
|
|
'text' => '如果你已经知道片名、演员或题材词,直接用搜索通常会比翻列表更快。',
|
|
],
|
|
[
|
|
'title' => '后续路径',
|
|
'text' => '找到感兴趣的内容后,建议先看详情页确认题材和线路,再决定是否直接进入播放页。',
|
|
],
|
|
];
|
|
}
|
|
{/php}
|
|
|
|
{/block}
|
|
|
|
{block name="title"}{site:seotkd code="title" page="home" /}{/block}
|
|
{block name="keywords"}{site:seotkd code="keywords" page="home" /}{/block}
|
|
{block name="description"}{site:seotkd code="description" page="home" /}{/block}
|
|
|
|
{block name="head"}
|
|
<meta name="robots" content="index,follow">
|
|
<link rel="canonical" href='https://{$DomainModel->d_domain}/'>
|
|
|
|
|
|
{// 社交媒体标签 }
|
|
<meta property="og:title" content='{site:seotkd code="title" page="home" /}' />
|
|
<meta property="og:description" content='{site:seotkd code="description" page="home" /}' />
|
|
<meta property="og:url" content="https://{$DomainModel->d_domain}" />
|
|
<meta property="og:type" content="website" />
|
|
{// 结构化数据 }
|
|
<script type="application/ld+json">
|
|
[
|
|
{
|
|
"@type": "WebSite",
|
|
"name": "{$DomainModel->d_name}",
|
|
"url": "https://{$DomainModel->d_domain}",
|
|
"alternateName": "{$DomainModel->d_domain}",
|
|
"description": "{site:seotkd code='description' page='home' /}",
|
|
"potentialAction": {
|
|
"@type": "SearchAction",
|
|
"target": 'https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}',
|
|
"query-input": "required name=search_term_string"
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
</script>
|
|
{/block}
|
|
|
|
{block name="main"}
|
|
<main class="page-home" style="max-width:{$TpStyle.template_cfg.global.page_max_width_pc}px;margin:0 auto;">
|
|
|
|
<section class="{$TpStyle.dom_prefix}-home-intro" style="margin:0 0 18px;padding:20px 22px;border:1px solid var(--border-color);border-radius:24px;background:linear-gradient(135deg,rgba(255,255,255,.98),var(--bg-soft-color));box-shadow:0 12px 28px rgba(0,0,0,.04);">
|
|
<div style="display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px;">
|
|
<span style="display:inline-flex;width:28px;height:3px;border-radius:999px;background:linear-gradient(90deg,var(--color-primary),var(--color-secondary));"></span>
|
|
<span style="display:inline-flex;align-items:center;padding:4px 10px;border-radius:999px;background:rgba(0,0,0,.04);color:var(--text-muted-color);font-size:12px;line-height:1.5;">首页导览</span>
|
|
</div>
|
|
<h1 style="margin:0 0 10px;color:var(--text-color);font-size:24px;line-height:1.35;">{$strHomeIntroTitle}</h1>
|
|
<p style="margin:0 0 10px;color:var(--text-color);font-size:15px;line-height:1.9;">{$strHomeIntroText}</p>
|
|
<p style="margin:0;color:var(--text-muted-color);font-size:13px;line-height:1.8;">{$strHomeIntroMeta}</p>
|
|
</section>
|
|
|
|
<section class="{$TpStyle.dom_prefix}-home-quick-signals" style="display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px;margin:0 0 18px;">
|
|
{foreach $arrHomeQuickSignals as $arrSignal}
|
|
<article style="padding:12px 14px;border-radius:16px;background:rgba(255,255,255,.92);border:1px solid rgba(0,0,0,.06);box-shadow:0 8px 18px rgba(0,0,0,.03);">
|
|
<strong style="display:block;margin:0 0 6px;color:var(--text-color);font-size:12px;line-height:1.5;">{$arrSignal.label}</strong>
|
|
<span style="display:block;color:var(--text-muted-color);font-size:13px;line-height:1.7;">{$arrSignal.text}</span>
|
|
</article>
|
|
{/foreach}
|
|
</section>
|
|
|
|
{// lunli }
|
|
{assign name="Slot" value="$TpStyle.template_cfg.pages.home.lunliSlots[0]"}
|
|
{assign name="title" value="$Slot.title_text"}
|
|
{include file="module/list/title/_title_router" /}
|
|
{assign name="listCfg" value="$TpStyle.template_cfg.list_layout.lunli"}
|
|
{assign name="limit" value="$listCfg.layout['max_items']"}
|
|
{video:listexp count="$limit"
|
|
v_category_en="lun-li-pian" d_key="key" d_val="Video" cache_life="3600"
|
|
export_name="__LIST__" /}
|
|
{include file="module/list/shell/_shell_router" /}
|
|
|
|
|
|
|
|
{// top}
|
|
{foreach $TpStyle.template_cfg.pages.home.slots as $Slot}
|
|
|
|
{assign name="module" value="$Slot['layout_key']"}
|
|
|
|
{assign name="limit" value="$TpStyle.template_cfg.list_layout[$module]['layout']['max_items']"}
|
|
|
|
{if $module == 'rank'}
|
|
{video:ranklistexp count="$limit" sort_type="weekly" d_key="key" d_val="Video" cache_life="3600"
|
|
export_name="__LIST__" /}
|
|
{else/}
|
|
{video:listexp count="$limit" sort_type="$module" d_key="key" d_val="Video" cache_life="3600"
|
|
export_name="__LIST__" /}
|
|
{/if}
|
|
|
|
{include file="module/list/home_block" /}
|
|
|
|
{/foreach}
|
|
|
|
{include file="module/seo_copy/collection" /}
|
|
|
|
{// 分类}
|
|
{foreach $TpStyle.template_cfg.pages.home.categories as $HomeCategory}
|
|
|
|
{assign name="Slot" value="$HomeCategory"}
|
|
|
|
{site:vciurl parent_category="$HomeCategory.key" export_name="strMoreUrl" /}
|
|
|
|
{assign name="title" value="$Slot.title_text"}
|
|
|
|
{include file="module/list/title/_title_router" /}
|
|
|
|
{assign name="HomeCategoryModel" value="$HomeCategory.layout_key"}
|
|
|
|
{assign name="listCfg" value="$TpStyle.template_cfg.list_layout[$HomeCategoryModel]"}
|
|
|
|
{assign name="limit" value="$listCfg.layout['max_items']"}
|
|
|
|
{video:listexp count="$limit"
|
|
v_parent_category_en="$HomeCategory.key"
|
|
sort_type="news"
|
|
d_key="d_key" d_val="Video" cache_life="3600"
|
|
export_name="__LIST__" /}
|
|
|
|
{// ===== Shell + Item ===== }
|
|
{include file="module/list/shell/_shell_router" /}
|
|
|
|
{/foreach}
|
|
|
|
</main>
|
|
|
|
{/block}
|