Files
orico-official-website-old/app/index/view/video/catelists-old.phtml
2024-10-29 14:04:59 +08:00

160 lines
8.3 KiB
PHTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Index">
<div id="header" class="theme-white">
{include file="include/top-header2023" /}
</div>
</header>
<!--top End-->
<?php if ($category['picture']): ?>
<!-- 轮播 s -->
<div class="homeban">
<div class="bd">
<ul>
<li><a href="<?php echo url_rewrite('video', ['id' => $category['id']]); ?>"><img src="<?php echo getImage($category['picture']); ?>"/></a></li>
</ul>
</div>
</div>
<!-- 轮播 e -->
<?php endif; ?>
<!-- 视频列表 s -->
<div class="vmain">
<div class="swt-Container">
<?php if ($videoCategory): ?>
<div class="History2">
<div class="hd">
<ul>
<?php foreach ($videoCategory as $k => $vc): ?>
<li<?php if ($category['id'] == $vc['id']): ?> class="on"<?php endif; ?>><?php echo $vc['name']; ?></li>
<?php endforeach; ?>
</ul>
<a class="prev"><img src="__PUBLIC__/web/images/bfl.png"></a>
<a class="next"><img src="__PUBLIC__/web/images/brh.png"></a>
</div>
<div class="bd">
<?php foreach ($videoCategory as $k => $vc): ?>
<ul data-cid="<?php echo $vc['id']; ?>">
<div class="vtext">
<p class="tl1"><?php echo $vc['name']; ?></p>
</div>
<?php
?>
<dl class="hotul" id="dl<?php echo $vc['id']; ?>">
<?php
if ($vc['id'] == $category['id'] && !empty($list)):
foreach ($list as $video):
?>
<dd>
<div class="hot1">
<video preload="none" controls="controls" poster="<?php echo getImage($video['picture']); ?>">
<source src="<?php echo $video['videopath'];?>" type="video/mp4">
</video>
</div>
<div class="htit1"><?php echo $video['name']; ?></div>
<div class="htit2"><?php echo msubstr($video['description'], 0, 160, 'utf-8'); ?></div>
</dd>
<?php endforeach; ?>
<div class="clear"></div>
<?php endif; ?>
</dl>
<div id="page<?php echo $vc['id']; ?>">
<!-- 分页 s -->
<?php
if ($vc['id'] == $category['id'] && !empty($list) && $page) {
echo $page;
}
?>
<!-- 分页 e -->
</div>
</ul>
<?php endforeach; ?>
</div>
<!-- Add Arrows -->
<script>
jQuery(".History2 .hd").slide({mainCell: "ul", autoPlay: false, effect: "left", vis: 8, scroll: 1, autoPage: false, prevCell: ".prev", nextCell: ".next"});
$(".History2").slide({trigger: "click", defaultIndex: 0, startFun: startFun, });
var thiscid = "<?php echo $category['id']; ?>";
$(function() {
$("#page" + thiscid + " a[href^='/video']").click(aPageClick);
});
function startFun(i, c, slider) {
var $current = $(".bd ul", slider).eq(i);
if ($current.length) {
var cid = $current.data('cid'), url = '/video/category/' + cid + '.html';
if ($("#dl" + cid + " dd", $current).length == 0) {
getPageContent(url);
}
}
console.log(i);
}
function aPageClick(event) {
event.preventDefault()
var url = this.href;
if (url) {
getPageContent(url);
}
}
function getPageContent(url) {
$.ajax({
url: url,
async: false,
dataType: "json",
success: function(data) {
if (data.code && data.data.list) {
var html = '', list = data.data.list, len = list.length, i, cid = data.data.category.id;
for (i = 0; i < len; i++) {
html += '<dd>';
// html += '<a href="/uk/video/detail/' + list[i].id + '.html">';
//html += '<div class="hot1"><div class="himg"><img src="' + list[i].picture + '"></div></div>';
html += '<video preload="none" controls="controls" poster="' + list[i].picture + '"><source src="' + list[i].videopath+ '" type="video/mp4"></video>';
html += '<div class="htit1">' + list[i].name.substring(0, 24) + '</div>';
html += '<div class="htit2">' + list[i].description.substring(0, 160) + '</div>';
html += '</dd>';
}
html += '<div class="clear"></div>';
$("#dl" + cid).html(html);
$("#page" + cid).html(data.data.page);
$("#page" + cid + " a[href^='/uk/video']").click(aPageClick);
$("html, body").animate({scrollTop: $("#dl" + cid).offset().top}, 1000);
}
},
error: function() {
//alert("请求超时,请重试!");
}
});
}
</script>
</div>
<?php endif; ?>
</div>
</div>
<!-- 视频列表 e -->
<!-- bottom s -->
{include file="include/bottom2023" /}
<!-- bottom e -->
</body>
</html>