This commit is contained in:
make
2025-05-02 12:04:24 +08:00
parent 7ec3ef4f38
commit 85f2ef5cb2
5 changed files with 389 additions and 24 deletions

View File

@@ -76,27 +76,6 @@ Route::get('/searchhome/0', function (\think\Request $Request, SiteContext $Site
})->ext('html'); })->ext('html');
/**
* 视频分类首页
*/
// Route::get('/vodtype/dianying', function (\think\Request $Request, SiteContext $SiteContext) {
// return view('video/getCategoryType.html');
// });
// Route::get('/vodtype/dianshiju', function (\think\Request $Request, SiteContext $SiteContext) {
// return view('video/getCategoryType.html');
// });
// Route::get('/vodtype/zonyi', function (\think\Request $Request, SiteContext $SiteContext) {
// return view('video/getCategoryType.html');
// });
// Route::get('/vodtype/donman', function (\think\Request $Request, SiteContext $SiteContext) {
// return view('video/getCategoryType.html');
// });
// Route::get('/vodtype/duanju', function (\think\Request $Request, SiteContext $SiteContext) {
// return view('video/getCategoryType.html');
// });
/** /**
* 路由配置文件 * 路由配置文件
*/ */
@@ -112,7 +91,7 @@ $arrRoutes = [
// 视频站点url -- start // 视频站点url -- start
// 视频分类 首页 // 视频分类 首页
'video_category' => [ 'video_category_index' => [
'/vodtype/:strCategory', '/vodtype/:strCategory',
'/vodclass/:strCategory', '/vodclass/:strCategory',
'/shipin-fenlei/:strCategory', '/shipin-fenlei/:strCategory',
@@ -123,6 +102,19 @@ $arrRoutes = [
'/video-leixing/:strCategory', '/video-leixing/:strCategory',
], ],
// 视频分类 分页 /vodshow/dianying/dong-zuo-pian/中国大陆/国语/1992/news/page1
// /vodshow/电影/动作片/中国大陆/国语/1992/最新/第一页
// /vodshow/dianying/dong-zuo-pian/zhongguodalu/guoyu/1992/news/page1
'video_category' => [
'/vodshow/:strClass/:strCategory/:strArea/:strLang/:strYear/:strSort/page:intPage',
'/:strCategory/vodshow-:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
'/vodshow-:strCategory/:strClass-:strArea-:strLang-:strYear-:strSort-page:intPage',
// '/vodshow/:strClass-:strCategory-:strArea-:strLang-:strYear-:strSort-page:intPage',
// /dong-zuo-pian/vodshow-dianying-zhongguodalu-guoyu-1992-news-page1
// /vodshow-dong-zuo-pian/dianying-zhongguodalu-guoyu-1992-news-page1
// /vodshow/dianying-dong-zuo-pian-zhongguodalu-guoyu-1992-news-page1
],
// 视频站点url -- end // 视频站点url -- end
@@ -332,12 +324,12 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
switch ($key) { switch ($key) {
// 视频站点url -- start // 视频站点url -- start
case 'video_category': case 'video_category_index':
$strView = 'pc/getCategoryType.html'; $strView = 'pc/getCategoryType.html';
if ($platform == 'h5') { if ($platform == 'h5') {
$strView = 'video/getCategoryType.html'; $strView = 'video/getCategoryType.html';
} }
//书库/分类 //视频分类 首页
Route::get($strRoute, function () use ($strView) { Route::get($strRoute, function () use ($strView) {
return view($strView); return view($strView);
}) })
@@ -345,6 +337,30 @@ foreach ($arrRoutes['prefixes'] as $platform => $prefixes) {
'strCategory' => '[a-z\-]*', // 允许空值 'strCategory' => '[a-z\-]*', // 允许空值
]); ]);
break; break;
case 'video_category':
$strView = 'pc/getCategory.html';
if ($platform == 'h5') {
$strView = 'video/getCategory.html';
}
//视频分类 分页
Route::get($strRoute, function () use ($strView) {
return view($strView);
})
->pattern([
'strClass' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strArea' => '[a-z\-]*', // 允许空值
'strLang' => '[a-z\-]*', // 允许空值
'strYear' => '[a-zA-Z0-9\-]*', // 允许空值
'strSort' => '[a-z\-]*', // 允许空值
'intPage' => '\d*', // 允许空值
// '/vodshow/:strClass/:strCategory/:strArea/:strLang/:strYear/:strSort/page:intPage'
// /vodshow/dianying/dong-zuo-pian/zhongguodalu/guoyu/1992/news/page1
// /dong-zuo-pian/vodshow-dianying-zhongguodalu-guoyu-1992-news-page1
]);
break;
// 视频站点url -- end // 视频站点url -- end
case 'latest': case 'latest':

View File

@@ -0,0 +1,213 @@
{extend name="base" /}
{block name="get-data"}
{video:pagerexp page="1" limit="30"
d_key="d_key"
d_val="Video"
p_val="page_data" button_num="10" cache_life="86400" func="generateSearchPager" export_name="resData" /}
{/block}
{block name="head-css"}
{/block}
{block name="head-js"}
{/block}
{block name="main"}
<div class="container">
<div class="row">
<div class="col-lg-wide-75 col-xs-1 padding-0">
<div class="stui-pannel stui-pannel-bg clearfix">
<div class="stui-pannel-box">
<div class="stui-pannel_hd">
<div class="stui-pannel__head active bottom-line clearfix">
<h3 class="title"><img
src="/template/videodadi/icon/icon_27.png">{$Request.route.strCategory}筛选</h3>
</div>
<ul class="stui-screen__list type-slide bottom-line-dot clearfix">
<li><span class="text-muted">按类型</span></li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
href="">全部</a>
</li>
{video:categorytype category_type="ONE" d_key="key" d_val="val"}
{if $val.v_category_en == $Request.route.strCategory}
{foreach $val.children as $intChildrenKey=>$arrChildrenCategory }
<li
class="{if $Request.route.strCategory == $arrChildrenCategory.v_category_en}active{/if}">
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)})" href=""
class="text-muted">{$arrChildrenCategory.v_category}</a>
</li>
{/foreach}
{/if}
{/video:categorytype}
</ul>
<ul class="stui-screen__list type-slide bottom-line-dot clearfix">
<li><span class="text-muted">按剧情</span></li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
href="">全部
</a>
</li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)})" href=""
class="text-muted">{剧情}</a>
</li>
</ul>
<ul class="stui-screen__list type-slide bottom-line-dot clearfix">
<li><span class="text-muted">按地区</span></li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
href="">全部</a>
</li>
{video:area d_key="key" d_val="val"}
<li class='{$Request.route.strCategory == $val}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)})" href=""
class="text-muted">{$val}</a>
</li>
{/video:area}
</ul>
<ul class="stui-screen__list type-slide bottom-line-dot clearfix">
<li><span class="text-muted">按年份</span></li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
href="">全部</a>
</li>
{video:year d_key="key" d_val="val"}
<li class='{$Request.route.strCategory == $val}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)})" href=""
class="text-muted">{$val}</a>
</li>
{/video:year}
</ul>
<ul class="stui-screen__list type-slide bottom-line-dot clearfix">
<li><span class="text-muted">按语言</span></li>
<li
class='{if empty( $Request.route.strCategory) || $Request.route.strCategory == ""}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
href="">全部</a>
</li>
{video:lang d_key="key" d_val="val"}
<li class='{$Request.route.strCategory == $val}active{/if}'>
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)})" href=""
class="text-muted">{$val}</a>
</li>
{/video:lang}
</ul>
</div>
</div>
</div>
<div class="stui-pannel stui-pannel-bg clearfix">
<div class="stui-pannel-box">
<div class="stui-pannel_hd">
<div class="stui-pannel__head active bottom-line clearfix">
<ul class="nav nav-head">
{video:sort d_key="key" d_val="val"}
<li class="{if $Request.route.strSort == $key}active{/if}">
<a style="color: rgb(172, 73, 70);" href="">{$val}</a>
</li>
{/video:sort}
</ul>
</div>
</div>
<div class="stui-pannel_bd">
<ul class="stui-vodlist clearfix">
{foreach $resData.data as $key=>$Video}
{include file="public/video-list-shu" /}
{/foreach}
</ul>
</div>
</div>
</div>
<!-- 分页 -->
<ul class="stui-page text-center clearfix">
{volist name="resData.p_data.pager" id="vo" key="k"}
{switch $vo.label}
{case value="上一页"}
{if $resData.p_data.page == 1}
<li class="disabled"><span>上一页</span></li>
{else}
<li><a style="color:rgb(121, 187, 165);" href="{$vo.url}">1</a></li>
{/if}
{/case}
{case value="下一页"}
{if $resData.p_data.page >= $resData.p_data.total}
<li class="disabled"><span>下一页</span></li>
{else}
<li><a style="color:rgb(10, 123, 124);" href="{$vo.url}">下一页</a></li>
{/if}
{/case}
{default /}
{if preg_match('/^\d+$/', $vo.label)}
<li><a style="color:rgb(10, 123, 124);" href="{$vo.url}">{$vo.label}</a></li>
{/if}
{/switch}
{/volist}
</ul>
</div>
<div class="col-lg-wide-25 col-xs-1 stui-pannel-side hidden-sm hidden-xs padding-0">
<div class="stui-pannel stui-pannel-bg clearfix">
<div class="stui-pannel-box">
<div class="stui-pannel_hd">
<div class="stui-pannel__head active bottom-line clearfix">
<h3 class="title"><img src="/template/videodadi/icon/icon_12.png">电影周榜单</h3>
</div>
</div>
<div class="stui-pannel_bd">
<ul class="stui-vodlist__text col-pd clearfix">
{video:ranklist count="10" sort_type="weekly" d_key="key" d_val="Video" cache_life="86400"}
{include file="public/video-list-phb" /}
{/video:ranklist}
</ul>
</div>
</div>
</div>
<div class="stui-pannel stui-pannel-bg clearfix">
<div class="stui-pannel-box">
<div class="stui-pannel_hd">
<div class="stui-pannel__head active bottom-line clearfix">
<h3 class="title"><img src="/template/videodadi/icon/icon_12.png">电影月榜单</h3>
</div>
</div>
<div class="stui-pannel_bd">
<ul class="stui-vodlist__text col-pd clearfix">
{video:ranklist count="10" sort_type="monthly" d_key="key" d_val="Video" cache_life="86400"}
{include file="public/video-list-phb" /}
{/video:ranklist}
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
{/block}
{block name="customize"}
{/block}

