l***@qq.com
- 发布:2017-01-14 20:19
- 更新:2019-12-19 10:07
- 阅读:3259
<body>
<!--头部选项卡-->
<header class="mui-bar mui-bar-nav title">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left title-cloe"></a>
<h1 class="mui-title title-cloe">投料单详情</h1>
</header>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div style="width:100%;position:fixed;clear:all;z-index:1; background-color:#F3F3F3; margin-top:0px;">
<ul style="width:100%;">
<span>
<span class="sampCss">物料代码</span>
<span class="sampCss1">物料名称</span>
<span class="fsampCss1">规格型号</span>
<a onclick="showSide();"style="width:30px;color:#000000;font-size:12px;">
筛选<img src="images/shaixuan.png" style="margin-right:5px;width:22px;height:16px;"/>
</a>
</span>
</ul>
</div>
<div class="mui-scroll" style="width:100%; margin-top:60px; z-index:0; background-color:#F3F3F3;">
<ul class="mui-table-view" id="ulDel">
</ul>
</div>
</div>
<script src="js/app.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
//获取输入框中数据
var wobillno = '';
var tlbillno = '';
var FNumber = '';
var FName = '';
var lastPage; //总共页数
var counter=1; //第几页
//发送请求获取数据
function getList(){
console.log("第"+counter+"页");
var result="";
$.ajax({
url:appFaction.ip()+'/phone/k3',
type:'POST',
dataType:"json",
timeout:10000,
data:{
tlbillno:tlbillno,
wobillno:wobillno,
fnumber:FNumber,
fname:FName,
pageSize:12,
pageNum:counter, //第几页
isAsc:'asc'
},
error:function(data){
console.log("error")
},
success:function(data){
lastPage = data.total;//总页数
var dataStr = JSON.stringify(data);
console.log(dataStr);
var lengths = 0;
lengths = data.rows.length;
console.log(lengths);
var contactHtml = '';
for (var i = 0 ; i <lengths; i ++ ) {
contactHtml +=''+
'<li class="mui-table-view-cell myLi" style="list-style-type:none;">'+
'<span class="sampCssL fontSize">'+data.rows[i].fnumber+'</span>'+
'<span class="sampCss1L fontSize">'+data.rows[i].fname+'</span>'+
'<span class="fsampCss1L fontSize">'+data.rows[i].fmodel+'</span>'+
'</li>';
}
$(contactHtml).insertBefore('#pullrefresh .mui-scroll .mui-table-view');
}
});
}
//上拉加载
mui.init({
pullRefresh : {
container:'#pullrefresh',//待刷新区域标识,querySelector能定位的css选择器均可,比如:id、.class等
up : {
height:50,//可选.默认50.触发上拉加载拖动距离
auto:true,//可选,默认false.自动上拉加载一次
contentrefresh : "正在加载...",//可选,正在加载状态时,上拉加载控件上显示的标题内容
contentnomore:'没有更多数据了',//可选,请求完毕若没有更多数据时显示的提醒内容;
callback :pullupRefresh //必选,刷新函数,根据具体业务来编写,比如通过ajax从服务器获取新数据;
}
}
});
//上拉刷新数据
function pullupRefresh(){
setTimeout(function(){
getList();//获取数据
mui('#pullrefresh').pullRefresh().endPullupToRefresh((++counter>lastPage));
},1500)
}
</script>
</body>
p***@126.com
补全 遮罩面板
var ws=null,wc=null;
// 扩展API加载完毕,现在可以正常调用扩展API
function plusReady(){
window.addEventListener('seachEvents',function(event){
wobillno = event.detail.wobillno;
tlbillno = event.detail.tlbillno;
FNumber = event.detail.FNumber;
FName = event.detail.FName;
//删除之前的数据,从新加载数据
$("li").remove();
//获取数据
getList();
})
ws=plus.webview.currentWebview();
// 用户点击后
ws.addEventListener("maskClick",function(){
wc.close("auto");
},false);
}
// 判断扩展API是否准备,否则监听"plusready"事件
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
}
// 显示侧滑页面
function showSide(){
// 防止快速点击可能导致多次创建
if(wc){
return;
}
// 开启遮罩
ws.setStyle({mask:"rgba(0,0,0,0.5)"});
// 创建侧滑页面
wc=plus.webview.create("showSide.html","side",{left:"30%",width:"70%",popGesture:"none"});
// 侧滑页面关闭后关闭遮罩
wc.addEventListener('close',function(){
ws.setStyle({mask:"none"});
wc=null;
},false);
// 侧滑页面加载后显示(避免白屏)
wc.addEventListener("loaded",function(){
wc.show("slide-in-right",200);
},false);
}
2019-12-19 10:08