var pageIndex=1;
$(document).ready(function(){
	//调用查询
	pageIndex=StringUtil.getQueryString('pageIndex');
	if(pageIndex==undefined||pageIndex==null){
		pageIndex=1;
	}
	queryConsumeLog(pageIndex);
});

function queryConsumeLog(index){
	if(typeof(index)=='undefined'){
		index=1;
	}
	 $.ajax({
         url:ctx+'/vip/goConsumeLog',
         data:{
            "currPage":index,
            "memberCode":$("#memberCode").val(),
            "storeId":$("#storeId").val(),
         },
         dataType:"json",
         type:"post",
         success:function(result){
        	 $('#data_content').empty();
         	 var data='';
        	 $.each(result.merchantMenberComsumeList,function(i){
        		 var merchantMenberComsume=result.merchantMenberComsumeList[i];
        		 var createDt='';
        		 if(StringUtil.isNotBlank(merchantMenberComsume.createDt)){
        			 createDt=new Date(merchantMenberComsume.createDt).toYYYYMMDDHHMMSS();
        		 }
         		data+='<div class="weui-flex pt10 pb10 bdbe">';
         	    data+='<div class="ml10"><img src="'+ctx+'/resources/images/bg.png" class="dlblock fc radiusp50 vm" width="45" height="45"/></div>';
         	    data+=' <div class="weui-flex__item">';
         	    data+=' <div class="mb10 f16 tleft ml10 f-black">'+merchantMenberComsume.nickName+'</div>';
         	    data+='<div class="f14 ml10">'+createDt+'</div>';
         	    data+='</div>';
         	    data+='<div class="mr10 f16 tright pt10 f-black">-'+merchantMenberComsume.comsumeMoney+'</div>';
         	    data+='</div>';
        	 });
        	 $('#data_content').append(data);
         }
      })
}

function queryConsumeLog2(index){
	if(typeof(index)=='undefined'){
		index=1;
	}
	 $.ajax({
         url:ctx+'/vip/goConsumeLog',
         data:{
            "currPage":index,
            "memberCode":$("#memberCode").val(),
            "storeId":$("#storeId").val(),
         },
         dataType:"json",
         type:"post",
         success:function(result){
        	 var data='';
        	 $.each(result.merchantMenberComsumeList,function(i){
        		 var merchantMenberComsume=result.merchantMenberComsumeList[i];
        		 var createDt='';
        		 if(StringUtil.isNotBlank(merchantMenberComsume.createDt)){
        			 createDt=new Date(merchantMenberComsume.createDt).toYYYYMMDDHHMMSS();
        		 }
         		data+='<div class="weui-flex pt10 pb10 bdbe">';
         	    data+='<div class="ml10"><img src="'+ctx+'/resources/images/bg.png" class="dlblock fc radiusp50 vm" width="45" height="45"/></div>';
         	    data+=' <div class="weui-flex__item">';
         	    data+=' <div class="mb10 f16 tleft ml10 f-black">'+merchantMenberComsume.nickName+'</div>';
         	    data+='<div class="f14 ml10">'+createDt+'</div>';
         	    data+='</div>';
         	    data+='<div class="mr10 f16 tright pt10 f-black">-'+merchantMenberComsume.comsumeMoney+'</div>';
         	    data+='</div>';
        	 });
        	 $('#data_content').append(data);
         }
      })
}

