﻿EWS.Order={};EWS.Order.layerIndex=100;EWS.Order.GetCatalogProductList=function(config){this.type='GetCatalogProductList';this.config=config;this.initLoad=true;var anchor=EWS.Anchor.get("Order_"+this.config.id);if(anchor!=null){this.config.catalogID=anchor.split(",")[0];};var parent=$("#"+this.config.id);parent.html('');this.config.styleId=this.config.styleId?this.config.styleId:(config.itemStyle==1?1:(config.itemStyle==2?5:6));var eshop_category=this.config.eshop_category?this.config.eshop_category:"商品分类";var eshop_product=this.config.eshop_product?this.config.eshop_product:"商品列表";if(this.config.styleId==1||this.config.styleId==2||this.config.styleId==5||this.config.styleId==6){var page=this.config.styleId==2?'ord_mop_page':'ord_page';$('<h3 id="'+this.config.id+'_CatalogTitle"></h3>').html(eshop_category+'：').addClass("ord_title").appendTo(parent);$('<ul id="'+this.config.id+'_Catalog" class="ord_sort">数据加载中......</ul>').appendTo(parent);$('<h3 id="'+this.config.id+'_ProductTitle" class="ord_title"></h3>').html(eshop_product+'：').addClass("ord_title").appendTo(parent);$("<div id='"+this.config.id+"_Product'>数据加载中......</div>").appendTo(parent);$("<div class='"+page+"'></div>").appendTo(parent);}else{if(this.config.styleId==3){var html='<div class="waresort_left" ><div class="waresort_top"><span>'+eshop_category+'</span></div><ul class="waresort_first" id="'+this.config.id+'_Catalog"></ul></div>'+'<div class="waresort_right"><div class="waresort_title" ><span>'+eshop_product+'</span></div><div id="'+this.config.id+'_Product">数据加载中......</div><div class="ord_mop_page"></div></div>';}else{var html='<div class="waresort_left" ><h3>'+eshop_category+'</h3><ul class="waresort_first" id="'+this.config.id+'_Catalog"></ul></div>'+'<div class="waresort_right"><h3>'+eshop_product+'</h3><div id="'+this.config.id+'_Product">数据加载中......</div><div class="ord_mop_page"></div></div>';}parent.append(html);}};EWS.Order.GetCatalogProductList.prototype.getCatalog=function(parentID){var eshop_category=this.config.eshop_category?this.config.eshop_category:"商品分类";if(parentID==undefined){parentID=this.config.catalogID;}else{this.config.catalogID=parentID;};if(this.config.styleId==1||this.config.styleId==2||this.config.styleId==5||this.config.styleId==6){this.getCatalogByA(parentID,eshop_category);}else{this.getCatalogByB(parentID,eshop_category);}};EWS.Order.GetCatalogProductList.prototype.getCatalogByA=function(parentID,tName){var _this=this;var _get_success=function(result){var title=$("#"+this.config.id+'_CatalogTitle');var ul=$('#'+this.config.id+'_Catalog');var TopCatalog='全部分类';if(result.Path.length==0){title.html(tName+'：<a href="javascript:Order_'+_this.config.id+'.setCatalog(\'0\',"1");">'+TopCatalog+'</a>');ul.html("没有找到相关的产品分类信息！");var product=$('#'+this.config.id+'_Product');product.html("没有找到相关的产品信息！");return;};var titlePath=[];$.each(result.Path,function(i,v){if(v.ID!=0){var name=v.Name;}else{var name="全部分类";};titlePath.push("<a hidefocus='true' href='javascript:Order_"+_this.config.id+".setCatalog(\""+v.ID+"\",1);'>"+name+"</a>");});title.html(tName+'：'+titlePath.join("&nbsp;&nbsp;>&nbsp;&nbsp;"));ul.html("");$.each(result.Catalog,function(i,v){ul.append("<li><a hidefocus='true' key='"+v.ID+"'  href='javascript:Order_"+_this.config.id+".setCatalog(\""+v.ID+"\",\""+v.CategoryCount+"\");'>"+v.Name+"</a></li>");});var anchor=EWS.Anchor.get("Order_"+this.config.id);if(anchor==null){var pageNum=1;}else{var pageNum=parseInt(anchor.split(",")[1]);};this.getProduct(pageNum);};$.ajax({url:"/EWS_Interface/Order_ListCatalog.aspx",type:'get',data:{CID:this.config.cid,ParentID:parentID},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.getCatalogByB=function(parentID,tName){var _this=this;var _get_success=function(result){var ul=$('#'+this.config.id+'_Catalog');var len=result.length;if(len==0){ul.html("没有分类！");return;};$.each(result,function(i,v){if(v.ID!=0){var name=v.Name;}else{var name="全部分类";};if(_this.config.styleId==3){if((i+1)==len){ul.append('<li class="waresort_last2" key="waresort_last2" id="c_'+v.id+'"><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>');}else{ul.append('<li id="c_'+v.id+'"><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>');}}else{ul.append('<li id="c_'+v.id+'"><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>');};if(v.children.length){createTreeCell(v.id,v.children,((i+1)==len));}});var anchor=EWS.Anchor.get("Order_"+this.config.id);if(anchor==null){var pageNum=1;}else{var pageNum=parseInt(anchor.split(",")[1]);if(this.config.styleId==4||this.config.styleId==3){$('#c_'+this.config.catalogID).find('a')[0].className='active';var obj=$('#c_'+this.config.catalogID).parent();obj.css('display','block');var pr=obj.parent().parent();if(pr[0].tagName=='UL'&&pr[0].className!='waresort_first'){pr.css('display','block');}}};this.getProduct(pageNum);};var createTreeCell=function(pId,data,flag){var len=data.length;var obj=$('#'+_this.config.id+'_Catalog').find('#c_'+pId);var ul=obj.find('ul');if(ul.length==0){ul=$('<ul style="display:none"></ul>');obj.append(ul);}for(var i=0;i<len;i++){var v=data[i];var li='';if(_this.config.styleId==3){if((i+1)==len){var cls=flag?'class="dashed4"':'';li='<li id="c_'+v.id+'" '+cls+'><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>';}else{li='<li id="c_'+v.id+'"><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>';}}else{li='<li id="c_'+v.id+'"><a hidefocus="true" href="javascript:Order_'+_this.config.id+'.setCatalogB(\''+v.id+'\');" title="'+v.name+'">'+v.name+'</a></li>';};ul.append(li);if(v.children.length){createTreeCell(v.id,v.children);}};};$.ajax({url:"/EWS_Interface/Order_ListAllCatalog.aspx",type:'get',data:{CID:this.config.cid},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result.tree[0].children);}});};EWS.Order.GetCatalogProductList.prototype.setCatalog=function(parentID,number){if(number!='0'||number!=0){$('#'+this.config.id+'_Catalog').html('数据加载中......');EWS.Anchor.set("Order_"+this.config.id,parentID+",1");this.getCatalog(parentID);}else{var obj=$('#'+this.config.id+'_Catalog');obj.find('.active').removeClass('active');$('#'+this.config.id+'_Catalog').find('a[key = '+parentID+']').addClass('active');this.config.catalogID=parentID;this.getProduct(1);}};EWS.Order.GetCatalogProductList.prototype.setCatalogB=function(parentID){var obj=$('#'+this.config.id+'_Catalog');obj.find('.active').removeClass();obj.find('#c_'+parentID+'>a').addClass('active');var ul=obj.find('#c_'+parentID+'>ul');EWS.Anchor.set("Order_"+this.config.id,parentID+",1");if(ul.length){if(this.config.styleId==3){var parent=$('#c_'+parentID);if(ul[0].style.display=='none'){var flag=(parent.attr('key')=='waresort_last2');if(flag){parent.removeClass();}ul.css('display','block');}else{var flag=(parent.attr('key')=='waresort_last2');if(flag){parent.addClass('waresort_last2');}ul.css('display','none');}}else{if(ul[0].style.display=='none'){ul.css('display','block');}else{ul.css('display','none');}}}this.config.catalogID=parentID;this.getProduct(1);};EWS.Order.GetCatalogProductList.prototype.getProduct=function(pageNum){var _get_success=function(result){var parent=$('#'+this.config.id+'_Product');if(parseInt(result.pageTotal)==0){parent.html("没有找到相关的产品信息！");return;};var pageTotal=Math.ceil(parseInt(result.totalCount)/this.config.pageItem)||0;if(parseInt(pageTotal)<pageNum){this.jumpPage(pageTotal,pageNum,pageTotal);return;};var imgList=[];var _this=this;var appId='Order_'+_this.config.id;parent.html("");var ul=[];var pLen=result.Product.length;var p=result.MoneyType;p=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));$.each(result.Product,function(i,v){var newId=_this.config.id+"_"+parseInt(_this.config.id).toString(36)+"_"+i;imgList.push({src:v.Img?v.Img:'http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png',id:newId});if(_this.config.rowItem==1){ul=[];}else{if((i+1)%_this.config.rowItem==1){ul=[];};};var action='javascript:'+appId+'.showDetial(\''+v.ID+'\',\''+v.Name+'\');';var style="margin-right:"+_this.config.sBetween+"px";if((i+1)%_this.config.rowItem==0||(i+1)==pLen){style='';};var ulCls='';switch(_this.config.styleId){case 5:case 6:case 1:var li='<li class="ord_part'+_this.config.styleId+'" style='+style+'>'+'<ul>'+'<li>'+'<a class="size" href="'+action+'">'+'<img id="'+newId+'" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" height="127" width="128"/>'+'</a>'+'</li>'+'<li>'+'<span>'+p+'&nbsp;'+v.UnitPrice+'</span>'+'<button class="buy" title="购买" onclick="'+appId+'.setShoppingCar(\''+v.ID+'\');'+appId+'.showShoppingCar();">购买</button>'+'<a href="'+action+'" class="detail" title="详细内容">详细内容</a>'+'</li>'+'<li>'+'<strong><a hidefocus="true" href="'+action+'" title='+v.Name+'>'+v.Name+'</a></strong>'+'</li>'+'</ul>'+'</li>';break;case 2:var li='<li style='+style+'><a class="size" href="'+action+'"><img id="'+newId+'" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" height="111px" width="111px"/></a></li>';ulCls='ord_show2';break;case 3:var li='<li style='+style+'>'+'<div class="waresort_content"><a href="'+action+'"><img id="'+newId+'" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" height="112" width="113"/></a></div>'+'<div class="waresort_content2"><a hidefocus="true" href="'+action+'" title='+v.Name+' id="ext-gen674">'+v.Name+'</a><p>'+p+'&nbsp;'+v.UnitPrice+'</p></div>'+'</li>';break;case 4:var li='<li class="waresort_r_bg" style='+style+'>'+'<ul>'+'<li class="waresort_r_a"><a href="'+action+'"><img id="'+newId+'" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" height="150" width="150"/></a></li>'+'<li><a hidefocus="true" href="'+action+'">'+v.Name+'</a></li>'+'<li class="waresort_r_num"><span>编号：'+v.Sn+'</span><a title="详细内容"  href="'+action+'">详细内容</a></li>'+'<li class="waresort_r_pre" id="ext-gen681"><span>单价：'+p+'&nbsp;'+v.UnitPrice+'</span><a title="购物" href="javascript:'+appId+'.setShoppingCar(\''+v.ID+'\');'+appId+'.showShoppingCar();">购物</a></li>'+'</ul>'+'</li>';break;};ul.push(li);if((i+1)%_this.config.rowItem==0||(i+1)==pLen){$('<ul class="'+ulCls+'">'+ul.join("")+'</ul>').appendTo(parent);};});if(pLen==0){parent.append('<div class="noData">此分类没有商品！</div>');}if(_this.config.picSize&&(_this.config.picSize==2||_this.config.picSize=='2')){var size=[Number(_this.config.picsizeW),Number(_this.config.picsizeH)];}else{var size=_this.returnWidthHeight(_this.config.styleId);}new EWS.PreLoadImage({path:"",arrSrc:imgList,maxWidth:size[0],maxHeight:size[1],scope:this,success:function(obj){_this.setImage(obj);_this.setImageLayer(obj);}});if(this.config.styleId==2||this.config.styleId==3||this.config.styleId==4){this.setNavigation(pageNum,pageTotal,this.config.id,true);}else{this.setNavigation(pageNum,pageTotal);}};var _this=this;$.ajax({url:"/EWS_Interface/Order_ListProduct.aspx",type:'get',data:{CID:this.config.cid,ParentID:this.config.catalogID,PageItem:this.config.pageItem,PageNum:pageNum},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.showDetial=function(id,name){this.hideImgLayer();var appId='Order_'+this.config.id;this.config.pId=id;var _this=this;var scrollSize=EWS.GetPageScroll();var pageSize=EWS.GetPageSize();var target=$('#Product_'+this.config.id);var top=scrollSize.Y+20;var left=(pageSize.WinW-830)/2;var isExists=false;var _get_success=function(result){var arr=this.createProductDetailHtml2(this.config,result);var target=$('#Product_'+this.config.id);var target_detial=$("#Product_"+_this.config.id+" div.ord_detail");if(isExists){target_detial.html(arr[0]);new EWS.PreLoadImage({path:"",arrSrc:arr[1],maxWidth:55,maxHeight:56,scope:_this,success:_this.setDetialImage});return;};target.animate({top:top+'px',left:left+'px'},"normal").animate({width:'+830px'},"fast",function(){target_detial.html(arr[0]);new EWS.PreLoadImage({path:"",arrSrc:arr[1],maxWidth:55,maxHeight:56,scope:_this,success:_this.setDetialImage});});};var html='<div id="Product_'+this.config.id+'" class="ord_mdl ord_box">'+'<div class="ord_mdl_t">'+'<div class="ord_mdl_t_l"></div>'+'<div class="ord_mdl_t_r"></div>'+'<div class="ord_mdl_t_c"><h2>商品详细信息</h2></div>'+'<div class="ord_mdl_t_m"><a href="javascript:'+appId+'.hideDetial();" title="关闭">关闭</a></div>'+'</div>'+'<div class="ord_mdl_c ord_g_p_hide">'+'<div class="ord_mdl_c_l ord_g_p_fill"></div>'+'<div class="ord_mdl_c_r ord_g_p_fill"></div>'+'<div class="ord_mdl_c_c">'+'<div class="ord_detail">'+'<div class="ord_loading"><strong>'+name+'</strong> 详细信息读取中...</div>'+'</div>'+'</div>'+'</div>'+'<div class="ord_mdl_b">'+'<div class="ord_mdl_b_l"></div>'+'<div class="ord_mdl_b_r"></div>'+'<div class="ord_mdl_b_c"></div>'+'</div>'+'</div>';EWS.Order.layerIndex++;if(target.length==0){$(html).css({position:'absolute',width:350,'z-index':EWS.Order.layerIndex,top:((pageSize.WinH-100)/2)+scrollSize.Y,left:(pageSize.WinW-350)/2}).appendTo("body");}else{$('#Product_'+this.config.id+' div.ord_detail').html('<div class="ord_loading"><strong>'+name+'</strong> 详细信息读取中...</div>');isExists=true;};$.ajax({url:"/EWS_Interface/Order_ProductShow.aspx",type:'get',data:{ProductID:id},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.showDetialImage=function(id){var Sid=this.config.styleId;var size=this.returnWidthHeight('bigImg');var ProductImage=$("#Product_"+this.config.id+"_Img");var img=$("#"+id)[0];if($.browser.msie){var originalImg=new Image();originalImg.src=img.src;var originalWidth=originalImg.width;var originalHeight=originalImg.height;}else{var originalWidth=img.naturalWidth;var originalHeight=img.naturalHeight;};if(!size)size=[354,216];var scaleProduct=this.getImageScale(originalWidth,originalHeight,size[0],size[1]);ProductImage.attr({src:img.src});ProductImage.css({width:scaleProduct[0],height:scaleProduct[1],position:'relative',top:(size[1]-scaleProduct[1])/2});};EWS.Order.GetCatalogProductList.prototype.showProductImage=function(){window.open($("#Product_"+this.config.id+"_Img")[0].src);};EWS.Order.GetCatalogProductList.prototype.hideDetial=function(id){id?$("#"+id).remove():$("#Product_"+this.config.id).remove();};EWS.Order.GetCatalogProductList.prototype.setDetialImage=function(img){if(img.index==0){this.showDetialImage(img.id);};var originalImg=new Image();originalImg.src=img.src;var originalWidth=originalImg.width;var originalHeight=originalImg.height;var size=this.returnWidthHeight(true);var width=size[0];var height=size[1];var scale=this.getImageScale(originalWidth,originalHeight,width,height);$("#"+img.id).css({position:'relative',top:(height-scale[1])/2});};EWS.Order.GetCatalogProductList.prototype.setNavigation=function(pageNum,pageTotal,id,type){if(type){var parent=$("#"+id+" div.ord_mop_page");}else{var parent=id?$("#"+id+" div.ord_pages"):$("#"+this.config.id+" div.ord_page");}var pageGroup=5;var groupNum=parseInt((pageNum-1)/pageGroup)+1;var start=(groupNum-1)*pageGroup+1;var end=groupNum*pageGroup>pageTotal?pageTotal:groupNum*pageGroup;var nextGroupNum=start+pageGroup;nextGroupNum=nextGroupNum>pageTotal?pageTotal:nextGroupNum;var prevGroupNum=pageGroup*(groupNum-1);prevGroupNum=prevGroupNum<1?1:prevGroupNum;var nextNum=pageNum+1;nextNum=nextNum>pageTotal?pageTotal:nextNum;var prevNum=pageNum-1;prevNum=prevNum<1?1:prevNum;var nextGroup="javascript:Order_"+this.config.id+".jumpPage("+nextGroupNum+","+pageNum+","+pageTotal+");";var nextPage="javascript:Order_"+this.config.id+".jumpPage("+nextNum+","+pageNum+","+pageTotal+");";var nextText="第 "+nextGroupNum+" 页";var prevPage="javascript:Order_"+this.config.id+".jumpPage("+prevNum+","+pageNum+","+pageTotal+");";var prevGroup="javascript:Order_"+this.config.id+".jumpPage("+prevGroupNum+","+pageNum+","+pageTotal+");";var prevText="第 "+prevGroupNum+" 页";var html="<a href='"+prevGroup+"' class='first' title='"+prevText+"'>"+prevText+"</a>"+"<a href='"+prevPage+"' class='previous' title='上一页'>上一页</a>"+"{span}"+"<a href='"+nextPage+"' class='next' title='下一页'>下一页</a>"+"<a href='"+nextGroup+"' class='last' title='"+nextText+"'>"+nextText+"</a>";var span="<span>";for(var i=start;i<=end;i++){if(i<=9){var num="0"+i;}else{var num=i;};var href="javascript:Order_"+this.config.id+".jumpPage("+i+","+pageNum+","+pageTotal+");";if(i==pageNum){span+="<a href='"+href+"' class='status'><strong>"+num+"</strong></a>";}else{span+="<a href='"+href+"'>"+num+"</a>";};};span+="</span>";parent.html("");$(html.replace(/{span}/,span)).appendTo(parent);if(this.initLoad){this.initLoad=false;};};EWS.Order.GetCatalogProductList.prototype.jumpPage=function(jumpPage,pageNum,pageTotal){jumpPage=jumpPage>pageTotal?pageTotal:jumpPage;if(jumpPage==pageNum){return;};if(this.type){EWS.Anchor.set("Order_"+this.config.id,this.config.catalogID+","+jumpPage);if(this.type=='orders_showCatalogProduct'){this.getProductByPage(jumpPage);}else if(this.type=='orders_showMoreProduct'){this.moreProductGetData(jumpPage);}else if(this.type=='GetCatalogProductList'){this.getProduct(jumpPage);}else if(this.type=='orders_productSearch'||this.type=='orders_fullearch'){this.getLists(jumpPage);};}else{};};EWS.Order.GetCatalogProductList.prototype.setImageLayer=function(img){var src=img.src.split('/');if(src[src.length-1]!='noImg.png'){var _this=this;var target=$("#"+img.id);target.mouseover(function(event){img.x=event.pageX==null?event.clientX:event.pageX;img.y=event.pageY==null?event.clientY:event.pageY;_this.showImgLayer(img);});target.mouseout(function(event){_this.hideImgLayer(img);});};};EWS.Order.GetCatalogProductList.prototype.hideImgLayer=function(){$("#"+this.config.id+"_zoomPic").remove();};EWS.Order.GetCatalogProductList.prototype.getImageScale=function(originalWidth,originalHeight,maxWidth,maxHeight){var _CalculateScale=function(num1,num2){var Temp=num2/num1;if(Temp.length>1){return num2;}else{return parseFloat(Temp.toString().substring(0,4));};};if(maxWidth==maxHeight){if(originalWidth>originalHeight){var wScale=_CalculateScale(originalWidth,maxWidth);if(wScale<=1){newWidth=maxWidth;newHeight=wScale*originalHeight;}else{newHeight=originalWidth;newWidth=originalHeight;}}else if(originalWidth<originalHeight){var hScale=_CalculateScale(originalHeight,maxHeight);if(hScale<=1){newHeight=maxHeight;newWidth=hScale*originalWidth;}else{newHeight=originalHeight;newWidth=originalWidth;}}else{var wScale=_CalculateScale(originalWidth,maxWidth);if(wScale<=1){newHeight=originalWidth*wScale;newWidth=newHeight;}else{newHeight=originalWidth;newWidth=newHeight;}}}else if(maxWidth>maxHeight){if(originalWidth>originalHeight){var wScale=_CalculateScale(originalWidth,maxWidth);if(wScale<=1){if(originalHeight*wScale>maxHeight){newHeight=maxHeight;newWidth=_CalculateScale(originalHeight,maxHeight)*originalWidth;}else{newWidth=maxWidth;newHeight=originalHeight*wScale;}}else{newWidth=originalWidth;newHeight=originalHeight;}}else if(originalWidth==originalHeight){var wScale=_CalculateScale(originalWidth,maxWidth);if(wScale<=1){newHeight=maxHeight;newWidth=_CalculateScale(originalHeight,maxHeight)*originalWidth;}else{if(originalHeight>maxHeight){newWidth=_CalculateScale(originalHeight,maxHeight)*originalWidth;newHeight=_CalculateScale(originalHeight,maxHeight)*originalHeight;}else{newWidth=originalWidth;newHeight=originalHeight;}}}else{var hScale=_CalculateScale(originalHeight,maxHeight);if(hScale<=1){if(hScale*originalWidth>maxWidth){newWidth=maxWidth;newHeight=_CalculateScale(originalWidth,maxWidth)*originalHeight;}else{newWidth=hScale*originalWidth;newHeight=maxHeight;}}else{newWidth=originalWidth;newHeight=originalHeight;}}}else{if(originalWidth>=originalHeight){var wScale=_CalculateScale(originalWidth,maxWidth);if(wScale<=1){newWidth=wScale*originalWidth;newHeight=wScale*originalHeight;}else{newWidth=originalWidth;newHeight=originalHeight;}}else if(originalWidth<originalHeight){var hScale=_CalculateScale(originalHeight,maxHeight);if(hScale*originalWidth>maxWidth){newWidth=maxWidth;newHeight=_CalculateScale(originalWidth,maxWidth)*originalHeight;}else{newWidth=originalWidth*hScale;newHeight=originalHeight*hScale;}}}return[newWidth,newHeight];};EWS.Order.GetCatalogProductList.prototype.showImgLayer=function(img){var id=this.config.id+"_zoomPic";var div=$.find("#"+id);var maxWidth=531;var maxHeight=384;var pageSize=EWS.GetPageSize();var scrollSize=EWS.GetPageScroll();var scale=this.getImageScale(img.width,img.height,maxWidth,maxHeight);var x=img.x+50;var y=img.y+50;var maxX=pageSize.WinW+scrollSize.X;var originalX=scale[0]+x;x=maxX>=originalX?x:x-scale[0]-100;var maxY=pageSize.WinH+scrollSize.Y;var originalY=scale[1]+y;y=maxY>=originalY?y:y-(originalY-maxY)-50;if(div.length==0){var target=$('<div id="'+id+'" class="ord_zoomPic">'+'<img width="'+scale[0]+'" height="'+scale[1]+'" src="'+img.src+'" />'+'</div>').css({width:scale[0],height:scale[1],"z-index":1,top:y,left:x,display:'none'}).appendTo("body");target.fadeIn("fast");}else{$("#"+id).css({width:scale[0],height:scale[1],"z-index":1,top:y,left:x});};};EWS.Order.GetCatalogProductList.prototype.showShoppingCar=function(){var _this=this;var isExists=false;var scrollSize=EWS.GetPageScroll();var pageSize=EWS.GetPageSize();var target=$('#ShoppingCar_'+this.config.id);var top=scrollSize.Y+100;var left=(pageSize.WinW-830)/2;var appId='Order_'+this.config.id;var ProductID=$.cookie("EWS_ShopCar_"+this.config.cid);var idList=[];var loadHtml='<div class="ord_detail">'+'<div class="ord_loading"><strong>'+name+'</strong> 订单信息读取中...</div>'+'</div>';var html='<div id="ShoppingCar_'+this.config.id+'" class="ord_mdl ord_box">'+'<div class="ord_mdl_t">'+'<div class="ord_mdl_t_l"></div>'+'<div class="ord_mdl_t_r"></div>'+'<div class="ord_mdl_t_c"><h2>订单</h2></div>'+'<div class="ord_mdl_t_m"><a href="javascript:'+appId+'.hideShoppingCar();" title="关闭">关闭</a></div>'+'</div>'+'<div class="ord_mdl_c ord_g_p_hide">'+'<div class="ord_mdl_c_l ord_g_p_fill"></div>'+'<div class="ord_mdl_c_r ord_g_p_fill"></div>'+'<div class="ord_mdl_c_c">'+loadHtml+'</div>'+'</div>'+'<div class="ord_mdl_b">'+'<div class="ord_mdl_b_l"></div>'+'<div class="ord_mdl_b_r"></div>'+'<div class="ord_mdl_b_c"></div>'+'</div>'+'</div>';var _get_success=function(result){var dateTime=result.addtime;var p=result.moneytype;p=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));var info_id="EWS_ShopInfo_"+this.config.cid;var info=$.cookie(info_id);var input={'OrderInfo_Name':{name:'企业/个人',cls:'ord_info_input ord_info_error',tag:'input',type:'text',value:'企业/个人信息不能为空'},'OrderInfo_Tel':{name:'联系电话',cls:'ord_info_input ord_info_error',tag:'input',type:'text',value:'联系电话信息不能为空'},'OrderInfo_Email':{name:'电子邮箱',cls:'ord_info_input ord_info_error',tag:'input',type:'text',value:'电子邮箱信息不能为空'},'OrderInfo_Addr':{name:'联系地址',cls:'ord_info_input ord_info_error',tag:'input',type:'text',value:'联系地址信息不能为空'},'OrderInfo_Remarks':{name:'购物备注',cls:'ord_info_textarea',tag:'textarea',type:'text',value:''}};if(info!=null){var infoArr=$.evalJSON(info);$.each(infoArr,function(i,v){input[i].value=v;input[i].cls=input[i].cls.replace(/ ord_info_error/,"");});};var infoHTML=[];$.each(input,function(i,v){if(v.tag=='input'){infoHTML.push('<label for="'+i+'"><strong>'+v.name+'</strong>'+'<'+v.tag+' id="'+i+'" class="'+v.cls+'" type="'+v.type+'" value="'+v.value+'" onblur="'+appId+'.changeShoppingInfo(this);" onfocus="'+appId+'.focusShoppingInfo(this);" />'+'</label>');}else{infoHTML.push('<label for="'+i+'"><strong>'+v.name+'</strong>'+'<'+v.tag+' id="'+i+'" class="'+v.cls+'" type="'+v.type+'" onblur="'+appId+'.changeShoppingInfo(this);" onfocus="'+appId+'.focusShoppingInfo(this);">'+v.value+'</'+v.tag+'>'+'</label>');};});var html='<div class="ord_neworder">'+'<h3 class="ord_title">新购物订单：</h3>'+'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+'<tr>'+'<th class="order_time">下单时间</th>'+'<td class="order_no">'+result.addtime+'</td>'+'<th class="order_time">付款方式</th>'+'<td class="order_no">'+'<label for="pay">'+'<select id="Payment">'+'<option value="1">银行转帐</option>'+'<option value="2">货到付款</option>'+'<option value="3">其它</option>'+'</select>'+'</label>'+'</td>'+'<th class="order_time"></th>'+'<td class="order_no"></td>'+'<th class="order_time"></th>'+'<td class="order_no"></td>'+'</tr>'+'</table>'+'<div class="order_bor">'+'<table id="Product_'+_this.config.id+'_Table" width="100%" border="0" cellspacing="0" cellpadding="0">{data}</table>'+'</div>'+'{total}'+'<div class="ord_info">{info}</div>'+'<div class="ord_pht">'+'<div class="ord_video"><div id="Order_'+_this.config.id+'_Video"></div></div>'+'<div class="ord_noVideo" style="display:none;">'+'<div class="ord_tips"><strong></strong></div>'+'</div>'+'<div class="ord_checkbox">'+'<label for="'+_this.config.id+'_ShowCapture"><input type="checkbox" id="'+_this.config.id+'_ShowCapture" checked="checked" />我要视频签署</label>'+'</div>'+'<input type="hidden" id="'+_this.config.id+'_Capture" value="" />'+'<button class="ord_video_btn" title="视频签署" onclick="Order_'+_this.config.id+'.camCapture(this)">视频签署</button>'+'</div>'+'<div class="ord_line"></div>'+'<div class="ord_newOrd_loading" style="display:none"><img src="http://'+_this.config.htmlUrl+'/theme/order/img/indicator.gif" />订单数据提交中.......</div>'+'<button class="ord_order_btn" title="提交订单" onclick="'+appId+'.submitShopping();">提交订单</button>'+'</div>';var line='<tr>'+'<td height="1" colspan="12"><div class="ord_dashed1"></div></td>'+'</tr>';var infoLine='<div class="ord_dashed"></div>';var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);var amount={};if(car!=null){var valArr=$.evalJSON(car);$.each(valArr,function(i,v){amount[v.id]=parseInt(v.amount);});};var rLen=result.product.length;var totalPrice=0;var data=[];if(rLen>0){for(var i=0;i<rLen;i++){data.push('<tr id="Product_'+result.product[i].ID+'_Row" class="order_sta">'+'<th class="digi">'+(i+1)+'.</th>'+'<th>名称</th>'+'<td class="name"><a href="javascript:'+appId+'.showDetial(\''+result.product[i].ID+'\',\''+result.product[i].Name+'\');" title="'+result.product[i].Name+' 商品详细信息">'+result.product[i].Name+'</a></td>'+'<th>编号</th>'+'<td class="no">'+result.product[i].Sn+'</td>'+'<th>单价</th>'+'<td class="price" id="'+result.product[i].ID+'_UnitPrice">'+result.product[i].UnitPrice+'</td>'+'<th>数量</th>'+'<td class="amount">'+'<label for="amount"><input value="'+amount[result.product[i].ID]+'" onkeyup="'+appId+'.changeShoppingCar(this,\''+result.product[i].ID+'\');" /></label>'+'</td>'+'<th>总价</th>'+'<td class="total" id="'+result.product[i].ID+'_TotalPrice">'+parseFloat(result.product[i].UnitPrice)*parseInt(amount[result.product[i].ID])+'</td>'+'<td><a href="javascript:'+appId+'.delShoppingCar(\''+result.product[i].ID+'\');" title="删除 '+result.product[i].Name+'产品" class="ord_del">删除</a></td>'+'</tr>');totalPrice+=parseFloat(result.product[i].UnitPrice)*parseInt(amount[result.product[i].ID]);};html=html.replace(/{data}/,data.join(line));html=html.replace(/{total}/,'<div class="order_sum">总金额:'+p+'<span id="Order_'+_this.config.id+'_TotalPrice">'+totalPrice+'</span></div>');}else{html=html.replace(/{data}/,'<tr class="order_nodata">没有数据</tr>');html=html.replace(/{total}/,'');};html=html.replace(/{info}/,infoHTML.join(infoLine));var target=$('#ShoppingCar_'+this.config.id);var target_detial=$("#ShoppingCar_"+_this.config.id+" div.ord_mdl_c_c");if(isExists){target_detial.html(html);return;};target.animate({top:top+'px',left:left+'px'},"normal").animate({width:'+830px'},"fast",function(){target_detial.html(html);var flashvars={};flashvars.debug="false";flashvars.eventLinstener="Order_"+_this.config.id+".camEvent";var params={};params.wmode="opaque";params.allowscriptaccess="always";params.bgcolor="#989797";var attributes={};attributes.id="Order_"+_this.config.id+"_Cam";swfobject.embedSWF("http://"+_this.config.htmlUrl+"/theme/CameraCapture.swf",'Order_'+_this.config.id+'_Video',"320","240","9.0.0",false,flashvars,params,attributes);});};EWS.Order.layerIndex++;if(target.length==0){$(html).css({position:'absolute',width:350,'z-index':EWS.Order.layerIndex,top:((pageSize.WinH-100)/2)+scrollSize.Y,left:(pageSize.WinW-350)/2}).appendTo("body");}else{$('#ShoppingCar_'+this.config.id+' div.ord_mdl_c_c').html(loadHtml);isExists=true;};if(ProductID!=null){var data=$.evalJSON(ProductID);$.each(data,function(i,v){idList.push(v.id);});var id_value=idList.join(",");}else{var id_value='';};$.ajax({url:"/EWS_Interface/Order_ListShopCar.aspx",type:'get',data:{ProductID:id_value,CID:this.config.cid},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.hideShoppingCar=function(){$('#ShoppingCar_'+this.config.id).remove();};EWS.Order.GetCatalogProductList.prototype.setShoppingCar=function(productID,amount,override){var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);if(amount==undefined){amount=1;};if(override==undefined){override=false;};if(car==null){var data=[{'id':productID,'amount':amount}];var val=$.toJSON(data);}else{var result=true;var valArr=$.evalJSON(car);$.each(valArr,function(i,v){if(v.id==productID){if(override){valArr[i]={'id':productID,'amount':amount};};result=false;return false;};});if(result){valArr.push({'id':productID,'amount':amount});};var val=$.toJSON(valArr);};$.cookie(car_id,val);};EWS.Order.GetCatalogProductList.prototype.delShoppingCar=function(productID){var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);var _this=this;if(car!=null){var valArr=$.evalJSON(car);$.each(valArr,function(i,v){if(v.id==productID){valArr.splice(i,1);return false;};});if(valArr.length==0){$.cookie(car_id,null);}else{$.cookie(car_id,$.toJSON(valArr));};}else{return;};var target=$('#Product_'+productID+'_Row');target.fadeOut('normal',function(){var tr=target.next();if(tr.length>0){if(tr[0].nodeName=="TR"){tr.remove();};};target.remove();_this.setTotalPrice();if(valArr.length==0){$('#Product_'+_this.config.id+'_Table').append('<tr class="order_nodata"><td>没有找到相关的订单数据</td></tr>');};});};EWS.Order.GetCatalogProductList.prototype.changeShoppingCar=function(input,productID){var formatfloat=function(f,size){var tf=f*Math.pow(10,size);tf=Math.round(tf+0.000000001);tf=tf/Math.pow(10,size);return tf;};var amount=1;var unitPriceObj=$("#"+productID+'_UnitPrice');var unitPrice=parseFloat(unitPriceObj.html());var singlePriceObj=$("#"+productID+'_TotalPrice');if(input.value.length==0){input.value=amount;singlePriceObj.html(formatfloat(unitPrice*amount,2));this.setShoppingCar(productID,amount,true);return;};var regular=/^\d+$/;if(regular.test(input.value)==false){var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);var valArr=$.evalJSON(car);$.each(valArr,function(i,v){if(v.id==productID){amount=parseInt(v.amount);return false;};});input.value=amount;singlePriceObj.html(formatfloat(unitPrice*amount,2));return;};amount=parseInt(input.value);singlePriceObj.html(formatfloat(unitPrice*amount,2));this.setTotalPrice();this.setShoppingCar(productID,amount,true);};EWS.Order.GetCatalogProductList.prototype.setTotalPrice=function(){var totalPrice=0;var obj=$("#Product_"+this.config.id+"_Table td.total");if(obj.length>0){$.each(obj,function(i,v){totalPrice+=parseFloat(v.innerHTML);});$("#Order_"+this.config.id+"_TotalPrice").html(totalPrice);}else{$("#ShoppingCar_"+this.config.id+" div.order_sum").remove();};};EWS.Order.GetCatalogProductList.prototype.changeShoppingInfo=function(input){var errorInfo={'OrderInfo_Name':['企业/个人信息不能为空',100],"OrderInfo_Tel":['联系电话信息不能为空',100],"OrderInfo_Email":['电子邮箱信息不能为空',100],"OrderInfo_Addr":['联系地址信息不能为空',200],"OrderInfo_Remarks":['',500]};var input=$("#"+input.id)[0];var input_value=$.trim(input.value);if(input_value.length==0&&input.id!='OrderInfo_Remarks'){input.value=errorInfo[input.id][0];input.className='ord_info_input ord_info_error';return;};if(EWS.LenB(input_value)>errorInfo[input.id][1]){input_value=EWS.MidB(input_value,0,errorInfo[input.id][1]);};input.value=input_value;if(input.id=='OrderInfo_Remarks'){input.className='ord_info_textarea';}else{input.className='ord_info_input';};var info_id="EWS_ShopInfo_"+this.config.cid;var info=$.cookie(info_id);if(info!=null){var valArr=$.evalJSON(info);}else{var valArr={};};valArr[input.id]=input_value;$.cookie(info_id,$.toJSON(valArr));};EWS.Order.GetCatalogProductList.prototype.focusShoppingInfo=function(input){if(input.id=='OrderInfo_Remarks'){input.className='ord_info_textarea';}else{if(input.className=='ord_info_input ord_info_error'){input.value='';input.className='ord_info_input';};};};EWS.Order.GetCatalogProductList.prototype.submitShopping=function(){var checkOk=true;var inputList=['OrderInfo_Name',"OrderInfo_Tel","OrderInfo_Email","OrderInfo_Addr","OrderInfo_Remarks"];$.each(inputList,function(i,v){var input=$("#"+v)[0];if(input.className=='ord_info_input ord_info_error'){checkOk=false;return false;};});var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);if(car==null){checkOk=false;};var IsCapture=$("#"+this.config.id+"_Capture").val();var ShowCaputre=$("#"+this.config.id+"_ShowCapture")[0].checked;if(IsCapture==''&&ShowCaputre){alert("您已经选择视频签署，请点击视频签署拍照后再提交订单，谢谢！");checkOk=false;};if(checkOk){if(ShowCaputre){var cam=swfobject.getObjectById("Order_"+this.config.id+"_Cam");cam.captureCamra("cid="+this.config.cid,"http://"+this.config.fileUrl+"/Order_uploadImg.aspx");}else{this.submitFormData('');};$("#ShoppingCar_"+this.config.id+" button.ord_order_btn").attr({"disabled":"disabled"});$("#ShoppingCar_"+this.config.id+" div.ord_newOrd_loading").css({'display':'inline'});};};EWS.Order.GetCatalogProductList.prototype.submitFormData=function(picURL){var Payment_val=1;$.each($("#Payment").find("option"),function(i,v){if(v.selected){Payment_val=v.value;return false;};});var ProductData=[];var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);var valArr=$.evalJSON(car);$.each(valArr,function(i,v){ProductData.push([v.id,v.amount]);});var data={CID:this.config.cid,Payment:Payment_val,OwnerName:$.trim($("#OrderInfo_Name").val()),Phone:$.trim($("#OrderInfo_Tel").val()),Email:$.trim($("#OrderInfo_Email").val()),Address:$.trim($("#OrderInfo_Addr").val()),Memo:$("#OrderInfo_Remarks").val(),Pic:picURL,Product:ProductData};var _this=this;$.post('/EWS_Interface/Order_ShopCarSave.aspx',{'data':$.toJSON(data)},function(result){var scrollSize=EWS.GetPageScroll();var pageSize=EWS.GetPageSize();var target=$('#ShoppingCar_'+_this.config.id);var top=scrollSize.Y+100;var left=(pageSize.WinW-830)/2;var targetContent=$("#ShoppingCar_"+_this.config.id+" div.ord_mdl_c_c");targetContent.html('');left=left>300?100:left;$("#ShoppingCar_"+_this.config.id+" div.ord_mdl_c_c").html('<div class="ord_detail">'+'<div class="order_inputsc" style="text-align:center;padding:28px;">'+'<img src="http://'+_this.config.htmlUrl+'/theme/order/img/inputsc.png" style="width:38px;height:27px;margin-left:-96px;*margin-left:-66px;" />'+'<h3 style="margin-top:-20px;color:#74823D;font-size:17px;margin-left:30px;">提交成功!</h3>'+'<p style="font-size:14px;font-family:宋体;">您本次的订单编号为:<span style="color:#f00;font-size:16px;padding-left:8px;">'+result+'</span></p>'+'<p style="padding-left:25px;font-size:14px;">请保留以便查询本次订单的跟进状态。</p>'+'</div>'+'</div>');var car_id="EWS_ShopCar_"+_this.config.cid;$.cookie(car_id,null);});};EWS.Order.GetCatalogProductList.prototype.camEvent=function(event){switch(event.type){case"camera_init":break;case"camera_not_found":$("#ShoppingCar_"+this.config.id+" div.ord_noVideo").css({"display":'inline'});$("#ShoppingCar_"+this.config.id+" div.ord_noVideo strong").html('没有检测到视频，请重试一次');$("#"+this.config.id+"_ShowCapture")[0].checked=false;break;case"camera_muted":alert('检测到视频被禁用，请重试一次');$("#"+this.config.id+"_ShowCapture")[0].checked=false;break;case"upload_complete":this.submitFormData("http://"+this.config.fileUrl+'/'+this.config.cid+'/'+event.data);break;case"upload_io_error":alert("视频签署操作失败，操作代码为："+event.data+",请与系统管理员联系！");break;};};EWS.Order.GetCatalogProductList.prototype.camCapture=function(btn){if($("#"+this.config.id+"_ShowCapture")[0].checked==false){return;};var cam=swfobject.getObjectById("Order_"+this.config.id+"_Cam");cam.pauseCamra();var _this=this;btn.innerHTML='重置镜头';btn.title='重置镜头';btn.onclick=function(){_this.camReset(btn);};$("#"+this.config.id+"_Capture").val("1");};EWS.Order.GetCatalogProductList.prototype.camReset=function(btn){if($("#"+this.config.id+"_ShowCapture")[0].checked==false){return;};var cam=swfobject.getObjectById("Order_"+this.config.id+"_Cam");cam.playCamra();var _this=this;btn.innerHTML='视频签署';btn.title='视频签署';btn.onclick=function(){_this.camCapture(btn);};$("#"+this.config.id+"_Capture").val("");};function createInheritance(parent,child){var property;for(property in parent){if(!child[property]){child[property]=parent[property];};};};EWS.Order.GetProductDetail=function(obj){this.type='GetProductDetail';var _this=this;this.config=obj;var _get_success=function(result){var arr="";var size=this.returnWidthHeight(true);var width=size[0];var height=size[1];if(!obj.styleId||obj.styleId==1){arr=this.createProductDetailHtml(obj,result);}else if(obj.styleId==2){arr=this.createProductDetailHtml2(obj,result);}else{arr=this.createProductDetailHtml3(obj,result);};$("#"+obj.id).html(arr[0]);new EWS.PreLoadImage({path:"",arrSrc:arr[1],maxWidth:width,maxHeight:height,scope:_this,success:_this.setDetialImage});};$.ajax({url:"/EWS_Interface/Order_ProductShow.aspx",type:'get',data:{ProductID:obj.pId},cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.setThisStyle=function(obj){if(this.type=='GetProductDetail'){var cls=this.config.styleId==2?'li_active':'li_active2';}else{var cls='li_active';}$(obj).parent().parent().find('.'+cls).removeClass();$(obj).parent().addClass(cls);};EWS.Order.GetProductDetail.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.GetCatalogProductList.prototype.createProductDetailHtml=function(obj,result){var p=result.MoneyType;if(p!='')p=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));var appId='Order_'+obj.id;var imgList=[];var pic='';var PicLen=result.Pic.length;for(var i=0;i<6;i++){if(i<PicLen){var newId=obj.id+'_Detial_'+i;imgList.push({src:result.Pic[i].Img?result.Pic[i].Img:'http://'+this.config.htmlUrl+'/theme/order/img/noImg.png',id:newId});pic+='<li><a href="javascript:'+appId+'.showDetialImage(\''+newId+'\');" title="'+result.Pic[i].Name+'">'+'<img id="'+newId+'" '+'src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png" '+'alt="'+result.Pic[i].Name+'" width="80" height="80" />'+'</a><span>'+result.Pic[i].Name+'</span></li>';}else{pic+='<li><img src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  width="84" height="84" title="暂无图片"/></li>';};};var style="style=display:"+(result.Name?"block":"none");var html='<div id=Pro_'+obj.pId+'  class="ord_picshow">'+'<div class="ord_big">'+'<a href="javascript:'+appId+'.showProductImage();">'+'<img id="Product_'+obj.id+'_Img"'+' src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"'+' style="position:relative; top:36px;" alt="'+result.Name+'" />'+'</a>'+'</div>'+'<ul class="ord_small">'+pic+'</ul>'+'</div>'+'<div class="ord_dashed"></div>'+'<div class="ord_prd_info">'+'<span class="title" title="商品名称"><strong>商品名称：'+result.Name+'</strong></span>'+'<button '+style+' class="ord_buy" onclick="'+appId+'.setShoppingCar(\''+obj.pId+'\');'+appId+'.showShoppingCar();">购买</button>'+'<span class="ord_price" title="单价">单价：<strong>'+p+result.UnitPrice+'</strong></span>'+'<div class="ord_dashed"></div>'+'<div class="ord_msg">'+'<div class="ord_msg_title">商品详细信息介绍</div>'+'<div>'+result.Intro+'</div>'+'</div>'+'</div>';return[html,imgList];};EWS.Order.GetCatalogProductList.prototype.createProductDetailHtml2=function(obj,result){var p=result.MoneyType;if(p!='')p=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));var appId='Order_'+obj.id;var imgList=[];var pic='';var PicLen=result.Pic.length;for(var i=0;i<6;i++){var cls="";if(i<PicLen){cls=i==0?"class = 'li_active'":"";var newId=obj.id+'_Detial_'+i;imgList.push({src:result.Pic[i].Img?result.Pic[i].Img:'http://'+this.config.htmlUrl+'/theme/order/img/noImg.png',id:newId});pic+='<li '+cls+'>'+'<img id="'+newId+'" '+'src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png" '+'alt="'+result.Pic[i].Name+'" width="62" height="56"  onclick="'+appId+'.showDetialImage(\''+newId+'\');'+appId+'.setThisStyle(this)" title="'+result.Pic[i].Name+'" class="hasImg"/>'+'</li>';}else{pic+='<li '+cls+'><img src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  width="62" height="56" title="暂无图片"/></li>';};};var style="style=display:"+(result.Name?"block":"none");var html='<div class="ord_picshow_title"><strong>'+result.Name+'</strong></div>'+'<div class="ord_picshow">'+'<div class="ord_big2">'+'<a href="javascript:'+appId+'.showProductImage();">'+'<img id="Product_'+obj.id+'_Img"'+' src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"'+' style="position:relative; top:36px;" alt="'+result.Name+'" />'+'</a>'+'</div>'+'<div class="ord_prd_info2">'+'<span title="单价" class="ord_price">'+'单价：<strong>'+p+result.UnitPrice+'</strong>'+'</span>'+'<div class="ord_line2"><div class="icon"/><div class="line"/></div>'+'<p title="'+result.Name+'" class="title"><strong>'+result.Name+'</strong></p>'+'<p>商品编号:'+result.Sn+'</p>';if(this.IsShowCategory()){html+='<p>所属分类:'+result.Category+'</p>';}if(this.IsShowTag()){html+='<p>标签:'+result.Tag+'</p>';}html+='</div>'+'<ul class="ord_small2">'+pic+'</ul>'+'<button  '+style+' class="ord_add" onclick="'+appId+'.setShoppingCar(\''+obj.pId+'\');'+appId+'.showShoppingCar();" >购 买</button>'+'</div>'+'<div class="ord_line2"><div class="icon"/><div class="line"/></div>'+'<div class="ord_msg">'+'<div class="ord_msg_title">商品详细信息介绍</div>'+'<div>'+result.Intro+'</div>'+'</div>';return[html,imgList];};EWS.Order.GetCatalogProductList.prototype.createProductDetailHtml3=function(obj,result){var p=result.MoneyType;if(p!=''){p=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));}var appId='Order_'+obj.id;var imgList=[];var pic='';var PicLen=result.Pic.length;for(var i=0;i<6;i++){var cls="";if(i<PicLen){cls=i==0?"class = 'li_active2'":"";var newId=obj.id+'_Detial_'+i;imgList.push({src:result.Pic[i].Img?result.Pic[i].Img:'http://'+this.config.htmlUrl+'/theme/order/img/noImg.png',id:newId});pic+='<li '+cls+'>'+'<img id="'+newId+'" '+'src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png" '+'alt="'+result.Pic[i].Name+'" width="49" height="40" onclick="'+appId+'.showDetialImage(\''+newId+'\');'+appId+'.setThisStyle(this)"  class="hasImg"/>'+'</li>';}else{pic+='<li '+cls+'><img src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  width="49" height="40" title="暂无图片"/></li>';};};var style="style=display:"+(result.Name?"block":"none");var html='<div class="ord_picshow_title"><strong>'+result.Name+'</strong></div>'+'<div class="ord_picshow">'+'<div class="ord_big2">'+'<a href="javascript:'+appId+'.showProductImage();">'+'<img id="Product_'+obj.id+'_Img"'+' src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"'+' style="position:relative; top:36px;"  alt="'+result.Name+'" />'+'</a>'+'</div>'+'<ul class="ord_small3">'+pic+'</ul>'+'<div class="ord_prd_info2 ord_prd_info3">'+'<p title="'+result.Name+'" class="title"><strong>名称：'+result.Name+'</strong></p>'+'<span title="单价" class="ord_price">'+'<strong>'+p+result.UnitPrice+'</strong>'+'</span>'+'<div class="ord_line3"/>'+'<p>商品编号:'+result.Sn+'</p>';if(this.IsShowCategory()){html+='<p>所属分类:'+result.Category+'</p>';}if(this.IsShowTag()){html+='<p>标签:'+result.Tag+'</p>';}html+='</div>'+'<button '+style+' class="ord_add" onclick="'+appId+'.setShoppingCar(\''+obj.pId+'\');'+appId+'.showShoppingCar();" >购 买</button>'+'</div>'+'<div class="ord_msg">'+'<div class="ord_msg_title">商品详细信息介绍</div>'+'<div class="ord_msg_con">'+result.Intro+'</div>'+'</div>';return[html,imgList];};EWS.Order.GetCatalogProductList.prototype.IsShowCategory=function(){var result=true;if(EWS.Order.Category){if(typeof EWS.Order.Category=='object'){var len=EWS.Order.Category.length;for(var i=0;i<len;i++){if(EWS.Order.Category[i]==this.config.id){result=false;break;}}}else if(typeof EWS.Order.Category=='boolean'){result=false;}}return result;};EWS.Order.GetCatalogProductList.prototype.IsShowTag=function(){var result=true;if(EWS.Order.Tag){if(typeof EWS.Order.Tag=='object'){var len=EWS.Order.Tag.length;for(var i=0;i<len;i++){if(EWS.Order.Tag[i]==this.config.id){result=false;break;}}}else if(typeof EWS.Order.Tag=='boolean'){result=false;}}return result;};EWS.Order.SearchOrder=function(obj){this.type='SearchOrder';this.config=obj;var ord=$("#"+this.config.id).find('input[name="order"]');this.inputValidate(ord,'请输入订单号');};EWS.Order.SearchOrder.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.SearchOrder.prototype.searchOrderByName=function(cmpId){var input=$.trim($("#"+cmpId).find('input[name="order"]').val());if(input&&input!='请输入订单号'){this.config.searchValue=input;this.createOrderListBody();};};EWS.Order.SearchOrder.prototype.createOrderListBody=function(){var _this=this;var isExists=false;var scrollSize=EWS.GetPageScroll();var pageSize=EWS.GetPageSize();var target=$('#ShoppingCar_'+this.config.id);var top=scrollSize.Y+150;var left=(pageSize.WinW-830)/2;var appId='Order_'+this.config.id;var idList=[];var formatfloat=function(f,size){var tf=f*Math.pow(10,size);tf=Math.round(tf+0.000000001);tf=tf/Math.pow(10,size);return tf;};var loadHtml='<div class="ord_detail">'+'<div class="ord_loading"><strong>'+name+'</strong> 订单信息读取中...</div>'+'</div>';var html='<div id="ShoppingCar_'+this.config.id+'" class="ord_mdl ord_box">'+'<div class="ord_mdl_t">'+'<div class="ord_mdl_t_l"></div>'+'<div class="ord_mdl_t_r"></div>'+'<div class="ord_mdl_t_c"><h2>查找订单</h2></div>'+'<div class="ord_mdl_t_m"><a href="javascript:'+appId+'.hideShoppingCar();" title="关闭">关闭</a></div>'+'</div>'+'<div class="ord_mdl_c ord_g_p_hide">'+'<div class="ord_mdl_c_l ord_g_p_fill"></div>'+'<div class="ord_mdl_c_r ord_g_p_fill"></div>'+'<div class="ord_mdl_c_c">'+loadHtml+'</div>'+'</div>'+'<div class="ord_mdl_b">'+'<div class="ord_mdl_b_l"></div>'+'<div class="ord_mdl_b_r"></div>'+'<div class="ord_mdl_b_c"></div>'+'</div>'+'</div>';var _get_success=function(result){var orderDetail=result.Order[0];var orderProductList=result.OrderDetial;var input={'OrderInfo_Member':{name:'会员账号',cls:'ord_info_p',tag:'p',type:'text',value:orderDetail.Account?orderDetail.Account:''},'OrderInfo_Name':{name:'企业/个人',cls:'ord_info_p'+(orderDetail.OwnerName=='企业/个人信息不能为空'?'ord_info_error':''),tag:'p',type:'text',value:orderDetail.OwnerName},'OrderInfo_Tel':{name:'联系电话',cls:'ord_info_p'+(orderDetail.Phone=='联系电话信息不能为空'?'ord_info_error':''),tag:'p',type:'text',value:orderDetail.Phone},'OrderInfo_Email':{name:'电子邮箱',cls:'ord_info_p'+(orderDetail.Email=='电子邮箱信息不能为空'?'ord_info_error':''),tag:'p',type:'text',value:orderDetail.Email},'OrderInfo_Addr':{name:'联系地址',cls:'ord_info_p'+(orderDetail.Address=='联系地址信息不能为空'?'ord_info_error':''),tag:'p',type:'text',value:orderDetail.Address},'OrderInfo_Remarks':{name:'购物备注',cls:'ord_info_p',tag:'p',type:'text',value:orderDetail.Memo.replace(/\s/g,"&nbsp;")}};var infoHTML=[];$.each(input,function(i,v){if(v.tag=='input'){infoHTML.push('<label for="'+i+'"><strong>'+v.name+'</strong>'+'<'+v.tag+' id="'+i+'" class="'+v.cls+'" type="'+v.type+'" value="'+v.value+'" onblur="'+appId+'.changeShoppingInfo(this);" onfocus="'+appId+'.focusShoppingInfo(this);" />'+'</label>');}else{infoHTML.push('<label for="'+i+'"><strong>'+v.name+'</strong>'+'<'+v.tag+' id="'+i+'" class="'+v.cls+'" type="'+v.type+'" onblur="'+appId+'.changeShoppingInfo(this);" onfocus="'+appId+'.focusShoppingInfo(this);">'+v.value+'</'+v.tag+'>'+'</label>');};});var Payment=orderDetail.Payment==1?'银行转帐':(orderDetail.Payment==2?'货到付款':'其它');var cls=orderDetail.Pic?'ord_video':'ord_noVideo';var html='<div class="ord_neworder">'+'<table width="100%" border="0" cellspacing="0" cellpadding="0">'+'<tr>'+'<th class="order_time">下单时间</th>'+'<td class="order_no">'+orderDetail.CreatedDate+'</td>'+'<th class="order_time">付款方式</th>'+'<td class="order_no" id="Payment">'+Payment+'</td>'+'<th class="order_time"></th>'+'<td class="order_no"></td>'+'<th class="order_time"></th>'+'<td class="order_no"></td>'+'</tr>'+'</table>'+'<div class="order_bor">'+'<table id="Product_'+_this.config.id+'_Table" width="100%" border="0" cellspacing="0" cellpadding="0">{data}</table>'+'</div>'+'{total}'+'<div class="ord_info">{info}</div>'+'<div class="ord_pht">'+'<div class="'+cls+'"><img src='+orderDetail.Pic+' alt="企业/个人相片" /></div>'+'</div>'+'<div class="ord_line"></div>'+'<div class="ord_newOrd_loading" style="display:none"><img src="http://'+_this.config.htmlUrl+'/theme/order/img/indicator.gif" />订单数据提交中.......</div>'+'</div>';var line='<tr>'+'<td height="1" colspan="12"><div class="ord_dashed1"></div></td>'+'</tr>';var infoLine='<div class="ord_dashed"></div>';var car_id="EWS_ShopCar_"+this.config.cid;var car=$.cookie(car_id);var amount={};if(car!=null){var valArr=$.evalJSON(car);$.each(valArr,function(i,v){amount[v.id]=parseInt(v.amount);});};var rLen=orderProductList.length;var totalPrice=0;var data=[];if(rLen>0){for(var i=0;i<rLen;i++){data.push('<tr id="Product_'+orderProductList[i].ProductId+'_Row" class="order_sta">'+'<th class="digi">1.</th>'+'<th>名称</th>'+'<td class="name"><a href="javascript:'+appId+'.showDetial(\''+orderProductList[i].ProductId+'\',\''+orderProductList[i].ProductName+'\');" title="'+orderProductList[i].ProductName+' 商品详细信息">'+orderProductList[i].ProductName+'</a></td>'+'<th>编号</th>'+'<td class="no">'+orderProductList[i].ProductSN+'</td>'+'<th>单价</th>'+'<td class="price" id="'+orderProductList[i].ProductId+'_UnitPrice">'+orderProductList[i].UnitPrice+'</td>'+'<th>数量</th>'+'<td class="amount">'+'<label for="amount">'+orderProductList[i].Amount+'</label>'+'</td>'+'<th>总价</th>'+'<td class="total" id="'+orderProductList[i].ProductId+'_TotalPrice">'+formatfloat(parseFloat(orderProductList[i].UnitPrice)*parseInt(orderProductList[i].Amount),2)+'</td>'+'</tr>');totalPrice+=formatfloat(parseFloat(orderProductList[i].UnitPrice)*parseInt(orderProductList[i].Amount),2);};html=html.replace(/{data}/,data.join(line));html=html.replace(/{total}/,'<div class="order_sum">总金额:￥<span id="Order_'+_this.config.id+'_TotalPrice">'+totalPrice+'</span></div>');}else{html=html.replace(/{data}/,'<tr class="order_nodata">没有数据</tr>');html=html.replace(/{total}/,'');};html=html.replace(/{info}/,infoHTML.join(infoLine));var target=$('#ShoppingCar_'+this.config.id);var target_detial=$("#ShoppingCar_"+_this.config.id+" div.ord_mdl_c_c");if(isExists){target_detial.html(html);return;};target.animate({top:top+'px',left:left+'px'},"normal").animate({width:'+830px'},"fast",function(){target_detial.html(html);var flashvars={};flashvars.debug="false";flashvars.eventLinstener="Order_"+_this.config.id+".camEvent";var params={};params.wmode="opaque";params.allowscriptaccess="always";params.bgcolor="#989797";var attributes={};attributes.id="Order_"+_this.config.id+"_Cam";swfobject.embedSWF("http://"+_this.config.htmlUrl+"/theme/CameraCapture.swf",'Order_'+_this.config.id+'_Video',"320","240","9.0.0",false,flashvars,params,attributes);});};EWS.Order.layerIndex++;if(target.length==0){$(html).css({position:'absolute',width:350,'z-index':EWS.Order.layerIndex,top:((pageSize.WinH-100)/2)+scrollSize.Y,left:(pageSize.WinW-350)/2}).appendTo("body");}else{$('#ShoppingCar_'+this.config.id+' div.ord_mdl_c_c').html(loadHtml);isExists=true;};$.ajax({url:"/EWS_Interface/Order_GetOrder.aspx",type:'get',data:{CID:this.config.cid,OrderID:this.config.searchValue},cache:false,dataType:'json',success:function(result){if(result.Order.length){_get_success.call(_this,result);}else{var obj=$('#ShoppingCar_'+_this.config.id);obj.css({'width':'850px','left':left});obj.find('.ord_loading').html('没有此订单！');};}});};EWS.Order.GetCatalogProductList.prototype.inputValidate=function(obj,tips){obj.bind('click',function(){if(this.value==tips){this.className="";this.value="";};}).bind('blur',function(){if($.trim(this.value)==""){this.className="ord_info_error";this.value=tips;};}).val(tips);};EWS.Order.orders_productSearch=function(json){this.type='orders_productSearch';this.config=json;var pro=$("#"+this.config.id).find('input[name="product"]');this.inputValidate(pro,'请输入商品名称');};EWS.Order.orders_productSearch.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_productSearch.prototype.searchPro=function(cmpId){var input=$.trim($("#"+cmpId).find('input[name="product"]').val());if(input&&input!='请输入商品名称'){this.config.searchValue=input;this.createProductListBody(1);};};EWS.Order.orders_productSearch.prototype.createProductListBody=function(pageNum,Category){var _this=this;var _get_success=function(result){this.hideImgLayer();var appId='Order_'+this.config.id;var _this=this;var scrollSize=EWS.GetPageScroll();var pageSize=EWS.GetPageSize();var top=scrollSize.Y+20;var left=(pageSize.WinW-830)/2;var isExists=false;var id='ProductSearch_'+this.config.id;var html='<div id="ProductSearch_'+this.config.id+'" class="ord_mdl ord_box">'+'<div class="ord_mdl_t">'+'<div class="ord_mdl_t_l"></div>'+'<div class="ord_mdl_t_r"></div>'+'<div class="ord_mdl_t_c"><h2>查找商品</h2></div>'+'<div class="ord_mdl_t_m"><a href="javascript:'+appId+'.hideDetial(\''+id+'\');" title="关闭">关闭</a></div>'+'</div>'+'<div class="ord_mdl_c ord_g_p_hide">'+'<div class="ord_mdl_c_l ord_g_p_fill"></div>'+'<div class="ord_mdl_c_r ord_g_p_fill"></div>'+'<div class="ord_mdl_c_c">'+'<div class="ord_product padding">'+'</div>'+'</div>'+'</div>'+'<div class="ord_mdl_b">'+'<div class="ord_mdl_b_l"></div>'+'<div class="ord_mdl_b_r"></div>'+'<div class="ord_mdl_b_c"></div>'+'</div>'+'</div>';EWS.Order.layerIndex++;if($("#"+id).length==0){$('body').append(html);$(html).animate({top:top+'px',left:left+'px'},"normal").animate({width:'+830px'},"fast",function(){});$('#ProductSearch_'+this.config.id).attr({'style':"position:absolute;left:"+left+"px;top:"+top+"px;z-index:"+EWS.Order.layerIndex});};var target=$('#ProductSearch_'+this.config.id);var parent=target.find('.ord_product');parent.html("");this.searchProductHtml(result,parent);parent.prepend('<h3 class="ord_title">符合 '+this.config.searchValue+' 共有<strong class="amount">'+(result.totalCount)+'</strong>个商品：</h3>');$("<div class='ord_mop_page'></div>").appendTo(parent);this.setNavigation(pageNum,Math.ceil(parseInt(result.totalCount)/6)||0,'ProductSearch_'+this.config.id,true);};var param={CID:this.config.cid,q:this.config.searchValue,Total:true,PageNum:1,PageItem:6};if(Category&&Category!="0"){param.Category=Category;};$.ajax({url:"/EWS_Interface/Order_ListProduct.aspx",type:'get',data:param,cache:false,dataType:'json',success:function(result){_get_success.call(_this,result);}});};EWS.Order.GetCatalogProductList.prototype.getLists=function(page){var param={CID:this.config.cid,q:this.config.searchValue,Total:true,PageNum:page,PageItem:6};var self=this;$.ajax({url:"/EWS_Interface/Order_ListProduct.aspx",type:'get',data:param,cache:false,dataType:'json',success:function(result){var target=$('#ProductSearch_'+self.config.id);var parent=target.find('.ord_product');parent.html("");parent.prepend('<h3 class="ord_title">符合 '+self.config.searchValue+' 共有<strong class="amount">'+(result.totalCount)+'</strong>个商品：</h3>');self.searchProductHtml(result,parent);$("<div class='ord_mop_page'></div>").appendTo(parent);self.setNavigation(page,Math.ceil(parseInt(result.totalCount)/2)||0,'ProductSearch_'+self.config.id,true);}});};EWS.Order.GetCatalogProductList.prototype.searchProductHtml=function(result,parent){imgList=[];var ul=[];var pLen=result.Product.length;if(pLen){var p=result.MoneyType;var mType=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));}var _this=this;var appId='Order_'+this.config.id;$.each(result.Product,function(i,v){var newId=parseInt(_this.config.id).toString(36)+"_"+i;imgList.push({src:v.Img?v.Img:'http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png',id:newId});var action='javascript:'+appId+'.showDetial(\''+v.ID+'\',\''+v.Name+'\');';ul.push('<li>'+'<div class="size">'+'<a href="'+action+'"><img  style="position: relative; top: 0.25px;" width="128" height="127"  title="商品图片"  src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" id="'+newId+'"/></a>'+'</div>'+'<div class="content">'+'<span>'+mType+v.UnitPrice+'</span>'+'<button class="buy" title="购买"  onclick="'+appId+'.setShoppingCar(\''+v.ID+'\');'+appId+'.showShoppingCar();">购买</button>'+'<a class="detail" title="详细内容" href="'+action+'">详细内容</a>'+'</div>'+'<div class="title">'+'<strong><a href="'+action+'">'+v.Name+'</a></strong>'+'</div>'+'</li>');});$('<div class="ord_mop_eight"><ul>'+ul.join("")+'</ul></div>').appendTo(parent);new EWS.PreLoadImage({path:"",arrSrc:imgList,maxWidth:177,maxHeight:128,scope:_this,success:''});};EWS.Order.orders_productOrdersSearch=function(obj){this.type='orders_productOrdersSearch';this.config=obj;var pro=$("#"+this.config.id).find('input[name="product"]');var ord=$("#"+this.config.id).find('input[name="order"]');this.inputValidate(pro,'请输入商品名称');this.inputValidate(ord,'请输入订单号');};EWS.Order.orders_productOrdersSearch.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_productOrdersSearch.prototype.searchOrderOrproByName=function(cmp){if(cmp=="1"||cmp==1){var input=$.trim($("#"+this.config.id).find('input[name="product"]').val());if(input&&input!='请输入商品名称'){this.config.searchValue=input;this.createProductListBody();};}else{var input=$.trim($("#"+this.config.id).find('input[name="order"]').val());if(input&&input!='请输入订单号'){this.config.searchValue=input;this.createOrderListBody();};};};EWS.Order.orders_shoppingCar=function(obj){this.type='orders_shoppingCar';this.config=obj;};EWS.Order.orders_shoppingCar.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_shoppingCar.prototype.shoppingCar=function(cmp){this.showShoppingCar();};EWS.Order.orders_fullearch=function(obj){this.type='orders_fullearch';this.config=obj;var JsTree=new EWS.Order.JsTree("showNode","hideNode",obj.htmlUrl,obj.id);JsTree.newtree2("/EWS_Interface/Order_ListAllCatalog.aspx?cid="+this.config.cid,JsTree,obj.id);this.JsTree=JsTree;var pro=$("#"+this.config.id).find('input[name="product"]');var ord=$("#"+this.config.id).find('input[name="order"]');this.inputValidate(pro,'请输入商品名称');this.inputValidate(ord,'请输入订单号');};EWS.Order.orders_fullearch.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_fullearch.prototype=EWS.Order.orders_productSearch.prototype;EWS.Order.orders_fullearch.prototype.searchProductByName=function(){var input=$.trim($("#"+this.config.id).find('input[name="product"]').val());if(input&&input!='请输入商品名称'){this.config.searchValue=input;this.createProductListBody(1,this.JsTree.curId);};};EWS.Order.orders_fullearch.prototype.searchOrderByName=function(){var input=$.trim($("#"+this.config.id).find('input[name="order"]').val());if(input&&input!='请输入订单号'){this.config.searchValue=input;this.createOrderListBody();};};EWS.Order.orders_fullearch.prototype.showCar=function(){this.showShoppingCar();};EWS.Order.orders_showMoreProduct=function(obj){this.config=obj;this.type='orders_showMoreProduct';var _this=this;var appId='Order_'+this.config.id;var anchor=EWS.Anchor.get("Order_"+this.config.id);if(anchor==null){var pageNum=1;}else{var pageNum=parseInt(anchor.split(",")[1]);};var _this=this;$.ajax({url:"/EWS_Interface/Order_getMoreProduct.aspx",type:'get',data:{CID:this.config.cid,proIDs:this.config.proListId},cache:false,dataType:'json',success:function(result){_this.proMoreListData=result;_this.moreProductGetData(pageNum);}});};EWS.Order.orders_showMoreProduct.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_showMoreProduct.prototype.moreProductGetData=function(page){var len=this.proMoreListData.length;if(this.config.styleId!='2'&&this.config.hasPage=='true'){var pageSize=Number(this.config.pageItem);if(len>=pageSize){var startId=(page-1)*pageSize;if(len>startId){var data=this.proMoreListData.slice(startId,(startId+pageSize));this.getHtmlSrc(data,page);}else{return;}}else{this.getHtmlSrc(this.proMoreListData,page);}}else{this.getHtmlSrc(this.proMoreListData,page);}};EWS.Order.orders_showMoreProduct.prototype.getHtmlSrc=function(data,page){var html='';var imgList=[];var obj=this.config;var _this=this;var len=data.length;var parent=$('#'+obj.id);if(len){var p=data[0].moneytype;this.config.mType=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));}else{this.moreProductGetData(page);return;}var ul=$('<ul></ul>');if(obj.styleId==2){var rdata=this.productNode();parent.append('<ul>'+rdata[0]+'</ul>');}else{parent.html('');if(obj.hasPage=='true'){if(obj.rowItem==0||obj.rowItem=='0'||obj.rowItem==""){for(var i=0;i<len;i++){if(obj.styleId!=7){var newId=obj.id+"_img_"+i;var Img=data[i].pic?data[i].pic:'/theme/order/img/noImg.png';imgList.push({src:Img,id:newId});}ul.append(this.returnHtmlSrc(data[i],i,len));};parent.append(ul);}else{for(var i=0;i<len;i++){if(obj.styleId!=7){var newId=obj.id+"_img_"+i;var Img=data[i].pic?data[i].pic:'/theme/order/img/noImg.png';imgList.push({src:Img,id:newId});};if(obj.rowItem==1){ul=$('<ul></ul>');}else{if((i+1)%obj.rowItem==1){ul=$('<ul></ul>');};};ul.append(this.returnHtmlSrc(data[i],i,len));if((i+1)%obj.rowItem==0||(i+1)==len){parent.append(ul);};};}parent.append('<div class="ord_mop_page"></div>');this.setNavigation(page,Math.ceil(parseInt(obj.proListId.split(',').length)/obj.pageItem)||0,obj.id,'last');}else{ul=$('<ul></ul>');if(obj.rowItem!=""&&obj.rowItem!=0){if(obj.pageItem<len){len=obj.pageItem;}}if(obj.rowItem==0||obj.rowItem=='0'||obj.rowItem==""){for(var i=0;i<len;i++){if(obj.styleId!=7){var newId=obj.id+"_img_"+i;var Img=data[i].pic?data[i].pic:'/theme/order/img/noImg.png';imgList.push({src:Img,id:newId});}ul.append(this.returnHtmlSrc(data[i],i,len));};parent.append(ul);}else{for(var i=0;i<len;i++){if(obj.styleId!=7){var newId=obj.id+"_img_"+i;var Img=data[i].pic?data[i].pic:'/theme/order/img/noImg.png';imgList.push({src:Img,id:newId});};if(obj.rowItem==1){ul=$('<ul></ul>');}else{if((i+1)%obj.rowItem==1){ul=$('<ul></ul>');};};ul.append(this.returnHtmlSrc(data[i],i,len));if((i+1)%obj.rowItem==0||(i+1)==len){parent.append(ul);};};}}}var imgHW=this.returnWidthHeight();if(obj.picSize&&(obj.picSize==2||obj.picSize=='2')){var imgHW=[Number(obj.picsizeW),Number(obj.picsizeH)];}else{var imgHW=this.returnWidthHeight();}if(obj.styleId!=2&&imgHW.length){new EWS.PreLoadImage({path:"",arrSrc:imgList,maxWidth:imgHW[0],maxHeight:imgHW[1],scope:this,success:function(obj){_this.setImageLayer(obj);_this.setImage(obj)}});}else{if(!imgHW.length){imgHW=[73,75];}new EWS.PreLoadImage({path:"",arrSrc:rdata[1],maxWidth:imgHW[0],maxHeight:imgHW[1],scope:this,success:function(obj){_this.setImageLayer(obj);_this.setImgState(obj)}});};};EWS.Order.orders_showMoreProduct.prototype.returnHtmlSrc=function(data,i,pLen){var obj=this.config;var style="style=margin-right:"+obj.sBetween+"px";if((i+1)%obj.rowItem==0||(i+1)==pLen){style='';};var newId=obj.id+"_img_"+i;var appId='Order_'+obj.id;var action='javascript:'+appId+'.showDetial(\''+data.id+'\',\''+data.name+'\');';switch(obj.styleId){case'8':return'<li '+style+'>'+'<div class="title"><a href="'+action+'" title="">'+data.name+'</a></div>'+'<div class="one_img"><a href="'+action+'" title=""><img height="150" width="150"  src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png" id="'+newId+'"/></a></div>'+'<div class="content">'+'<div class="number1"><div class="number2"><strong>'+data.sn+'</strong></div></div>'+'<div class="price1"><div class="price2"><strong>'+obj.mType+' '+data.unitprice+'</strong></div></div>'+'</div>'+'</li>';break;case'1':return'<li '+style+'>'+'<div class="content">'+'<div class="price"><strong>'+obj.mType+data.unitprice+'</strong></div>'+'<a  href="'+action+'" title=""><img width="122" height="121" src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a>'+'</div>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.name+'</a>'+'<span>'+data.sn+'</span>'+'</div>'+'</li>';break;case'3':return'<li '+style+'>'+'<div class="content"><a  href="'+action+'" title=""><img width="114" height="114" src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a></div>'+'</li>';break;case'4':return'<li '+style+'>'+'<div class="content">'+'<div class="title">'+'<a href="'+action+'" title="">'+data.name+'</a>'+'<div class="price"><span>'+obj.mType+data.unitprice+'</span></div>'+'<div class="buy"><a href="javascript:void(0)" title="购物车" onclick="'+appId+'.setShoppingCar(\''+data.ID+'\');'+appId+'.showShoppingCar();"><img src="http://'+this.config.htmlUrl+'/theme/order/img/buy.png" >购物</a></div>'+'</div>'+'<div class="photo"><a  href="'+action+'" title=""><img style="position: relative; top: 0.5px;" width="130" src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a><div>'+'</div>'+'</li>';break;case'5':return'<li '+style+'>'+'<div class="content">'+'<div class="photo">'+'<a  href="'+action+'" title=""><img  style="position: relative; top: 1px;" width="150" height="150" src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a>'+'<a class="price"  href="'+action+'"><strong>'+obj.mType+data.unitprice+'</strong></a>'+'</div>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.name+'</a>'+'<span>'+data.sn+'</span>'+'</div>'+'</div>'+'</li>';break;case'6':return'<li '+style+'>'+'<div class="content">'+'<div class="price"><strong>'+obj.mType+data.unitprice+'</strong>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.name+'</a>'+'<span>'+data.sn+'</span>'+'</div>'+'</div>'+'<div class="photo"><a  href="'+action+'" title=""><img style="position: relative; top: 5px;" width="120"  src="http://'+this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a></div>'+'</div>	'+'</li>';break;case'7':return'<li '+style+'>'+'<div class="price">'+'<div class="title">'+'<a href="'+action+'" title="">'+data.name+'</a>'+'<span>编号：'+data.sn+'</span><strong>'+obj.mType+data.unitprice+'</strong>'+'</div>'+'</div>'+'</li>';break;};};EWS.Order.orders_showMoreProduct.prototype.showPic=function(id){window.open($('#'+id).attr('src'));};EWS.Order.orders_showMoreProduct.prototype.showMoreProduct=function(data,obj){var len=data.length;var proList=this.productNode(data[0],2);for(var i=1;i<len;i++){proList+=this.productNode(data[i],1);};return['<ul>'+proList+'</ul>',""];};EWS.Order.orders_showMoreProduct.prototype.productNode=function(data,type){var appId='Order_'+this.config.id;var len=this.proMoreListData.length;var html='';var imgList=[];var appId='Order_'+this.config.id;for(var i=(len-1);i>=0;i--){var data=this.proMoreListData[i];var dis="display:block";var disb="display:none";if(i==(len-1)){dis="display:none";disb="display:block";}var action='javascript:'+appId+'.showDetial(\''+data.id+'\',\''+data.name+'\');';html+='<li id="p1_'+data.id+'" onmouseover="'+appId+'.overShowProduct(this,\''+data.id+'\');" style="'+dis+'">'+data.name+'</li>';var img=data.pic?data.pic:'http://'+this.config.htmlUrl+'/theme/order/img/noImg.png';var id=this.config.id+'_morePro_'+data.id;imgList.push({src:img,id:id});html+='<li id="p1_'+data.id+'_b" class="current"  style="'+disb+'">'+'<div class="blending">'+'<div class="blend_photo"><a href="'+action+'" ><img id=\''+id+'\' src="'+img+'" width="75" height="75" /></a></div>'+'<div class="blend_name"><span title="'+data.name+'">'+data.name+'</span><p>'+this.config.mType+'</p><strong>'+data.unitprice+'</strong>'+'<a href="javascript:void(0)" ><img src="http://'+this.config.htmlUrl+'/theme/order/img/p2_10_8_1.png" onclick="'+appId+'.setShoppingCar(\''+data.id+'\');'+appId+'.showShoppingCar();"/></a>'+'</div>'+'</div>'+'</li>';};if(len){this.config.current=this.proMoreListData[len-1].id;}return[html,imgList];};EWS.Order.orders_showMoreProduct.prototype.overShowProduct=function(obj,id){$('#p1_'+this.config.current+'_b').hide();$('#p1_'+this.config.current).show();$(obj).hide();$('#p1_'+id+'_b').show();this.config.current=id;};EWS.Order.orders_showMoreProduct.prototype.setImgState=function(obj){var dom=$('#'+obj.id);if(obj.picSize&&(obj.picSize==2||obj.picSize=='2')){var imgHW=[Number(obj.picsizeW),Number(obj.picsizeH)];}else{var imgHW=[73,75];}var w=(imgHW[0]-dom.attr('width'))/2+'px';var h=(imgHW[0]-dom.attr('height'))/2+'px';var style='left:'+w+';top:'+h+';position:absolute;';dom.attr('style',style);};EWS.Order.orders_showMoreProduct.prototype.setImage=function(img){var originalImg=new Image();originalImg.src=img.src;var originalWidth=originalImg.width;var originalHeight=originalImg.height;var width=73;var height=75;if(this.config.styleId){if(this.config.picSize&&(this.config.picSize==2||this.config.picSize=='2')){var size=[Number(this.config.picsizeW),Number(this.config.picsizeH)];}else{var size=this.returnWidthHeight();}width=size[0];height=size[1];};var scale=this.getImageScale(originalWidth,originalHeight,width,height);$("#"+img.id).css({position:'relative',top:(height-scale[1])/2});};EWS.Order.orders_showCatalogProduct=function(obj){this.type='orders_showCatalogProduct';this.config=obj;var _this=this;var appId='Order_'+this.config.id;var chunnel=EWS.getCataLog();if(chunnel){var v=chunnel[1].split('#');if(decodeURI(v[0])==this.config.chunnelName){this.config.catalogID=chunnel[0];}}var anchor=EWS.Anchor.get("Order_"+this.config.id);if(anchor==null){var pageNum=1;}else{var pageNum=parseInt(anchor.split(",")[1]);};this.getProductByPage(pageNum);};EWS.Order.orders_showCatalogProduct.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_showCatalogProduct.prototype.showCatalogProduct=function(data,obj){var len=data.length;var appId='Order_'+this.config.id;var proList='';var imgList=[];};EWS.Order.orders_showCatalogProduct.prototype.getProductByPage=function(page){var _this=this;$.ajax({url:"/EWS_Interface/Order_ListProduct.aspx",type:'get',data:{CID:this.config.cid,ParentID:this.config.catalogID,PageItem:this.config.pageItem,PageNum:page},cache:false,dataType:'json',success:function(result){_this.createProductHtml(result,page)}});};EWS.Order.GetCatalogProductList.prototype.createProductHtml=function(result,page){var _this=this;var p=result.MoneyType;var mType=p=='0'?'￥':(p=='1'?'＄':(p=='2'?'￡':'€'));var product=result.Product;var obj=this.config;var pLen=product.length;var ul=$('<ul></ul>');var imgList=[];var parent=$("#"+obj.id);parent.html('');for(var i=0;i<pLen;i++){if(obj.styleId!=7){var newId=obj.id+"_img_"+i;var Img=product[i].Img?product[i].Img:'/theme/order/img/noImg.png';imgList.push({src:Img,id:newId});};if(obj.rowItem==1){ul=$('<ul></ul>');}else{if((i+1)%obj.rowItem==1){ul=$('<ul></ul>');};};ul.append(returnHtml(product[i],i));if((i+1)%obj.rowItem==0||(i+1)==pLen){parent.append(ul);};};if(pLen==0){parent.append('<div class="noData">此分类没有商品！</div>');}if(!obj.hasPage||obj.hasPage=='true'){parent.append('<div class="ord_mop_page"></div>');}function returnHtml(data,i){var style="style=margin-right:"+obj.sBetween+"px";if((i+1)%obj.rowItem==0||(i+1)==pLen){style='';};var newId=obj.id+"_img_"+i;var appId='Order_'+obj.id;var action='javascript:'+appId+'.showDetial(\''+data.ID+'\',\''+data.Name+'\');';switch(obj.styleId){case'1':return'<li '+style+'>'+'<div class="title"><a href="'+action+'" title="">'+data.Name+'</a></div>'+'<div class="one_img"><a href="'+action+'" title=""><img height="150" width="150"  style="position: relative;top: 8px;" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" id="'+newId+'"/></a></div>'+'<div class="content">'+'<div class="number1"><div class="number2"><strong>'+data.Sn+'</strong></div></div>'+'<div class="price1"><div class="price2"><strong>'+mType+' '+data.UnitPrice+'</strong></div></div>'+'</div>'+'</li>';break;case'2':return'<li '+style+'>'+'<div class="content">'+'<div class="price"><strong>'+mType+data.UnitPrice+'</strong></div>'+'<a  href="'+action+'" title=""><img width="122" height="121" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a>'+'</div>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.Name+'</a>'+'<span>'+data.Sn+'</span>'+'</div>'+'</li '+style+'>';break;case'3':return'<li '+style+'>'+'<div class="content"><a  href="'+action+'" title=""><img  width="114" height="114"  src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a></div>'+'</li>';break;case'4':return'<li '+style+'>'+'<div class="content">'+'<div class="title">'+'<a href="'+action+'" title="">'+data.Name+'</a>'+'<div class="price"><span>'+mType+data.UnitPrice+'</span></div>'+'<div class="buy"><a href="javascript:void(0)" title="购物车" onclick="'+appId+'.setShoppingCar(\''+data.ID+'\');'+appId+'.showShoppingCar();"><img src="http://'+_this.config.htmlUrl+'/theme/order/img/buy.png" >购物</a></div>'+'</div>'+'<div class="photo">'+'<a href="'+action+'" title="">'+'<img style="position: relative; top: 0.5px;" width="130" height="129" src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/>'+'</a>'+'</div>'+'</div>'+'</li>';break;case'5':return'<li '+style+'>'+'<div class="content">'+'<div class="photo">'+'<a  href="'+action+'" title=""><img style="position: relative; top: 1px;" width="150" height="150"  src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a>'+'<a class="price" href="'+action+'"><strong>'+mType+data.UnitPrice+'</strong></a>'+'</div>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.Name+'</a>'+'<span>'+data.Sn+'</span>'+'</div>'+'</div>'+'</li>';break;case'6':return'<li '+style+'>'+'<div class="content">'+'<div class="price"><strong>'+mType+data.UnitPrice+'</strong>'+'<div class="title">'+'<a href="'+action+'" title="">'+data.Name+'</a>'+'<span>'+data.Sn+'</span>'+'</div>'+'</div>'+'<div class="photo"><a  href="'+action+'" title=""><img  style="position: relative; top: 5px;" width="120" height="120"  src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png"  id="'+newId+'"/></a></div>'+'</div>	'+'</li>';break;case'7':return'<li '+style+'>'+'<div class="price">'+'<div class="title">'+'<a href="'+action+'" title="">'+data.Name+'</a>'+'<span>编号：'+data.Sn+'</span><strong>'+mType+data.UnitPrice+'</strong>'+'</div>'+'</div>'+'</li>';break;case'8':return'<li '+style+'>'+'<div class="size">'+'<a href="'+action+'"><img  style="position: relative; top: 0.25px;" width="128" height="127"  title="商品图片"  src="http://'+_this.config.htmlUrl+'/theme/order/img/noImg.png" id="'+newId+'"/></a>'+'</div>'+'<div class="content">'+'<span>'+mType+data.UnitPrice+'</span>'+'<button class="buy" title="购买"  onclick="'+appId+'.setShoppingCar(\''+data.ID+'\');'+appId+'.showShoppingCar();">购买</button>'+'<a class="detail" title="详细内容" href="'+action+'">详细内容</a>'+'</div>'+'<div class="title">'+'<strong><a href="'+action+'">'+data.Name+'</a></strong>'+'</div>'+'</li>';break;};};if(obj.picSize&&(obj.picSize==2||obj.picSize=='2')){var size=[obj.picsizeW,obj.picsizeH];}else{var size=this.returnWidthHeight();}if(obj.styleId!=7){new EWS.PreLoadImage({path:"",arrSrc:imgList,maxWidth:size[0],maxHeight:size[1],scope:this,success:function(obj){_this.setImageLayer(obj);_this.setImage(obj)}});};if(!obj.hasPage||obj.hasPage=='true'){this.setNavigation(page,Math.ceil(parseInt(result.totalCount)/obj.pageItem)||0,obj.id,'last');}};EWS.Order.orders_showCatalogProduct.prototype.setImage1=function(img){var originalImg=new Image();originalImg.src=img.src;var originalWidth=originalImg.width;var originalHeight=originalImg.height;var width=185;var height=162;if(this.config.styleId){var size=this.returnWidthHeight();width=size[0];height=size[1];};var scale=this.getImageScale(originalWidth,originalHeight,width,height);$("#"+img.id).css({position:'relative',top:(height-scale[1])/2});};EWS.Order.orders_showCatalogs=function(obj){this.type='orders_showCatalogs';this.config=obj;var _this=this;var appId='Order_'+this.config.id;var _get_success=function(result){var arr="";if(obj.styleId==1){arr=_this.createCatalogListHtml(result,obj);}else if(obj.styleId==2){arr=_this.createCatalogListHtml2(result,obj);}else{arr=_this.createCatalogListHtml3(result,obj);};};$.ajax({url:"/EWS_Interface/Order_ListCatalog.aspx",type:'get',data:{CID:this.config.cid,ParentID:this.config.catalogID},cache:false,dataType:'json',success:function(result){_this.createCatalogListHtml(result)}});};EWS.Order.orders_showCatalogs.prototype=EWS.Order.GetCatalogProductList.prototype;EWS.Order.orders_showCatalogs.prototype.createCatalogListHtml=function(result){var data=result.Catalog;var appId='Order_'+this.config.id;var len=data.length;if(this.config.cataNum=='2'){len=this.config.cataNumValue?(this.config.cataNumValue>len?len:this.config.cataNumValue):len;}var action='javascript:'+appId+'.showProductLists();';var html='';switch(this.config.styleId){case'1':var cls=len==0?'li_title li_first':'li_title';if(result.Path[0].Number==''){var nL='';}else{var nL='( '+result.Path[0].Number+' )';}html='<ul><li class="'+cls+'"><a href="javascript:void(0)" onclick="'+appId+'.setState(this,1);"><strong>'+this.config.catalogName+nL+'</strong></a><ul>';for(var i=0;i<len;i++){if(i==len-1)html+='<li class="li_last"><a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'( '+data[i].Number+' )</a></li>';else html+='<li><a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'( '+data[i].Number+' )</a></li>';};html+='</ul></li></ul>';break;case'2':html='<ul><li class="li_title"><a href="javascript:'+appId+'.showProductLists(\''+this.config.catalogID+'\')"><strong>'+this.config.catalogName+'</strong></a><a href="javascript:void(0)" onclick="'+appId+'.setState(this,2);" class="iconUl">显示/隐藏</a><ul>';for(var i=0;i<len;i++){if(i==len-1)html+='<li class="li_last"><a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'</a></li>';else html+='<li><a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'</a></li>';};html+='</ul></li></ul>';break;case'3':if(this.config.hasTitle&&this.config.hasTitle=='true'){html='<div class="ord_sortList3_title"><a href="javascript:'+appId+'.showProductLists(\''+this.config.catalogID+'\')">'+this.config.catalogName+'</a></div>';}for(var i=0;i<len;i++){html+='|<a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'</a>';};break;case'4':if(this.config.hasTitle&&this.config.hasTitle=='true'){html='<div class="ord_sortList4_title"><a href="javascript:'+appId+'.showProductLists(\''+this.config.catalogID+'\')">'+this.config.catalogName+'</a></div>';}for(var i=0;i<len;i++){html+='<a href="javascript:'+appId+'.showProductLists(\''+data[i].ID+'\')">'+data[i].Name+'</a>';};break;}$('#'+this.config.id).html(html);};EWS.Order.orders_showCatalogs.prototype.setState=function(obj,p){var cls=obj.parentNode.className;if(cls.split(' ').length>1){obj.parentNode.className='li_title';}else{obj.parentNode.className='li_title hide';};};EWS.Order.orders_showCatalogs.prototype.showProductLists=function(id){if(this.config.chunnel=='1'){if(this.config.proComId){var obj=eval('Order_'+this.config.proComId);if(obj.config){obj.config.catalogID=id;obj.getProductByPage(1);}}}else{if(this.config.linkId){window.open(this.config.linkId+'.shtml?catName='+id+','+this.config.chunnelName);}};};EWS.Order.GetCatalogProductList.prototype.returnWidthHeight=function(p){var width='';var height='';var sId=this.config.styleId;sId=sId?Number(sId):1;switch(this.type){case'GetCatalogProductList':if(typeof(p)=='string'){return[406,269];}else if(typeof(p)=='boolean'){return[55,56];}else{switch(sId){case 1:return[177,128];case 2:return[111,111];case 3:return[130,113];case 4:return[177,168];case 5:return[117,93];case 6:return[85,68];};}break;case'GetProductDetail':if(p=='bigImg'){switch(sId){case 1:return[354,216];case 2:return[406,269];case 3:return[370,269];};};switch(sId){case 1:return p?[89,84]:[354,216];case 2:return p?[55,56]:[406,269];case 3:return p?[49,40]:[370,269];};break;case'orders_showCatalogProduct':if(p=='bigImg'){return[406,269];}else if(p==true){return[55,56];};switch(sId){case 1:return[185,166];case 2:return[130,122];case 3:return[114,114];case 4:return[157,130];case 5:return[173,152];case 6:return[120,130];case 8:return[177,128];};break;case'orders_showMoreProduct':if(p=='bigImg'){return[406,269];}else if(p==true){return[55,56];};switch(sId){case 1:return[130,122];case 3:return[114,114];case 4:return[157,130];case 5:return[173,152];case 6:return[120,130];case 8:return[185,166];default:return[354,216];};break;case'SearchOrder':case'orders_productSearch':case'orders_productOrdersSearch':case'orders_fullearch':if(p=='bigImg'){return[406,269];}else if(p==true){return[55,56];};break;};};