<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<ul id="TU00KssqdList" class="mui-table-view">
</ul>
</div>
</div>
<script src="<%=tRootPath%>/TU00Kssqd/TU00Kssqd-Protected.js?t=201607061446"></script>
<script>
var tRootPath = '<%=tRootPath%>';
mui.init({
pullRefresh : {
container : '#pullrefresh',
up : {
contentrefresh : '正在加载...',
contentnomore : '没有更多申请单信息了!',
callback : pullupRefresh
},
down: {
callback: pulldownRefresh
}
}
});
//当前页数
var tCurrentPageIndex = -1;
//每页显示条数
var tPageSize = 8;
/**
- 上拉加载申请单信息
*/
function pullupRefresh() {
tCurrentPageIndex++;
setTimeout(function() {
Func_GetTU00KssqdList(tCurrentPageIndex, tPageSize);
}, 300);
}
/**
- 下拉刷新申请单信息
*/
function pulldownRefresh() {
tCurrentPageIndex = 0;
setTimeout(function() {
$("#TU00KssqdList").html("");
Func_GetTU00KssqdList(tCurrentPageIndex, tPageSize);
}, 300);
}
mui.ready(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
});
function Func_GetTU00KssqdList(aCurrentPageIndex, aPageSize) {
var json = {"wxgzhopenid":tOpenid};
$.ajax({
url : tRootPath + "/TU00Kssqd/GetList",
data : {
"QueryParame" : JSON.stringify(json),
"pageIndex" : aCurrentPageIndex,
"pageSize" : aPageSize
},
cache : false,
dataType : 'json',
type : "POST",
success : function(aResult) {
if (aResult.data.length > 0) {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
mui('#pullrefresh').pullRefresh().endPullupToRefresh(aResult.data.length < 1);
var TU00KssqdListJson = JSON.stringify(aResult.data);
loadList(TU00KssqdListJson);
} else {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
}
},
error : function() {
mui.toast("没有您的申请信息!");
},
});
}
2 个回复
Trust - 少说废话
请上传示例代码附件。
風水大師 (作者)
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<ul id="TU00KssqdList" class="mui-table-view">
</ul>
</div>
</div>
<script src="<%=tRootPath%>/TU00Kssqd/TU00Kssqd-Protected.js?t=201607061446"></script>
<script>
var tRootPath = '<%=tRootPath%>';
mui.init({
pullRefresh : {
container : '#pullrefresh',
up : {
contentrefresh : '正在加载...',
contentnomore : '没有更多申请单信息了!',
callback : pullupRefresh
},
down: {
callback: pulldownRefresh
}
}
});
//当前页数
var tCurrentPageIndex = -1;
//每页显示条数
var tPageSize = 8;
/**
*/
function pullupRefresh() {
tCurrentPageIndex++;
setTimeout(function() {
Func_GetTU00KssqdList(tCurrentPageIndex, tPageSize);
}, 300);
}
/**
*/
function pulldownRefresh() {
tCurrentPageIndex = 0;
setTimeout(function() {
$("#TU00KssqdList").html("");
Func_GetTU00KssqdList(tCurrentPageIndex, tPageSize);
}, 300);
}
mui.ready(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
});
function Func_GetTU00KssqdList(aCurrentPageIndex, aPageSize) {
var json = {"wxgzhopenid":tOpenid};
$.ajax({
url : tRootPath + "/TU00Kssqd/GetList",
data : {
"QueryParame" : JSON.stringify(json),
"pageIndex" : aCurrentPageIndex,
"pageSize" : aPageSize
},
cache : false,
dataType : 'json',
type : "POST",
success : function(aResult) {
if (aResult.data.length > 0) {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
mui('#pullrefresh').pullRefresh().endPullupToRefresh(aResult.data.length < 1);
var TU00KssqdListJson = JSON.stringify(aResult.data);
loadList(TU00KssqdListJson);
} else {
mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
}
},
error : function() {
mui.toast("没有您的申请信息!");
},
});
}
Trust
请上传可以还原场景的工程,方便测试。
2016-07-23 10:57