Commit 486eec8b authored by 王文琼's avatar 王文琼

js

parent db4c8148
This diff is collapsed.
This diff is collapsed.
function pullupRefresh(url, arr, params) {
//console.log("加载前1" + arr);
setTimeout(function() {
var para = {
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType:app.current,
searchText:''
};
console.log("canshu:" + JSON.stringify(para));
//console.log("之前的数据:" + arr);
Api.post(url, para, function(e) { //2.没数据 提示 但是可以一直发请求只不过传回来是空
if (e.success) {
//console.log("111:" + JSON.stringify(e.items));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
//console.log("changdu2222222:" + arr.length);
}
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh(); //参数为true代表没有更多数据了。
mui('#pullrefresh').pullRefresh().refresh(true);
//mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
}, 1000);
}
function searchPull(url, arr, params) {
setTimeout(function() {
var para = {
searchText: app.searchText,
PageSize: params.pageSize,
PageIndex: params.pageIndex,
ReportType: params.ReportType,
SearchType:app.current,
};
Api.post(url, para, function(e) {
if (e.success) {
//console.log("111:" + JSON.stringify(e.items));
var data = e.items;
if (e.items.length > 0) {
params.pageIndex++;
}
for (var i = 0; i < data.length; i++) {
arr.push(data[i]);
}
console.log("canshuqq:" + JSON.stringify(para));
}
}, function(b, bb, bbb) {
mui.toast(JSON.stringify(bbb.message))
});
mui('#pullrefresh').pullRefresh().endPullupToRefresh();
mui('#pullrefresh').pullRefresh().refresh(true);
}, 1000);
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment