203 lines
8.4 KiB
HTML
203 lines
8.4 KiB
HTML
|
|
<!doctype html>
|
|||
|
|
<html>
|
|||
|
|
|
|||
|
|
<head>
|
|||
|
|
<meta charset="utf-8">
|
|||
|
|
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
|
|||
|
|
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
|
|||
|
|
<title>Hello APP</title>
|
|||
|
|
<link rel="stylesheet" type="text/css" href="../css/api.css" />
|
|||
|
|
<link rel="stylesheet" type="text/css" href="../css/content.css" />
|
|||
|
|
<style type="text/css">html,body{background: none;overflow: hidden;}
|
|||
|
|
.floor-product{margin-top:0;padding-top:0;}
|
|||
|
|
.floor-product-item .product-item-cont .product-cont {
|
|||
|
|
float: left;
|
|||
|
|
width: 50%;
|
|||
|
|
padding-left:0.4em;
|
|||
|
|
padding-right:0.4em;
|
|||
|
|
padding-bottom: 0.4em;
|
|||
|
|
display: block;
|
|||
|
|
overflow:hidden;
|
|||
|
|
box-sizing:border-box;
|
|||
|
|
-moz-box-sizing:border-box;
|
|||
|
|
-webkit-box-sizing:border-box;
|
|||
|
|
overflow: hidden;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
.floor-product-item .product-item-cont .product-cont .product-cont-box{
|
|||
|
|
background-color: #f4f4f4;
|
|||
|
|
border: 1px solid #e1e1e1;
|
|||
|
|
}
|
|||
|
|
.floor-product-item .product-item-cont .product-cont span {
|
|||
|
|
height:auto;
|
|||
|
|
line-height: 1.2em;
|
|||
|
|
}
|
|||
|
|
.floor-product-item .product-item-cont .product-cont.product-cont0{
|
|||
|
|
padding-left:0.4em;
|
|||
|
|
padding-right:0;
|
|||
|
|
}
|
|||
|
|
.floor-product-item .product-item-cont .product-cont img {
|
|||
|
|
|
|||
|
|
width: 100%; height:9em; border-radius:0.5em 0.5em 0 0;
|
|||
|
|
background:url(../image/loading.gif) #fff center center no-repeat;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
</head>
|
|||
|
|
|
|||
|
|
<body style="padding:0;width: 100%;box-sizing: border-box;overflow: hidden;" onclick="closecommon()">
|
|||
|
|
<div class="wrap" id="commnheader" style=" position: absolute; bottom:0;width: 100%; background: #fff;border-radius:0.8em 0.8em 0 0;box-sizing: border-box;overflow: hidden;" onclick="stopPropagation(event)">
|
|||
|
|
<header style="background: none;"><div class="ub">
|
|||
|
|
<div class="nav-btn" id="nav-left" style=" margin:0; padding:0; padding-top:0.2em; min-width:4em" onclick="closecommon();">
|
|||
|
|
<img src="../image/faifeito0.png" style="margin-left:0; margin-top:0em; height:1.4em;width:1.4em;display: none;" />
|
|||
|
|
</div>
|
|||
|
|
<h1 class="ub-f1" style="color: #000000;font-size: 1em;">
|
|||
|
|
<span id="plcount">0</span>条商品
|
|||
|
|
</h1>
|
|||
|
|
<div class="nav-btn blue" id="nav-right" style=" margin:0; padding:0;padding-top:0.2em; min-width:4em">
|
|||
|
|
<!--<img src="../image/full.png" class="full" onclick="onfull()" style="margin-left:0; margin-top:0em; height:1.4em;width:1.4em;" />--><img src="../image/close.png" class="close" style="margin-left:0.8em;margin-right:0.8em; margin-top:0em; height:1.5em;width:1.5em;" onclick="closecommon();" />
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</header>
|
|||
|
|
<section class="ub-f1" onclick="stopPropagation(event)" >
|
|||
|
|
<div class="floor-product" id="sysnew" style="height:32em; padding-bottom:1em; box-sizing: border-box;overflow: hidden; overflow-y: auto; -webkit-overflow-scrolling:touch;overflow-scrolling:touch;">
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</section>
|
|||
|
|
</div>
|
|||
|
|
<div class="ajaxLoader ub ub-ac uhide" onclick="reload()">
|
|||
|
|
<div class="ub ub-ac ub-ver"><img src="../image/load.gif" /><br>正在加载...</div>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
<script type="text/javascript" src="../script/api.js"></script>
|
|||
|
|
<script type="text/javascript" src="../script/main.js"></script>
|
|||
|
|
<script type="text/javascript" src="../script/moment.js"></script>
|
|||
|
|
<script type="text/javascript" src="../script/jquery-2.0.2.min.js"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var productids="";
|
|||
|
|
var userId=null;
|
|||
|
|
var LoginId=null;
|
|||
|
|
apiready = function() {
|
|||
|
|
productids=$api.getStorage("productids");
|
|||
|
|
userId=$api.getStorage("userId");
|
|||
|
|
LoginId=$api.getStorage("LoginId");
|
|||
|
|
|
|||
|
|
rdata(1);
|
|||
|
|
onScroll0();
|
|||
|
|
};
|
|||
|
|
function onScroll0() {
|
|||
|
|
isload = true;//设置是否终止滚动加载
|
|||
|
|
curScrollHeight = 0;//当前滚动位置
|
|||
|
|
curCount = 1;//计数器,防止滚动时重复执行加载下一页
|
|||
|
|
$(".floor-product").scroll(function () {
|
|||
|
|
var pageHeight = $("body").height();
|
|||
|
|
var showHeight = $(".floor-product").height();
|
|||
|
|
var scrollHeight = $(".floor-product").scrollTop();
|
|||
|
|
|
|||
|
|
if (curScrollHeight - scrollHeight < 10 && curScrollHeight > 0) {
|
|||
|
|
if (curCount == 1 && isload) {
|
|||
|
|
|
|||
|
|
rdata(0);
|
|||
|
|
}
|
|||
|
|
curCount++; //加载下一页后计数器+1
|
|||
|
|
}
|
|||
|
|
if (curScrollHeight < scrollHeight) {
|
|||
|
|
curScrollHeight = pageHeight - showHeight;//滚动到页面底部时,重设当前滚动位置
|
|||
|
|
curCount = 1;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function rdata(t) {
|
|||
|
|
$api.removeCls($api.dom(".ajaxLoader"),"uhide");
|
|||
|
|
var Start = $api.domAll(".floor-product .product-cont").length;
|
|||
|
|
if(t==1){
|
|||
|
|
|
|||
|
|
Start = 0;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
api.ajax({
|
|||
|
|
url : apiurl+"/apiajax.ashx?action=getvideoproductlist&Start="+Start + "&productids=" + productids + (userId!=null?"&userId=" + userId:"") + (LoginId!=null?"&LoginId=" + LoginId:""),
|
|||
|
|
method:'get',
|
|||
|
|
dataType:'json'
|
|||
|
|
},
|
|||
|
|
function(data, status) {
|
|||
|
|
if (data) {
|
|||
|
|
|
|||
|
|
$api.addCls($api.dom(".ajaxLoader"),"uhide");
|
|||
|
|
if(data.status==1){
|
|||
|
|
$api.html($api.dom('#plcount'),data.Recount);
|
|||
|
|
if(data.productlist.length>0){
|
|||
|
|
var list = data.productlist;
|
|||
|
|
var html="";
|
|||
|
|
if(Start==0){
|
|||
|
|
|
|||
|
|
html+="<div class=\"floor-product-item\">";
|
|||
|
|
html+="<div class=\"product-item-cont\">";
|
|||
|
|
}
|
|||
|
|
for(j=0;j<list.length;j++){
|
|||
|
|
if(document.getElementsByClassName(".databox_"+list[j]._id).length==0){
|
|||
|
|
html+="<div onclick=\"ondetail("+list[j]._id+")\" class=\"product-cont"+(j%2==0?" product-cont0":"")+" databox_"+list[j]._id+"\">";
|
|||
|
|
html+="<div class=\"product-cont-box\"><img src=\""+ list[j].image+"\" />";
|
|||
|
|
html += "<span class=\"txt\">" + list[j].name + "</span>";
|
|||
|
|
html += "<span class=\"rmb\" style=\"float:right; margin-top: .6em;\"><del>" + list[j].scje + "元</del><span class=\"hyje\" style=\"float:right; margin-top: 0em;\">" + list[j].hyje + "元</span></span>";
|
|||
|
|
|
|||
|
|
html+="</div></div>";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
if(Start==0){
|
|||
|
|
html+="</div>";
|
|||
|
|
html+="</div>";
|
|||
|
|
}
|
|||
|
|
if(Start==0){
|
|||
|
|
$api.html($api.dom(".floor-product"), html);
|
|||
|
|
}else{
|
|||
|
|
$api.append($api.dom(".floor-product .product-item-cont"), html);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}else{
|
|||
|
|
|
|||
|
|
toast(data.msg);
|
|||
|
|
if(data.msg=="您未登录"){
|
|||
|
|
$api.rmStorage("userId");
|
|||
|
|
$api.rmStorage("LoginId");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}else{
|
|||
|
|
|
|||
|
|
toast("网络错误!");
|
|||
|
|
$api.addCls($api.dom(".ajaxLoader"), "uhide");
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
function closecommon(){
|
|||
|
|
execScript0("video_content","playvideo()");
|
|||
|
|
closeFrame('video_cartto');
|
|||
|
|
}
|
|||
|
|
function stopPropagation(e) {
|
|||
|
|
if (e.stopPropagation)
|
|||
|
|
e.stopPropagation();
|
|||
|
|
else
|
|||
|
|
e.cancelBubble = true;
|
|||
|
|
}
|
|||
|
|
function ondetail(id){
|
|||
|
|
onlink("shop_view.html?id=" + id);
|
|||
|
|
}
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
</html>
|