Files

114 lines
4.0 KiB
HTML

<main class="{$TpStyle.dom_prefix}-d2-page">
{php}
$strDetailPlaySlug = trim((string)($arrVideo['v_name_en'] ?? ''));
if ($strDetailPlaySlug === '') {
$strDetailPlaySlug = (string)($arrVideo['v_id'] ?? '');
}
{/php}
{// 顶部大横图 }
<section class="{$TpStyle.dom_prefix}-d2-hero">
<img loading="lazy"
src="{site:cfg code='PUBLIC_COVER_DOMAIN' encode='false'/}{$arrVideo.v_pic}"
alt="{$arrVideo.v_name}"
class="{$TpStyle.dom_prefix}-d2-heroimg">
<div class="{$TpStyle.dom_prefix}-d2-heromask"></div>
<div class="{$TpStyle.dom_prefix}-d2-heroinfo">
<h1>{$arrVideo.v_name}</h1>
<p>{$arrVideo.v_year} · {$arrVideo.type.type_name} · {$arrVideo.v_area}</p>
</div>
</section>
{// 基本信息 }
<section class="{$TpStyle.dom_prefix}-d2-info">
<p><b>主演:</b>{$arrVideo.v_actor}</p>
<p><b>导演:</b>{$arrVideo.v_director}</p>
<p><b>语言:</b>{$arrVideo.v_lang}</p>
</section>
{// 播放线路 TAB }
<nav class="{$TpStyle.dom_prefix}-d2-tabs">
<?php $keyLineGroup = 0; ?>
{foreach $arrVideo.v_play_url as $strPlayGroupName=>$arrPlayUrlType }
<?php $keyLineGroup++ ;?>
<button type="button"
class="{$TpStyle.dom_prefix}-d2-tabbtn {eq name='$keyLineGroup' value='1'}active{/eq}"
onclick="d2SwitchLine('{$strPlayGroupName}', this)">
{$strPlayGroupName}
</button>
{/foreach}
</nav>
{// 每个线路的集数列表(竖排) }
<section class="{$TpStyle.dom_prefix}-d2-lines">
<?php $keyLineGroup = 0; ?>
{foreach $arrVideo.v_play_url as $strPlayGroupName=>$arrPlayUrlType }
<?php $keyLineGroup++ ;?>
<ul class="{$TpStyle.dom_prefix}-d2-epis {eq name='$keyLineGroup' value='1'}active{/eq}"
id="d2_line_{$strPlayGroupName}">
<?php $keyLine = 0; ?>
{volist name='$arrPlayUrlType' id='arrPlayUrl'}
<?php $keyLine++ ;?>
{php}
$strEpisodePlayUrl = app(\app\services\VideoService::class)->getVideoPlayUrl(
(int)($arrVideo['v_id'] ?? 0),
$strDetailPlaySlug,
(string)$strPlayGroupName,
(int)$keyLine
);
{/php}
<li>
<a href="{$strEpisodePlayUrl}"
class="{if $keyLine == $Request.route.intPlayIndex}active{/if}"
m3u8="{$arrPlayUrl.url}">
{$arrPlayUrl.name}
</a>
</li>
{/volist}
</ul>
{/foreach}
</section>
{// 剧情简介 }
<section class="{$TpStyle.dom_prefix}-d2-desc">
<h2>剧情简介</h2>
<p>{$arrVideo.v_des}</p>
</section>
{// 相关推荐:同分类 }
<section class="{$TpStyle.dom_prefix}-d2-rel">
<h3>同类推荐</h3>
{video:listexp count="8" v_category="$arrVideo.v_category" d_key="key" d_val="Video"
export_name="arrRelCat" cache_life="3600" /}
<div class="{$TpStyle.dom_prefix}-d2-relgrid">
{volist name="arrRelCat" id="re"}
<a href="/detail/{$re.v_id}.html" class="{$TpStyle.dom_prefix}-d2-relcard">
<img loading="lazy"
src="{site:cfg code='PUBLIC_COVER_DOMAIN' encode='false'/}{$re.v_pic}"
alt="{$re.v_name}">
<p>{$re.v_name}</p>
</a>
{/volist}
</div>
</section>
</main>
<script>
function d2SwitchLine(name, btn) {
document.querySelectorAll('.{$TpStyle.dom_prefix}-d2-epis')
.forEach(function(el){ el.classList.remove('active'); });
var box = document.getElementById('d2_line_'+name);
if (box) box.classList.add('active');
document.querySelectorAll('.{$TpStyle.dom_prefix}-d2-tabbtn')
.forEach(function(el){ el.classList.remove('active'); });
btn.classList.add('active');
}
</script>