qlg.tsgz.moe/static/app2/js/ect_recharge_list.js
2019-09-06 23:53:10 +08:00

90 lines
2.3 KiB
JavaScript
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mui.plusReady(function() {
var isjiazai = 1;
var page = 1;
// function hyhUrl(url) {
// return 'http://192.168.1.101/hyh/' + url;
// }
function getLocalTime(nS) {
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
}
var token = localStorage.getItem('token');
// alert(token);
function getDate(page) {
var num = page;
if(isjiazai == 0) {
return;
} else {
isjiazai = 0;
}
mui.ajax(hgUrl('app/Ectwallets/getEctRechargeLog'), { 
headers: { 
"HYH-Token": token
},
data: {
page: num
},
dataType: 'json', //服务器返回json格式数据  
type: 'post', //HTTP请求类型  
timeout: 10000, //超时时间设置为10秒  
success: function(data) {           //服务器返回响应,根据响应结果,分析是否登录成功; 
var data = toJson(data, 1);
if(data.status == 1) {
var html = '';
if(data.data.list.Rows == '') {
$('.mui-scroll').append('<p style="float: left;width: 100%;text-align: center;padding-bottom: 9px;">没有更多记录</p>');
isjiazai = 0;
return;
}
$.each(data.data.list.Rows, function() {
var ectType;
var dataSrc;
if(this.status == 0){
dataSrc = '待确认';
}else if(this.status == 1) {
dataSrc = '已确认';
} else if(this.status == 2) {
dataSrc = '已拒绝';
} else{
dataSrc = '';
}
html += '<div class="row"><img src="../img/bg_pay_list.png"/><p class="p1">' + this.value + '</p><p class="p3">状态:' + dataSrc + '</p><p class="p4">' + getLocalTime(this.createTime) + '</p></div>'
});
if(page == 1) {
$('.con').html(html);
} else {
$('.con').append(html);
}
isjiazai = 1
} else {
// console.log(data.status)
}
},
error: function(xhr, type, errorThrown) {           //异常处理;  
alert(errorThrown);      
}  
}); 
}
getDate(page);
document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
if(scroll.y == scroll.maxScrollY) {
if(isjiazai == 1) {
page++;
getDate(page);
}
}
})
})