下拉加载

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>订单管理</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
          name="viewport">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <link rel="stylesheet" href="<?php echo TPL_URL;?>css/orderCss.css"/>
    <link rel="stylesheet" href="<?php echo TPL_URL;?>css/dropload.css"/>
   <script type="text/javascript" src="<?php echo TPL_URL;?>js/jquery.min.js"></script>
   <script type="text/javascript" src="<?php echo TPL_URL;?>js/dropload.min.js"></script>
   </head>
   <style>
       .hide{
           display:none
       }
   </style>
   <body class="storelist">
    <div class="header">
        <p><?php echo $company_name; ?></p>
    </div>
<div class="orderList">
    <div class="list"></div>
 <!--<?php foreach($storelist['store_list'] as $store) {?>
    <div class="perOrder">
      <div class="orderVie">
         <img src="<?php if (empty($store['logo']) || $store['logo']=='images/weidian_logo.png'){ echo TPL_URL.'images/weidian_logo.png' ;}else{ echo $store['logo'] ;} ?>" alt="" />
      </div>

      <div class="orderInfo">
         <p><?php echo $store['name']; ?></p>
         <a href="javascript:void(0)" class="set_position" data-id="<?php echo $store['store_id']; ?>" >订单管理</a>
      </div>
    </div>
 <?php } ?>-->
   <div class="js-has-company hide">
      <div class="js-page-list pagenavi"><?php echo $storelist['page'];?></div>
   </div>
</div> 
   
   </body>
   <script>
   function jianting(){
           $('.set_position').on('click', function(e){
                event.stopPropagation();
                var store_id = $(this).attr('data-id');
                window.location.href = '/wap/OrderManage.php?a=index&store_id='+store_id;
            });
       }
$(function(){
    var page = 1; //页码
    var load_url ='/wap/WapAdmin.php?a=select_store';

    /*$('.pagenavi > a').on('click', function(){
        page = $(this).attr('data-page-num');
      load_page('.storelist', load_url, {'p': page}, '', function(){});
    });*/
});    

//加载页面
/*var load_page_cache = [];
function load_page(dom,url,param,cache,obj){
   if(cache!='' && load_page_cache[cache]){
      $(dom).html(load_page_cache[cache]);
      if(obj) obj();
   }else{
      $(dom).html('<div class="loading-more"><span></span></div>');
      $(dom).load(url+'&t='+Math.random(),param,function(response,status,xhr){
         if(cache!='') load_page_cache[cache]=response;
         if(obj) obj();
      });
   }
}*/
//window.οnlοad=function(){
//下拉加载
var counter=0;
 var load_url ='/wap/WapAdmin.php?a=select_store';
 var num = 0;
    var pageStart = 0,pageEnd = 0;
$('.orderList').dropload({
        scrollArea : window,
        domDown : {
                    domClass   : 'dropload-down',
                    domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
                    domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
                    domNoData  : '<div class="dropload-noData">我是有底线的!!</div>'
                },
        loadDownFn : function(me){
            $.ajax({
                type: 'GET',
                url: '/wap/WapAdmin.php?a=getList&num='+num,
                success: function(data){
                    var data=JSON.parse(data);
                    if(data.data.length==0){
                        me.lock();
                        me.noData();

                    }
                    var result = '';
                    counter++;
                    pageEnd = num * counter;
                    pageStart = pageEnd - num;
                    for(var i=0;i<data.data.length;i++){
                        if(data.data[i].logo=='images/weidian_logo.png' || data.data[i].logo==""){
                            result+='<div class="perOrder"><div class="orderVie"><img src="../Application/Wap/View/images/weidian_logo.png"></div><div class="orderInfo"><p>'+data.data[i].name+'</p><a href="javascript:void(0)" class="set_position" data-id="'+data.data[i].store_id+'">订单管理</a></div></div>';
                        }
                        else{
                            result+='<div class="perOrder"><div class="orderVie"><img src="'+data.data[i].logo+'"></div><div class="orderInfo"><p>'+data.data[i].name+'</p><a href="javascript:void(0)" class="set_position" data-id="'+data.data[i].store_id+'">订单管理</a></div></div>';
                        }

                    }


                    setTimeout(function(){
                        $('.list').append(result);
                        jianting();
                        num++;
                        // 每次数据加载完,必须重置
                        me.resetload();
                    },1000);
                },
                error: function(xhr, type){
                    alert('Ajax error!');
                    // 即使加载出错,也得重置
                    me.resetload();
                }
            });
        }
    });
//}
</script>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值