grow_up_detal.js
3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/***
* 程序入口
*/
var page=1;
var isnomore=0;
$(function () {
getList();
})
/*----同步调用----*/
function async_get(url,data,func,err) {
$.ajax({
url: url, data: data, type: "get",
dataType: "json", async:false,
success: function(res) {
if(res.code==0){ func(res); }
}
});
}
///滑动到底部加载更多
$(document).unbind("scroll");
$(document).bind("scroll", function (event) {
if ($(document).scrollTop() >= $(document).height() - window.innerHeight) {
if(!isnomore) getList();
}
});
function getList() {
//--获取成长值明细--
var d_data={storeId:stoid,userId:user_id,page:page,pageSize:6};
if($.trim($("#start_time").val())){
var tt1=$.trim($("#start_time").val());
d_data.beginDate=tt1.replace("/","-")
}
if($.trim($("#end_time").val())){
var tt2=$.trim($("#end_time").val());
d_data.endDate=tt2.replace("/","-")
}
async_get(apihost+"/api/weshop/users/grade/vipinoutgrade/page",d_data,
function (res) {
var data=res.data.pageData;
if(data.length!=0 ){
page++;
var html="";
for(var i in data) {
var item=data[i];
var htm = '<div class="xc-bills-frame" >'+
'<div class="flex jc_sb">'+
'<div>' +
'<div class="word-number">' +(item.Remark?item.Remark:"未知")+
'</div>' +
'<div class="word-time">' +item.BillDate+
'</div></div>';
if(item.InGrade){
htm+= '<div class="xc-val fs035">+'+item.InGrade+'</div></div></div>';}
else if(item.OutGrade){
htm+= '<div class="xc-val fs035">-'+item.OutGrade+'</div></div></div>';}
else{
htm+= '<div class="xc-val fs035">'+0+'</div></div></div>';}
html+=htm;
}
$(".no_text").hide();
$(".xc-list-frame").append(html);
}else{
html=''
//$(".xc-list-frame").html(html);
if(page==1) $(".no_text").show();
else{
$(".xc-list-frame").append("<div class='xc-bills-frame' style='height: 0.5rem; border-bottom: none; text-align: center; color: #999'>无更多数据</div>");
}
isnomore=1;
}
})
}
function goto(e){
var index=$(e).attr("ind");
switch (index) {
case "0": window.location.href= "/mobile/index/index/stoid/"+stoid;break;
case "1": window.location.href= "/mobile/user/coupon/stoid/"+stoid; break;
case "2": window.location.href= "/mobile/user/gorw_up/stoid/"+stoid; break;
}
}
function show_submit() {
$("#s_select_time").hide();
$(".xc_sx ").removeClass("clicked");
$(".xc-list-frame").html("");
page=1; isnomore=0;
getList();
}
function reset() {
$("#start_time").val("");
$("#end_time").val("");
$(".xc-list-frame").html("");
page=1;isnomore=0;
getList();
}