<?php 
error_reporting(0); 
include("../../../config/os.php");
$id=base64_decode($_GET[id]);
$type="where id='$id'";
$daili=queryall(daili,$type);
if(!$daili){echo err();exit;}
$type="where userid='$daili[userid]'";
$user=queryall(user,$type);
if($user[pb]==1 or $user==null){
$str ="<script>location.href='http://www.baidu.com'</script>";
echo $str;
exit;
}
$lurl='/tzzonglink-'.$_GET[id].'-'.$user[mb].$dshz;
$fhurl=base64_encode($lurl);
$pdurl='http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
if (strpos($pdurl, '?id=') !== false) {
$p = explode('?id=',$pdurl); 
$pdid=$p[1];
}else{
$pdid='0';
}
$type="where lx='2' and  userid='$daili[userid]'  order by rand() limit 1";
$skurl=queryall(daili,$type);
?>
<!DOCTYPE html>
<html>
<head>
<title>-</title>
<meta charset="gb2312">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="stylesheet" href="/mb/3/layout.css" />
<link rel="stylesheet" href="/mb/3/master.css" />
<script src="/2019newui/js/jquery.min.js"></script>
<script src="/layui/layui.js" charset="utf-8"></script> 
<script type="text/javascript" src="/mb/3/flexible.js" ></script>
<script type="text/javascript" src="/mb/3/axios.min.js" ></script>
</head>
<body>
<div class="page unselect">
<div class="page-head page-head--gray">
<div class="page-head__left"></div>
<div class="page-head__center page-head__center--green">热门视频</div>
<div class="page-head__right"></div>
</div>
<div class="page-body">
<?php if($skurl){?>
<video class="video-player" state="show" controls="controls" autoplay="autoplay" x-webkit-airplay="true" x5-video-player-fullscreen="true" preload="auto" playsinline="true" webkit-playsinline x5-video-player-typ="h5">
<source type="application/x-mpegURL" src="<?php echo $skurl[url]?>">
</video>
<div class="video-describe" state="show"><?php echo $skurl[name]?></div>
<?php }?>
<div class="video-list"  id="html_box"></div>
</div>
</div>
<script>
layui.use(['form', 'layedit', 'laydate', 'element', 'jquery', 'upload', 'layer'], function(){
  var form = layui.form
  ,layer   = layui.layer
  ,layedit = layui.layedit
  ,element = layui.element
  ,upload  = layui.upload
  ,$       = layui.jquery
  ,laydate = layui.laydate;
$(function () {
wait = true;
getData();
});
var flid ='<?php echo $pdid?>';
var page = 1;
var pagesize = 10;
var wait = false;
var isFree = -1;
$(document).on('scroll', function () {
if (wait) return;
var wScrollY = window.scrollY; // 当前滚动条位置
var wInnerH = window.innerHeight; // 设备窗口的高度（不会变）
var bScrollH = document.body.scrollHeight; // 滚动条总高度
if (wScrollY + wInnerH >= bScrollH) {
wait = true;
getData();
}
});
function getData() {
<?php if($pdid==0){?>
flid = '0';
<?php }else{?>
flid = '<?php echo $pdid?>';
<?php }?>
if (page == 1) {
}else{
var index = layer.load(2, {
content: '',
success: function (layero) {
layero.find('.layui-layer-content').css({
'paddingTop': '40px',
 'width': '60px',
'textAlign': 'center',
'backgroundPositionX': 'center'
});
}
});
}
$.ajax({
type : "post",
url : "/sjpost/",
dataType: "json",  
async: true,
data: {flid: flid,page: page,userid: '<?php echo $daili[userid]?>'},
timeout: 10000 ,
success : function(d){
if(d.zt=='true'){  
layer.closeAll('loading');
if (d.data.length > 0) {
appendData(d.data);
page++;
wait = false;
}else{
layer.msg('<i class="layui-icon layui-icon-face-cry"></i><br>没有更多了');
}
} 
},
error:function(){
}
});
}
function appendData(data) {
if (page == 1) {
if (data.length == 0) {
$('#html_box').html('<li style="text-align:center;" class="mui-table-view-cell mui-media">抱歉，没有您找的数据，换个条件试试</li>');
return;
}
$('#html_box').html("");
}
for (var i in data) {
var str = '<a class="video-list-item" href="'+data[i].url+'" target="_self">'+'<div class="video-list-item__image"><img src="'+data[i].pic+'" width="100%"></div>' +'<div class="video-list-item__label">'+data[i].name+'</div></a>';
var li = $(str);
$("#html_box").append(li);
}
}
var last1 = $(".type-panel .book-right:eq(0) .my-btn:eq(0)")[0];
$(".type-panel .book-right:eq(0) .my-btn").click(function () {
$(".type-panel .book-right:eq(0) a").removeClass("active");
$(this).addClass("active");
last1.classList.remove('type-alive');
last1 = this;
last1.classList.add('type-alive');
flid = last1.getAttribute('data-flid');
page = 1;
getData();
});
});
</script>
<script type="text/javascript">
function run () {
var index = Math.floor(Math.random()*100);
pmd(index);
};
var times = document.getElementsByClassName('fuckyou').length;
setInterval('run()',times*2000);
function pmd (id) {
var colors = new Array('#FF5151','#ffaad5','#ffa6ff','#d3a4ff','#2828FF','#00FFFF','#1AFD9C','#FF8000','#81C0C0','#B766AD');
var color = colors[id];
var tmp = document.getElementsByClassName('fuckyou');
for (var i = 0; i < tmp.length; i++) {
var id = tmp[i];
var moren = id.style.color;
setTimeout(function(id){
id.style.color = color;
},i*200,id);
setTimeout(function(id,moren){
id.style.color = moren;
},i*200+180,id,moren);
};
}
</script>
<script>
function onBridgeReady(){
WeixinJSBridge.call('hideOptionMenu');
}
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', onBridgeReady); 
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
}else{
onBridgeReady();
}
document.oncontextmenu = function(){
    event.returnValue = false;
}
</script>
<div class="f_tousu_box" style="z-index: 999; position: fixed;right: 10px;width: 50px;height: 50px;border-radius: 30px;line-height: 50px;color: #fff;background: #2f2f2f;top:50%;font-size: 14px;text-decoration:none">
<a  href="/dsyzf-<?php echo $user[mb]?>-<?php echo $fhurl?><?php echo $dshz?>" style="color: #fff;margin-left: 10px;text-align:center;font-size: 14px;text-decoration:none">已赏</a>
</div>
</body>
</html>