View File

@@ -59,6 +59,33 @@ class StaticConfig
'total' => '总', 'total' => '总',
]; ];
static $arrVideoLang = [
'hanyuputonghua' => '汉语普通话',
'yueyu' => '粤语',
'yingyu' => '英语',
'guoyu' => '国语',
];
static $arrVideoArea = [
'zhongguodalu' => '中国大陆',
'zhongguotaiwang' => '中国台湾',
'zhongguoxianggan' => '中国香港',
'meiguo' => '美国',
'yingguo' => '英国',
'faguo' => '法国',
'yindu' => '印度',
'riben' => '日本',
'taiguo' => '泰国',
];
static $arrVideoYear = [
];
// 'v_lang', # 视频的语言(如“中文”、“英语”)
// 'v_area', # 视频的地区(如“中国”、“美国”)
// 'v_year', # 视频的发行年份(如 2023
/** /**
* getNovelCategoryFilter * getNovelCategoryFilter
* *

View File

@@ -14,6 +14,10 @@ class Video extends TagLib
'sort' => ['attr' => 'd_key,d_val'], 'sort' => ['attr' => 'd_key,d_val'],
'ranksort' => ['attr' => 'd_key,d_val'], 'ranksort' => ['attr' => 'd_key,d_val'],
'status' => ['attr' => 'd_key,d_val'], 'status' => ['attr' => 'd_key,d_val'],
'lang' => ['attr' => 'd_key,d_val'],
'area' => ['attr' => 'd_key,d_val'],
'year' => ['attr' => 'd_key,d_val'],
'category' => ['attr' => 'd_key,d_val,v_sex'], 'category' => ['attr' => 'd_key,d_val,v_sex'],
'categorytype' => ['attr' => 'category_type,d_key,d_val,v_sex'], 'categorytype' => ['attr' => 'category_type,d_key,d_val,v_sex'],
@@ -285,6 +289,81 @@ EOT;
return $strParse; return $strParse;
} }
public function tagLang($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoLang = app(\\app\\services\\StaticConfig::class)::\$arrVideoLang;
if (!empty(\$arrVideoLang) && is_array(\$arrVideoLang)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoLang as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
public function tagArea($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoArea = app(\\app\\services\\StaticConfig::class)::\$arrVideoArea;
if (!empty(\$arrVideoArea) && is_array(\$arrVideoArea)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoArea as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
public function tagYear($tag, $content)
{
$d_key = $tag['d_key'] ?? 'd_key';
$d_val = $tag['d_val'] ?? 'd_val';
$strParse = <<<EOT
<?php
\$arrVideoYear = app(\\app\\services\\StaticConfig::class)::\$arrVideoYear;
if (!empty(\$arrVideoYear) && is_array(\$arrVideoYear)):
?>
EOT;
$strParse .= <<<EOT
<?php foreach (\$arrVideoYear as \${$d_key} => \${$d_val}): ?>
EOT;
$strParse .= $content;
$strParse .= <<<EOT
<?php endforeach; ?>
<?php endif; ?>
EOT;
return $strParse;
}
/** /**
* 获取排序筛选参数 * 获取排序筛选参数
* *

View File

@@ -433,6 +433,10 @@ resData = [
$limit ?? '10'; # 查询条数 $limit ?? '10'; # 查询条数
$v_category ?? "all"; # 查询分类 $v_category ?? "all"; # 查询分类
$sort_type ?? "all"; # 排序方式 $sort_type ?? "all"; # 排序方式
# 'all' => '全部排序',
# 'news' => '最新入库',
# 'tuijian' => '推荐',
# 'update' => '最新更新',
$v_status ?? "all"; # 查询状态: $v_status ?? "all"; # 查询状态:
# * * 'all' => '所有', # * * 'all' => '所有',
# * * 'lianzai' => '连载中', # * * 'lianzai' => '连载中',
@@ -591,8 +595,34 @@ resData = [
{/video:ranklist} {/video:ranklist}
# 27、获取视频语言筛选条件
# 传参与默认值(传参用下面的变量名,名称不需要$符号, 值的话如果用第三方变量作为值,需要带$符号)
$d_key ?? 'd_key'; # 查询出来的数据遍历的时候, 下标键变量的名称
$d_val ?? 'd_val'; # 查询出来的数据遍历的时候, 值的名称
# 样例
{video:lang d_key="key" d_val="val"}
<li> : {$key} - : {$val} </li>
{/video:lang}
# 28、获取视频地区筛选条件
# 传参与默认值(传参用下面的变量名,名称不需要$符号, 值的话如果用第三方变量作为值,需要带$符号)
$d_key ?? 'd_key'; # 查询出来的数据遍历的时候, 下标键变量的名称
$d_val ?? 'd_val'; # 查询出来的数据遍历的时候, 值的名称
# 样例
{video:area d_key="key" d_val="val"}
<li> : {$key} - : {$val} </li>
{/video:area}
# 29、获取视频年份筛选条件
# 传参与默认值(传参用下面的变量名,名称不需要$符号, 值的话如果用第三方变量作为值,需要带$符号)
$d_key ?? 'd_key'; # 查询出来的数据遍历的时候, 下标键变量的名称
$d_val ?? 'd_val'; # 查询出来的数据遍历的时候, 值的名称
# 样例
{video:year d_key="key" d_val="val"}
<li> : {$key} - : {$val} </li>
{/video:year}