restore gpt seo copy pipeline and stabilize seo tkd output

This commit is contained in:
root
2026-04-16 22:45:00 +08:00
parent 09b2137fa6
commit 2a905bbf0f
18 changed files with 3587 additions and 85 deletions

View File

@@ -1,12 +1,98 @@
{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:replace code="VIDEO@INDEX@INDEX@TITLE"}{/block}
{block name="keywords"}{site:replace code="VIDEO@INDEX@INDEX@KEYWORDS"}{/block}
{block name="description"}{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"}{/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">
@@ -14,8 +100,8 @@
{// 社交媒体标签 }
<meta property="og:title" content='{site:replace code="VIDEO@INDEX@INDEX@TITLE"}' />
<meta property="og:description" content='{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"}' />
<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" />
{// 结构化数据 }
@@ -26,7 +112,7 @@
"name": "{$DomainModel->d_name}",
"url": "https://{$DomainModel->d_domain}",
"alternateName": "{$DomainModel->d_domain}",
"description": "{site:replace code="VIDEO@INDEX@INDEX@DESCRIPTION"}",
"description": "{site:seotkd code='description' page='home' /}",
"potentialAction": {
"@type": "SearchAction",
"target": 'https://{$DomainModel->d_domain}{site:vsurl key="search_term_string" p="1"/}',
@@ -42,6 +128,25 @@
{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"}
@@ -74,6 +179,8 @@
{/foreach}
{include file="module/seo_copy/collection" /}
{// 分类}
{foreach $TpStyle.template_cfg.pages.home.categories as $HomeCategory}
@@ -105,4 +212,3 @@
</main>
{/block}

View File

@@ -1,80 +1,207 @@
{// ===================== Desc Variants ===================== }
{php}
$intCurrentForgeId = (int)(request()->route('intVForgeId') ?? 0);
$strSeoCopyScene = $intCurrentForgeId > 0 ? 'forge' : 'detail';
{/php}
{video:seocopy scene="$strSeoCopyScene" video="$arrVideo" export_name="seoCopy" /}
{php}
$strDetailMainDescription = trim(preg_replace('/\s+/u', ' ', strip_tags((string)($arrVideo['v_description'] ?? ''))));
if ($strDetailMainDescription === '') {
$strDetailMainDescription = '当前内容暂无完整剧情简介,建议结合详情信息与播放入口继续判断。';
}
$arrPlayGroups = is_array($arrVideo['v_play_url'] ?? null) ? $arrVideo['v_play_url'] : [];
$strPrimaryPlayType = '';
$intPrimaryPlayIndex = 1;
if (!empty($arrPlayGroups)) {
$strPrimaryPlayType = (string)array_key_first($arrPlayGroups);
}
$strDetailSlug = trim((string)($arrVideo['v_name_en'] ?? request()->route('strPinyin') ?? ''));
if ($strDetailSlug === '') {
$strDetailSlug = (string)($arrVideo['v_id'] ?? '');
}
$strPreferredPlayUrl = '';
if ((int)($arrVideo['v_id'] ?? 0) > 0 && $strPrimaryPlayType !== '') {
$strPreferredPlayUrl = app(\app\services\VideoService::class)->getVideoPlayUrl(
(int)$arrVideo['v_id'],
$strDetailSlug,
$strPrimaryPlayType,
$intPrimaryPlayIndex
);
}
$boolIsForgeDetail = $intCurrentForgeId > 0;
$strOriginVideoName = trim((string)($arrVideo['v_name'] ?? ''));
$strMainVideoInfoUrl = '';
if ((int)($arrVideo['v_id'] ?? 0) > 0) {
$strMainVideoInfoUrl = app(\app\services\VideoService::class)->getVideoInfoUrl(
(int)$arrVideo['v_id'],
$strDetailSlug
);
}
$strDetailBody = trim((string)($seoCopy['detail_faq'] ?? ''));
$strDetailBodyLead = trim((string)($seoCopy['detail_body_lead'] ?? ''));
$strDetailPlayLinkLead = trim((string)($seoCopy['detail_play_link_lead'] ?? ''));
$strDetailBodyTail = trim((string)($seoCopy['detail_body_tail'] ?? ''));
$strForgeBodyLead = trim((string)($seoCopy['forge_body_lead'] ?? ''));
$strForgeReturnLead = trim((string)($seoCopy['forge_return_lead'] ?? ''));
if ($strForgeReturnLead === '') {
$strForgeReturnLead = '如果想回到标准详情,可返回';
}
$strForgePlayLead = trim((string)($seoCopy['forge_play_lead'] ?? ''));
$strForgeDetailNote = trim((string)($seoCopy['forge_detail_note'] ?? ''));
$arrGuideCards = array_values(array_filter((array)($seoCopy['guide_cards'] ?? []), static function ($arrCard): bool {
return is_array($arrCard)
&& (
trim((string)($arrCard['title'] ?? '')) !== ''
|| trim((string)($arrCard['text'] ?? '')) !== ''
);
}));
$arrForgeEntryLinks = [];
foreach ($arrGuideCards as $arrGuideCard) {
$strGuideTitle = trim((string)($arrGuideCard['title'] ?? ''));
$strGuideText = trim((string)($arrGuideCard['text'] ?? ''));
$strGuideLine = trim($strGuideTitle . ($strGuideText !== '' ? '' . $strGuideText : ''));
if ($strGuideLine !== '') {
$arrForgeEntryLinks[] = [
'url' => $strMainVideoInfoUrl !== '' ? $strMainVideoInfoUrl : '/',
'text' => $strGuideLine,
];
}
}
{/php}
<style>
.{$TpStyle.dom_prefix}-dm-desc,
.{$TpStyle.dom_prefix}-dm-desc-body,
.{$TpStyle.dom_prefix}-dm-desc-guide,
.{$TpStyle.dom_prefix}-dm-forge-note {
min-width: 0;
word-break: break-word;
}
.{$TpStyle.dom_prefix}-dm-desc p,
.{$TpStyle.dom_prefix}-dm-desc li,
.{$TpStyle.dom_prefix}-dm-desc blockquote,
.{$TpStyle.dom_prefix}-dm-desc summary,
.{$TpStyle.dom_prefix}-dm-desc-body p,
.{$TpStyle.dom_prefix}-dm-desc-guide p,
.{$TpStyle.dom_prefix}-dm-forge-note p {
font-size: 14px;
line-height: 1.78;
}
.{$TpStyle.dom_prefix}-dm-desc header,
.{$TpStyle.dom_prefix}-dm-desc summary {
font-size: 16px;
line-height: 1.45;
}
@media (max-width: 768px) {
.{$TpStyle.dom_prefix}-dm-desc p,
.{$TpStyle.dom_prefix}-dm-desc li,
.{$TpStyle.dom_prefix}-dm-desc blockquote,
.{$TpStyle.dom_prefix}-dm-desc summary,
.{$TpStyle.dom_prefix}-dm-desc-body p,
.{$TpStyle.dom_prefix}-dm-desc-guide p,
.{$TpStyle.dom_prefix}-dm-forge-note p {
font-size: 13px !important;
line-height: 1.74 !important;
}
.{$TpStyle.dom_prefix}-dm-desc header,
.{$TpStyle.dom_prefix}-dm-desc summary {
font-size: 15px !important;
}
.{$TpStyle.dom_prefix}-dm-desc-body,
.{$TpStyle.dom_prefix}-dm-desc-guide,
.{$TpStyle.dom_prefix}-dm-forge-note {
margin-top: 8px !important;
padding: 10px 10px !important;
border-radius: 12px !important;
}
}
</style>
{if $variant == 0}
<p class="{$TpStyle.dom_prefix}-dm-desc v0">
{$arrVideo.v_description}
{$strDetailMainDescription}
</p>
{elseif $variant == 1}
<div class="{$TpStyle.dom_prefix}-dm-desc v1">
<p>{$arrVideo.v_description|mb_substr=0,120}</p>
<p>{$strDetailMainDescription|mb_substr=0,120}</p>
</div>
{elseif $variant == 2}
<section class="{$TpStyle.dom_prefix}-dm-desc v2">
<p>{$arrVideo.v_description|mb_substr=0,200}</p>
<p>{$strDetailMainDescription|mb_substr=0,200}</p>
</section>
{elseif $variant == 3}
<article class="{$TpStyle.dom_prefix}-dm-desc v3">
<p>{$arrVideo.v_description}</p>
<p>{$strDetailMainDescription}</p>
</article>
{elseif $variant == 4}
<div class="{$TpStyle.dom_prefix}-dm-desc v4">
<p>
剧情简介:{$arrVideo.v_description|mb_substr=0,150}
剧情简介:{$strDetailMainDescription|mb_substr=0,150}
</p>
</div>
{elseif $variant == 5}
<details class="{$TpStyle.dom_prefix}-dm-desc v5">
<summary>剧情介绍</summary>
<p>{$arrVideo.v_description}</p>
<p>{$strDetailMainDescription}</p>
</details>
{elseif $variant == 6}
<div class="{$TpStyle.dom_prefix}-dm-desc v6">
<p>{$arrVideo.v_description|mb_substr=0,100}...</p>
<p>{$strDetailMainDescription|mb_substr=0,100}...</p>
<a href="#desc">查看详情</a>
</div>
{elseif $variant == 7}
<section class="{$TpStyle.dom_prefix}-dm-desc v7">
<header>影片简介</header>
<p>{$arrVideo.v_description|mb_substr=0,180}</p>
<p>{$strDetailMainDescription|mb_substr=0,180}</p>
</section>
{elseif $variant == 8}
<div class="{$TpStyle.dom_prefix}-dm-desc v8">
<blockquote>
{$arrVideo.v_description|mb_substr=0,160}
{$strDetailMainDescription|mb_substr=0,160}
</blockquote>
</div>
{elseif $variant == 9}
<p class="{$TpStyle.dom_prefix}-dm-desc v9">
{$arrVideo.v_name}{$arrVideo.v_year})剧情:
{$arrVideo.v_description|mb_substr=0,140}
{$strDetailMainDescription|mb_substr=0,140}
</p>
{elseif $variant == 10}
<div class="{$TpStyle.dom_prefix}-dm-desc v10">
<p itemprop="description">
{$arrVideo.v_description|mb_substr=0,160}
{$strDetailMainDescription|mb_substr=0,160}
</p>
</div>
{elseif $variant == 11}
<div class="{$TpStyle.dom_prefix}-dm-desc v11"
data-desc="{$arrVideo.v_description|mb_substr=0,200}">
<p>{$arrVideo.v_description|mb_substr=0,120}</p>
data-desc="{$strDetailMainDescription|mb_substr=0,200}">
<p>{$strDetailMainDescription|mb_substr=0,120}</p>
</div>
{elseif $variant == 12}
<section class="{$TpStyle.dom_prefix}-dm-desc v12">
<p>
{$arrVideo.v_description|mb_substr=0,100}
{$strDetailMainDescription|mb_substr=0,100}
<span class="{$TpStyle.dom_prefix}-dm-desc-more">
{$arrVideo.v_name} 在线观看
</span>
@@ -84,7 +211,7 @@
{elseif $variant == 13}
<div class="{$TpStyle.dom_prefix}-dm-desc v13">
<p>
{$arrVideo.v_description|mb_substr=0,130}
{$strDetailMainDescription|mb_substr=0,130}
高清完整版内容介绍。
</p>
</div>
@@ -92,7 +219,7 @@
{elseif $variant == 14}
<div class="{$TpStyle.dom_prefix}-dm-desc v14">
<p>
{$arrVideo.v_description|mb_substr=0,150}
{$strDetailMainDescription|mb_substr=0,150}
</p>
<p class="{$TpStyle.dom_prefix}-dm-desc-note">
本片支持在线播放
@@ -101,7 +228,7 @@
{elseif $variant == 15}
<p class="{$TpStyle.dom_prefix}-dm-desc v15">
{$arrVideo.v_description|mb_substr=0,120}
{$strDetailMainDescription|mb_substr=0,120}
免费观看{$arrVideo.v_name}
</p>
@@ -109,30 +236,59 @@
<div class="{$TpStyle.dom_prefix}-dm-desc v16">
<p>
<strong>{$arrVideo.v_name}</strong>
{$arrVideo.v_description|mb_substr=0,140}
{$strDetailMainDescription|mb_substr=0,140}
</p>
</div>
{elseif $variant == 17}
<section class="{$TpStyle.dom_prefix}-dm-desc v17">
<p>{$arrVideo.v_description|mb_substr=0,180}</p>
<p>{$strDetailMainDescription|mb_substr=0,180}</p>
</section>
{elseif $variant == 18}
<div class="{$TpStyle.dom_prefix}-dm-desc v18">
<p class="{$TpStyle.dom_prefix}-dm-desc-hidden">
{$arrVideo.v_description}
{$strDetailMainDescription}
</p>
</div>
{elseif $variant == 19}
<article class="{$TpStyle.dom_prefix}-dm-desc v19">
<header>剧情简介</header>
<p>{$arrVideo.v_description|mb_substr=0,160}</p>
<p>{$strDetailMainDescription|mb_substr=0,160}</p>
</article>
{/if}
{notempty name="$strDetailBody"}
<div class="{$TpStyle.dom_prefix}-dm-desc-body" style="margin-top:10px;padding:12px 12px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-soft-color);">
<p style="margin:0;color:var(--text-color);line-height:1.8;">{$strDetailBody}</p>
</div>
{/notempty}
{if empty($boolIsForgeDetail)}
{include file="module/seo_copy/detail" /}
{/if}
{if !empty($boolIsForgeDetail)}
<div class="{$TpStyle.dom_prefix}-dm-desc-guide" style="margin-top:10px;padding:12px 12px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-soft-color);">
<p style="margin:0;color:var(--text-color);line-height:1.8;">{$strForgeBodyLead|default='当前页围绕延伸词补充主片相关信息,适合先确认内容归属。'}</p>
<p style="margin:8px 0 0;color:var(--text-muted-color);line-height:1.7;">
{notempty name="$strMainVideoInfoUrl"}
{$strForgeReturnLead|default='如果想回到标准详情,可返回'} <a href="{$strMainVideoInfoUrl}">《{$strOriginVideoName}》详情页</a>
{/notempty}
{notempty name="$strPreferredPlayUrl"}
{$strForgePlayLead|default='如果准备继续观看,也可以直接进入'} <a href="{$strPreferredPlayUrl}">播放页</a>
{/notempty}
</p>
</div>
<div class="{$TpStyle.dom_prefix}-dm-forge-note" style="margin-top:10px;padding:12px 12px;border:1px solid var(--border-color);border-radius:14px;background:var(--bg-soft-color);">
<p style="margin:0;color:var(--text-color);line-height:1.8;">{$strForgeDetailNote|default='当前页提供的是延伸词视角,适合先确认内容归属,再决定是否回到标准详情或播放页。'}</p>
{notempty name="$strMainVideoInfoUrl"}
<p style="margin:8px 0 0;color:var(--text-muted-color);line-height:1.7;">如果你想继续查看主内容页,可以回到 <a href="{$strMainVideoInfoUrl}">《{$strOriginVideoName}》详情页</a></p>
{/notempty}
</div>
{/if}
{video:seoaddon video="$arrVideo" export_name="arrAddon" /}
{include file="module/detail/_seo_addon" /}

View File

@@ -0,0 +1,57 @@
{php}
$arrGuideLines = [];
foreach ([
$seoCopy['search_landing'] ?? '',
$seoCopy['category_intro'] ?? '',
$seoCopy['intro_text'] ?? '',
$seoCopy['intro_meta'] ?? '',
$seoCopy['faq_content'] ?? '',
] as $strGuideLine) {
$strGuideLine = trim((string)$strGuideLine);
if ($strGuideLine !== '' && !in_array($strGuideLine, $arrGuideLines, true)) {
$arrGuideLines[] = $strGuideLine;
}
}
$arrGuideCards = array_values(array_filter((array)($seoCopy['guide_cards'] ?? []), static function ($arrCard): bool {
return is_array($arrCard)
&& (
trim((string)($arrCard['title'] ?? '')) !== ''
|| trim((string)($arrCard['text'] ?? '')) !== ''
);
}));
{/php}
{if !empty($arrGuideLines) || !empty($arrGuideCards)}
<section class="{$TpStyle.dom_prefix}-guide {$TpStyle.dom_prefix}-guide-collection"
style="margin:28px 0 18px;padding:20px 22px;border:1px solid var(--border-color);border-radius:22px;background:linear-gradient(180deg,var(--bg-soft-color),rgba(255,255,255,.96));box-shadow:0 12px 28px rgba(0,0,0,.04);">
{notempty name="arrGuideLines"}
<div style="display:grid;gap:10px;margin-bottom:{notempty name='arrGuideCards'}16px{else/}0{/notempty};">
{foreach $arrGuideLines as $strGuideLine}
<p style="margin:0;line-height:1.9;color:var(--text-color);font-size:15px;">
{$strGuideLine}
</p>
{/foreach}
</div>
{/notempty}
{notempty name="arrGuideCards"}
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;">
{foreach $arrGuideCards as $arrGuideCard}
<article style="padding:14px 16px;border-radius:16px;background:rgba(255,255,255,.9);border:1px solid rgba(0,0,0,.06);">
{notempty name="$arrGuideCard.title"}
<h3 style="margin:0 0 8px;font-size:15px;line-height:1.4;color:var(--text-color);">
{$arrGuideCard.title}
</h3>
{/notempty}
{notempty name="$arrGuideCard.text"}
<p style="margin:0;line-height:1.8;color:var(--text-muted-color);font-size:13px;">
{$arrGuideCard.text}
</p>
{/notempty}
</article>
{/foreach}
</div>
{/notempty}
</section>
{/if}

View File

@@ -0,0 +1,55 @@
{php}
$arrGuideLines = [];
foreach ([
$seoCopy['detail_body_lead'] ?? '',
$seoCopy['detail_play_link_lead'] ?? '',
$seoCopy['detail_body_tail'] ?? '',
$seoCopy['detail_faq'] ?? '',
] as $strGuideLine) {
$strGuideLine = trim((string)$strGuideLine);
if ($strGuideLine !== '' && !in_array($strGuideLine, $arrGuideLines, true)) {
$arrGuideLines[] = $strGuideLine;
}
}
$arrGuideCards = array_values(array_filter((array)($seoCopy['guide_cards'] ?? []), static function ($arrCard): bool {
return is_array($arrCard)
&& (
trim((string)($arrCard['title'] ?? '')) !== ''
|| trim((string)($arrCard['text'] ?? '')) !== ''
);
}));
{/php}
{if !empty($arrGuideLines) || !empty($arrGuideCards)}
<section class="{$TpStyle.dom_prefix}-guide {$TpStyle.dom_prefix}-guide-detail"
style="margin-top:16px;padding:18px 20px;border:1px solid rgba(0,0,0,.08);border-radius:20px;background:rgba(255,255,255,.92);">
{notempty name="arrGuideLines"}
<div style="display:grid;gap:10px;margin-bottom:{notempty name='arrGuideCards'}16px{else/}0{/notempty};">
{foreach $arrGuideLines as $strGuideLine}
<p style="margin:0;line-height:1.9;color:var(--text-color);font-size:14px;">
{$strGuideLine}
</p>
{/foreach}
</div>
{/notempty}
{notempty name="arrGuideCards"}
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;">
{foreach $arrGuideCards as $arrGuideCard}
<article style="padding:12px 14px;border-radius:14px;background:var(--bg-soft-color);border:1px solid rgba(0,0,0,.05);">
{notempty name="$arrGuideCard.title"}
<h3 style="margin:0 0 8px;font-size:14px;line-height:1.4;color:var(--text-color);">
{$arrGuideCard.title}
</h3>
{/notempty}
{notempty name="$arrGuideCard.text"}
<p style="margin:0;line-height:1.8;color:var(--text-muted-color);font-size:13px;">
{$arrGuideCard.text}
</p>
{/notempty}
</article>
{/foreach}
</div>
{/notempty}
</section>
{/if}

View File

@@ -0,0 +1,55 @@
{php}
$arrGuideLines = [];
foreach ([
$seoCopy['play_intro'] ?? '',
$seoCopy['play_meta_note'] ?? '',
$seoCopy['play_body_lead'] ?? '',
$seoCopy['play_body_next'] ?? '',
] as $strGuideLine) {
$strGuideLine = trim((string)$strGuideLine);
if ($strGuideLine !== '' && !in_array($strGuideLine, $arrGuideLines, true)) {
$arrGuideLines[] = $strGuideLine;
}
}
$arrGuideCards = array_values(array_filter((array)($seoCopy['guide_cards'] ?? []), static function ($arrCard): bool {
return is_array($arrCard)
&& (
trim((string)($arrCard['title'] ?? '')) !== ''
|| trim((string)($arrCard['text'] ?? '')) !== ''
);
}));
{/php}
{if !empty($arrGuideLines) || !empty($arrGuideCards)}
<section class="{$TpStyle.dom_prefix}-guide {$TpStyle.dom_prefix}-guide-play"
style="margin:20px 0 6px;padding:18px 20px;border:1px solid rgba(0,0,0,.08);border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.98),var(--bg-soft-color));">
{notempty name="arrGuideLines"}
<div style="display:grid;gap:10px;margin-bottom:{notempty name='arrGuideCards'}16px{else/}0{/notempty};">
{foreach $arrGuideLines as $strGuideLine}
<p style="margin:0;line-height:1.9;color:var(--text-color);font-size:14px;">
{$strGuideLine}
</p>
{/foreach}
</div>
{/notempty}
{notempty name="arrGuideCards"}
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;">
{foreach $arrGuideCards as $arrGuideCard}
<article style="padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.92);border:1px solid rgba(0,0,0,.05);">
{notempty name="$arrGuideCard.title"}
<h3 style="margin:0 0 8px;font-size:14px;line-height:1.4;color:var(--text-color);">
{$arrGuideCard.title}
</h3>
{/notempty}
{notempty name="$arrGuideCard.text"}
<p style="margin:0;line-height:1.8;color:var(--text-muted-color);font-size:13px;">
{$arrGuideCard.text}
</p>
{/notempty}
</article>
{/foreach}
</div>
{/notempty}
</section>
{/if}

View File

@@ -2,9 +2,9 @@
{block name="get-data"}
{if $Request.route.intVId && $Request.route.intVForgeId}
{video:info v_id="$Request.route.intVId" v_key="arrVideo" v_fid="$Request.route.intVForgeId" export_name="arrVideo"/}
{elseif $Request.route.intVId}
{video:info v_id="$Request.route.intVId" v_key="arrVideo" export_name="arrVideo"/}
{video:info v_id="$Request.route.intVId" v_pinyin="$Request.route.strPinyin" v_key="arrVideo" v_fid="$Request.route.intVForgeId" export_name="arrVideo"/}
{elseif $Request.route.intVId || $Request.route.strPinyin}
{video:info v_id="$Request.route.intVId" v_pinyin="$Request.route.strPinyin" v_key="arrVideo" export_name="arrVideo"/}
{else}
{video:info v_id="$DomainModel->info_id" n_key="arrVideo" export_name="arrVideo" /}
{/if}
@@ -15,12 +15,83 @@
area="all" lang="all" year="all" order="all" page="1"
export_name="strVclurl" /}
{video:seocopy scene="play"
video="$arrVideo"
play_type="$Request.route.strPlayType"
play_index="$Request.route.intPlayIndex"
export_name="seoCopy" /}
{php}
$arrBreadcrumb = [
['title'=>'首页','url'=>'/'],
['title'=>$arrVideo['v_parent_category'],'url'=>$strVciurl],
['title'=>$arrVideo['v_category'],'url'=>$strVclurl],
];
$strPlaySlug = trim((string)($arrVideo['v_name_en'] ?? request()->route('strPinyin') ?? ''));
if ($strPlaySlug === '') {
$strPlaySlug = (string)($arrVideo['v_id'] ?? '');
}
$strCurrentPlayType = trim((string)(request()->route('strPlayType') ?? ''));
$intCurrentPlayIndex = max(1, (int)(request()->route('intPlayIndex') ?? 1));
$arrPlayGroups = is_array($arrVideo['v_play_url'] ?? null) ? $arrVideo['v_play_url'] : [];
if ($strCurrentPlayType === '' && !empty($arrPlayGroups)) {
$strCurrentPlayType = (string)array_key_first($arrPlayGroups);
}
$strCurrentPlayLine = trim((string)app(\app\services\VideoService::class)->getConverterPlayLineVal($strCurrentPlayType));
if ($strCurrentPlayLine === '') {
$strCurrentPlayLine = strtoupper($strCurrentPlayType !== '' ? $strCurrentPlayType : 'default');
}
$strCurrentEpisodeName = '第' . $intCurrentPlayIndex . '集';
if (!empty($arrPlayGroups[$strCurrentPlayType][$intCurrentPlayIndex - 1]['name'])) {
$strCurrentEpisodeName = trim((string)$arrPlayGroups[$strCurrentPlayType][$intCurrentPlayIndex - 1]['name']);
}
$strPlayDetailUrl = '';
if ((int)($arrVideo['v_id'] ?? 0) > 0) {
$strPlayDetailUrl = app(\app\services\VideoService::class)->getVideoInfoUrl(
(int)$arrVideo['v_id'],
$strPlaySlug
);
}
$strPlayVisibleIntro = trim((string)($seoCopy['play_intro'] ?? ''));
if ($strPlayVisibleIntro === '') {
$strPlayVisibleIntro = '当前页围绕《' . (string)($arrVideo['v_name'] ?? '当前内容') . '》' . $strCurrentEpisodeName . '整理在线播放入口,并补充剧情与观看线索,方便直接续看。';
}
$strPlayMetaNote = trim((string)($seoCopy['play_meta_note'] ?? ''));
if ($strPlayMetaNote === '') {
$strPlayMetaNote = '当前线路为' . $strCurrentPlayLine . ',如果加载较慢可以切换线路,或先回详情页补看剧情资料。';
}
$strPlayBodyGuideLead = trim((string)($seoCopy['play_body_lead'] ?? ''));
if ($strPlayBodyGuideLead === '') {
$strPlayBodyGuideLead = '播放页更适合先确认当前线路、集数和回详情路径,再决定是否继续完整观看。';
}
$strPlayBodyGuideNext = trim((string)($seoCopy['play_body_next'] ?? ''));
if ($strPlayBodyGuideNext === '') {
$strPlayBodyGuideNext = '如果想先了解完整剧情和人物资料,可以回到详情页继续浏览。';
}
$arrPlayGuideCards = 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($arrPlayGuideCards)) {
$arrPlayGuideCards = [
['title' => '当前剧集', 'text' => $strCurrentEpisodeName],
['title' => '当前线路', 'text' => $strCurrentPlayLine],
['title' => '观看建议', 'text' => '如果当前线路不够稳定,可先切换线路,或返回详情页继续浏览剧情资料。'],
];
}
{/php}
{/block}
@@ -181,6 +252,8 @@
{include file="module/page/page_router" /}
{include file="module/seo_copy/play" /}
<script>
const strMaxPlayHeight = '480px'
const strVideoId = `{$arrVideo.v_id}`;