G.app.order.shippingtype = {
		_curDistrict:0,
		SHIP_TIME_LIST_TRIPLE:{1:"上午09:00-14:00",2:"下午14:00-18:00",3:"晚上18:00-22:00"},
		SHIP_TIME_LIMIT_LIST_TRIPLE:{1:"09:00-12:00",2:"12:00-14:00",3:"14:00-16:00",4:"16:00-18:00",5:"18:00-20:00"},
		WEEK_DAY_LIST:["","一","二","三","四","五","六","日"],
		_tpl:{desc:'<ul class="list_info"><li><span class="tit">配送方式：</span>{ShipTypeName}（ {ShipTypeDesc}）</li>{ShipDateTimeDesc}<li><span class="tit">运　　费：</span>{shippingPriceDesc}</li></ul><div style="display:none" t="sp"></div>{ShipSignByOtherDesc}',desc_sub:'<div class="wrap_mod"><p class="para_inb"><span class="para_tit">你选择的商品在不同仓库中，为确保商品快速送达，下单后将自动拆分；商品将按拆分后的子订单分开配送，给您带来的不便敬请谅解。</span></p></div><div class="wrap_mod"><p class="selected">配送方式：<strong>{ShipTypeName}</strong> {ShipTypeDesc}</p><div class="table_form">	<@subOrderInfo@>	<table width="100%" border="0" cellspacing="0" cellpadding="0">		<colgroup><col width="443"><col width="66"><col width="66"><col width="32%"></colgroup>		<thead><tr><th class="col1"><strong>[{groupName}]</strong></th><th class="col2">合计重量</th><th class="col3">合计运费</th><th class="col4">{shipTimePre}</th></tr></thead>		<tbody>			<@rows@>			<tr><td class="col1"><div class="goods_info"><p class="name">{product_name}</p></div></td>{total_weight}{total_shipping_price}{shippingtime}</tr>			<@_rows@>		</tbody>	</table>	<@_subOrderInfo@></div>{ShipSignByOtherDesc}</div>',list:'<table class="table_nobor">	<colgroup><col width="5%"><col width="15%"><col width="8%"><col width="72%"></colgroup>	<tbody>		<@list@>		<tr sid="{ShippingId}">			<td><input type="radio" name="sel_shipping" value="{ShippingId}"/></td>			<td><p class="name">{ShipTypeName}</p></td>			<td><span class="strong">{shippingPriceDesc}</span></td>			<td><p>{ShipTypeDesc}</p><div class="table_form" style="display:none">{subOrderInfo}{extinfodesc}</div></td>		</tr>		<@_list@>	</tbody>	<tfoot>		<tr><td colspan="4"><div style="display:none" t="sp"></div><label><input type="checkbox" name="sign_by_other" value="1" checked="checked" />收货时若快递无法联系上我，我同意由朋友、同事或家人代收</label></td></tr>		<tr><td colspan="4"><div class="wrap_btn"><a class="btn_strong" href="#" onclick="return false" t="ssave">确认配送方式</a></div></td></tr>	</tfoot></table>',list_sub:'<div class="wrap_mod">	<p class="para_inb"><span class="para_tit">你选择的商品在不同仓库中，为确保商品快速送达，下单后将自动拆分；商品将按拆分后的子订单分开配送，给您带来的不便敬请谅解。</span></p></div><@list@><div class="wrap_mod" sid="{ShippingId}">	<div class="mode">		<label><input type="radio" name="sel_shipping" value="{ShippingId}">{ShipTypeName}</label>		{shippingPriceDesc}		{ShipTypeDesc}	</div>	{subOrderInfo}</div><@_list@><div class="wrap_mod">	<label><input type="checkbox" name="sign_by_other" value="1" checked="checked" />收货时若快递无法联系上我，我同意由朋友、同事或家人代收</label></div><div class="wrap_mod_btn"><a class="btn_strong" href="#" onclick="return false" t="ssave">确认配送方式</a></div>',subinfo:'<div class="table_form" style="display:none">	<@subOrderInfo@>	<table width="100%" border="0" cellspacing="0" cellpadding="0">		<colgroup><col width="443"><col width="66"><col width="66"><col width="32%"></colgroup>		<thead><tr><th class="col1"><strong>[{groupName}]</strong></th><th class="col2">合计重量</th><th class="col3">合计运费</th><th class="col4">{shipTimePre}</th></tr></thead>		<tbody>			<@rows@>			<tr><td class="col1"><div class="goods_info"><p class="name">{product_name}</p></div></td>{total_weight}{total_shipping_price}{shippingtime}</tr>			<@_rows@>		</tbody>	</table>	<@_subOrderInfo@></div>'},
		_mod:{
			getAll:function(e,c,d){
				var b=G.app.order.shippingtype,a=b._dao;
				a.get(e,function(){var g=a._list[e],f=0;$.each(g,function(i,h){if(i<0){f++}});if(f==0){c(g)}else{d(g)}},function(f){G.ui.popup.showMsg("获取配送方式失败，请稍候重试")})
			},
			get:function(f,b,d,e){
				var c=G.app.order.shippingtype,a=c._dao;
				a.get(f,function(){var h=a._list[f],g=0;$.each(h,function(j,i){if(j<0){g++}});if(g==0){d(h[b])}else{e(h)}},function(g){G.ui.popup.showMsg("获取配送方式失败，请稍候重试")})
			}
		},
		_dao:{
			_list:{},
			get:function(h,f,e){
				if(G.logic.login.ifLogin(this,arguments)===false){return}
				
				var i=G.app.order.shippingtype._dao,c=G.logic.login.getLoginUid(),j=G.app.order.status.get("product");
				if(i._list[h]!=null){return f()}
				var b=function(l){var m=[];$.each(l,function(o,n){m.push(o+":"+n)});return m.join(",")};
				var g={},d={};
				$.each(j.items,function(m,l){g[m]=l.totalWeight;d[m]=l.isVirtual?1:0});
				var a={district:h,weight:b(g),isvirtual:b(d)};
				var k=G.util.parse.url();
				if(k.search.ism==2){a.product_id_es=j.productIds}
				a.act="getshippingtype";
				G.util.post("/purchase/order/getshippingtype",a,function(l){
					if(l&&l.errno==0){
						i._list[h]={};
						var index = 0;
						$.each(l.data,function(n,m){i._list[h][m.ShippingId]=m;if(index==0){G.app.order.status.setSavedId("shippingtype",m.ShippingId)};index++;});
						if($.isEmptyObject(i._list[h])&&l.forbidden){$.each(l.forbidden,function(n,m){i._list[h][-n]=m})}
						$.isFunction(f)&&f()
					}else{$.isFunction(e)&&e(l)}
				})
			}
		},
		_view:{
			_curId:0,_dom:false,
			getDom:function(){
				var b=G.app.order.shippingtype,a=b._view;
				if(!a._dom){a._dom=$('<div class="mod_order id_separate_order">	<div class="inner">		<div class="hd">			<h3>配送方式</h3>			<div class="more"><a href="#" onclick="return false" id="shippingtype_btn">更改</a></div>		</div>		<div class="bd"></div>	</div></div>');a._dom.insertAfter(G.app.order.address.getDom());a.switchBtnStatus(1)}return a._dom
			},
			_getShipRange:function(e){
					if(e.shipRange){return e.shipRange}else{if(e.timeAvaiable){var c={},d=[],b=0,h=0;$.each(e.timeAvaiable,function(j,i){b++;var k=i.ship_date.substr(0,4)+"-"+i.ship_date.substr(4,2)+"-"+i.ship_date.substr(6,2)+" 星期"+(G.app.order.shippingtype.WEEK_DAY_LIST[i.week_day]),l=G.app.order.shippingtype.SHIP_TIME_LIST_TRIPLE[i.time_span];if(!c[i.ship_date]){c[i.ship_date]={name:k,list:{}};d.push(i.ship_date)}if(l){c[i.ship_date].list[i.time_span]=l}});if(e.isArrivedLimitTime==true){$.each(c,function(k,j){for(var l=1;l<6;l++){c[k].list[l]=G.app.order.shippingtype.SHIP_TIME_LIMIT_LIST_TRIPLE[l]}})}if(b==0){return null}$.each(c,function(i,k){var j=0;$.each(k.list,function(){j++});if(j>h){h=j}});e.once=h<1?1:h;d.sort();var a={};for(var g=0;g<3;g++){var f=d.shift();a[f]=c[f]}e.shipRange=a;return e.shipRange}else{return null}}
			},
			_springShipTip:function(a,b){return""},
			desc:function(){
				var f=G.app.order.shippingtype,c=f._view,e=f._mod,d=f._tpl,g=G.app.order.status.get("shippingtype"),b=G.app.order.status.get("product"),a="";
				G.logic.constants.getWhId(function(m){var o=G.app.order.status.get("address");if(g!=null){g=f._encode(g);g.ShipSignByOtherDesc="";if(g.ShipTypeName.indexOf("易迅快递")>=0){var n=c._springShipTip(o.district,m);if(n){g.ShipSignByOtherDesc=G.app.order._getYTipHtml(n)}}if(g.sign_by_other==1){g.ShipSignByOtherDesc+=G.app.order._getYTipHtml("收货时若快递无法联系上我，我同意由朋友、同事或家人代收")}var p=c._prepareSubOrderTpl(g,b,true,m);if(b.isSubMode){g.subOrderInfo=p;g.ShipSignByOtherDesc=g.sign_by_other==1?('<div class="notice_check">'+G.app.order._getYTipHtml("收货时若快递无法联系上我，我同意由朋友、同事或家人代收","")+"</div>"):"";$(".bd",c.getDom()).empty().html(G.ui.template.fillWithTPL(false,g,false,d.desc_sub))}else{if(p.length>0){var j=null;$.each(g.subOrder,function(r,q){q.subId=r;j=q;return false});if(j==null||!j.shipRange){g.ShipDateTimeDesc=""}else{var h=j.shipRange[j.sDate],i=g.ShipTypeName.indexOf("\u63D0")>=0?"自提时间":"送货时间",l="";if(h){l+=h.name;if(h.list[j.sTime]){l+=" "+h.list[j.sTime]}}g.ShipDateTimeDesc='<li><span class="tit">'+i+'：</span><span class="strong">'+(l||"暂未选择")+"</a></li>"}}else{g.ShipDateTimeDesc=""}$("div.bd",c.getDom()).empty().html(G.ui.template.fillWithTPL(false,g,false,d.desc))}c._specialShipTip($(".bd div[t=sp]",c.getDom()));c.switchBtnStatus(1);c.getDom().addClass("readonly")}else{var o=G.app.order.status.get("address"),k=$(".bd",c.getDom()).empty().html(G.app.order._getYTipHtml("请先选择并确认收货信息")+"<p>&nbsp;</p>");$("a[name=add]",k).click(c.list)}})
			},
			_addListListener:function(a){
					$("div[sid], tr[sid]",a).each(function(){var b=$(this).attr("sid");$("input[name=sel_shipping]",this).click({sid:b},function(c){G.app.order.shippingtype._view.select(c.data.sid)})});
					$("a[t=ssave]",a).click(G.app.order.shippingtype._view.save)
			},
			_specialShipTip:function(e){return true;
					var b=G.app.order.status.get("address");
					var a=G.util.shipLocation||{1:[2626,2629,2637,2628,2630,2631,2638,2625,2627,2624,3333,3525,3329,2645,3513,2636,2647,2646,2634,2635,2640,2633,2632,1693,1694,3485,3448,3486,1695,1697,3687,3688,3696,2639,1605,1604,1603,1598,1601,1602,1600,1593,3682,3683,3724,3723,1685,1683,1684,1689,1686,1691,1687,1650,3601,1656,1658,1659,3229,3230,3228,3227,3231,3728,3727,3715,3242,3241,3716,3,4,5,6,1675,1676,3745],1001:[424,3605,425,426,421,427,422,3746,3732,3762,3763,3764,3765,418,3842,3885,3903,3904,529,3886],2001:[134,133,140,138,137,3783,3767,3779,3792,3802,3803,3795,3804,3796,3810,3801,3822],3001:[1326,1330]};
					var d=null;
					$.each(a,function(f,g){$.each(g,function(h,i){if(i==b.district){d=f;return false}});if(d!=null){return false}});
					var c=[1,3001];
					if(d){
						$(e).css("display","none");
						G.logic.constants.getWhId(function(f){f=parseInt(f);d=parseInt(d);if(f!=d&&(($.inArray(f,c)==-1)||($.inArray(d,c)==-1))){var g=$('<div class="location_tip"><div class="wrap_para"><p class="para_inb">您目前在'+G.logic.constants.allowedWhInfo[f]+'站。根据您的收货地址，我们建议您在<span class="strong">'+G.logic.constants.allowedWhInfo[d]+'站</span>购买</p></div><div class="pic"></div></div>');$(e).replaceWith(g)
							}else{$(e).remove()}})
					}else{$(e).remove()}
			},
			_prepareSubOrderTpl:function(d,a,f,e,c){
					var b=[];
					if(!$.isEmptyObject(d.subOrder)){$.each(d.subOrder,function(i,g){if(!a.items[i]){return}var m=[];$.each(a.items[i].items,function(p,r){var q={product_name:r.name,total_weight:"",total_shipping_price:"",shippingtime:""};m.push(q)});var k=m.length,h=d.ShipTypeName.indexOf("\u63D0")>=0?"自提时间":"送货时间",j=null;if(k>0){m[0].total_weight='<td class="col2" rowspan="'+k+'"><span>'+(a.items[i].totalWeight/1000).toFixed(3)+"kg</span></td>";m[0].total_shipping_price='<td class="col3" rowspan="'+k+'"><strong class="strong">&yen;'+(g.shippingPrice/100).toFixed(2)+"</strong></td>";var o='<span class="nor">'+d.ShipTypeName+"无需选择"+h+"</span>";if(g.shipRange){if(f){if(g.sDate&&g.shipRange[g.sDate]){o=g.shipRange[g.sDate].name;if(g.sTime&&g.once!=1&&g.shipRange[g.sDate].list[g.sTime]){o+=" "+g.shipRange[g.sDate].list[g.sTime]}}else{o="未选择时间"}}else{o=[];$.each(g.shipRange,function(p,q){if(j==null||p<j){j=p}o.push('<option value="'+p+'">'+q.name+"</option>")});if(o.length>0){o.unshift('<option value="">请选择收货日期</option>');o='<select name="shipDate" shipid="'+d.ShippingId+'" subid="'+i+'">'+o.join("")+'</select> <select name="shipTime" shipid="'+d.ShippingId+'" subid="'+i+'"'+(g.once==1?' style="display:none"':"")+"></select>"}}}var n="";if(a.items[i].isVirtual&&j!=null){n='<div style="text-align:left">订单商品需仓库调配，无法当日出货，最早可选'+h+"为："+g.shipRange[j].name+"</div>"}else{if(!f&&d.ShipTypeName.indexOf("易迅快递")>=0){var l=G.app.order.shippingtype._view._springShipTip(c,e);n=!l?"":('<div style="text-align:left;">'+G.app.order._getYTipHtml(l,"")+"</div>")}}m[0].shippingtime='<td class="col3" rowspan="'+k+'">'+n+o+"</td>"}b.push({groupName:a.items[i].groupName,shipTimePre:h,rows:m})})}return b
			},
			list:function(){
					var f=G.app.order.shippingtype,c=f._view,e=f._mod,d=f._tpl,b=G.app.order.status.get("address"),a=G.app.order.status.get("product");
					G.logic.constants.getWhId(function(g){
						e.getAll(b.district,function(i){if(!i||$.isEmptyObject(i)){$("div.bd",c.getDom()).empty().html(G.app.order._getYTipHtml("系统暂不支持所选地址的配送服务。")+'<p>&nbsp;</p><div t="sp" style="display:none"></div>');c._specialShipTip($("div.bd div[t=sp]",c.getDom()))}else{var k={list:[]},j=$("div.bd",c.getDom());$.each(i,function(n,q){q=f._encode(q);q.extinfodesc="";var p=c._prepareSubOrderTpl(q,a,false,g,b.district);if(a.isSubMode){q.subOrderInfo=G.ui.template.fillWithTPL(false,{subOrderInfo:p},false,d.subinfo)}else{if(p.length>0){var t=null;$.each(q.subOrder,function(v,u){u.subId=v;t=u;return false});if(t==null||!a.items[t.subId]){q.subOrderInfo=""}else{var s=[],m=null;$.each(t.shipRange||[],function(u,v){if(m==null||u<m){m=u}s.push('<option value="'+u+'">'+v.name+"</option>")});if(s.length>0){s.unshift('<option value="">请选择收货日期</option>');s='<select name="shipDate" shipid="'+q.ShippingId+'" subid="'+t.subId+'">'+s.join("")+'</select>															<select name="shipTime" shipid="'+q.ShippingId+'"'+(t.once==1?' style="display:none"':"")+' subid="'+t.subId+'"></select>'}else{s=""}var r=q.ShipTypeName.indexOf("\u63D0")>=0?"自提时间":"送货时间";q.subOrderInfo=s?(r+"："+s):"";if(a.items[t.subId].isVirtual&&m!=null){q.extinfodesc='<div style="padding-top:3px;">'+G.app.order._getYTipHtml("订单商品需仓库调配，无法当日出货，最早可选"+r+"为："+t.shipRange[m].name,"")+"</div>"}else{if(q.ShipTypeName.indexOf("易迅快递")>=0){var o=G.app.order.shippingtype._view._springShipTip(b.district,g);q.extinfodesc=!o?"":('<div style="padding-top:3px;">'+G.app.order._getYTipHtml(o,"")+"</div>")}}}}else{q.subOrderInfo=""}}k.list.push(q)});j.empty().html(G.ui.template.fillWithTPL(false,k,false,a.isSubMode?d.list_sub:d.list));var h=G.app.order.status.get("shippingtype"),l=$("input[name=sign_by_other]",j);if(l.length>0){l[0].checked=h&&h.sign_by_other=="0"?false:true}$("select[name=shipDate]",j).change(function(m){var p=$(this).attr("shipid"),u=$(this).attr("subid");if(!p||!u){return}var t=$(this).val(),s=['<option value="">请选择收货时间</option>'];if(t&&i[p]&&i[p].subOrder[u]&&i[p].subOrder[u].shipRange&&i[p].subOrder[u].shipRange[t]){$.each(i[p].subOrder[u].shipRange[t].list,function(x,v){s.push('<option value="'+x+'">'+v+"</option>")})}$("select[name=shipTime][shipid="+p+"][subid="+u+"]",j).empty().html(s.join(""));var w=new Date(),o=m.target.value,q=$(m.target),r=o.substr(4,2);if("0"==r.charAt(0)){r=parseInt(r.substr(1,1))-1}else{r=parseInt(r)-1}w.setFullYear(o.substr(0,4),r,o.substr(6,2));if($.inArray(w.getDay(),[6,0])!=-1){if($("#shippingTimeWeekendHint").length==0){var n='<div id="shippingTimeWeekendHint" style="padding-top:3px;">'+G.app.order._getYTipHtml("您选择的是周末（非工作日）送货，为避免送货错误，请确保您填的收货地址非单位地址。","")+"</div>";q.parent().append(n)}}else{$("#shippingTimeWeekendHint").remove()}}).change();c._addListListener(j);if(c._curId>0){c.select(c._curId)}else{c.select($("div[sid]:first,tr[sid]:first").attr("sid"))}}c._specialShipTip($(".bd div[t=sp]",c.getDom()));c.switchBtnStatus(2);c.getDom().removeClass("readonly")},function(j){var i=G.app.order.status.get("product"),l='以下商品无法配送到您所选的收货地址，请<a href="http://buy.51buy.com/cart.html" class="todo_link">返回购物车</a>修改',k="",h=[];$.each(j||[],function(n,m){$.each(m||[],function(p,o){if(i&&i.pinfo&&i.pinfo[o]){h.push("<p>"+i.pinfo[o].name+"</p>")}})});if(h.length>0){l+="：";k=h.join("")}else{l+="。"}$(".bd",c.getDom()).empty().html(G.app.order._getYTipHtml(l)+'<p>&nbsp;</p><div class="wrap_para">'+(k||"<p>&nbsp;</p>")+'</div><div t="sp" style="display:none"></div>');c._specialShipTip($(".bd div[t=sp]",c.getDom()))})
				})
			},
			save:function(e){
					var h=G.app.order.shippingtype,c=h._view,d=h._mod,b=G.app.order.status.get("address"),a=G.app.order.status.get("product"),g=c._curId,f=$(".bd",c.getDom());
					d.get(b.district,g,function(k){
						if(!k){return}var j=k.ShippingId,k=h._encode(k),i=false;
						$.each(k.subOrder,function(m,l){
							if(!a.items[m]){return}
							if($("select[name=shipDate][shipid="+j+"][subid="+m+"]",f).length>0){k.subOrder[m].sDate=$("select[name=shipDate][shipid="+j+"][subid="+m+"]",f).val()}
							if($("select[name=shipTime][shipid="+j+"][subid="+m+"]",f).length>0){k.subOrder[m].sTime=$("select[name=shipTime][shipid="+j+"][subid="+m+"]",f).val()}
							if(e!==false){
								if(l.shipRange&&(!k.subOrder[m].sDate||!l.shipRange[k.subOrder[m].sDate])){G.ui.popup.showMsg("请选择收货日期");i=true;return false}else{if(l.shipRange&&k.subOrder[m].once!=1&&(!k.subOrder[m].sTime||!l.shipRange[k.subOrder[m].sDate].list[k.subOrder[m].sTime])){G.ui.popup.showMsg("请选择收货时间");i=true;return false}}
							}
							if(k.subOrder[m].once==1){$.each(l.shipRange[k.subOrder[m].sDate]?l.shipRange[k.subOrder[m].sDate].list:[],function(n,o){k.subOrder[m].sTime=n;return false})}
							//$("#cartinfo span[psdes="+m+"]").html("（"+(l.shippingPrice<=0?"免运费":"含运费")+"）")
						});
						if(i){return}
						k.sign_by_other=$("input[name=sign_by_other]",f).length==0?k.sign_by_other:($("input[name=sign_by_other]:checked",f).length>0?1:0);
						G.app.order.status.set("shippingtype",k);
						b.default_shipping=k.ShippingId;
						
						G.app.order.putPointOrCouponChange();
						
						c.desc();
						G.app.order.status.saveIds();
						G.app.order.price.set("shippingprice",(k.shippingPrice-k.shippingPriceCut)/100)
				})
			},
			select:function(b){
					var f=G.app.order.shippingtype,c=f._view,e=f._mod,a=G.app.order.status.get("address");var d=$(".bd div[sid], .bd tr[sid]",c.getDom()).removeClass("status_on").filter("[sid="+b+"]").addClass("status_on").find("input[name=sel_shipping]"),g=$(".bd",c.getDom());if(d.length>0){d[0].checked=true}e.getAll(a.district,function(j){var h=j[b];if(!h){b=$(".bd div[sid], .bd tr[sid]",c.getDom()).first().attr("sid");h=j[b]}h=f._encode(h);if(h.subOrder){$.each(h.subOrder,function(l,k){if(k.sDate&&k.shipRange&&k.shipRange[k.sDate]){if($("select[name=shipDate][shipid="+h.ShippingId+"][subid="+l+"]",g).length>0){$("select[name=shipDate][shipid="+h.ShippingId+"][subid="+l+"]",g).val(k.sDate).change()}if(k.once!=1&&k.sTime&&k.shipRange[k.sDate].list[k.sTime]){if($("select[name=shipTime][shipid="+h.ShippingId+"][subid="+l+"]",g).length>0){$("select[name=shipTime][shipid="+h.ShippingId+"][subid="+l+"]",g).val(k.sTime)}}}})}c._curId=b;$(".bd div .table_form, .bd tr .table_form",c.getDom()).hide();$(".bd div[sid="+b+"] .table_form, .bd tr[sid="+b+"] .table_form",c.getDom()).show();var i=$(".bd div[sid], .bd tr[sid]",c.getDom()).removeClass("status_on").filter("[sid="+b+"]").addClass("status_on").find("input[name=sel_shipping]");if(i.length>0){i[0].checked=true}})
			},
			switchBtnStatus:function(c){
					var f=G.app.order.shippingtype,d=f._view,e=f._mod,b=G.app.order.status.get("address"),a=$("#shippingtype_btn");
					a.show();
					if(c==1){
						a.html("更改").unbind().click(d.list);
						if(G.app.order.status.get("shippingtype")){G.app.order.status.get("shippingtype").uediting=false}
						G.app.order.paytype.init()
					}else{
							if(!G.app.order.status.get("shippingtype")){
								a.hide()
							}else{
								G.app.order.status.get("shippingtype").uediting=true;a.html("取消").unbind().click(d.desc);
								G.app.order.paytype.hide()
							}
					}
			},
			__decodeCacheShipTimeStr:function(b){if(!b){return{}}b=b.split("_");var a={};$.each(b,function(d,c){c=c.split("x");a[c[0]]=c[1]});return a},
			init:function(){
					var d=G.app.order.shippingtype,b=d._view,c=d._mod,a=G.app.order.status.get("address");
					if(!a){return}
					c.getAll(a.district,function(i){
						var k=G.app.order.status.getSavedId("shippingtype")||0;if(k!=0){G.app.order.status.delSavedId("shippingtype")}
						k=k||a.default_shipping;
						if((d._curDistrict==0||d._curDistrict==a.district)&&k>0&&i[k]){
							b._curId=k;var f=G.app.order.status.getSavedId("shipTime"),j=G.app.order.status.getSavedId("shipDate"),e=G.app.order.status.getSavedId("signByOther");
							var g=i[k],g=d._encode(g),h=true;f=b.__decodeCacheShipTimeStr(f);j=b.__decodeCacheShipTimeStr(j);
							if(g.subOrder){
								$.each(g.subOrder,function(m,l){if(f[m]!=null){g.subOrder[m].sTime=f[m]}if(j[m]!=null){g.subOrder[m].sDate=j[m]}if(g.subOrder[m].shipRange&&(!g.subOrder[m].shipRange[g.subOrder[m].sDate]||(g.subOrder[m].once!=1&&!g.subOrder[m].shipRange[g.subOrder[m].sDate].list[g.subOrder[m].sTime]))){h=false}})
							}
							if(e!=null){g.sign_by_other=e}
							if(!h){b.list()}else{b.save(false)}
							b.save(false);
						}else{
							b.list()
						}
						d._curDistrict=a.district
					},function(){b.list();b.save(false);})
			}
		},
		_encode:function(a){
				a.shippingPriceDesc=(a.shippingPrice==0?"免费":('<span class="i_yuan">&yen;</span>'+(a.shippingPrice/100).toFixed(2)));
				$.each(a.subOrder,function(b,c){a.subOrder[b].shipRange=G.app.order.shippingtype._view._getShipRange(c)});return a
		},
		hide:function(){
					$(".bd",this.getDom()).empty().html(G.app.order._getYTipHtml("请先选择并确认收货信息")+"<p>&nbsp;</p>");
					G.app.order.status.set("shippingtype",null);
					$("#shippingtype_btn").hide();
					G.app.order.paytype.hide()
		},
		getDom:function(){return this._view.getDom()},
		getShipRange:function(a){return this._view._getShipRange(a)},
		init:function(){this._view.init()}
	}
