<!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>
下拉加载
最新推荐文章于 2024-09-17 01:46:56 发布