﻿goodslist=function(obj)
{
    jQuery.ajaxSetup({cache:false});
               
    goodslist.obj=obj;
    goodslist.obj.method=obj.method||'goodslist';
    goodslist.obj.index=obj.index||1;
    goodslist.obj.size=obj.size||12;
//    goodslist.obj.objuin=Request.QueryString('uin');;
//    goodslist.uin=Request.QueryString('uin');//document.getElementById('hiduin').value;
//    goodslist.pwd=Request.QueryString('pwd');
    goodslist.url=obj.url||'fronthomejson.aspx';
    goodslist.load({index:1});
}
goodslist.load=function(obj)
{
     goodslist.obj.index=obj.index;
     goodslist.obj.size=obj.size;
     jQuery.ajax({
				  type:"GET",
				  url:goodslist.url,
				  dataType:"json",
				  //data:{method:'orderdesk',starttime:obj.starttime,endtime:obj.endtime,mobile:obj.mobile,cardnumber:obj.cardnumber,ispayd:'1',index:obj.index,size:obj.size},
				  data:goodslist.obj,
				  global:false, 
				  //timeout:100,
				   success: function(json){						
				    goodslist.store=json;			
					goodslist.data=goodslist.store[1].Data;					
					goodslist.Total=goodslist.store[0].TotalCount;					
					goodslist.load_html_start({});					
				   },
				   error:function(xmlHttpRequest,textStatus, errorThrown)
				   {
				        //alert(xmlHttpRequest.responseText);
				   }
				});
}
goodslist.obj={};
goodslist.data=[];
goodslist.store=[];
goodslist.Total=0;
goodslist.content="";
//goodslist.uin=document.getElementById('hiduin').value;
//goodslist.pwd=document.getElementById('hidpwd').value;
goodslist.make_content_list=function(obj)
{    
    var html='';
    html='<li><span>2009-07-20</span><a href="#">英国17岁少年谎称办航空公司险些骗得飞机'+obj.goodsid+'</a></li>';
   return html;         
}
goodslist.make_content_title=function(obj)
{
var html='';
html='<h3><span><a href="list.aspx">更多+</a></span><img src="greenimg/righttitimg.gif" alt="我的日志"  /></h3>';
return html;
}

goodslist.load_html_start=function(obj)
{	
	var total_item=12;
	var length=goodslist.Total;//Mobile_search_content_array.length;
	var total_page=Math.ceil(goodslist.Total/total_item);
	var begin=0;//(page-1)*total_item;
	var end=goodslist.data.length;//page*total_item;	
	this.message_obj={};
        this.message_obj.index=obj.index;
        this.message_obj.total_page=total_page;
        this.message_obj.size=12;
        this.message_obj.total=goodslist.Total;
        this.message_obj.page=obj.index;   
        goodslist.content="";  
	var buf=[];
//	buf.push(goodslist.make_content_title());
	goodslist.content+=goodslist.make_content_title();
	goodslist.content+='<ul class="myList" id="ulMyList">';
	  for(var i=0;i<end;i++){
		      if((i>=begin)&&(i<end)){
//			    buf.push(goodslist.make_content_list(goodslist.data[i]));
			    goodslist.content+=goodslist.make_content_list(goodslist.data[i]);  
		      }
	    }
	goodslist.content+="</ul>";
//	    goodslist.content=buf.join("");
//	 jQuery("#myKJbox").html(buf.join(""));
//	 jQuery("#page_list").html(goodslist.make_content_footer(this.message_obj));
	 
}
//goodslist.appply=function()
//{
//    location.href='applyadd.aspx?uin='+goodslist.uin+'&pwd='+goodslist.pwd;
//}
