var ec={scrollTo:function(el){var top=el&&$(el).offset().top;$("body,html").animate({scrollTop:top||0},300)},ready:function(fn){$(window.document).ready(function(){ke.ui.render();fn()})},validate:function(){var r=arguments;if($.isArray(arguments[0])){r=arguments[0]}var msg="";$.each(r,function(i,dom){if(!dom.validate()){msg=L.G("请输入")+" "+$(dom).prev().html().replace("*","");return false}});if(msg)window.top.ec.notifyQ(msg);return msg},toggleValidateCode:function(v,ele,cls){var ele=ele||$("#get_code");ele.toggleClass(cls||"disabled",v);ele.html(L.G(v?"正在发送...":"获取验证码"))},loading:function(){var html="
";$(window.document.body).append(html)},unLoading:function(){$("#common_loading").remove()},btnLoading:function(el,v,loading){if(loading){window._btnLoadingElement=el;window._btnLoadingElementText=el.html();el.toggleClass("btn-loading",true);el.append('');el.addClass("disabled")}else{el.toggleClass("btn-loading",false);el.find("ico-loading").remove();el.removeClass("disabled")}if(v){var span=el.find("span");if(span.length)span.html(v);else el.html(v)}},btnTimeout:function(s,ele){var btnGetVCode=ele||$("#get_code");if(s>0){btnGetVCode.html(L.G("重新获取")+"("+s+")");btnGetVCode.addClass("disabled");window._codeStart=setTimeout("ec.btnTimeout("+(s-1)+");",1e3)}else{clearTimeout(window._codeStart);btnGetVCode.html(L.G("获取验证码"));btnGetVCode.removeClass("disabled")}},seePassword:function(el,box){var btn=el.find("i");var see=btn.hasClass("ico16-eyeopen");btn.toggleClass("ico16-eyeopen",!see);box.find("input").attr("type",see?"password":"text")},notify:function(msg,sec,icon){$.messager.notify(msg,sec||5e3,{icon:icon||"ok"})},notifyQ:function(msg,sec){ec.notify(msg,sec,"question")},notifyE:function(msg,sec){ec.notify(msg,sec,"error")},confirm:function(title,msg,callback,icon){window.top.$.messager.show({title:title,msg:msg,callback:callback,modal:true,draggable:false,closable:false,minimizable:false,maximizable:false,collapsible:false,css:"window2 ",icon:icon||"info"})},maskScroll:function(isShow){$("html").toggleClass("overflow-hidden",isShow);$("body").toggleClass("overflow-hidden",isShow)},sliderDown:function(el,itemsSelector,i){var pre=parseInt(el.attr("data-tab-index")||0);var items=el.find(itemsSelector||".items");var i=pre+i;if(i<0)return;else if(i>=items.length)return;if(pre!=i){items.eq(pre).slideUp();items.eq(i).slideDown();el.attr("data-tab-index",i)}},openWindow:function(title,url,w,h){ke.openWindow(title,url,w||650,h||600,{modal:true,clickHide:false,css:"window1 ",draggable:false,btnClose:true})},hideWindow:function(id){ke.ui.destroy(window.parent.ke.ui.find(id||"ke_open_window"))},changeWindowSize:function(w,h){try{if(!window.iswap)this.getParentLayer().changeSize(w,h)}catch(e){}},getParentLayer:function(){var layers=window.parent.ke.ui.findControls(null,"layer");for(var i=0;i0){var p=$.grep(d,function(obj){return obj[2]===r[0][0]});var p1=[];p.forEach(function(t){p1.push({num:t[1],name:t[1]})});return(new ke.table).load(p1,true)}}if(window.Province)Country.change(function(){Province.bindStore(getStore(Country.get()))});if(window.City)Province.change(function(){City.bindStore(getStore(Province.get()))});if(c.length)Country.setTriggerChange(c[0][1])},includeJs:function(){for(var i=0;i<\/script>")}},includeCss:function(){for(var i=0;i")}},redirect:function(url){window.top.location.href=url},showImageVcode:function(fn){view.vCodeCallback=fn;ke.openWindow(null,"/vcode",420,220,{modal:true,css:"window1 ",draggable:false,id:"window_image_vcode"})},viewImage:function(logoPicRID,url){var win=window;var cfg={url:"/common/viewerimage?id="+logoPicRID+"&url="+escape(url),width:800,height:650,clickHide:true,modal:true,id:"viewer_image"};win.ec.showLayer("",cfg).show().center()},showLayer:function(html,opt,unrenew){var id=opt.id||"ec_common_layer";var con=ke.ui.find(id);if(!unrenew||con==null){ke.ui.destroy(con);$(document.body).append('
'+html+"
");con=$("#"+id).layer(opt).render()}return con},cookie:function(name,obj){if(obj)$.cookie(name,obj,{expires:7,path:"/"});else $.removeCookie(name)},toggleLayers:function(btn,layers,o,i){layers.slideToggle("fast");btn.find("i").toggleClass(o).toggleClass(i);$(window).click(function(e){var x=$(e.target).offset().left||0;var y=$(e.target).offset().top||0;if(!btn._containsXY(x,y)&&!layers._containsXY(x,y)){layers.slideUp("fast");btn.find("i").removeClass(i).addClass(o)}})},validatePrice:function(){ec.showImageVcode(function(code){new ec.api("common").put("validate-price",code,function(){$.messager.notify(L.G("验证成功"));window.location.reload()})})},scrollAnimate:function(delay){ec._animates=$("[data-animate]");if(ec._animates.length){$(document).scroll(function(){ec._animates.each(function(i,dom){var top=$(document).scrollTop();var bottom=top+$(window).height();var el=$(dom);var rect=el._getRect();if(rect.top+rect.height>=top&&rect.top<=bottom){var cls="animate__animated "+el.attr("data-animate");if(delay)cls+=" animate__delay-"+delay+"s";el.addClass(cls)}})})}}};var L={isEn:false,packs:[],route:"",language:0,G:function(txt){if(L.isEn&&L.packs){txt=txt.trim();for(var i=0;i