index.js 51.9 KB
define("index",["jquery","handlebars","source-map","index","lazyload"],function(e,t,n){var i;e("js/common"),e("js/product/entry"),e("js/home/entry"),n.exports=i}),define("js/common",["jquery","handlebars","source-map","index"],function(e,t,n){function i(e){var t,n,i=document.cookie;return document.cookie&&""!==document.cookie&&(n=i.indexOf(e+"="),n>-1&&(n+=e.length+1,t=decodeURIComponent(c.trim(i.substring(n,i.indexOf(";",n)))))),t}function o(e,t,n){var i,o,a,s,r="";"undefined"!=typeof t&&(n=n||{},null===t&&(t="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(s=new Date,s.setTime(s.getTime()+24*n.expires*60*60*1e3)):s=n.expires,r="; expires="+s.toUTCString()),i=n.path?"; path="+n.path:"",o=n.domain?"; domain="+n.domain:"",a=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,i,o,a].join(""))}function a(){var e,t=i("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function s(){var e=a();return 0===e?0:e[1]}function r(){var e=i("_g");return"undefined"==typeof e?"":JSON.parse(e).k}var c=e("jquery");e("js/footer"),e("js/simple-header"),e("js/header"),function(e,t,n,i,o){var a=t.createElement(n),s=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=o,e[o]=function(){e[o].p=arguments},a.async=1,a.src=i,s.parentNode.insertBefore(a,s)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.13.6.3/yas.js","_yas"),function(){var e=s();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.13.6.3","yohobuy_web",e,"","")}(),window.cookie=i,window.setCookie=o,window.getUser=a,window.getUid=s,window.getShoppingKey=r}),define("js/footer",["jquery"],function(e,t,n){function i(){var e=r("#subscriber-box"),t=r("#subscriber-btn"),n=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,i={method:"open.subscriber.subscriber",v:1,return_type:"jsonp",open_key:"12345"},o={mail:"&#xe61b;",tick:"&#xe61a"},a=r.trim(e.val()),s={};e.focus(function(){r(this).val("").css("color",""),t.removeClass("done").html(o.mail)}),t.click(function(){if(""!==a&&n.test(a)){r.extend(s,i,{email:a,tmp:Math.random(),uid:r.uid("_UID")});try{r.getJSON("http://test.open.yohobuy.com/?callback=?",s,function(n){1===n.data.result?(e.val("已订阅到:"+a),t.addClass("done").html(o.tick)):e.css("color","red")})}catch(c){console.log(c.message)}}else e.css("color","red")})}function o(){var e=r(".vote"),t=r("#feed-back-page"),n=e.children("li").length;t.on("click","span",function(){var t=r(this);t.hasClass("cur")||(t.siblings(".cur").removeClass("cur"),t.addClass("cur"),e.children().not(".hide").addClass("hide").end().eq(t.index()).removeClass("hide"))}),e.on("click",".feed-back-btn",function(){var i=r(this),o=i.closest("li"),a=o.index(),c={},l=[],d=o.find(".feedback-answer").val(),u=o.find(".feedback-id").val(),h=o.find(".question-id").val();o.find(":checked").each(function(){l.push(r(this).val())}),c={method:"open.feedback.submit",feedback:u||0,question:h||0,answer:d||"",solution:l.join(",")},r.getData(s,c,function(i){var s=a+1;if(1===i.result){if(a===n-1)return void alert("感谢您的参与!");o.addClass("hide"),e.eq(a+1).removeClass("hide"),t.children(".cur").removeClass("cur"),t.eq(s).addClass("cur")}})})}function a(){r(window).height()<r(document).height()?c.removeClass("hide"):c.addClass("hide")}var s,r=e("jquery"),c=r(".return-top");c.click(function(){r("html,body").animate({scrollTop:0},500)}),r(window).scroll(function(){0===r(window).scrollTop()?c.addClass("hide"):c.removeClass("hide")}),a(),c.hasClass("hide")&&r("img").load(a),i(),o(),window.rePosReturnTop=a}),define("js/simple-header",["jquery"],function(e,t,n){var i=e("jquery");i(".simple-header").size()>0&&i(".tool-options").on("mouseenter",function(){i(this).find(".tool-select").fadeIn()}).on("mouseleave",function(){i(this).find(".tool-select").fadeOut()})}),define("js/header",["jquery","handlebars","source-map","index"],function(e,t,n){function i(e){var t;200===+e.code&&"object"==typeof e.data&&(t='<a target="_blank" href="'+e.data.url+'" class="page-top-banner"style="height:50px;border:none;background-image:url('+window.unescape(e.data.src)+');background-position: center;display:block;background-color:#ff5409;">&nbsp;</a>',F("body").prepend(t))}function o(e){200===+e.code&&(L=!0)}function a(){var e;L||(e='<div class="noticewrapper"><div class="noticecontainer"><h1 class="noticetitle">关于系统升级的公告</h1><div class="noticecontent"><p class="tips">尊敬的顾客:</p><p class="detail">您好!为了向您提供更优质的服务,目前系统正在升级,请耐心等待。</p><p class="detail">系统升级期间,部分地区用户体验会有暂时中断,如遇紧急事宜,欢迎垂询客服热线:400-889-9646 09:00-22:30(周一至周日)。稍后系统将恢复正常</p><p class="detail">使用,欢迎您继续光顾YOHO!BUY有货!带来不便之处深表歉意,请您谅解!</p></div></div></div>',F(".header-topwrapper").append(e))}function s(e){var t=document.createElement("script");t.src="http://new.yohobuy.com/resource/getbanner?content_code="+e+"&client_type=web&callback=JsonPCallBack",document.getElementsByTagName("head")[0].appendChild(t)}function r(e){var t=document.createElement("script");t.src="http://new.yohobuy.com/resource/getbanner?content_code="+e+"&client_type=web&callback=NoticeCallBack",document.getElementsByTagName("head")[0].appendChild(t),window.setTimeout(a,5e3)}function c(e,t){var n,i;F(e).hover(function(e){e.preventDefault(),n=F(this),i=F(t)[0],""===i.style.display?(n.addClass("acttags"),i.style.display="block"):(n.removeClass("acttags"),i.style.display="")})}function l(){var e,t,n=[{sourceClass:".myyoho",targetClass:".myyoho-info"},{sourceClass:".phone",targetClass:".qr"}];for(t=0;t<n.length;t++)e=n[t],c(e.sourceClass,e.targetClass)}function d(){var e;F(".yohogroup").mouseenter(function(){e=F(this),e.text(e.attr("cn"))}),F(".yohogroup").mouseleave(function(){e=F(this),e.text(e.attr("en"))})}function u(){var e,t,n=["webkit","moz","ms"];for(t=0;t<n.length;t++)return e=n[t]+"RequestAnimationFrame",window[e]?!0:!1}function h(){var e=["webkit","moz","ms"],t=e[0]+"RequestAnimationFrame",n=e[1]+"RequestAnimationFrame",i=e[2]+"RequestAnimationFrame";return window[t]?function(e){window[t](e)}:window[n]?function(e){window[n](e)}:window[i]?function(e){window[i](e)}:function(e){window.setTimeout(e,67)}}function f(){window.start+=10,window.$logotrans.css({transform:"rotateX("+window.start+"deg)","-webkit-transform":"rotateX("+window.start+"deg)","-moz-transform":"rotateX("+window.start+"deg)"}),window.start/90%2===1&&(window.isen?(window.$logotrans.css("background-image","url(http://static.yohobuy.com/newheader/img/logo1.png)"),window.isen=!1):(window.$logotrans.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),window.isen=!0)),window.start/90%2===0&&window.start%360!==0?window.setTimeout(f,3e3):window.start%360===0?window.setTimeout(f,6e4):window.requestFrame(function(){f()})}function p(){window.globaltimeout&&window.clearTimeout(window.globaltimeout),window.$logotrans.fadeOut(window.loopdurationtime,function(){window.isen=!1,window.$logotrans.css("background-image","url(http://static.yohobuy.com/newheader/img/logo.png)"),window.$logotrans.fadeIn(window.loopdurationtime,function(){window.onetimeoout=window.setTimeout(function(){window.$logotrans.fadeOut(window.loopdurationtime,function(){window.clearTimeout(window.onetimeoout),window.isen=!0,window.$logotrans.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),window.$logotrans.fadeIn(window.loopdurationtime,function(){window.globaltimeout=window.setTimeout(p,6e4)})})},3e3)})})}function m(){u()?window.setTimeout(f,3e3):window.setTimeout(p,3e3)}function g(){var e=F("#nav_keyword").text(),t="vans",n=F("#query_key");""!==e?(n.css({color:"#000"}),n.val(e)):(n.css({color:"#e0e0e0"}),n.val(t),n.on("focus",function(e){n.css({color:"#000"}),n.val("")}))}function w(e,t,n){try{window.dataLayer.push({louceng:e,weizhi:t,event:n})}catch(i){}}function y(){var e=F.cookie("_Gender"),t=F(".cure");"undefined"!=typeof e&&""!==e&&F.setcookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===t.find(".name-cn a").text()&&(F.setcookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),F.setcookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===t.find(".name-cn a").text()&&(F.setcookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),F.setcookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})),"创意生活"===t.find(".name-cn a").text()&&F.setcookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===t.find(".name-cn a").text()&&F.setcookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})}function v(){var e,t,n,i=document.cookie,o=i.split(";");for(e=0;e<o.length;e++)t=o[e].split("="),n=t[0].replace(/\s/g,""),window.cookieMap[n]=t[1]}function b(){var e;F(".first-nav-item").click(function(){e=F.cookie("_Gender"),"undefined"!=typeof e&&""!==e&&F.setcookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===F(this).find(".name-cn a").text()&&(F.setcookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),F.setcookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===F(this).find(".name-cn a").text()&&(F.setcookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),F.setcookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})),"创意生活"===F(this).find(".name-cn a").text()&&F.setcookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===F(this).find(".name-cn a").text()&&F.setcookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})}),F("#backToOld").click(function(){F.setcookie("_New",1,{path:"/",domain:".yohobuy.com"}),location.href="http://www.yohobuy.com"})}function k(){F("#miniCartBox").miniCart({cartNum:".ic-infomation"})}function x(){var e,t,n;F.getData(Y,{method:"open.Shoppingcart.getCartData",shopping_key:F.getShoppingKey()},function(i){""===window.cartTpl&&(window.cartTpl=D.compile(F("#mini-cart-tpl").html())),F("#miniCartBox").children(".gobuy-wrapper").html(window.cartTpl({carData:i})),0===parseInt(F(".ic-infomation").html())&&F("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'),F("#miniCartBox .goods-list li").length<1&&(e=F.cookie("_g"),t=H.parse(e),null!==t&&(n='{"_k":"'+t._k+'","_nac":0,"_ac":0,"_r":0}',F.setcookie("_g",n,{path:"/",domain:".yohobuy.com"})),F(".ic-infomation").html(0),F("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'))})}function _(e,t){F.getData(Y,{method:"open.Shoppingcart.delone",shopping_key:F.getShoppingKey(),id:e,isreduce:t},function(e){var t=F.cookie("_g"),n=H.parse(t),i='{"_k":"'+n._k+'","_nac":'+e.total_goods_num+',"_ac":0,"_r":0}';F.setcookie("_g",i,{path:"/",domain:".yohobuy.com"}),x(),k()})}function C(){var e,t,n;F(document).on("click",".goodscardelete",function(i){e=F(this),t=e.attr("goodsid"),n=e.attr("cheapest"),_(t,n)})}function j(){var e;F(document).on("click",".mycart_i_down",function(t){e=F(this),e.toggleClass("mycart_i_up"),F("#mycartmore").slideToggle(300)})}function q(){var e,t="http://www.yohobuy.com/shopping/cart";F("#miniCartBox").on("click",function(n){e=F(n.target),e.hasClass("gobuy")&&(window.location.href=t)})}function T(e){1===e?(F("#miniCartBox").addClass("list-cur"),F(".gobuy-wrapper").show(),0!==parseInt(F(".ic-infomation").html())?(F("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-loading"><h3 class="information">加载中,请稍后</h3></div>'),x()):F("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>')):(F("#miniCartBox").removeClass("list-cur"),F(".gobuy-wrapper").hide())}function $(){var e;F("#miniCartBox").mouseenter(function(t){e=F(t.target),("miniCartBox"===e.attr("id")||"ic-infomation"===e.attr("class"))&&T(1)}),F("#miniCartBox").mouseleave(function(e){T(0)})}function S(){var e,t="indexkids",n="indexlifestyle",i="indexboys",o="indexgirls",a="uniquebrand",c=window.location.href,l=window.location.host,d="";-1!==c.indexOf("search")&&(d=window.bannerMap["search"+window.cookieMap._Channel]),-1!==c.indexOf("list")&&(d=window.bannerMap["list"+window.cookieMap._Channel]),-1!==c.indexOf("brands")&&(d=window.bannerMap["brands"+window.cookieMap._Channel]),-1!==c.indexOf("new")&&(d=window.bannerMap["new"+window.cookieMap._Channel]),-1!==c.indexOf("sale")&&(d=window.bannerMap["sale"+window.cookieMap._Channel]),-1!==c.indexOf("home")&&(d=window.bannerMap["home"+window.cookieMap._Channel]),-1!==c.indexOf("kids")&&(d=window.bannerMap[t]),-1!==c.indexOf("woman")&&(d=window.bannerMap[o]),-1!==c.indexOf("lifestyle")&&(d=window.bannerMap[n]),-1!==c.indexOf("www.yohobuy.com")&&"/"===window.location.pathname&&(d=window.bannerMap[i]),e=l.split(".")[0],"list"!==e&&"search"!==e&&"www"!==e&&"new"!==e&&"item"!==e&&"guang"!==e&&(d=window.bannerMap[a+window.cookieMap._Channel]),s(d),r(d)}function I(e){F(".hot-brands").find("ul").stop().animate({opacity:0,"z-index":1},200).eq(e).animate({opacity:1,"z-index":2},200)}function z(){var e,t=0;F(".hot-brands").size()>0&&(e=F(".hot-brands").find("ul").size(),F(".hot-brands").find("ul").eq(0).css({opacity:1,"z-index":2}),F(".brands-control").on("click",".next",function(){t===e-1?t=0:t++,I(t)}),F(".brands-control").on("click",".prev",function(){0===t?t=e-1:t--,I(t)}))}function O(){setInterval(k,2e3)}function E(){var e=F("#goodcartempwarpper").html().replace(/\\/g,"");F("#goodcartempwarpper").html(e),R=D.compile(F("#tmpl-my-login-new").html())}function M(){var e="http://search.yohobuy.com/api/suggest";F("#query_key").search(e)}function B(e){var t=(new Date).getTime(),n='<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">请登录</a>]&nbsp;[<a href="http://www.yohobuy.com/reg.html" class="list-a login-out" onclick="">免费注册</a>]',i='<span>Hi~<a href="http://www.yohobuy.com/home?t='+t+'">{{user_name}}</a></span>&nbsp;{{#equalone islogin}}[<a href="{{logout}}" class="list-a login-out">退出</a>]{{else}}[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out">请登录</a>]&nbsp;[<a href="http://www.yohobuy.com/reg.html" onclick="" class="list-a login-out">免费注册</a>]{{/equalone}}',o=F("#loginBox"),a=F.cookie("_UID")||"",s=e.data.profile_name||"",r=0,c=0,l="",d=a.split("::")||"",u=d[0]||" ",h="",f="1",p=0,m={user_name:s,logout:h,random:Math.random()};if(A=D.compile(i),"undefined"==typeof a||null===a)return o.html(n),!1;if("undefined"==typeof d||d.length<4)return o.html(n),!1;for(c;c<u.length;c++)l=u.substr(c,1),r+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1;if(10>=r)s=u;else{for(p=0,c;c<u.length;c++)10>p&&(l=u.substr(c,1),"*"!==l&&(p+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1),s+=l);s.length<u.length&&(s+="...")}h=/http:\/\//.test(d[3])?d[3].replace("www.yohobuy.com","www.yohobuy.com"):"http://www.yohobuy.com/logout_"+d[3]+".html",-1===e.result&&(f="-1"),m.islogin=f,o.html(A(m))}function N(e){var t=e.data,n="";if(1===e.result){if(void 0===typeof t||t.length<1)return!1;F("#myYohoBox").mouseenter(function(){return F(this).addClass("acttags"),F("#myYohoBox .myyoho-info").show().html(R(t)),n=F(".myyoho-photo img").attr("data-url"),1===F._checkUrlState?void F(".myyoho-photo").show().find("img").attr("src",n):void(""!==n&&""===F._checkUrl&&F.ajax({url:n,type:"GET",complete:function(e){(200===e.status||0===e.status)&&(F(".myyoho-photo").show().find("img").attr("src",n),F._checkUrlState=1),F._checkUrl=n}}))}),F("#myYohoBox").mouseleave(function(){F(this).removeClass("acttags"),F("#myYohoBox .myyoho-info").hide()})}}function P(){var e={method:"open.passport.get"};F.getData(Y,e,function(e){B(e),N(e)})}function U(){E(),y(),v(),d(),l(),m(),S(),z(),g(),b(),$(),k(),O(),M(),q(),C(),j(),P()}var F=e("jquery"),D=e("handlebars"),H=e("index"),L=!1,R=null,A=null,Y="http://api.open.yohobuy.com";D.registerHelper("equalone",function(e,t){return"1"===e?t.fn(this):t.inverse(this)}),D.registerHelper("equallevelthree",function(e,t){return"3"===e?t.fn(this):t.inverse(this)}),D.registerHelper("equalzero",function(e,t){return"0"===e?t.fn(this):t.inverse(this)}),e("plugin/yohocookie"),e("plugin/yohocart"),window.JsonPCallBack=i,window.NoticeCallBack=o,window.requestFrame=h(),window.start=0,window.$logotrans=F(".icon-logo"),window.isen=!0,window.loopdurationtime=500,window.globaltimeout,window.onetimeoout,window.dataLayer=[],window.reg=/^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/\s]{0,}$/g,window.keyword="",window.link="",window.submitSearch=function(){var e,t,n=F("#query_key").val(),i="Search",o="Head Search",a="Search";if(e=F.trim(window.keyword.toLowerCase()),t=F.trim(n.toLowerCase()),w(i,o,a),""!==window.link&&""!==window.keyword&&e===t)location.href=window.link.replace("'","");else{if(!window.reg.test(n))return F("#searchForm").submit(),!1;location.href="http://search.yohobuy.com/error?query="+n+"&result=error"}},window.bannerMap={listboys:"4f78b0f418fc42314d8b6e791cfb7fa8",listgirls:"00c1f025a51b6b597dc37925951ea27d",listkids:"b02df11184727701ade1b6de9737d08c",listlifestyle:"fd35c52dced0c880976ba858346d1fc5",searchboys:"9fb8986ea700cc27a8057361c3924394",searchgirls:"e3e207a1443ca60c8037fe52a5560c18",searchkids:"620fc77f479da8feaeb06f2324e5d0bb",searchlifestyle:"a3c93301c6ffaf3ed0f36a4a451be36d",uniquebrandboys:"2ebb0810c0d1a67e5229149c9c3aba7d",uniquebrandgirls:"99e23385f4ba4b65f406b7e2968ac821",uniquebrandkids:"a74ebc9b17840c91b9ea46568111fe6b",uniquebrandlifestyle:"0e8c81ead53f56302baa4d0ad967f527",brandsboys:"77b352db07129c76a9d532acad149f9f",brandsgirls:"bf047f16e52ebc38be5ce9c7623831e6",brandskids:"e3ae1ce9b5e13c6d271ef3eccb831652",brandslifestyle:"e4ac8029c30f65d7f1af030980d140fe",newboys:"869d3c5f3b450fb52101d00a61ce87cb",newgirls:"d953b6dfdac02483d1dcce8d96055954",newkids:"0874cb6d75df8e0e78f2d475e53ecc08",newlifestyle:"43e8fc8e178115c262bbce2bd0012db7",saleboys:"c846e3165c994769b4201d8c32f3ae9b",salegirls:"52b1d389edcbc62d65de71b80c4d6ad0",salekids:"ad8b1703c761ba00973868ab5199cc27",salelifestyle:"7acc64905c70ac91846f43fb2cec4bbd",homeboys:"b0856a771ef1b59ab1234c74688fa42d",homegirls:"2bd61fa12e4933211518f70fe5ce3c48",homekids:"895c59e8c64b40399c9533509507320c",homelifestyle:"2e037d4e25d2767352ca3e0a4627f7bd",indexboys:"0c911d3000f52e8ca7cffb74f5864c29",indexgirls:"b645b8980c423ab30485e0a9d08c2ef7",indexkids:"17f6d5d5d454d2c507bc5fcbc90f7756",indexlifestyle:"735cd393e841762af8793c346abbbc36"},window.cookieMap={},U()}),define("plugin/yohocookie",["jquery"],function(e,t,n){var i=e("jquery");!function(e){e.extend({cookie:function(e){var t=null;if(document.cookie&&""!=document.cookie)for(var n=document.cookie.split(";"),o=0;o<n.length;o++){var a=i.trim(n[o]);if(a.substring(0,e.length+1)==e+"="){t=decodeURIComponent(a.substring(e.length+1));break}}return t},setcookie:function(e,t,n){var i="";if("undefined"!=typeof t){if(n=n||{},null===t&&(t="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)){var o;"number"==typeof n.expires?(o=new Date,o.setTime(o.getTime()+24*n.expires*60*60*1e3)):o=n.expires,i="; expires="+o.toUTCString()}var a=n.path?"; path="+n.path:"",s=n.domain?"; domain="+n.domain:"",r=n.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),i,a,s,r].join("")}}})}(i)}),define("plugin/yohocart",["jquery"],function(require,exports,module){var jQuery=require("jquery"),$yohocookie=require("plugin/yohocookie");!function($){$.fn.miniCart=function(options){var defaults={cookie:"_g",cartNum:""},params=$.extend(defaults,options),cartInfo=eval("("+$.cookie(params.cookie)+")");if(null!=cartInfo){var totalNum=parseInt(cartInfo._nac)+parseInt(cartInfo._ac);0==totalNum?$("#icart-num").attr("class","icart-num icart-none"):$("#icart-num").attr("class","icart-num"),$(params.cartNum).html(totalNum)}},$.fn.search=function(e){function t(t){var n=$.trim($(t).val());return n=n.replace(new RegExp("'","gm"),""),""==n?($(".search-list").hide(),!1):(n=encodeURI(n),void $.get(e+"?callback=?&query="+n,function(e){$(".search-list").html(e.data),i=$(".search-list").children("li").length,o=-1,i>0?$(".search-list").show():$(".search-list").hide(),$(".search-list").find("a").hover(function(){$(this).css("background-color","#eee")},function(){$(this).css("background-color","#fff")})},"jsonp"))}function n(e){$(".search-list li:eq("+a+")").children("a").css("background-color","#fff"),$(".search-list li:eq("+o+")").children("a").css("background-color","#eee");var t=$(".search-list li:eq("+o+")").children("a").attr("title");$("#query_key").val(t)}var i=0,o=0,a=0;return this.each(function(){$(this).keyup(function(e){if(38==e.which){if(0==i)return!1;-1==o&&(o=0),a=o,o=(o-1+i)%i,n(this)}else if(40==e.which){if(0==i)return!1;a=o,o=(o+1)%i,n(this)}else 13==e.which?submitSearch():t(this)})})},$.extend({getData:function(domain,options,onSuccess){var defaults={page:1,method:"",v:1,return_type:"jsonp",open_key:"12345",tmp:Math.random()};if(void 0==typeof domain||""==domain)return console.log("请设置请求的api地址"),!1;var params=$.extend(defaults,options);if(params.page=params.page||1,""==params.method)return console.log("请设置请求的URL"),!1;try{$.getJSON(domain+"/?callback=?",params,function(_data){return""!=onSuccess?(eval(onSuccess(_data.data)),!1):void 0})}catch(e){console.log(e.message)}},getShoppingKey:function(){var shoppingInfo=$.cookie("_g");if("undefined"==typeof shoppingInfo||null==shoppingInfo)return"";var shoppingData=eval("("+shoppingInfo+")");return shoppingData._k}})}(jQuery),exports.init=function(){}}),define("js/product/entry",["jquery","lazyload","handlebars","source-map"],function(e,t,n){e("js/product/list"),e("js/product/hotrank")}),define("js/product/list",["jquery","lazyload"],function(e,t,n){e("js/product/filter"),e("js/product/sort-pager"),e("js/product/product")}),define("js/product/filter",["jquery"],function(e,t,n){function i(e){e.removeClass("checked").html(w.unchecked)}function o(){v.addClass("hide"),b.removeClass("hide")}function a(){b.addClass("hide"),v.removeClass("hide")}function s(e,t){var n,i=decodeURIComponent(window.location.search),o=e+"="+t;n=""===i?"?"+o:i+"&"+o,window.location.href=n}function r(e){T.children(".senior-sub:eq("+m+")").addClass("hide"),$.children(".attr:eq("+m+")").removeClass("hover"),m=-1}var c,l,d,u,h,f,p,m,g=e("jquery"),w={unchecked:"&#xe613;",checked:"&#xe612;"},y={up:"&#xe610;",down:"&#xe600;"},v=g(".brand .default"),b=g(".brand .brand-panel"),k=g(".brand .attr"),x=g("#brand-more"),_=g("#brand-multi"),C=g(".ud-price-range"),j=/^\d+$/,q=g(".sort-sub-wrap"),T=g(".senior-sub-wrap"),$=g(".senior-attr-wrap");g(".filter-box").on("selectstart",".attr, .brands-index span",function(){return!1}),g(".sort-pre").on("click","li",function(){var e=g(this),t=e.index();e.siblings(".active").removeClass("active"),e.addClass("active"),q.children(":not(.hide)").addClass("hide"),q.children(":eq("+t+")").removeClass("hide")}),x.length>0&&(c=x.children("em"),l=x.children(".iconfont")),_.click(function(){"none"===b.css("display")&&o(),b.addClass("multi"),g(this).addClass("hide")}),x.click(function(){var e=g(this);e.hasClass("more")?(a(),c.text("更多"),l.html(y.down)):(o(),c.text("收起"),l.html(y.up)),g(this).toggleClass("more")}),g(".brands-index").on("click","span",function(){var e=g(this),t=e.data("index");0===e.index()?k.removeClass("hide"):k.addClass("hide").filter("[data-index="+t+"]").removeClass("hide")}),g("#brand-search-input").keyup(function(){var e=g(this).val().toLowerCase();""===e?k.removeClass("hide"):k.addClass("hide").filter("[data-key*="+e+"]").removeClass("hide")}),g("#brand-multi-ok").click(function(){var e="";g(this).hasClass("dis")||(b.find(".checked").each(function(){var t=g(this).data("id");e+=""===e?t:","+t}),s("brand",e))}),g(".multi-select-cancel").click(function(){var e=g(this).closest(".multi");e.hasClass("brand-panel")&&(a(),_.removeClass("hide")),e.removeClass("multi"),i(e.find(".checkbox.checked"))}),g(".check-container").on("click",".attr",function(){var e=g(this),t=e.find(".checkbox"),n=e.parent(".check-container").next(".btns").find(".multi-select-ok");t.toggleClass("checked"),t.hasClass("checked")?t.html(w.checked):t.html(w.unchecked),t.hasClass("checked")||e.siblings(".attr").find(".checked").length>0?n.removeClass("dis"):n.addClass("dis")}),g(".brand, .senior").on("click",".attr > a",function(e){g(this).closest(".multi").length>0&&e.preventDefault()}),C.length>0&&(d=C.find(".limit"),u=d.filter(".min"),h=d.filter(".max"),f=C.find(".price-sure"),d.keyup(function(){var e=g.trim(u.val()),t=g.trim(h.val()),n=j.test(e),i=j.test(t);i&&(""===e||n)||n&&(""===t||i)?f.removeClass("hide"):f.addClass("hide")}),f.click(function(){var e,t=g.trim(u.val()),n=g.trim(h.val());""!==t&&""!==n&&+t>+n&&(e=n,n=t,t=e),s("price",t+","+n)})),$.on("mouseenter",".attr",function(){var e=g(this).addClass("hover").index();T.children(".senior-sub:eq("+e+")").removeClass("hide")}).on("mouseleave",".attr",function(){var e=g(this),t=e.index();m=t,p=setTimeout(function(){r()},100)}),g(".senior-sub").on("click",".multi-select",function(){g(this).closest(".senior-sub").addClass("multi")}).on("click",".multi-select-ok",function(){var e=g(this),t=e.closest(".senior-sub"),n="";e.hasClass("dis")||(t.find(".checked").each(function(){var e=g(this).data("id");n+=""===n?e:","+e}),s(t.data("attr"),n))}).on("mouseenter",function(){clearTimeout(p)}).on("mouseleave",function(){r()})}),define("js/product/sort-pager",["jquery"],function(e,t,n){var i=e("jquery"),o=i("#count-per-page"),a=o.next("ul"),s=200;i(document).click(function(e){i(e.target).closest(".page-count").length>0||a&&a.slideUp(s)}),o.click(function(){"none"===a.css("display")?a.slideDown(s):a.slideUp(s)})}),define("js/product/product",["jquery","lazyload"],function(e,t,n){var i,o=e("jquery"),a=e("lazyload"),s=e("js/common/product-event"),r=o(".goods-container"),c=r.find(".good-info"),l=r.find(".good-item-wrapper"),d=r.find(".good-info-main"),u=r.find(".good-select-color"),h=o(".product-list-nav");a(o("img.lazy")),t.init=function(e){function t(e){var t,n,i,o="",a=e.length,s=4,r=Math.ceil(a/s),c=0;for(t=0;r>t;t++)for(o+="<ul>",n=0;s>n&&(i=t*s+n,i!==a);n++)o+='<li><a href="'+e[t*s+n].url+'"><img src="'+e[t*s+n].src+'" data-cover="'+e[t*s+n].coverImg+'" /></a></li>',n===s-1&&(o+="</ul>",c++);return r>c&&(o+="</ul>"),{colorListStr:o,ulNum:r}}function n(){d.html(""),u.html(""),l.css({display:"none"})}i=null,c.unbind(),i=s(c,e),i.addHandler("MouseEnter",function(e){var i,a,s,c,h,f,p,m,g=10,w=35,y="";o.ajax({type:"POST",url:"/product/list/getProductPic",dataType:"json",data:{skn:e.target.attr("data-skn")}}).then(function(v){n(),y=t(v).colorListStr,i=t(v).ulNum,d.append(e.targetDuplicate),u.append(o(y)),f=l.css("paddingLeft"),p=l.css("paddingTop"),m=r.css("paddingTop"),a=10+65*i+e.targetWidth,c=(e.targetX-1)*(e.targetWidth+g)-(parseInt(f)+1),h=(e.targetY-1)*(e.targetHeight+w)+parseInt(m)-(parseInt(p)+1),s=e.offsetR-(65*i+25),0>=s&&(c=c+s-25),l.css({width:a,left:c,top:h,display:"inline-block"})})}),l.mouseleave(function(){n()})},o(document).on("hover",".good-select-color li",function(){var e=o(this).find("img").attr("data-cover"),t=o(this).closest(".good-item-wrapper").find(".good-detail-img").find("img");t.attr("src",e)}),h.click(function(){o(this).hasClass("active")?o(this).find(".sort-child-list").stop(!0,!0).slideUp():o(this).find(".sort-child-list").stop(!0,!0).slideDown(),o(this).toggleClass("active")})}),define("js/common/product-event",["jquery"],function(e,t,n){function i(){this.handlers={}}var o=e("jquery");i.prototype={constructor:i,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,n;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],n=0;n<t.length;n++)t[n](e)},removeHandler:function(e,t){var n,i;if(this.handlers[e]instanceof Array){for(n=this.handlers[e],i=0;i<n.length&&n[i]!==t;i++);n.splice(i,1)}}},n.exports=function(e,t){function n(e){var n,i=0,l=0,d=t,u=0,h="",f=0,p=0;switch(e.type){case"mouseenter":n=o(this),h=n.clone(),u=n.index()+1,i=u%d===0?d:u%d,l=Math.ceil(u/d),f=n.offset().left,p=c-(f+s),a.fire({type:"MouseEnter",target:n,targetWidth:s,targetHeight:r,targetX:i,targetY:l,rowWidth:d,activeIndex:u,targetDuplicate:h,offsetL:f,offsetR:p});break;case"mouseleave":a.fire({type:"MouseLeave"})}}var a=new i,s=e.eq(0).width(),r=e.eq(0).height(),c=o(window).width();return e.bind("mouseenter",n),a}}),define("js/product/hotrank",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var i=e("jquery"),o=e("handlebars"),a=e("lazyload");e("js/common/slider"),e("js/common/logo-brand"),a(i("img.lazy")),i(".slide-container").slider(),i(".logo-brand").logoBrand({showNum:10,url:"./getBrand"}),function(e){function t(t,n){var c={};c=n?{sid:t,page:n}:{sid:t},e.ajax({type:"GET",dataType:"json",url:"/hotrank/getdata",data:c,success:function(t){var c;200===t.code&&(c={list:t.data},s=o.compile(i),n?(e(".hot-week-list").append(s(c)),r.css({position:"fixed",marginTop:-r.height()/2,top:"50%"})):e(".hot-week-list").html(s(c)),a(e("img.lazy")),u=!1)}})}var n,i,s,r=e(".hot-week").find(".floatlayer"),c=e(".hot-cate").find("li").eq(0).data("sid"),l=1,d=0,u=!1;i='{{# list}}<div class="good-info"><div class="item-img"><a class="good-thumb" target="_blank" href="{{url}}"><img class="lazy" data-original="{{img}}"></a></div><div class="good-detail-text"><a target="_blank" href="{{url}}">{{name}}</a><p class="price"><span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">¥{{salePrice}}</span>{{# marketPrice}}<span class="market-price">¥{{.}}</span>{{/ marketPrice}}</p></div></div>{{/ list}}',e(window).on("scroll",function(){var i=n+e(".hot-week").outerHeight();n=e(".hot-week").offset().top,e(this).scrollTop()>=n-e(window).height()/2?r.offset().top+r.outerHeight()>=i?r.css({position:"absolute",marginTop:0,top:e(".hot-week").outerHeight()-r.outerHeight()}):r.css({marginTop:-r.height()/2}).stop().animate({opacity:1},200,function(){r.show()}):r.stop().animate({opacity:0},200,function(){r.hide()}),r.offset().top>=e(this).scrollTop()+(e(window).height()-r.outerHeight())/2&&r.css({position:"fixed",marginTop:-r.height()/2,top:"50%"}),e(this).scrollTop()>=n+e(".hot-week").height()-e(window).height()&&(u||(l++,u=!0,t(c,l)))}),e(".hot-cate").find("li").each(function(t){var n=e(".hot-cate").width();n>=d&&(d+=e(this).width(),d>=n&&e(".floatlayer").find("li").eq(t).hide().nextAll().hide())}),e(".hot-cate").on("click","li",function(){var i=e(this).index(),o=e(this).data("sid");e(this).addClass("current").siblings().removeClass("current"),e(".floatlayer").find("li").removeClass("current").eq(i).addClass("current"),e("body,html").stop().animate({scrollTop:n-110},500),t(o),l=1}),e(".floatlayer").on("click","li",function(){var t=e(this).index();e(".hot-cate").find("li").trigger("click"),e(this).addClass("current").siblings().removeClass("current"),e(".hot-cate").find("li").removeClass("current").eq(t).addClass("current")}),e(".hot-cate").find("li").eq(0).addClass("current"),e(".floatlayer").find("li").eq(0).addClass("current")}(i)}),define("js/common/slider",["jquery","lazyload"],function(e,t,n){var i=e("jquery"),o=e("lazyload");!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.slider.defaults,n),this.bigItem=this.$element.find(".slide-wrapper").find("li"),this.smallItem=null,this.len=this.bigItem.size(),this.index=0,this.timer=null,this.init()};t.prototype={init:function(){if(this.$element){if(this.len<=1)return void o(this.$element.find("img.lazy"));this.options.pagination?this.smallItem=e(this.options.pagination).find("li"):this._createPage(),this.options.orient&&this._createOrient(),this._slideShow(),this._bindEvent(),this._autoplay()}},_createOrient:function(){var e='<div class="slide-switch"><a class="prev" href="javascript:;"><span class="iconfont">&#xe60c;</span></a><a class="next" href="javascript:;"><span class="iconfont">&#xe60b;</span></a></div>';this.$element.find(".slide-switch").length>0||this.$element.append(e)},_createPage:function(){var t='<div class="slide-pagination"><div class="slide-pagination-inner"><div class="slide-shade"></div><div class="slide-pagination-last">',n=0;
if(!(this.len<=1)){for(n=0;n<this.len;n++)t+="<span></span>";t+="</div></div></div>",this.$element.append(e(t)),this.smallItem=e(".slide-pagination-inner").find("span")}},_bindEvent:function(){var t=this;this.$element.find(".slide-switch").on("click",".next",function(){t._nextSlide(),clearInterval(t.timer),t.timer=setInterval(function(){t._nextSlide()},t.options.time)}).on("click",".prev",function(){t._prevSlide(),clearInterval(t.timer),t.timer=setInterval(function(){t._nextSlide()},t.options.time)}),this.smallItem.on("mouseenter",function(){t.index=e(this).index(),clearInterval(t.timer),t._slideShow()}).on("mouseleave",function(){t._autoplay()}),this.$element.on("mouseenter",function(){e(this).find(".slide-switch").addClass("show")}).on("mouseleave",function(){e(this).find(".slide-switch").removeClass("show")})},_nextSlide:function(){this.index===this.len-1?this.index=0:this.index++,this._slideShow()},_prevSlide:function(){0===this.index?this.index=this.len-1:this.index--,this._slideShow()},_slideShow:function(){var t=this.bigItem.eq(this.index).find("img.lazy");t.attr("src")!==t.data("original")&&(o(t,{event:"sporty"}),t.trigger("sporty")),this.smallItem.eq(this.index).addClass("focus").siblings().removeClass("focus"),this.bigItem.eq(this.index).show().stop().animate({opacity:1}).siblings().stop().animate({opacity:0},function(){e(this).hide()})},_autoplay:function(){var e=this;clearInterval(this.timer),this.timer=setInterval(function(){e._nextSlide()},this.options.time)}},e.fn.slider=function(n){return this.each(function(){var i=e(this),o=i.data("Slider"),a="object"==typeof n&&n;o||i.data("Slider",o=new t(this,a)),"string"==typeof n&&o[n]()})},e.fn.slider.Constructor=t,e.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(i)}),define("js/common/logo-brand",["jquery","handlebars","source-map","lazyload"],function(e,t,n){var i=e("jquery"),o=e("handlebars"),a=e("lazyload");!function(e){var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.logoBrand.defaults,n),this.init()};t.prototype={init:function(){this.$element.addClass("logos-"+this.options.showNum),this._sendRequest()},_createHelper:function(){var e=this.options.showNum;o.registerHelper("brandList",function(t,n){var i="<ul>",o=0,a=null,s=0;if(t.length%e!==0)for(s=e-t.length%e,o=0;s>o;o++)t.push({href:"javascript:;",img:""});for(o=0;o<t.length;o++)a=n.fn(t[o]),i=o%e===5||5===o?i+'<li class="logo-brand-switch" data-page="'+Math.floor(o/e)+'"><a class="prev iconfont" href="javascript:;">&#xe60f;</a><a class="next iconfont" href="javascript:;">&#xe60e;</a></li><li data-page="'+Math.floor(o/e)+'">'+a+"</li>":0!==o&&o%e===0?i+'<li class="brand-more" data-page="'+Math.floor(o/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li><li data-page="'+Math.floor(o/e)+'">'+a+"</li>":i+'<li data-page="'+Math.floor(o/e)+'">'+a+"</li>";return i+'<li class="brand-more" data-page="'+Math.floor(o/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li></ul>'})},_sendRequest:function(){var t=this;e.ajax({type:"GET",url:t.options.url,dataType:"json",success:function(e){var n,i;t._createHelper(),i='{{#brandList logoBrand}}<a href="{{href}}" target="_blank"><img class="lazy" data-original="{{img}}" alt=""></a>{{/brandList}}',n=o.compile(i),t.$element.html(n(e)),t.$element.find(".brand-more a").attr("href",e.moreBrand),a(t.$element.find("img.lazy")),t._bindEvent()}})},_brandShow:function(t,n){var i=this;a(e("li[data-page="+n+"]").find("img.lazy").trigger("appear")),i.$element.find("li[data-page="+t+"]").find("img").fadeOut("normal",function(){i.$element.find("li").hide(),i.$element.find("li[data-page="+n+"]").show().find("img").fadeIn()})},_bindEvent:function(){var t=this;t.$element.on("click",".next",function(){var n=e(this).parent().data("page"),i=0,o=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;i=n===o?0:n+1,t._brandShow(n,i)}),t.$element.on("click",".prev",function(){var n=e(this).parent().data("page"),i=0,o=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;i=0===n?o:n-1,t._brandShow(n,i)})}},e.fn.logoBrand=function(n){return this.each(function(){var i=e(this),o=i.data("LogoBrand"),a="object"==typeof n&&n;o||i.data("LogoBrand",o=new t(this,a)),"string"==typeof n&&o[n]()})},e.fn.logoBrand.Constructor=t,e.fn.logoBrand.defaults={showNum:16,url:"/boys/getBrand"}}(i)}),define("js/home/entry",["jquery","lazyload","handlebars","source-map"],function(e,t,n){e("js/home/home")}),define("js/home/home",["jquery","lazyload","handlebars","source-map"],function(e,t,n){var i=e("jquery"),o=e("lazyload"),a=i(".home-page").data("page"),s=i(".logo-brand").data("url");e("js/common/slider"),e("js/common/slider2"),e("js/common/logo-brand"),e("js/common/accordion"),"brands"===a&&e("js/home/brands"),i.inArray(a,["boys","girls","kids","lifestyle"])>-1&&(e("js/common/new-arrivls")({type:a,url:"/common/getNewArrival",count:"boys"===a||"lifestyle"===a?5:4,rows:[5,3]}),window.setCookie("_Channel",a,{domain:".yohobuy.com",path:"/",expires:365})),o(i("img.lazy")),"boys"===a?i(".slide-container").slider({pagination:".thumb-pagination"}):(i(".center-col").slider(),i(".slide-container").slider()),"boys"===a?(i(".logo-brand").logoBrand({url:s}),i(".img-brand").slider2()):(i(".logo-brand").logoBrand({showNum:10,url:s}),i(".img-slider-wrapper").slider2())}),define("js/common/slider2",["jquery"],function(e,t,n){var i=e("jquery");!function(e){e.fn.slider2=function(t){function n(t,n,o){o===!0?(e(".next").trigger("click"),t===n-3?i(--t,n,!1):i(++t,n,!0)):(e(".prev").trigger("click"),0===t?i(++t,n,!0):i(--t,n,!1))}function i(t,i,o){window.setTimeout(n,e.fn.slider2.defaults.delaytime,t,i,o)}function o(t,n,i){var o=-(t*n);e(".img-list").animate({"margin-left":o+"px"},"slow",i)}return e.fn.slider2.defaults={index:0,shownum:3,autoplay:!1,delaytime:3e3},this.each(function(){var n=e.extend({},e.fn.slider2.defaults,t),a=parseInt(e(".img-item").css("margin-right")),s=e(".img-item"),r=[],c=s.outerWidth()+a,l=s.length,d=0;if(3>=l)return void e(this).find(".img-brand-switch").hide();for(d=0;d<s.length;d++)r.push(s[d]);l=r.length,e(this).find(".img-list").css({width:c*l}),e(this).find(".next").on("click",function(t){var n=0,i=null;t.preventDefault(),o(3,c,function(){for(n=0;3>n;n++)i=r.shift(),e(".img-item").parent().append(i.outerHTML),r.push(i);e(".img-item").first().remove(),e(".img-item").first().remove(),e(".img-item").first().remove(),e(".img-list").css({"margin-left":"0"})})}),e(this).find(".prev").on("click",function(t){var n=0,i=null,a="";for(t.preventDefault(),n=0;3>n;n++)i=r.pop(),e(".img-item").parent().prepend(i.outerHTML),r.unshift(i);a=3*c,e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-list").css({"margin-left":-a+"px"}),o(0,c)}),n.autoplay===!0&&i(n.index,l,!0)})}}(i)}),define("js/common/accordion",["jquery"],function(e,t,n){function i(e){c.each(function(t){s(this).css("zIndex",t),e>=t?s(this).stop().animate({left:t*d},400):s(this).stop().animate({left:e*d+l+d*(t-e-1)},400)})}var o,a=e("js/common/yohoui/YH.slide"),s=e("jquery"),r=s(".slide-accordion"),c=r.find("li"),l=c.width(),d=1150===parseInt(s(".home-page").width())?125:107;i(0),o=new a({length:5,loop:!1,auto:!1,timeout:2,index:3}),o.on("change",function(e){i(e.to)}),c.mouseover(function(){o.go(s(this).index())}),o.init()}),define("js/common/yohoui/YH.slide",[],function(e,t,n){var i=e("js/common/yohoui/YH.base"),o=function(e){this.__lastTime=null,this.__isStop=!1,e=i.extend(this.defaults,e),o.superclass.constructor.call(this,e)};i.inherit(o,i.assembly),o.prototype.oninit=function(){var e=this,t=e.options;return t.auto&&e.play(),e.go(t.index),this},o.prototype.go=function(e,t){var n,i,o,a,s,r,c,l,d=this,u=d.options;d.__lastTime&&(clearTimeout(d.__lastTime),d.__lastTime=null),t="undefined"==typeof t?u.index:t,n=e===t?0:e>t?1:-1,i=u.loop,a=u.length-1,s=e,e=i?e>a?e-a-1:0>e?e+a+1:e:e>a?a:0>e?0:e,o=u.index=e,r={from:t,to:e,originalto:s,direction:n};for(c in d.registerEvent)if(d.registerEvent[c].length>0)for(l in d.registerEvent[c])d.registerEvent[c].hasOwnProperty(l)&&d.registerEvent[c][l](r);o!==a||e?!d.__isStop&&u.auto&&d.play():d.__lastTime&&clearTimeout(d.__lastTime)},o.prototype.play=function(){var e=this,t=e.options;return e.__lastTime=setTimeout(function(){e.next()},1e3*t.timeout),this},o.prototype.next=function(){var e=this,t=e.options,n=t.index,i=n+t.step;e.go(i,n)},o.prototype.prev=function(){var e=this,t=e.options,n=t.index,i=n-t.step;e.go(i,n)},o.prototype.pause=function(){var e=this;e.__lastTime&&clearTimeout(e.__lastTime),e.__isStop=!0},o.prototype.resume=function(){var e=this;e.__isStop=!1,e.play()},o.prototype.defaults={index:0,timeout:5,step:1,per:1,auto:!1,loop:!1},n.exports=o}),define("js/common/yohoui/YH.base",[],function(e,t,n){var i,o={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object String]":"string"},a={__Index:0,list:[],get:function(e){return void 0===e?this.list:this.list[e]},fn:function(){},inherit:function(e,t){var n=a.fn;n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,e.prototype.constructor===Object.prototype.constructor&&(e.prototype.constructor=t)},extend:function(e,t){var n;for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},copy:function(e,t,n){var i,o,s;if("object"!=typeof t)return t;if(i=t.valueOf(),t!==i)return new t.constructor(i);if(t instanceof t.constructor&&t.constructor!==Object){o=e?new e:a.clone(t.constructor.prototype);for(s in t)(e||t.hasOwnProperty(s))&&(o[s]=t[s])}else{o={};for(s in t)o.hasOwnProperty(s)&&(o[s]=t[s])}if(n)for(s in n)o.hasOwnProperty(s)&&(o[s]=n[s]);return o},clone:function(e){return a.__cloneFunc.prototype=e,new a.__cloneFunc},__cloneFunc:function(){},delegate:function(e,t){var n;return t=t||window,arguments.length>2?(n=Array.prototype.slice.call(arguments,2),function(){return e.apply(t,n)}):function(){return e.call(t)}},dom:function(e,t){var n,i,o=e,a={wrap:o},s=o[0].getElementsByTagName("*"),r=s.length;for(i=0;r>i;i++)n=s[i].className,n.indexOf(t)>-1&&(n=n.split(t)[1]),n&&(a[n]=o.find(s[i]));return a},template:function(){var e,t,n,i,o=arguments;if(o.length>0&&a.isString(o[0]))if(e=o[0],2===o.length&&a.isObject(o[1]))for(t in o[1])void 0!==o[1][t]&&(n=new RegExp("({"+t+"})","g"),e=e.replace(n,o[1][t]));else for(i=1;i<o.length;i++)void 0!==o[i]&&(n=new RegExp("({["+(i-1)+"]})","g"),e=e.replace(n,o[i]));return e},__type:function(e){return null==e?String(e):o[Object.prototype.toString.call(e)]||"object"},isObject:function(e){return this.isFunction(e)||!(!e||"object"!=typeof e)},isFunction:function(e){return"function"===this.__type(e)},isArray:Array.isArray||function(e){return"array"===this.__type(e)},isNum:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},isString:function(e){return"string"===this.__type(e)},each:function(e,t,n){var i,o;if(a.isArray(e))for(i=0,o=e.length;o>i&&t.call(e[i],i,e[i],n)!==!1;i++);else for(i in e)if(t.call(e[i],i,e[i],n)===!1)break},funManager:{__loadList:{},__loadFun:function(e,t,n){e.methord&&a.isFunction(e.methord())&&(n=n||window,e.methord()(e,function(){t()},n))},load:function(e,t,n,i){i=i||0,e[i]&&a.funManager.__loadFun(e[i],function(){a.funManager.load(e,t,n,i+1)},n),t(i,n)},get:function(e){return this.__loadList[e]}},log:function(e){var t=window.console||{log:function(){}};t.log(e)},Event:{mousewheel:function(e){var t=e.originalEvent,n=t.detail?-1*t.detail:t.wheelDelta/40,i=0>n?-1:1;return{direction:i,unit:n}},__:function(e,t,n,i){var o;for(o in e)if(window[e[o].validator]){t[e[o].validator](e[o].prefix+n,i,!1);break}},add:function(e,t,n){var i=[{validator:"addEventListener",prefix:""},{validator:"attachEvent",prefix:"on"}];this.__(i,e,t,n)},remove:function(e,t,n){var i=[{validator:"removeEventListener",prefix:""},{validator:"detachEvent",prefix:"on"}];this.__(i,e,t,n)}},getUid:function(e){return a.template("me-{0}{1}-{2}",e,(new Date).getTime(),a.__Index++)},Browser:{isTouch:function(){var e=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture;return"ontouchstart"in window||e||window.DocumentTouch?!0:!1},Prefix:function(){var e,t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],n=document.createElement("div");for(e in t)if(void 0!==n.style[t[e]])return a.template("-{0}-",t[e].replace("Perspective","").toLowerCase())},parseURL:function(e){var t,n,i,o,a,s=document.createElement("a");return s.href=e,{source:e,protocol:s.protocol.replace(":",""),host:s.hostname,port:s.port,query:s.search,params:function(){for(t={},n=s.search.replace(/^\?/,"").split("&"),i=n.length,o=0,a;i>o;o++)n[o]&&(a=n[o].split("="),t[a[0]]=a[1]);return t}(),file:(s.pathname.match(/\/([^\/?#]+)$/i)||[null,""])[1],hash:s.hash.replace("#",""),path:s.pathname.replace(/^([^\/])/,"/$1"),relative:(s.href.match(/tps?:\/\/[^\/]+(.+)/)||[null,""])[1],segments:s.pathname.replace(/^\//,"").split("/")}}},Array:{indexOf:function(e,t){var n;for(n=0;n<e.length;n++)if(this[n]===t)return n;return-1},remove:function(e,t){var n=this.indexOf(e,t);return n>-1&&e.splice(n,1),e}}};i=function(e){this.initialized=!1,this.registerEvent={before:[],change:[],after:[]},this.options=e,this.init(e)},i.output=function(){a.log(a.list)},i.prototype.oninit=a.fn,i.prototype.init=function(e){this.initialized=!0,this.__Uid=a.getUid("me"),this.oninit(e),a.list[this.__Uid]=this},i.prototype.destory=function(){this.initialized=!1,delete a.list[this.__Uid]},i.prototype.getUid=function(){return this.__Uid},i.prototype.getOptions=function(){return this.options},i.prototype.config=function(){if(!(arguments.length>0))return this.options;if("string"==typeof arguments[0]){if(!(arguments.length>1))return this.options[name];this.options[arguments[0]]=arguments[1]}},i.prototype.on=function(e,t){var n=this,i=n.registerEvent[e];return i&&i.push(t),i},i.prototype.off=function(e,t){var n=this,i=n.registerEvent[e],o=[];a.each(i,function(e,n){n===t&&o.push(e)}),a.each(o.reverse(),function(e,t){i.splice(t,1)})},a.assembly=i,n.exports=a}),define("js/home/brands",["jquery","handlebars","source-map"],function(e,t,n){function i(e,t,n){var i,o=e,r={width:o.width(),left:o.offset().left,right:parseFloat(a(window).width())-parseFloat(o.offset().left)-parseFloat(o.width())};c.find(".brands-layer").remove(),i=s.compile(n),o.parent("li").find(".brands-dialog").html(i(t)),r.right-350<0&&o.parent("li").find(".brands-layer").addClass("brands-layer-right").css("left",-330-r.width)}var o,a=e("jquery"),s=e("handlebars"),r=a(".brands-tabs"),c=a(".brands-list"),l=a(".brands-category"),d=c.find("li>a"),u=l.find("a"),h=r.find("li>a"),f=r.find(".hoverarr"),p=u.height(),m=u.offset()?u.offset().top:0,g={},w='<div class="brands-layer">';w+='    <div class="layer-content">',w+='        <div class="title">{{title}}</div>',w+='        <div class="clearfix desc">',w+='            <img src="{{icon}}">',w+='            <p class="right">{{content}}</p>',w+="        </div> ",w+='        <div class="featured">',w+="            <p>{{subtitle}}</p> ",w+='            <div class="clearfix"> ',w+="                {{#each imgs}}",w+='                <img src="{{src}}">',w+="                {{/each}}",w+="            </div>",w+="        </div>",w+="    </div>",w+="</div>",a.easing.easeOutQuint=function(e,t,n,i,o){return i*((t=t/o-1)*t*t*t*t+1)+n},h.eq(0).parent("li").find(".brands-content").css("z-index","1"),h.hover(function(){var e=a(this);clearTimeout(o),o=setTimeout(function(){var t=parseFloat(e.offset().left)-parseFloat(r.offset().left);f.animate({left:t},200,"easeOutQuint")},200),r.find(".brands-content").removeAttr("style"),e.parent("li").find(".brands-content").css("z-index","1")},function(){clearTimeout(o)}),a(window).scroll(function(){a(this).scrollTop()>m?l.addClass("category-fix"):l.removeClass("category-fix")}),u.click(function(){var e=a(this).attr("href").split("#")[1],t=c.find("[name="+e+"]").offset().top-p;return a("html,body").animate({scrollTop:t},200),!1}),d.hover(function(){var e=a(this),t=e.attr("data-key"),n={url:"/brands/brandinfo",type:"get",success:function(t){200===t.code&&t.brand&&(g.hasOwnProperty(t.brand.key)||(g[t.brand.key]=t.brand),i(e,g[t.brand.key],w))}};clearTimeout(o),o=setTimeout(function(){g.hasOwnProperty(t)?i(e,g[t],w):a.ajax(n)},200)},function(){clearTimeout(o),c.find(".brands-layer").remove()})}),define("js/common/new-arrivls",["jquery","lazyload","handlebars","source-map"],function(e,t,n){function i(e){var t={index:0,isload:!0,isrun:!0,offset:{height:null,width:null}};return this.registerEvent={before:[],change:[],after:[]},this.options=o.extend(!0,{},t,e),this}var o=e("jquery"),a=e("lazyload"),s=e("handlebars");i.prototype.on=function(e,t){var n=this,i=n.registerEvent[e];return i&&i.push(t),i},i.prototype.exect=function(e,t){var n,i=this;if(i.registerEvent[e]&&i.registerEvent[e].length>0)for(n in i.registerEvent[e])i.registerEvent[e].hasOwnProperty(n)&&i.registerEvent[e][n](t)},i.prototype.init=function(){function e(){n.isrun&&n.isload&&t.__directionCalculation()&&(n.isload=!1,n.index++,t.exect("after",n)),t.exect("change",n)}var t=this,n=this.options;t.exect("before",n),o(window).scroll(e)},i.prototype.emit=function(){var e=this.options;e.isload=!0},i.prototype.stop=function(){var e=this.options;e.isrun=!1,e.isload=!1},i.prototype.__directionCalculation=function(){var e=this.options;return e.offset.height&&e.offset.height()>0&&o(window).scrollTop()+window.innerHeight>=e.offset.height()?!0:!1},n.exports=function(e){var t,n=o("#newarrivals .goods-container"),r=o(".loading a"),c=new i({index:1,isload:!1,offset:{height:function(){return parseFloat(n.offset().top)+parseFloat(n.height())-200}}}),l=e.url,d=e.count,u=e.rows;e.pageIndex=0,delete e.url,delete e.count,delete e.rows,t=function(e,t,i){var l={type:"POST",url:e,success:function(e){var o,l,d,u=e.code;200===u?(l=e.goods.length%i,d=e.goods.length-l-1,e.goods.splice(d,l),o=s.compile(c.tpl),n.append(o(e.goods)),t.pageIndex=t.pageIndex+e.goods.length,a(n.find("img.lazy")),c.emit()):(c.stop(),r.html("查看更多"))},error:function(){c.stop(),r.html("网络断开连接了~")}};l.data=t,o.ajax(l)},c.on("after",function(n){e.pageCount=d*u[1],t(l,e)}),c.on("before",function(n){c.tpl="{{#each this}}",c.tpl+='<div class="good-info" data-skn="{{skn}}">',c.tpl+='    <div class="tag-container clearfix">',c.tpl+="        {{# tags}}",c.tpl+="            {{# isNew}}",c.tpl+='                <span class="good-tag new-tag">NEW</span>',c.tpl+="            {{/ isNew}}",c.tpl+="            {{# isReNew}}",c.tpl+='                <span class="good-tag renew-tag">再到着</span>',c.tpl+="            {{/ isReNew}}",c.tpl+="            {{# isSale}}",c.tpl+='                <span class="good-tag sale-tag">SALE</span>',c.tpl+="            {{/ isSale}}",c.tpl+="            {{# isNewFestival}}",c.tpl+='                <span class="good-tag new-festival-tag">新品节</span>',c.tpl+="            {{/ isNewFestival}}",c.tpl+="            {{# isLimit}}",c.tpl+='                <span class="good-tag limit-tag">限量商品</span>',c.tpl+="            {{/ isLimit}}",c.tpl+="            {{# isYearEndPromotion}}",c.tpl+='                <span class="good-tag yep-tag">年终大促</span>',c.tpl+="            {{/ isYearEndPromotion}}",c.tpl+="            {{# isYearMidPromotion}}",c.tpl+='                <span class="good-tag ymp-tag">年中热促</span>',c.tpl+="            {{/ isYearMidPromotion}}",c.tpl+="        {{/ tags}}",c.tpl+="    </div>",c.tpl+='    <div class="good-detail-img">',c.tpl+='        <a class="good-thumb" href="{{url}}" target= "_blank">',c.tpl+='            <img class="lazy" data-original="{{thumb}}">',c.tpl+="        </a>",c.tpl+="        {{# isFew}}",c.tpl+='            <p class="few-tag">即将售罄</p>',c.tpl+="        {{/ isFew}}",c.tpl+="        {{#if showColBtn}}",c.tpl+='            <span class="col-btn iconfont{{#if coled}} coled{{/if}}">&#xe616;</span>',c.tpl+="        {{/if}}",c.tpl+="    </div>",c.tpl+='    <div class="good-detail-text">',c.tpl+='        <a href="{{url}}" target= "_blank">{{name}}</a>',c.tpl+='        <p class="price">',c.tpl+='            <span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">',c.tpl+="                ¥{{salePrice}}",c.tpl+="            </span>",c.tpl+="            {{# marketPrice}}",c.tpl+='                <span class="market-price">¥{{.}}</span>',c.tpl+="            {{/ marketPrice}}",c.tpl+="        </p>",c.tpl+="    </div>",c.tpl+="</div>",c.tpl+="{{/each}}",e.pageCount=d*u[0],t(l,e,e.count)}),c.init()}});