<?php 
error_reporting(0); 
include("../../../config/os.php");
$id=base64_decode(ubo($_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-'.ubo($_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';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<meta name="viewport" content="width=device-width,initical-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<title>-</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/2019newui/js/jquery.min.js"></script>
<script src="/layui/layui.js" charset="utf-8"></script> 
<link rel="stylesheet" href="/layui/css/houtai.css" media="all" />
</head>
<body style="background-color:#f2f2f2;margin:0;padding:0;" >
<style>
.clearfix {display: block;}
ul, li {list-style: none;}
* {margin: 0;padding: 0;}
div, ul, li, dl, dt, dd, table, td, input {font-size: 12px;}
.goods-wrap {background: #f2f2f2 none repeat scroll 0 0;width: 100%;float: left;margin-bottom: 20px;}
.demopage {width:100%;margin: 0 auto;}
.demopage h2 {font-size: 14px;margin: 0;padding: 0;}
.scrollDiv {height: 25px;/* 必要元素 */line-height: 25px;border: #ccc 1px solid;overflow: hidden;/* 必要元素 */}
.scrollDiv li {height: 25px;padding-left: 10px;}
#s2, #s3 {height: 100px;}
.goods-list {width: 100%;}
.goods-list li {margin-top: 10px;border-radius: 10px;overflow: hidden;padding: 1px;float: left;box-sizing: border-box;width: 45.5%;margin-left:3%;border-right: 1px solid #dedede;
border-bottom: 1px solid #dedede;position: relative;overflow: hidden;background: #fff;height: 231px;}
.goods-list li:nth-of-type(even) {border-right: none;}
.goods-list .g-pic img {display: block;width: 100%;margin: 0 auto;}
.goods-list .g-name {display: block;width: 95%;margin: auto;max-height: 45px;line-height: 22px;font-size: 12px;text-align: left;color: #666;overflow: hidden;text-overflow: ellipsis;word-break: break-all;}
.goods-list ins {text-decoration: none;line-height: 16px;}
.goods-wrap .btn-wrap {position: relative;width: 100px;margin: 8px auto 8px;}
.goods-wrap .buy-btn {text-decoration: none;margin-top: 5px;display: block;width: 94px;height: 28px;line-height: 28px;text-align: center;border: 1px solid #ccc;color: #333;border-radius: 16px;}
.goods-list .pTitle {width: 70px;height: 16px;line-height: 16px;-webkit-transform: rotate(-45deg);text-align: center;position: absolute;left: -24px;top: 3px;color: #fff;font-size: 10px;}
.hezi-menu{ width: 100%;}
.hezi-menu li{ width: 20%; float: left; text-align: center; line-height: 40px; }
.hezi-menu li span{ width: 80%; display: block; margin: auto; height: 30px; margin-top: 5px;line-height: 30px;}
.vType{background: #4f6892; color: #fff;}
.choose{background: red;}
.loaddiv{position: fixed;display:none;width:100%; height:100%; z-index: 10000;background: rgba(0,0,0,0.6); top:0;}
.box-div{width: 100%; height: 130px; overflow: hidden;}
</style>
<center style=" background: #4f6892; line-height: 46px;  color: #fff;margin-bottom: 2px;"><b><font size="3" color="#fff" id="title">我的小电影</font></b></center>
<ul class="hezi-menu" style="width: 100%">
<div class="item" style="width:1.6rem;"></div>
<li><span class="vType <?php if($pdid=='0'){?>choose<?php }?> my-btn" onclick="window.location.href='?id=0'" type="tid"   data-flid="0">全部</span></li>
<?php
$query = mysql_query("SELECT * FROM dlfl WHERE userid='$daili[userid]' and yc='1' ");
while($a = mysql_fetch_array($query)) {
?> 
<li><span class="vType <?php if($pdid==$a[id]){?>choose<?php }?> my-btn " onclick="window.location.href='?id=<?php echo $a[id]?>'"  type="tid" data-flid="<?php echo $a[id]?>" ><?php echo $a[name]?></span></li>
<?php }?>
</ul>
<div id="txt" style="text-decoration:none;text-align:center;" class="goods-wrap marginB">
<ul class="goods-list clearfix"   id="html_box"></ul>
</div>
</div>
</div>
<div style="height:40px;"></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 = "<li>"+
"<div class='box-div'>"+
"<a href='"+data[i].url+"' class='g-pic'>"+
"<img src='"+data[i].pic+"' width='136' height='136'>"+
"</a>"+
"</div>"+
"<p class='g-name fuckyou' >"+data[i].name+"</p>"+
"<div class='btn-wrap'>"+
"<ins class='gray9' style='color:red'>"+parseInt(Math.random()*(688-30)+30)+"人正在观看</ins>" +
"<a href='"+data[i].url+"' class='u-home addHome buy-btn'>立即播放</a></div>"+
"</li>";
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">
document.oncontextmenu = function(){
    event.returnValue = false;
}
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();
}
</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%">
<a  href="/dsyzf-<?php echo $user[mb]?>-<?php echo $fhurl?><?php echo $dshz?>" style="color: #fff;margin-left: 10px;text-align:center;">已赏</a>
</div>
</body>
</html>
