mui.init({
pullRefresh: {
container: '#pullrefresh',
down: {},
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
var pageNumber = 0,
pagesize = 10;
function pullupRefresh() {
pageNumber += 1;
$.ajax(base_path + '/withdraw/selectUserLogs', {
data: {
"pageSize": pagesize,
"pageNo": pageNumber
},
dataType: 'json',
type: 'post',
timeout: 15000,
xhrFields: {
withCredentials: true
},
crossDomain: true,
success: function(dt) {
if(dt.isRedirect) {
location.href = dt.redirectURL;
} else {
if(dt.status) {
var log_list = [];
log_list = dt.data;
mui('#pullrefresh').pullRefresh().endPullupToRefresh((log_list.length < pagesize));
var table = document.body.querySelector('.my-tab-view-pull');
var fenxiaostr = "";
mui(log_list).each(function(index) {
var li = document.createElement('li');
li.className = 'mui-table-view-cell';
this.name == null ? this.name = "神仙哥哥" : this.name;
var status = this.withdrawalsStatus;
switch(status) {
case 1:
status = "提现成功";
break;
case 2:
status = "提现申请中";
break;
default:
status = "提现失败"
};
var num = accDiv(this.withdrawalsLogsAmount, 100);
li.innerHTML = '提现:¥ -' + num + '' + status + '' + this.withdrawalsLogsDate + '';
table.appendChild(li)
})
} else {
var btnArray = ['否', '是'];
mui.confirm(dt.message + '是否刷新页面?', '提示', btnArray, function(e) {
if(e.index == 1) {
location.reload(true)
}
})
}
}
},
error: function(xhr, type, errorThrown) {
console.log(xhr)
}
})
};
mui.ready(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
getCartNum();
document.querySelector('.loading-bg').style.display = 'none'
});