mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {},
up: {contentrefresh: '正在加载...', callback: pullupRefresh}
}
});
var pageNumber = 0, pagesize = 10, endNo = 0;
function pullupRefresh() {
pageNumber += 1;
var btnArray = ['否', '是'];
$.ajax(base_path + '/rebackStatic/underUnderlingStatisc?dates=' + new Date().getTime(), {
data: {
"pageSize": pagesize,
"pageNumber": pageNumber,
"endNo": endNo,
"openid": getParam("openid")
},
dataType: 'json',
type: 'post',
timeout: 15000,
xhrFields: {
withCredentials: true
},
crossDomain: true,
success: function (dt) {
if (dt.isRedirect) {
location.href = dt.redirectURL;
} else {
console.log(dt);
if (dt.status) {
var chanpin_data = [];
if (dt.data.list != null) {
chanpin_data = dt.data.list
}
document.querySelector("#b_accounts").innerHTML = dt.data.size;
endNo = dt.data.endNo;
mui('#pullrefresh').pullRefresh().endPullupToRefresh(chanpin_data.length < pagesize);
var table = document.body.querySelector('.my-tab-view-pull');
mui(chanpin_data).each(function (index) {
var li = document.createElement('li');
li.className = 'mui-table-view-cell';
if (this.img == null) {
li.innerHTML = '
 | ' + decodeURI("未命名") + ' | ' + this.roleName + ' | ' + this.strDate + ' |
'
} else {
li.innerHTML = ' | ' + decodeURI(this.name) + ' | ' + this.roleName + ' | ' + this.strDate + ' |
'
}
table.appendChild(li)
})
} else {
mui.confirm(dt.message, '提示', btnArray, function (e) {
if (e.index == 1) {
}
})
}
}
}, error: function (xhr, type, errorThrown) {
console.log(xhr)
}
})
};mui.ready(function () {
mui('#pullrefresh').pullRefresh().pullupLoading();
getCartNum();
document.querySelector('.loading-bg').style.display = 'none'
});