/*** * 程序入口 */ 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 = '
'+ '
'+ '
' + '
' +(item.Remark?item.Remark:"未知")+ '
' + '
' +item.BillDate+ '
'; if(item.InGrade){ htm+= '
+'+item.InGrade+'
';} else if(item.OutGrade){ htm+= '
-'+item.OutGrade+'
';} else{ htm+= '
'+0+'
';} 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("
无更多数据
"); } 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(); }