2019-09-06 23:53:10 +08:00

120 lines
3.6 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.

$('.scroll_out_t').removeClass('con');
$('.mui-scroll').html('<div class="con"></div>');
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(hyhUrl('app/Ectwallets/getEctLog'), { 
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.Rows == '') {
$('.con').append('<p style="float: left;width: 100%;text-align: center;padding-bottom: 9px;">没有更多记录</p>');
isjiazai = 0;
return;
}
$.each(data.data.Rows, function() {
var ectType;
var dataSrc;
if(this.ectType == 1) {
ectType = '+';
} else {
ectType = '-';
}
if(this.dataSrc == 1) {
dataSrc = '注册赠送';
} else if(this.dataSrc == 2) {
dataSrc = '推荐赠送';
} else if(this.dataSrc == 3) {
dataSrc = '交易';
} else if(this.dataSrc == 4) {
dataSrc = '提现';
}else if(this.dataSrc == 5) {
dataSrc = '联盟积分转换';
}else if(this.dataSrc == 6) {
dataSrc = '成为商家';
}else if(this.dataSrc == 7) {
dataSrc = '推荐成为商家';
}else if(this.dataSrc == 8) {
dataSrc = '成为线上商城商家';
}else if(this.dataSrc == 9) {
dataSrc = '推荐成为线上商城商家';
}else if(this.dataSrc == 11) {
dataSrc = '购物';
}else if(this.dataSrc == 12) {
dataSrc = '结算';
}else if(this.dataSrc == 13) {
dataSrc = '退款';
}else if(this.dataSrc == 14) {
dataSrc = '充值';
}else{
dataSrc = '';
}
// html += '<div class="block"><img src="../img/ect_list_bg.png"/><div class="s1">ECT变动记录</div><div class="s2">' + getLocalTime(this.createTime) + '</div><div class="s3">变动数量</div><div class="s4">' + ectType + ' ' + this.ectNum + ' </div><div class="s5">变动类型:<o>' + dataSrc + '</o></div><div class="s6">备注:<o>' + this.dataRemarks + '</o></div></div>';
html +='<div class="row"><img src="../img/bg_pay_list.png"/><p class="p1">' + ectType + ' ' + this.ectNum + '</p><p class="p3">变动类型:<o>' + dataSrc + '</o></p><p class="p2">备注:<o>' + this.dataRemarks + '</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);
}
}
})
})