index.js
96 KB
define("index",["jquery","handlebars","source-map","index","lazyload","dot","jquery.placeholder"],function(e,t,a){var n;e("js/common"),e("js/header"),e("js/simple-header"),e("js/product/entry"),e("js/index/index"),e("js/brand/index"),e("js/passport/entry"),e("js/order/ensure"),a.exports=n}),define("js/common",["jquery"],function(e,t,a){function n(e){var t=new RegExp(e+"=([^;$]*)","i"),a="$1";return t.test(decodeURIComponent(document.cookie))?RegExp[a]:""}function i(e,t,a){var n,i,o,s,r="";"undefined"!=typeof t&&(a=a||{},null===t&&(t="",a.expires=-1),a.expires&&("number"==typeof a.expires||a.expires.toUTCString)&&("number"==typeof a.expires?(s=new Date,s.setTime(s.getTime()+24*a.expires*60*60*1e3)):s=a.expires,r="; expires="+s.toUTCString()),n=a.path?"; path="+a.path:"",i=a.domain?"; domain="+a.domain:"",o=a.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,n,i,o].join(""))}function o(){var e,t=n("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function s(){var e=o();return 0===e?0:e[1]}function r(){var e=n("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function d(){var e,t,a={},n=window.location.search,i=n?decodeURIComponent(n).slice(1).split("&"):[];for(t=0;t<i.length;t++)e=i[t].split("="),a[e[0]]=e[1];return a}var l=e("jquery"),c=l("body");e("js/footer"),function(e,t,a,n,i){var o=t.createElement(a),s=t.getElementsByTagName(a)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[i].p=arguments},o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js","_yas"),function(){var e=s();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.14","yohobuy_web",e,"","")}(),l(window).on("resize",function(){var e=l(this).width();1360>e?l(".return-top").addClass("min"):l(".return-top").removeClass("min"),1180>e?c.addClass("min-screen"):c.removeClass("min-screen")}).trigger("resize"),window.cookie=n,window.setCookie=i,window.getUser=o,window.getUid=s,window.getShoppingKey=r,window.queryString=d}),define("js/footer",["jquery"],function(e,t,a){function n(){var e=s("#subscriber-box"),t=s("#subscriber-btn"),a=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,n={mail:"",tick:""};e.focus(function(){s(this).val("").css("color",""),t.removeClass("done").html(n.mail)}),t.click(function(){var i=s.trim(e.val());if(""!==i&&a.test(i))try{s.ajax({url:"http://new.yohobuy.com/common/emailsubscriber",dataType:"jsonp",data:{email:i,tmp:Math.random(),uid:window.getUid()},success:function(a){1===a.data.result?(e.val("已订阅到:"+i),t.addClass("done").html(n.tick)):e.css("color","red")}})}catch(o){console.log(o.message)}else e.css("color","red")})}function i(){var e=s(".vote"),t=s("#feed-back-page"),a=e.children("li").length;t.on("click","span",function(){var t=s(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 n=s(this),i=n.closest("li"),o=i.index(),r=[],d=i.find(".feedback-answer").val(),l=i.find(".feedback-id").val(),c=i.find(".question-id").val();i.find(":checked").each(function(){r.push(s(this).val())}),s.ajax({url:"http://new.yohobuy.com/common/suggestfeedback",dataType:"jsonp",data:{feedback_id:l||0,question_id:c||0,answer:d||"",solution:r.join(",")},success:function(n){var s=o+1;if(1===~~n.data.result){if(o===a-1)return void alert("感谢您的参与!");i.addClass("hide"),e.children(":eq("+(o+1)+")").removeClass("hide"),t.children(".cur").removeClass("cur"),t.children(":eq("+s+")").addClass("cur")}}})})}function o(){s(window).height()>s(document).height()&&r.addClass("hide")}var s=e("jquery"),r=s(".return-top");r.click(function(){s("html,body").animate({scrollTop:0},500)}),s(window).scroll(function(){0===s(window).scrollTop()?r.addClass("hide"):r.removeClass("hide")}),r.hasClass("hide")&&s("img").load(o),n(),i(),window.rePosReturnTop=o}),define("js/header",["jquery","handlebars","source-map","index"],function(e,t,a){function n(e,t,a){try{te.push({louceng:e,weizhi:t,event:a})}catch(n){}}function i(){var e=G("#nav_keyword").text(),t="vans",a=G("#query_key");""!==e?(a.css({color:"#000"}),a.val(e)):(a.css({color:"#e0e0e0"}),a.val(t),a.on("focus",function(e){a.css({color:"#000"}),a.val("")}))}function o(){var e={cookie:"_g",cartNum:""},t="",a="",n=0,i=0,o=0,s=0,r="";G.fn.miniCart=function(n){if(t=G.extend(e,n),"undefined"==typeof window.cookie(t.cookie))a=null;else if(t.cookie)try{a=V.parse(window.cookie(t.cookie))}catch(i){}null!==a&&""!==a&&(s=parseInt(a._nac)+parseInt(a._ac),0===s?G("#icart-num").attr("class","icart-num icart-none"):G("#icart-num").attr("class","icart-num"),G(t.cartNum).html(s))},G.fn.search=function(e){function t(t){var a=G.trim(G(t).val());return a=a.replace(new RegExp("'","gm"),""),""===a?(G(".search-list").hide(),!1):(a=encodeURI(a),void G.get(e+"?query="+a,function(e){G(".search-list").html(e.data),n=G(".search-list").children("li").length,i=-1,n>0?G(".search-list").show():G(".search-list").hide(),G(".search-list").find("a").hover(function(){G(this).css("background-color","#eee")},function(){G(this).css("background-color","#fff")})},"jsonp"))}function a(e){G(".search-list li:eq("+o+")").children("a").css("background-color","#fff"),G(".search-list li:eq("+i+")").children("a").css("background-color","#eee"),r=G(".search-list li:eq("+i+")").children("a").attr("title"),G("#query_key").val(r)}return this.each(function(){G(this).keyup(function(e){if(38===e.which){if(0===n)return!1;-1===i&&(i=0),o=i,i=(i-1+n)%n,a(this)}else if(40===e.which){if(0===n)return!1;o=i,i=(i+1)%n,a(this)}else 13===e.which?window.submitSearch():t(this)})})},G.extend({getData:function(e,t,a){var n={page:1,method:"",v:1,return_type:"jsonp",open_key:"12345",tmp:Math.random()},i="";if(void 0===typeof e||""===e)return!1;if(i=G.extend(n,t),i.page=i.page||1,""===i.method)return!1;try{G.getJSON(e+"/?callback=?",i,function(e){return""!==a?("undefined"!=typeof a(e.data)&&V.parse(a(e.data)),!1):void 0})}catch(o){console.log(o.message)}},getShoppingKey:function(){var e=window.cookie("_g"),t=V.parse(e);return"undefined"==typeof e||null===e?"":t._k}})}function s(e){var t;200===+e.code&&"object"==typeof e.data&&(t=""!==e.data.url?'<a target="_blank" href="'+e.data.url+'" class="page-top-banner"style="height:36px;border:none;background-image:url('+window.unescape(e.data.src)+');background-position: center;display:block;"> </a>':'<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>',G("body").prepend(t))}function r(e){var t=document.createElement("script");t.src=le+e+"&client_type=web&callback=JsonPCallBack",document.getElementsByTagName("head")[0].appendChild(t)}function d(e,t){var a,n;G(e).hover(function(e){e.preventDefault(),a=G(this),n=G(t)[0],""===n.style.display?(a.addClass("acttags"),n.style.display="block"):(a.removeClass("acttags"),n.style.display="")})}function l(){var e,t,a=[{sourceClass:".myyoho",targetClass:".myyoho-info"},{sourceClass:".phone",targetClass:".qr"}];for(t=0;t<a.length;t++)e=a[t],d(e.sourceClass,e.targetClass)}function c(){var e;G(".yohogroup").mouseenter(function(){e=G(this),e.text(e.attr("cn"))}),G(".yohogroup").mouseleave(function(){e=G(this),e.text(e.attr("en"))})}function u(){var e,t,a=["webkit","moz","ms"];for(t=0;t<a.length;t++)return e=a[t]+"RequestAnimationFrame",window[e]?!0:!1}function h(){var e=["webkit","moz","ms"],t=e[0]+"RequestAnimationFrame",a=e[1]+"RequestAnimationFrame",n=e[2]+"RequestAnimationFrame";return window[t]?function(e){requestAnimationFrame(e)}:window[a]?function(e){window[a](e)}:window[n]?function(e){window[n](e)}:function(e){window.setTimeout(e,67)}}function p(){ne+=10,ie.css({transform:"rotateX("+ne+"deg)","-webkit-transform":"rotateX("+ne+"deg)","-moz-transform":"rotateX("+ne+"deg)"}),ne/90%2===1&&(oe?(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo1.png)"),oe=!1):(ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),oe=!0)),ne/90%2===0&&ne%360!==0?window.setTimeout(p,3e3):ne%360===0?window.setTimeout(p,6e4):ae(function(){p()})}function f(){H&&window.clearTimeout(H),ie.fadeOut(se,function(){oe=!1,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo.png)"),ie.fadeIn(se,function(){N=window.setTimeout(function(){ie.fadeOut(se,function(){window.clearTimeout(N),oe=!0,ie.css("background-image","url(http://static.yohobuy.com/newheader/img/logo_e.png)"),ie.fadeIn(se,function(){H=window.setTimeout(f,6e4)})})},3e3)})})}function m(){u()?(ae=h(),window.setTimeout(p,3e3)):window.setTimeout(f,3e3)}function g(e){var t=G(e);t.find(".thirdnavbar").each(function(){var e=G(this),t=e.find("a"),a=t.attr("href"),n="hot"===t.attr("hot")?!0:!1,i={};i=e.hasClass("category-title")?{type:"title",height:49,content:e.text(),index:window.valueIndex,href:a,hot:!1}:{type:"catlist",height:36,content:t.text(),index:window.valueIndex,href:a,hot:n},window.valueIndex++,window.newArr.push(i)})}function v(){var e=window.newArr.length,t=0,a=[],n=[],i=[],o=[],s="",r="",d="",l=0,c=0,u=0;for(t;e>t;t++){if(a=window.newArr[t],0===window.gindex&&(window.oh1=window.oh1+a.height,window.oh1>=340&&t!==e-1&&(window.targetArr1=window.newArr.slice(0,a.index+1),window.nowIndex=a.index+1,window.gindex++),t===e-1)){window.targetArr1=window.newArr.slice(0,e+1);break}if(1===window.gindex&&(window.oh2=window.oh2+a.height,window.oh2>=340&&t!==e-1&&(window.targetArr2=window.newArr.slice(window.nowIndex,a.index+1),window.nowIndex=a.index+1,window.gindex++),t===e-1)){window.targetArr2=window.newArr.slice(window.nowIndex,e+1);break}if(2===window.gindex){if(window.oh3=window.oh3+a.height,window.oh3>=340&&t!==e-1){window.targetArr3=window.newArr.slice(window.nowIndex,a.index+1),window.nowIndex=a.index+1,window.gindex++;break}if(t===e-1){window.targetArr3=window.newArr.slice(window.nowIndex,e+1);break}}}for(l;l<window.targetArr1.length;l++)n=window.targetArr1[l]||{},"title"===n.type?window.inner1=window.inner1+'<li class="cattitle"><h3><a href="'+n.href+'">'+n.content+"</a></h3></li>":n.hot===!0?window.inner1=window.inner1+'<li class="catdetail"><a class="thirdcatelink hot" href="'+n.href+'">'+n.content+"</a></li>":window.inner1=window.inner1+'<li class="catdetail"><a class="thirdcatelink" href="'+n.href+'">'+n.content+"</a></li>";for(c;c<window.targetArr2.length;c++)i=window.targetArr2[c]||{},"title"===i.type?window.inner2=window.inner2+'<li class="cattitle"><h3><a href="'+i.href+'">'+i.content+"</a></h3></li>":i.hot===!0?window.inner2=window.inner2+'<li class="catdetail"><a class="thirdcatelink hot" href="'+i.href+'">'+i.content+"</a></li>":window.inner2=window.inner2+'<li class="catdetail"><a class="thirdcatelink" href="'+i.href+'">'+i.content+"</a></li>";for(u;u<window.targetArr3.length;u++)o=window.targetArr3[u]||{},"title"===o.type?window.inner3=window.inner3+'<li class="cattitle"><h3><a href="'+o.href+'">'+o.content+"</a></h3></li>":o.hot===!0?window.inner3=window.inner3+'<li class="catdetail"><a class="thirdcatelink hot" href="'+o.href+'">'+o.content+"</a></li>":window.inner3=window.inner3+'<li class="catdetail"><a class="thirdcatelink" href="'+o.href+'">'+o.content+"</a></li>";""!==window.inner1&&(s='<ul class="cate_row1 cate_row">'+window.inner1+"</ul>"),""!==window.inner2&&(r='<ul class="cate_row2 cate_row">'+window.inner2+"</ul>"),""!==window.inner3&&(d='<ul class="cate_row3 cate_row">'+window.inner3+"</ul>"),window.finalresult=s+r+d,G("#"+window.wrapperindex).empty().append(window.finalresult)}function w(){G(".categorywrapper").each(function(e){window.wrapperindex=G(this).attr("id"),window.newArr=[],window.gindex=0,window.targetArr1=[],window.targetArr2=[],window.targetArr3=[],window.oh1=0,window.oh2=0,window.oh3=0,window.valueIndex=0,window.nowIndex=0,window.inner1="",window.inner2="",window.inner3="",g(G(this).find(".category")),v()})}function y(){var e={},t="",a="",n="",i="",o="";G(document).on("mouseenter",".sub-nav-item",function(){t=G(this).find(".showdetail").attr("data-code"),t&&(e[t]||(e[t]=t,a=G(this).find(".showdetail").find("img"),n=G(this).find(".showdetail").find(".title"),i=G(this).find(".showdetail").find("a"),G.get(le+t+"&width=337&height=250&client_type=web",function(e){a.attr("src",e.data.src),i.attr("href",e.data.url),n.text(e.data.title)},"jsonp")))}),o=G(".cure").find(".name-cn").find("a").attr("href"),G(".main-link").attr("href",o)}function b(){var e=G("#cover");e.remove()}function C(){var e,t=window.cookie("_Gender"),a="",i="",o="",s="";"http://www.yohobuy.com/"!==window.location.href||"undefined"!=typeof t&&""!==t&&null!==t||G.get("http://www.yohobuy.com/index/guide",function(t){a=document.createElement("div"),a.id="cover",a.innerHTML=t,document.body.appendChild(a),i=G(window).height(),o=G(".guide-box").height(),e=i/2-o/2,s=G(".guide-box .clear").find("li").length,G(".guide-box").css({width:200*s+"px",top:e+"px"}),G("#cover").bind("click",function(e){window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),b()}),G("#cover .guide-box .close").bind("click",function(e){n("弹窗","CLOSE","homepage_man"),window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),b()}),G(".boys img , .boys .go").bind("click",function(e){n("弹窗","BOYS","homepage_man"),window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7}),b()}),G(".girls img, .girls .go").bind("click",function(e){n("弹窗","GIRLS","homepage_woman"),window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:90}),window.setCookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})}),G(".lifestyle img, .lifestyle .go").bind("click",function(e){window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),n("弹窗","LIEFSTYLE","homepage_lifestyle")}),G("#cover .guide-box").bind("click",function(e){e.stopPropagation()})})}function i(){var e=G("#nav_keyword").text(),t=G("#defaultsearch").val(),a=G("#query_key");""!==e?(a.css({color:"#000"}),a.val(e)):(a.css({color:"#e0e0e0"}),a.val(t),a.on("focus",function(e){a.css({color:"#000"}),a.val("")}))}function x(){var e=window.cookie("_Gender"),t=G(".cure");"undefined"!=typeof e&&""!==e&&window.setCookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===t.find(".name-cn a").text()&&(window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===t.find(".name-cn a").text()&&window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),"创意生活"===t.find(".name-cn a").text()&&window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===t.find(".name-cn a").text()&&window.setCookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})}function k(){G(".first-nav-item").click(function(){var e=window.cookie("_Gender");"undefined"!=typeof e&&""!==e&&window.setCookie("_Gender",1,{path:"/",domain:".yohobuy.com",expires:7}),"男生"===G(this).find(".name-cn a").text()&&(window.setCookie("_Gender","1,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","boys",{path:"/",domain:".yohobuy.com",expires:7})),"女生"===G(this).find(".name-cn a").text()&&(window.setCookie("_Gender","2,3",{path:"/",domain:".yohobuy.com",expires:7}),window.setCookie("_Channel","girls",{path:"/",domain:".yohobuy.com",expires:7})),"创意生活"===G(this).find(".name-cn a").text()&&window.setCookie("_Channel","lifestyle",{path:"/",domain:".yohobuy.com",expires:7}),"潮童"===G(this).find(".name-cn a").text()&&window.setCookie("_Channel","kids",{path:"/",domain:".yohobuy.com",expires:7})})}function j(){var e,t,a,n=document.cookie,i=n.split(";");for(e=0;e<i.length;e++)t=i[e].split("="),"undefined"!=typeof t[0]&&(a=t[0].replace(/\s/g,""),de[a]=t[1])}function _(){G("#miniCartBox").miniCart({cartNum:".ic-infomation"})}function $(){var e,t,a;G.getData(X,{method:"open.Shoppingcart.getCartData",shopping_key:G.getShoppingKey()},function(n){""===J&&(J=Y.compile(G("#mini-cart-tpl").html())),G("#miniCartBox").children(".gobuy-wrapper").html(J({carData:n})),0===parseInt(G(".ic-infomation").html())&&G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'),G("#miniCartBox .goods-list li").length<1&&(e=window.cookie("_g"),t=V.parse(e),null!==t&&(a='{"_k":"'+t._k+'","_nac":0,"_ac":0,"_r":0}',window.setCookie("_g",a,{path:"/",domain:".yohobuy.com"})),G(".ic-infomation").html(0),G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>'))})}function q(e,t){G.getData(X,{method:"open.Shoppingcart.delone",shopping_key:G.getShoppingKey(),id:e,isreduce:t},function(e){var t=window.cookie("_g"),a=V.parse(t),n='{"_k":"'+a._k+'","_nac":'+e.total_goods_num+',"_ac":0,"_r":0}';window.setCookie("_g",n,{path:"/",domain:".yohobuy.com"}),$(),_()})}function T(){var e,t,a;G(document).on("click",".goodscardelete",function(n){e=G(this),t=e.attr("goodsid"),a=e.attr("cheapest"),q(t,a)})}function A(){var e;G(document).on("click",".mycart_i_down",function(t){e=G(this),e.toggleClass("mycart_i_up"),G("#mycartmore").slideToggle(300)})}function I(){var e,t="http://www.yohobuy.com/shopping/cart";G("#miniCartBox").on("click",function(a){e=G(a.target),e.hasClass("gobuy")&&(window.location.href=t)})}function S(e){1===e?(G("#miniCartBox").addClass("list-cur"),G(".gobuy-wrapper").show(),0!==parseInt(G(".ic-infomation").html())?(G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-loading"><h3 class="information">加载中,请稍后</h3></div>'),$()):G("#miniCartBox .gobuy-wrapper").html('<div class="gobuy-empty"><h3 class="information">您的购物车暂无商品</h3></div>')):(G("#miniCartBox").removeClass("list-cur"),G(".gobuy-wrapper").hide())}function O(){var e;G("#miniCartBox").mouseenter(function(t){e=G(t.target),("miniCartBox"===e.attr("id")||"ic-infomation"===e.attr("class"))&&S(1)}),G("#miniCartBox").mouseleave(function(e){S(0)})}function P(){var e,t="indexkids",a="indexlifestyle",n="indexboys",i="indexgirls",o="uniquebrand",s=window.location.href,d=window.location.host,l="";-1!==s.indexOf("search")&&(l=re["search"+de._Channel]),-1!==s.indexOf("list")&&(l=re["list"+de._Channel]),-1!==s.indexOf("brands")&&(l=re["brands"+de._Channel]),-1!==s.indexOf("new")&&(l=re["new"+de._Channel]),-1!==s.indexOf("sale")&&(l=re["sale"+de._Channel]),-1!==s.indexOf("home")&&(l=re["home"+de._Channel]),-1!==s.indexOf("kids")&&(l=re[t]),(-1!==s.indexOf("woman")||-1!==s.indexOf("girls"))&&(l=re[i]),-1!==s.indexOf("lifestyle")&&(l=re[a]),-1!==s.indexOf("www.yohobuy.com")&&"/"===window.location.pathname&&(l=re[n]),e=d.split(".")[0],"list"!==e&&"search"!==e&&"www"!==e&&"new"!==e&&"item"!==e&&"guang"!==e&&(l=re[o+de._Channel]),r(l)}function z(e){G(".hot-brands").find("ul").stop().animate({opacity:0,"z-index":1},200).eq(e).animate({opacity:1,"z-index":2},200)}function M(){var e,t=0;G(".hot-brands").size()>0&&(e=G(".hot-brands").find("ul").size(),G(".hot-brands").find("ul").eq(0).css({opacity:1,"z-index":2}),G(".brands-control").on("click",".next",function(){t===e-1?t=0:t++,z(t)}),G(".brands-control").on("click",".prev",function(){0===t?t=e-1:t--,z(t)}))}function E(){setInterval(_,2e3)}function B(){var e=G("#goodcartempwarpper"),t="";e&&e.html()&&(t=G("#goodcartempwarpper").html().replace(/\\/g,""),G("#goodcartempwarpper").html(t),W=Y.compile(G("#tmpl-my-login-new").html()))}function D(){var e="http://search.yohobuy.com/api/suggest";G("#query_key").search(e)}function F(e){var t=(new Date).getTime(),a='<span>Hi~</span>[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out ">请登录</a>] [<a href="http://www.yohobuy.com/reg.html" class="list-a login-out" onclick="">免费注册</a>]',n='<span>Hi~<a href="http://www.yohobuy.com/home?t='+t+'">{{user_name}}</a></span> {{#if islogin}}[<a href="{{logout}}" class="list-a login-out">退出</a>]{{/if}}{{#unless islogin}}[<a href="http://www.yohobuy.com/signin.html" class="list-a login-out">请登录</a>] [<a href="http://www.yohobuy.com/reg.html" onclick="" class="list-a login-out">免费注册</a>]{{/unless}}',i=G("#loginBox"),o=window.cookie("_UID"),s=e.data.profile_name,r=0,d=0,l="",c=o.split("::"),u=c[0]||" ",h="http://www.yohobuy.com/logout_",p="1",f=0,m={user_name:s,logout:h+e.data.token+".html",random:Math.random()};if(Z=Y.compile(n),"undefined"==typeof o||null===o)return i.html(a),!1;if("undefined"==typeof c||c.length<4)return i.html(a),!1;for(d;d<u.length;d++)l=u.substr(d,1),r+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1;if(10>=r)s=u;else{for(f=0,d;d<u.length;d++)10>f&&(l=u.substr(d,1),"*"!==l&&(f+=/.*[\u4e00-\u9fa5]+.*$/.test(l)?2:1),s+=l);s.length<u.length&&(s+="...")}h=/http:\/\//.test(c[3])?c[3].replace("www.yohobuy.com","www.yohobuy.com"):"http://www.yohobuy.com/logout_"+c[3]+".html",-1===e.result&&(p="-1"),m.islogin=p,i.html(Z(m))}function U(e){var t=e.data,a="";if(1===e.result){if(void 0===typeof t||t.length<1)return!1;"3"===t.vip.curVipInfo.curLevel&&(t.vip3=!0),G("#myYohoBox").mouseenter(function(){return G(this).addClass("acttags"),G("#myYohoBox .myyoho-info").show().html(W(t)),a=G(".myyoho-photo img").attr("data-url"),1===G._checkUrlState?void G(".myyoho-photo").show().find("img").attr("src",a):void(""!==a&&""===G._checkUrl&&G.ajax({url:a,type:"GET",complete:function(e){(200===e.status||0===e.status)&&(G(".myyoho-photo").show().find("img").attr("src",a),G._checkUrlState=1),G._checkUrl=a}}))}),G("#myYohoBox").mouseleave(function(){G(this).removeClass("acttags"),G("#myYohoBox .myyoho-info").hide()})}}function L(){var e={method:"open.passport.get"};G.getData(X,e,function(e){-1!==e.result&&(F(e),U(e))})}function R(){w(),y(),B(),C(),x(),k(),j(),o(),c(),l(),m(),P(),M(),i(),O(),_(),E(),D(),I(),T(),A(),L(),i()}var H,N,G=e("jquery"),Y=e("handlebars"),V=e("index"),W=null,Z=null,X=G("#api-domain").val(),J="",K=/^[\^\!\+\-\(\)\:\[\]\\\{\}\~\*\?\|\&\;\/]{0,}$/g,Q="",ee="",te=[],ae=null,ne=0,ie=G(".icon-logo"),oe=!0,se=500,re={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"},de={},le="http://new.yohobuy.com/common/getbanner?content_code=";G("#api-domain").remove(),window.submitSearch=function(){var e,t,a=G("#query_key").val(),i=G("#defaultsearch").val(),o="Search",s="Head Search",r="Search";if(e=G.trim(Q.toLowerCase()),t=G.trim(a.toLowerCase()),n(o,s,r),""!==ee&&""!==Q&&e===t)location.href=ee.replace("'","");else{if(!K.test(a)||""===a)return""===a&&G("#query_key").val(i),G("#searchForm").submit(),!1;location.href="http://search.yohobuy.com/error?query="+a+"&result=error"}},Y.registerHelper("timestamp",function(){return(new Date).getTime()}),Y.registerHelper("headerimg",function(e){return""===e?"http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100":e}),Y.registerHelper("equallevelthree",function(e,t){return"3"===e?t.fn(this):t.inverse(this)}),Y.registerHelper("equalzero",function(e,t){return"0"===e?t.fn(this):t.inverse(this)}),window.JsonPCallBack=s,window.newArr=[],window.wrapperindex=0,window.gindex=0,window.targetArr1=[],window.targetArr2=[],window.targetArr3=[],window.oh1=0,window.oh2=0,window.oh3=0,window.valueIndex=0,window.nowIndex=0,window.inner1="",window.inner2="",window.inner3="",window.finalresult="",R()}),define("js/simple-header",["jquery"],function(e,t,a){function n(e){var t,a,n,i=0,o=0;for(n=0;n<e.length;n++)a=e.substr(n,1),o+=/.*[\u4e00-\u9fa5]+.*$/.test(a)?2:1;if(10>=o)t=e;else{for(i=0,t="",n=0;n<e.length;n++)10>i&&(a=e.substr(n,1),"*"!==a&&(i+=/.*[\u4e00-\u9fa5]+.*$/.test(a)?2:1),t+=a);t.length<e.length&&(t+="...")}return t}function i(e){var t,a;e&&e.href&&e.href.user?(a=n(e.href.user),t='<span>Hi~</span><a href="">'+a+'</a> <a href="'+e.href.logout+'">[退出]</a>'):(a=n(e.user),t='<span>Hi~</span><a href="">'+a+'</a> <a href="http://www.yohobuy.com/signin.html">[请登录]</a><a href="http://www.yohobuy.com/reg.html">[免费注册]</a>'),r(".header-tool li").eq(0).html(t)}function o(){r.ajax({type:"GET",url:"/common/getSimpleHeader",data:{},success:function(e){200===e.code&&i(e.data)}})}function s(){o()}var r=e("jquery");r(".simple-header").size()>0&&r(".tool-options").on("mouseenter",function(){r(this).find(".tool-select").fadeIn()}).on("mouseleave",function(){r(this).find(".tool-select").fadeOut()}),s()}),define("js/product/entry",["jquery","handlebars","source-map","lazyload"],function(e,t,a){e("js/product/list"),e("js/product/brand"),e("js/product/hotrank")}),define("js/product/list",["jquery","handlebars","source-map","lazyload"],function(e,t,a){e("js/product/filter"),e("js/product/sort-pager"),e("js/product/latest-walk"),e("js/product/product")}),define("js/product/filter",["jquery","handlebars","source-map"],function(e,t,a){function n(e){e.removeClass("checked").html(w.unchecked)}function i(){b.addClass("hide"),C.removeClass("hide")}function o(){C.addClass("hide"),b.removeClass("hide")}function s(e,t){var a,n=window.queryString();n[e]=t,a="?"+decodeURIComponent(g.param(n)),window.location.href=a}function r(e){T.children(".senior-sub:eq("+m+")").addClass("hide"),A.children(".attr:eq("+m+")").removeClass("hover"),m=-1}var d,l,c,u,h,p,f,m,g=e("jquery"),v=e("handlebars"),w={unchecked:"",checked:""},y={up:"",down:""},b=g(".brand .default"),C=g(".brand .brand-panel"),x=C.find(".attr"),k=g("#brand-more"),j=g("#brand-multi"),_=g(".ud-price-range"),$=/^\d+$/,q=g(".sort-sub-wrap"),T=g(".senior-sub-wrap"),A=g(".senior-attr-wrap"),I='{{# size}}<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>{{/ size}}',S={},O=g(".filter-box .size");I=v.compile(I),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(),a=e.data("id");return e.hasClass("active")?(e.removeClass("active"),q.children(":eq("+t+")").addClass("hide"),void O.addClass("hide")):(e.siblings(".active").removeClass("active"),e.addClass("active"),q.children(":not(.hide)").addClass("hide"),q.children(":eq("+t+")").removeClass("hide"),void(O.data("load")||(S[a]?(O.find(".attr-content").html(S[a]),O.removeClass("hide")):g.ajax({url:"/product/search/sortSize",data:{msort:a}}).then(function(e){"array"===g.type(e)&&e.length?(S[a]=I({size:e}),O.find(".attr-content").html(S[a]),O.removeClass("hide")):O.addClass("hide")}))))}),k.length>0&&(d=k.children("em"),l=k.children(".iconfont")),j.click(function(){"none"===C.css("display")&&k.trigger("click"),i(),C.removeClass("hide").addClass("multi"),g(this).addClass("hide"),k.addClass("hide")}),k.click(function(){var e=g(this);e.hasClass("more")?(o(),d.text("更多"),l.html(y.down)):(i(),d.text("收起"),l.html(y.up)),g(this).toggleClass("more")}),g(".brands-index").on("mouseenter","span",function(){var e=g(this),t=e.data("index");e.hasClass("hover")||(e.siblings("span.hover").removeClass("hover"),e.addClass("hover"),0===e.index()?x.removeClass("hide"):x.addClass("hide").filter("[data-index="+t+"]").removeClass("hide"))}),g("#brand-search-input").keyup(function(){var e=g(this).val().toLowerCase();""===e?x.removeClass("hide"):x.addClass("hide").filter('[data-key*="'+e+'"]').removeClass("hide")}),g("#brand-multi-ok").click(function(){var e=[];g(this).hasClass("dis")||(C.find(".checked").each(function(){e.push(g(this).data("id"))}),s("brand",e.join(",")))}),g(".multi-select-cancel").click(function(){var e=g(this).closest(".multi");e.hasClass("brand-panel")&&(j.removeClass("hide"),k.trigger("click"),k.removeClass("hide")),e.addClass("hide").removeClass("multi"),o(),n(e.find(".checkbox.checked"))}),g(".check-container").on("click",".attr",function(){var e=g(this),t=e.find(".checkbox"),a=e.closest(".brand-panel, .senior-sub").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?a.removeClass("dis"):a.addClass("dis")}),g(".brand, .senior").on("click",".attr > a",function(e){g(this).closest(".multi").length>0&&e.preventDefault()}),g(".filter-box").on("click","li.checked, a.checked",function(e){e.preventDefault()}),_.length>0&&(c=_.find(".limit"),u=c.filter(".min"),h=c.filter(".max"),p=_.find(".price-sure"),c.keyup(function(){var e,t,a,n=g.trim(g(this).val()),i=$.test(n);i||(e=parseInt(n,10),g(this).val(isNaN(e)?"":e)),t=g.trim(u.val()),a=g.trim(h.val()),""!==t||""!==a?p.removeClass("hide"):p.addClass("hide")}),p.click(function(){var e,t=g.trim(u.val()),a=g.trim(h.val());""!==t&&""!==a&&+t>+a&&(e=a,a=t,t=e),s("price",t+","+a)})),A.on("mouseenter",".attr",function(){var e=g(this),t=e.index();e.hasClass("no-sub")||(e.addClass("hover").siblings().removeClass("hover"),T.children(".senior-sub:eq("+t+")").removeClass("hide").siblings().addClass("hide"))}).on("mouseleave",".attr",function(){var e=g(this),t=e.index();e.hasClass("no-sub")||(m=t,f=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"),a=[];e.hasClass("dis")||(t.find("span.checked").each(function(){a.push(g(this).data("id"))}),s(t.data("attr"),a.join(",")))}).on("mouseenter",function(){clearTimeout(f)}).on("mouseleave",function(){r()})}),define("js/product/sort-pager",["jquery"],function(e,t,a){var n=e("jquery"),i=n("#count-per-page"),o=i.next("ul"),s=200;n(document).click(function(e){n(e.target).closest(".page-count").length>0||o&&o.slideUp(s)}),i.click(function(){"none"===o.css("display")?o.slideDown(s):o.slideUp(s)})}),define("js/product/latest-walk",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload"),s=n("#latest-walk-count");!function(){var e;0!==s.length&&(e=i.compile(n("#latest-walk-tpl").html()),n.ajax({url:"http://itemapi.yohobuy.com/item/item/recentreview",dataType:"jsonp",data:{limit:s.val()},success:function(t){var a,i,s,r=[];if(200===t.code){if(a=t.data,0===a.length)return void n(".latest-walk").addClass("hide");
for(i=0;i<a.length;i++)s=a[i],r.push({href:s.url,img:s.pic_url,name:s.product_name,salePrice:s.price,marketPrice:s.market_price});r.length>0&&(n("#latest-walk-goods").html(e({latestWalk:r})),o(n("#latest-walk-goods .lazy")))}}}))}()}),define("js/product/product",["jquery","lazyload"],function(e,t,a){var n,i=e("jquery"),o=e("lazyload"),s=e("js/common/product-event"),r=i(".goods-container"),d=r.find(".good-info"),l=r.find(".good-item-wrapper"),c=r.find(".good-info-main"),u=r.find(".good-select-color"),h=i(".product-list-nav");o(i("img.lazy")),t.init=function(e){function t(e,t){var a,n,i,o="",s=e.length,r=4,d=Math.ceil(s/r),l=0;for(a=0;d>a;a++)for(o+="<ul>",n=0;r>n&&(i=a*r+n,i!==s);n++)o+='<li><a target="_blank" href="'+e[a*r+n].url+t+'"><img src="'+e[a*r+n].src+'" data-cover="'+e[a*r+n].coverImg+'" /></a></li>',n===r-1&&(o+="</ul>",l++);return d>l&&(o+="</ul>"),{colorListStr:o,ulNum:d}}function a(){c.html(""),u.html(""),l.css({display:"none"})}n=null,d.unbind(),n=s(d,e),n.addHandler("MouseEnter",function(e){var n,o,s,d,h,p,f,m,g=10,v=35,w="",y=e.target.attr("data-from")||"";i.ajax({type:"POST",url:"/product/list/getProductPic",dataType:"jsonp",jsonp:"callback",data:{skn:e.target.attr("data-skn")}}).then(function(b){var C=b.data,x=t(C.pics,y);a(),w=x.colorListStr,n=x.ulNum,c.append(e.targetDuplicate),u.append(i(w)),C.isFavorite?c.find(".col-btn").addClass("coled"):c.find(".col-btn").removeClass("coled"),p=l.css("paddingLeft"),f=l.css("paddingTop"),m=r.css("paddingTop"),o=10+65*n+e.targetWidth,d=(e.targetX-1)*(e.targetWidth+g)-(parseInt(p)+1),h=(e.targetY-1)*(e.targetHeight+v)+parseInt(m)-(parseInt(f)+1),s=e.offsetR-(65*n+25),0>=s&&(d=d+s-25),l.css({width:o,left:d,top:h,display:"inline-block"}),C.pics[0]&&C.pics[0].src&&c.find(".good-thumb img").attr("src",C.pics[0].src)})}),l.mouseleave(function(){a()})},i(document).on("hover",".good-select-color li",function(){var e=i(this).find("img").attr("data-cover"),t=i(this).closest(".good-item-wrapper").find(".good-detail-img").find("img");t.attr("src",e)}),c.on("click",".col-btn",function(){var e=i(this);i.ajax({type:"POST",url:"/product/list/changeFavorite",dataType:"jsonp",data:{skn:e.closest(".good-info").data("skn"),isFavorite:e.hasClass("coled")}}).then(function(t){200===t.code?e.toggleClass("coled"):403===t.code&&(location.href="http://www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})}),h.find("h3").click(function(e){var t=i(this).closest(".product-list-nav");t.hasClass("active")?t.find(".sort-child-list").stop(!0,!0).slideUp():t.find(".sort-child-list").stop(!0,!0).slideDown(),t.toggleClass("active")})}),define("js/common/product-event",["jquery"],function(e,t,a){function n(){this.handlers={}}var i=e("jquery");n.prototype={constructor:n,addHandler:function(e,t){"undefined"==typeof this.handlers[e]&&(this.handlers[e]=[]),this.handlers[e].push(t)},fire:function(e){var t,a;if(e.target||(e.target=this),this.handlers[e.type]instanceof Array)for(t=this.handlers[e.type],a=0;a<t.length;a++)t[a](e)},removeHandler:function(e,t){var a,n;if(this.handlers[e]instanceof Array){for(a=this.handlers[e],n=0;n<a.length&&a[n]!==t;n++);a.splice(n,1)}}},a.exports=function(e,t){function a(e){var a,n=0,l=0,c=t,u=0,h="",p=0,f=0;switch(e.type){case"mouseenter":a=i(this),h=a.clone(),u=a.index()+1,n=u%c===0?c:u%c,l=Math.ceil(u/c),p=a.offset().left,f=d-(p+s),o.fire({type:"MouseEnter",target:a,targetWidth:s,targetHeight:r,targetX:n,targetY:l,rowWidth:c,activeIndex:u,targetDuplicate:h,offsetL:p,offsetR:f});break;case"mouseleave":o.fire({type:"MouseLeave"})}}var o=new n,s=e.eq(0).width(),r=e.eq(0).height(),d=i(window).width();return e.bind("mouseenter",a),o}}),define("js/product/brand",["jquery"],function(e,t,a){var n=e("jquery");n("#brand-favor").on("click",function(){var e=n(this),t=window.getUid();n.ajax({type:"post",url:"/product/index/favoriteBrand",data:{uid:t,brandId:e.data("id")}}).then(function(t){200===t.code?"add"===t.message?e.find("i").addClass("coled"):e.find("i").removeClass("coled"):403===t.code&&(location.href="http://www.yohobuy.com/signin.html?refer="+encodeURIComponent(location.href))})})}),define("js/product/hotrank",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload");e("js/common/slider"),e("js/common/logo-brand"),o(n("img.lazy")),n(".slide-container").slider(),n(".logo-brand").logoBrand({showNum:10,url:n(".logo-brand").data("url")}),function(e){function t(t,a){var d={};d=a?{sid:t,page:a}:{sid:t},e.ajax({type:"GET",dataType:"json",url:"/product/index/getdata",data:d,success:function(t){var d;200===t.code&&(d={list:t.data},s=i.compile(n),a?(e(".hot-week-list").append(s(d)),r.css({position:"fixed",marginTop:-r.height()/2,top:"50%"})):e(".hot-week-list").html(s(d)),o(e("img.lazy")),c=!1)}})}var a,n,s,r=e(".hot-week").find(".floatlayer"),d=(e(".hot-cate").find("li").eq(0).data("sid"),1),l=0,c=!1;n='{{# list}}<div class="good-info"><div class="item-img"><a class="good-thumb" target="_blank" href="{{url}}"><img class="lazy" data-original="{{thumb}}"></a></div><div class="good-detail-text"><a target="_blank" href="{{url}}">{{name}}</a><p class="price">{{# marketPrice}}<span class="market-price">¥{{.}}</span>{{/ marketPrice}} <span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">¥{{salePrice}}</span></p></div></div>{{/ list}}',e(window).on("scroll",function(){var n,i=a+e(".hot-week").outerHeight();a=e(".hot-week").offset().top,e(this).scrollTop()>=a-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()>=a+e(".hot-week").height()-e(window).height()&&(c||(n=e(".hot-cate").find("li.current").data("sid"),d++,c=!0,t(n,d)))}),e(".hot-cate").find("li").each(function(t){var a=e(".hot-cate").width();a>=l&&(l+=e(this).width(),l>=a&&e(".floatlayer").find("li").eq(t).hide().nextAll().hide())}),e(".hot-cate").on("click","li",function(){var n=e(this).index(),i=e(this).data("sid");e(this).hasClass("current")||(e(this).addClass("current").siblings().removeClass("current"),e(".floatlayer").find("li").removeClass("current").eq(n).addClass("current"),e("body,html").stop().animate({scrollTop:a-110},500),t(i),d=1)}),e(".floatlayer").on("click","li",function(){var t=e(this).index();e(this).hasClass("current")||(e(".hot-cate").find("li").eq(t).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")}(n)}),define("js/common/slider",["jquery","lazyload"],function(e,t,a){var n=e("jquery"),i=e("lazyload");!function(e){var t=function(t,a){this.$element=e(t),this.options=e.extend({},e.fn.slider.defaults,a),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 i(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"></span></a><a class="next" href="javascript:;"><span class="iconfont"></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">',a=0;if(!(this.len<=1)){for(a=0;a<this.len;a++)t+="<span></span>";t+="</div></div></div>",this.$element.append(e(t)),this.smallItem=this.$element.find(".slide-pagination-inner 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")&&(i(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},function(){e(this).find(".slide-tips > p").removeClass("hide")}).siblings().stop().animate({opacity:0},function(){e(this).hide().find(".slide-tips > p").addClass("hide")})},_autoplay:function(){var e=this;clearInterval(this.timer),this.timer=setInterval(function(){e._nextSlide()},this.options.time)}},e.fn.slider=function(a){return this.each(function(){var n=e(this),i=n.data("Slider"),o="object"==typeof a&&a;i||n.data("Slider",i=new t(this,o)),"string"==typeof a&&i[a]()})},e.fn.slider.Constructor=t,e.fn.slider.defaults={time:5e3,orient:!0,pagination:null}}(n)}),define("js/common/logo-brand",["jquery","handlebars","source-map","lazyload"],function(e,t,a){var n=e("jquery"),i=e("handlebars"),o=e("lazyload");!function(e){var t=function(t,a){this.$element=e(t),this.options=e.extend({},e.fn.logoBrand.defaults,a),this.init()};t.prototype={init:function(){this.$element.addClass("logos-"+this.options.showNum),this._sendRequest()},_createHelper:function(){var e=this.options.showNum;i.registerHelper("brandList",function(t,a){var n="<ul>",i=0,o=null,s=0;if(t.length%e!==0)for(s=e-t.length%e,i=0;s>i;i++)t.push({href:"javascript:;",img:""});for(i=0;i<t.length;i++)o=a.fn(t[i]),n=i%e===5||5===i?n+'<li class="logo-brand-switch" data-page="'+Math.floor(i/e)+'"><a class="prev iconfont" href="javascript:;"></a><a class="next iconfont" href="javascript:;"></a></li><li data-page="'+Math.floor(i/e)+'">'+o+"</li>":0!==i&&i%e===0?n+'<li class="brand-more" data-page="'+Math.floor(i/(e+1))+'"><a href="javascript:;" target="_blank">MORE ></a></li><li data-page="'+Math.floor(i/e)+'">'+o+"</li>":n+'<li data-page="'+Math.floor(i/e)+'">'+o+"</li>";return n+'<li class="brand-more" data-page="'+Math.floor(i/(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 a,n;e&&0!==e.length&&(t._createHelper(),n='{{#brandList logoBrand}}<a href="{{href}}" target="_blank"><img class="lazy" data-original="{{img}}" alt=""></a>{{/brandList}}',a=i.compile(n),t.$element.html(a(e)),t.$element.find(".brand-more a").attr("href",e.moreBrand),o(t.$element.find("img.lazy")),t._bindEvent())}})},_brandShow:function(t,a){var n=this;o(e("li[data-page="+a+"]").find("img.lazy").trigger("appear")),n.$element.find("li[data-page="+t+"]").find("img").fadeOut("normal",function(){n.$element.find("li").hide(),n.$element.find("li[data-page="+a+"]").show().find("img").fadeIn()})},_bindEvent:function(){var t=this;t.$element.on("click",".next",function(){var a=e(this).parent().data("page"),n=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;n=a===i?0:a+1,t._brandShow(a,n)}),t.$element.on("click",".prev",function(){var a=e(this).parent().data("page"),n=0,i=Math.ceil(t.$element.find("li").size()/(t.options.showNum+2))-1;n=0===a?i:a-1,t._brandShow(a,n)})}},e.fn.logoBrand=function(a){return this.each(function(){var n=e(this),i=n.data("LogoBrand"),o="object"==typeof a&&a;i||n.data("LogoBrand",i=new t(this,o)),"string"==typeof a&&i[a]()})},e.fn.logoBrand.Constructor=t,e.fn.logoBrand.defaults={showNum:16,url:"/boys/getBrand"}}(n)}),define("js/index/index",["jquery","lazyload","handlebars","source-map"],function(e,t,a){var n=e("jquery"),i=e("lazyload"),o=n(".home-page").data("page"),s=n(".logo-brand").data("url");e("js/common/slider"),e("js/common/slider2"),e("js/common/logo-brand"),e("js/common/accordion"),n(document).on("mouseenter",".imgopacity a img",function(){n(this).css("opacity",.8)}),n(document).on("mouseout",".imgopacity a img",function(){n(this).css("opacity",1)}),n.inArray(o,["boys","girls","kids","lifestyle"])>-1&&(e("js/common/new-arrivls")({type:o,url:"/common/getNewArrival",count:"boys"===o||"lifestyle"===o?5:4,rows:[5,3]}),window.setCookie("_Channel",o,{domain:".yohobuy.com",path:"/",expires:365})),i(n("img.lazy")),"boys"===o?n(".slide-container").slider({pagination:".thumb-pagination"}):(n(".center-col").slider(),n(".slide-container").slider()),"boys"===o?(n(".logo-brand").logoBrand({url:s}),n(".img-brand").slider2()):(n(".logo-brand").logoBrand({showNum:10,url:s}),n(".img-slider-wrapper").slider2())}),define("js/common/slider2",["jquery"],function(e,t,a){var n=e("jquery");!function(e){e.fn.slider2=function(t){function a(t,a,i){i===!0?(e(".next").trigger("click"),t===a-3?n(--t,a,!1):n(++t,a,!0)):(e(".prev").trigger("click"),0===t?n(++t,a,!0):n(--t,a,!1))}function n(t,n,i){window.setTimeout(a,e.fn.slider2.defaults.delaytime,t,n,i)}function i(t,a,n){var i=-(t*a);e(".img-list").animate({"margin-left":i+"px"},"slow",n)}return e.fn.slider2.defaults={index:0,shownum:3,autoplay:!1,delaytime:3e3},this.each(function(){var a=e.extend({},e.fn.slider2.defaults,t),o=parseInt(e(".img-item").css("margin-right")),s=e(".img-item"),r=[],d=s.outerWidth()+o,l=s.length,c=0;if(3>=l)return void e(this).find(".img-brand-switch").hide();for(c=0;c<s.length;c++)r.push(s[c]);l=r.length,e(this).find(".img-list").css({width:d*l}),e(this).find(".next").on("click",function(t){var a=0,n=null;t.preventDefault(),i(3,d,function(){for(a=0;3>a;a++)n=r.shift(),e(".img-item").parent().append(n.outerHTML),r.push(n);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 a=0,n=null,o="";for(t.preventDefault(),a=0;3>a;a++)n=r.pop(),e(".img-item").parent().prepend(n.outerHTML),r.unshift(n);o=3*d,e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-item").last().remove(),e(".img-list").css({"margin-left":-o+"px"}),i(0,d)}),a.autoplay===!0&&n(a.index,l,!0)})}}(n)}),define("js/common/accordion",["jquery"],function(e,t,a){function n(e){d.each(function(t){s(this).css("zIndex",t),e>=t?s(this).stop().animate({left:t*c},400):s(this).stop().animate({left:e*c+l+c*(t-e-1)},400)})}var i,o=e("js/common/yohoui/YH.slide"),s=e("jquery"),r=s(".slide-accordion"),d=r.find("li"),l=d.width(),c=1150===parseInt(s(".home-page").width())?125:107;n(0),i=new o({length:5,loop:!1,auto:!1,timeout:2,index:0}),i.on("change",function(e){n(e.to)}),d.mouseover(function(){i.go(s(this).index())}),i.init()}),define("js/common/yohoui/YH.slide",[],function(e,t,a){var n=e("js/common/yohoui/YH.base"),i=function(e){this.__lastTime=null,this.__isStop=!1,e=n.extend(this.defaults,e),i.superclass.constructor.call(this,e)};n.inherit(i,n.assembly),i.prototype.oninit=function(){var e=this,t=e.options;return t.auto&&e.play(),e.go(t.index),this},i.prototype.go=function(e,t){var a,n,i,o,s,r,d,l,c=this,u=c.options;c.__lastTime&&(clearTimeout(c.__lastTime),c.__lastTime=null),t="undefined"==typeof t?u.index:t,a=e===t?0:e>t?1:-1,n=u.loop,o=u.length-1,s=e,e=n?e>o?e-o-1:0>e?e+o+1:e:e>o?o:0>e?0:e,i=u.index=e,r={from:t,to:e,originalto:s,direction:a};for(d in c.registerEvent)if(c.registerEvent[d].length>0)for(l in c.registerEvent[d])c.registerEvent[d].hasOwnProperty(l)&&c.registerEvent[d][l](r);i!==o||e?!c.__isStop&&u.auto&&c.play():c.__lastTime&&clearTimeout(c.__lastTime)},i.prototype.play=function(){var e=this,t=e.options;return e.__lastTime=setTimeout(function(){e.next()},1e3*t.timeout),this},i.prototype.next=function(){var e=this,t=e.options,a=t.index,n=a+t.step;e.go(n,a)},i.prototype.prev=function(){var e=this,t=e.options,a=t.index,n=a-t.step;e.go(n,a)},i.prototype.pause=function(){var e=this;e.__lastTime&&clearTimeout(e.__lastTime),e.__isStop=!0},i.prototype.resume=function(){var e=this;e.__isStop=!1,e.play()},i.prototype.defaults={index:0,timeout:5,step:1,per:1,auto:!1,loop:!1},a.exports=i}),define("js/common/yohoui/YH.base",[],function(e,t,a){var n,i={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object String]":"string"},o={__Index:0,list:[],get:function(e){return void 0===e?this.list:this.list[e]},fn:function(){},inherit:function(e,t){var a=o.fn;a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e,e.superclass=t.prototype,e.prototype.constructor===Object.prototype.constructor&&(e.prototype.constructor=t)},extend:function(e,t){var a;for(a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e},copy:function(e,t,a){var n,i,s;if("object"!=typeof t)return t;if(n=t.valueOf(),t!==n)return new t.constructor(n);if(t instanceof t.constructor&&t.constructor!==Object){i=e?new e:o.clone(t.constructor.prototype);for(s in t)(e||t.hasOwnProperty(s))&&(i[s]=t[s])}else{i={};for(s in t)i.hasOwnProperty(s)&&(i[s]=t[s])}if(a)for(s in a)i.hasOwnProperty(s)&&(i[s]=a[s]);return i},clone:function(e){return o.__cloneFunc.prototype=e,new o.__cloneFunc},__cloneFunc:function(){},delegate:function(e,t){var a;return t=t||window,arguments.length>2?(a=Array.prototype.slice.call(arguments,2),function(){return e.apply(t,a)}):function(){return e.call(t)}},dom:function(e,t){var a,n,i=e,o={wrap:i},s=i[0].getElementsByTagName("*"),r=s.length;for(n=0;r>n;n++)a=s[n].className,a.indexOf(t)>-1&&(a=a.split(t)[1]),a&&(o[a]=i.find(s[n]));return o},template:function(){var e,t,a,n,i=arguments;if(i.length>0&&o.isString(i[0]))if(e=i[0],2===i.length&&o.isObject(i[1]))for(t in i[1])void 0!==i[1][t]&&(a=new RegExp("({"+t+"})","g"),e=e.replace(a,i[1][t]));else for(n=1;n<i.length;n++)void 0!==i[n]&&(a=new RegExp("({["+(n-1)+"]})","g"),e=e.replace(a,i[n]));return e},__type:function(e){return null==e?String(e):i[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,a){var n,i;if(o.isArray(e))for(n=0,i=e.length;i>n&&t.call(e[n],n,e[n],a)!==!1;n++);else for(n in e)if(t.call(e[n],n,e[n],a)===!1)break},funManager:{__loadList:{},__loadFun:function(e,t,a){e.methord&&o.isFunction(e.methord())&&(a=a||window,e.methord()(e,function(){t()},a))},load:function(e,t,a,n){n=n||0,e[n]&&o.funManager.__loadFun(e[n],function(){o.funManager.load(e,t,a,n+1)},a),t(n,a)},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,a=t.detail?-1*t.detail:t.wheelDelta/40,n=0>a?-1:1;return{direction:n,unit:a}},__:function(e,t,a,n){var i;for(i in e)if(window[e[i].validator]){t[e[i].validator](e[i].prefix+a,n,!1);break}},add:function(e,t,a){var n=[{validator:"addEventListener",prefix:""},{validator:"attachEvent",prefix:"on"}];this.__(n,e,t,a)},remove:function(e,t,a){var n=[{validator:"removeEventListener",prefix:""},{validator:"detachEvent",prefix:"on"}];this.__(n,e,t,a)}},getUid:function(e){return o.template("me-{0}{1}-{2}",e,(new Date).getTime(),o.__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"],a=document.createElement("div");for(e in t)if(void 0!==a.style[t[e]])return o.template("-{0}-",t[e].replace("Perspective","").toLowerCase())},parseURL:function(e){var t,a,n,i,o,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={},a=s.search.replace(/^\?/,"").split("&"),n=a.length,i=0,o;n>i;i++)a[i]&&(o=a[i].split("="),t[o[0]]=o[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 a;for(a=0;a<e.length;a++)if(this[a]===t)return a;return-1},remove:function(e,t){var a=this.indexOf(e,t);return a>-1&&e.splice(a,1),e}}};n=function(e){this.initialized=!1,this.registerEvent={before:[],change:[],after:[]},this.options=e,this.init(e)},n.output=function(){o.log(o.list)},n.prototype.oninit=o.fn,n.prototype.init=function(e){this.initialized=!0,this.__Uid=o.getUid("me"),this.oninit(e),o.list[this.__Uid]=this},n.prototype.destory=function(){this.initialized=!1,delete o.list[this.__Uid]},n.prototype.getUid=function(){return this.__Uid},n.prototype.getOptions=function(){return this.options},n.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]}},n.prototype.on=function(e,t){var a=this,n=a.registerEvent[e];return n&&n.push(t),n},n.prototype.off=function(e,t){var a=this,n=a.registerEvent[e],i=[];o.each(n,function(e,a){a===t&&i.push(e)}),o.each(i.reverse(),function(e,t){n.splice(t,1)})},o.assembly=n,a.exports=o}),define("js/common/new-arrivls",["jquery","lazyload","handlebars","source-map"],function(e,t,a){function n(e){var t={index:0,isload:!0,isrun:!0,offset:{height:null,width:null}};return this.registerEvent={before:[],change:[],after:[]},this.options=i.extend(!0,{},t,e),this}var i=e("jquery"),o=e("lazyload"),s=e("handlebars");n.prototype.on=function(e,t){var a=this,n=a.registerEvent[e];return n&&n.push(t),n},n.prototype.exect=function(e,t){var a,n=this;if(n.registerEvent[e]&&n.registerEvent[e].length>0)for(a in n.registerEvent[e])n.registerEvent[e].hasOwnProperty(a)&&n.registerEvent[e][a](t)},n.prototype.init=function(){function e(){a.isrun&&a.isload&&t.__directionCalculation()&&(a.isload=!1,a.index++,t.exect("after",a)),t.exect("change",a)}var t=this,a=this.options;t.exect("before",a),i(window).scroll(e)},n.prototype.emit=function(){var e=this.options;e.isload=!0},n.prototype.stop=function(){var e=this.options;e.isrun=!1,e.isload=!1},n.prototype.__directionCalculation=function(){var e=this.options;return e.offset.height&&e.offset.height()>0&&i(window).scrollTop()+i(window).height()>=e.offset.height()?!0:!1},a.exports=function(e){var t,a=i("#newarrivals .goods-container"),r=i(".loading a"),d=new n({index:1,isload:!1,offset:{height:function(){return parseFloat(a.offset().top)+parseFloat(a.height())-200}}}),l=e.url,c=e.count,u=e.rows;e.pageIndex=0,delete e.url,delete e.count,delete e.rows,t=function(e,t,n){var l={type:"POST",url:e,success:function(e){var i,l,c,u=e.code;200===u?(l=e.goods.length%n,c=e.goods.length-l-1,e.goods.splice(c,l),i=s.compile(d.tpl),a.append(i(e.goods)),t.pageIndex=t.pageIndex+e.goods.length,o(a.find("img.lazy")),d.emit()):(d.stop(),r.html("查看更多"))},error:function(){d.stop(),r.html("网络断开连接了~")}};l.data=t,i.ajax(l)},d.on("after",function(a){e.pageCount=c*u[1],t(l,e)}),d.on("before",function(a){d.tpl="{{#each this}}",d.tpl+='<div class="good-info imgopacity" data-skn="{{skn}}">',d.tpl+=' <div class="tag-container clearfix">',d.tpl+=" {{# tags}}",d.tpl+=" {{# isNew}}",d.tpl+=' <span class="good-tag new-tag">NEW</span>',d.tpl+=" {{/ isNew}}",d.tpl+=" {{# isReNew}}",d.tpl+=' <span class="good-tag renew-tag">再到着</span>',d.tpl+=" {{/ isReNew}}",d.tpl+=" {{# isSale}}",d.tpl+=' <span class="good-tag sale-tag">SALE</span>',d.tpl+=" {{/ isSale}}",d.tpl+=" {{# isNewFestival}}",d.tpl+=' <span class="good-tag new-festival-tag">新品节</span>',d.tpl+=" {{/ isNewFestival}}",d.tpl+=" {{# isLimit}}",d.tpl+=' <span class="good-tag limit-tag">限量商品</span>',d.tpl+=" {{/ isLimit}}",d.tpl+=" {{# isYearEndPromotion}}",d.tpl+=' <span class="good-tag yep-tag">年终大促</span>',d.tpl+=" {{/ isYearEndPromotion}}",d.tpl+=" {{# isYearMidPromotion}}",d.tpl+=' <span class="good-tag ymp-tag">年中热促</span>',d.tpl+=" {{/ isYearMidPromotion}}",d.tpl+=" {{/ tags}}",d.tpl+=" </div>",d.tpl+=' <div class="good-detail-img">',d.tpl+=' <a class="good-thumb" href="{{url}}" target= "_blank">',d.tpl+=' <img class="lazy" data-original="{{thumb}}">',d.tpl+=" </a>",d.tpl+=" {{# isFew}}",d.tpl+=' <p class="few-tag">即将售罄</p>',d.tpl+=" {{/ isFew}}",d.tpl+=" {{#if showColBtn}}",d.tpl+=' <span class="col-btn iconfont{{#if coled}} coled{{/if}}"></span>',d.tpl+=" {{/if}}",d.tpl+=" </div>",d.tpl+=' <div class="good-detail-text">',d.tpl+=' <a href="{{url}}" target= "_blank">{{name}}</a>',d.tpl+=' <p class="price">',d.tpl+=' <span class="sale-price{{#unless marketPrice}}prime-cost{{/unless}}">',d.tpl+=" ¥{{salePrice}}",d.tpl+=" </span>",d.tpl+=" {{# marketPrice}}",d.tpl+=' <span class="market-price">¥{{.}}</span>',d.tpl+=" {{/ marketPrice}}",d.tpl+=" </p>",d.tpl+=" </div>",d.tpl+="</div>",d.tpl+="{{/each}}",e.pageCount=c*u[0],t(l,e,e.count)}),d.init()}}),define("js/brand/index",["jquery","lazyload","handlebars","source-map","dot"],function(e,t,a){var n=e("jquery"),i=e("lazyload");e("js/common/slider"),e("js/brand/brands"),i(n("img.lazy")),n(".slide-container").slider({orient:!0})}),define("js/brand/brands",["jquery","handlebars","source-map","dot"],function(e,t,a){function n(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),a=window.location.search.substr(1).match(t);return null!=a?window.unescape(a[2]):null}function i(e,t,a){var n,i=e,o={width:i.width(),left:i.offset().left,right:parseFloat(l(window).width())-parseFloat(i.offset().left)-parseFloat(i.width())},s=i.parent("li");p.find(".brands-dialog").remove(),n=c.compile(a),s.append(n(t)),u(s.find(".right")),o.right-350<0&&s.find(".brands-layer").addClass("brands-layer-right").css("left",-330-o.width)}function o(){v.unbind("mouseenter").unbind("mouseleave").hover(function(){var e=l(this),t=e.attr("data-key"),a={url:"/brands/brandinfo",type:"get",data:{brandId:t},success:function(t){200===t.code&&t.brand&&(_.hasOwnProperty(t.brand.key)||(_[t.brand.key]=t.brand),i(e,_[t.brand.key],$))}};clearTimeout(r),r=setTimeout(function(){_.hasOwnProperty(t)?i(e,_[t],$):l.ajax(a)},200)},function(){clearTimeout(r),p.find(".brands-dialog").remove()})}var s,r,d,l=e("jquery"),c=e("handlebars"),u=e("dot"),h=l(".brands-tabs"),p=l(".brands-list"),f=l(".brands-category"),m=l(".news-txt ul"),g=p.find("dl.clearfix"),v=p.find("li>a"),w=f.find("a"),y=h.find("li>a"),b=h.find(".hoverarr"),C=w.height(),x=w.offset()?w.offset().top:0,k=m.height(),j=m.offset()?m.offset().top:0,_={},$='<div class="brands-dialog">';$+=' <div class="brands-layer">',$+=' <div class="layer-content">',$+=' <div class="title">{{title}}</div>',$+=' <div class="clearfix desc">',$+=' <img src="{{icon}}">',$+=' <p class="right">{{content}}</p>',$+=" </div> ",$+=' <div class="featured">',$+=" <p>{{subtitle}}</p> ",$+=' <div class="clearfix"> ',$+=" {{#each imgs}}",$+=' <img src="{{src}}">',$+=" {{/each}}",$+=" </div>",$+=" </div>",$+=" </div>",$+=" </div>",$+="</div>",u(l(".brand-desc")),l.easing.easeOutQuint=function(e,t,a,n,i){return n*((t=t/i-1)*t*t*t*t+1)+a},m.length&&m.find("li").each(function(){var e=l(this),t=e.offset().top-j+e.height();t>k&&e.hide()}),y.eq(0).parent("li").find(".brands-content").css("z-index","1"),d=n("id")?n("id"):0,s=y.eq(d),s.find(".g-mask").addClass("g-mask-on"),d&&s.length&&b.css({left:parseFloat(s.offset().left)-parseFloat(h.offset().left)}),y.hover(function(){var e=l(this);clearTimeout(r),r=setTimeout(function(){var t=parseFloat(e.offset().left)-parseFloat(h.offset().left);b.animate({left:t},200,"easeOutQuint")},50),h.find(".brands-content").removeAttr("style"),e.parent("li").find(".brands-content").css("z-index","1")},function(){clearTimeout(r)}),l(window).scroll(function(){l(this).scrollTop()>=x?f.addClass("category-fix"):f.removeClass("category-fix")}),w.click(function(){var e=l(this).attr("href").split("#")[1],t=p.find("[name="+e+"]").offset().top-C;return f.hasClass("category-fix")||(t-=C),l("html,body").animate({scrollTop:t},200),!1}),g.length<26&&l.ajax({url:"/brands/brandList",type:"POST",data:{start:g.length?g.length+1:1},success:function(e){e&&(p.append(e),v=p.find("li>a"),o())}}),o()}),define("js/passport/entry",["jquery","jquery.placeholder"],function(e,t,a){e("js/passport/reg"),e("js/passport/back"),e("js/passport/login"),e("js/passport/reset"),e("js/passport/vertification"),e("js/passport/thirdlogin"),e("js/passport/third-pwd")}),define("js/passport/reg",["jquery","jquery.placeholder"],function(e,t,a){function n(e,t){var a,n;"reg"===e?(a="/passport/register/checkmobile",n={mobile:j.val(),area:S.text().split("+")[1]}):"third"===e&&(a="/passport/autouserinfo/bindCheck",n={mobile:j.val(),area:S.text().split("+")[1],openId:p("#open-id").val(),sourceType:p("#source-type").val()}),p.ajax({url:a,type:"POST",data:n}).then(function(e){if(e){switch(e.code){case 200:k[0].message="",k[0].status=!0;break;case 400:k[0].message=e.message,k[0].status=!1}t()}})}function i(e,t){var a;"reg"===e?a="/passport/register/piccaptcha":"third"===e&&(a="/passport/autouserinfo/checkPicCode"),p.ajax({type:"POST",url:a,data:{verifyCode:T.val()}}).then(function(e){if(e){switch(e.code){case 200:k[1].message="",k[1].status=!0;break;case 400:k[1].message="图形验证码错误",k[1].status=!1}t()}})}function o(e,t){var a;"reg"===e?a="/passport/register/msgcaptcha":"third"===e&&(a="/passport/autouserinfo/checkBindMsg"),p.ajax({type:"POST",url:a,data:{code:_.val(),mobile:j.val(),area:S.text().split("+")[1]}}).then(function(e){if(e){switch(e.code){case 200:k[2].message="",k[2].status=!0;break;case 400:k[2].message="短信验证码错误",k[2].status=!1}t()}})}function s(e,t,a){var s,r=p.trim(t.val());t.hasClass("phone-num")?(s=S.text(),""===r?(k[0].message="请输入手机号码",k[0].status=!1,a()):f.phoneRegx[s].test(r)?n(e,a):(k[0].message="手机号码格式不正确,请重新输入",k[0].status=!1,a())):t.hasClass("captcha")?""===r?(k[1].message="请输入图形验证码",k[1].status=!1,a()):r.length<=3?(k[1].message="图形验证码为4位",k[1].status=!1,a()):k[0].status?i(e,a):(k[1].message="图形验证码错误",k[1].status=!1,a()):t.hasClass("msg-captcha")?""===r?(k[2].message="请输入短信验证码",k[2].status=!1,a()):r.length<=3?(k[2].message="短信验证码错误",k[2].status=!1,a()):k[1].status?o(e,a):(k[2].message="短信验证码错误",k[2].status=!1,a()):t.hasClass("pwd")?(""===r?(k[3].message="请输入密码",k[3].status=!1):r.length<6||r.length>20?(k[3].message="密码只支持6-20位字符",
k[3].status=!1):z.test(t.val())?(k[3].message="",k[3].status=!0):(k[3].message="密码须字母和数字组合",k[3].status=!1),a()):t.hasClass("repwd")&&(""===r?(k[4].message="请输入密码确认",k[4].status=!1):$.val()!==r?(k[4].message="与密码不一致,请重新输入",k[4].status=!1):(k[4].message="",k[4].status=!0),a())}function r(){var e=h.offset();return y.css({top:e.top-40,left:e.left})}function d(){var e,t=!1,a=k.length;for(e=0;a>e;e++)t||(k[e].message?(y.find("span").text(k[e].message),h=p("#"+k[e].id),r().removeClass("hide"),t=!0):y.addClass("hide"))}function l(){var e,t,a=k.length;for(t=0;a>t;t++)k[t].message?(e=p("#"+k[t].id),e.addClass("error")):(e=p("#"+k[t].id),e.removeClass("error"))}function c(e){var t=e.val(),a=m(t),n=0;switch(n=0===a?0:10>=a?1:20>=a?2:3){case 0:I.removeClass("red yellow green"),A.removeClass("color");break;case 1:I.addClass("red").removeClass("yellow green"),A.filter(".low").addClass("color"),A.filter(".mid,.high").removeClass("color");break;case 2:I.addClass("yellow").removeClass("red green"),A.filter(".low,.mid").addClass("color"),A.filter(".high").removeClass("color");break;case 3:I.addClass("green").removeClass("yellow red"),A.addClass("color")}""===t?w.removeClass("red yes no").addClass("default"):t.length<6||t.length>20?w.removeClass("default yes").addClass("no red"):w.removeClass("default no red").addClass("yes")}var u,h,p=e("jquery"),f=e("js/passport/mail-phone-regx"),m=e("js/passport/pwd-strength"),g=p(".register-page"),v=p("#pwd-tips"),w=v.find("#pwd-tip1"),y=p("#err-tip"),b=p("#register-btn"),C=p("#send-captcha"),x=4,k=[],j=p("#phone-num"),_=p("#msg-captcha"),$=p("#pwd"),q=p("#repwd"),T=p("#captcha"),A=p(".pwd-intensity"),I=A.closest(".pwd-intensity-container"),S=p("#country-code"),O=p("#region"),P=!1,z=f.pwdValidateRegx;e("jquery.placeholder"),setTimeout(function(){j.val(""),_.val(""),$.val(""),q.val(""),T.val("")},0),T.attr("maxlength",x),$.focus(function(e){v.removeClass("hide"),P=!0,u=p(this).val()}).blur(function(){v.addClass("hide"),P=!1}),p("[placeholder]").placeholder(),k=[{id:"phone-num",message:"",status:!1},{id:"captcha",message:"",status:!1},{id:"msg-captcha",message:"",status:!1},{id:"pwd",message:"",status:!1},{id:"repwd",message:"",status:!1}],p(window).resize(function(){y.hasClass("hide")||r()}),t.init=function(e){p("#agree-terms").click(function(){p(this).attr("notchecked")&&(p(this).removeAttr("notchecked"),b.addClass("disable").attr("disabled","true"))}),g.on("keydown",function(e){var t=e.which;13===t&&b.click()}),g.find(".va").keyup(function(){var t,a=0,n=k.length,i=p(this);s(e,p(this),function(){for(d(),l(),t=0;n>t;t++)k[t].status&&a++;4!==a||p("#agree-terms").attr("notchecked")?b.addClass("disable").attr("disabled","true"):b.removeClass("disable").removeAttr("disabled"),k[1].status?C.removeClass("disable"):C.addClass("disable")}),i.hasClass("pwd")&&c(i)}).blur(function(){}),O.change(function(){S.text(p("#region").val()),s(e,j,d)}),C.click(function(){var t,a,n=60;p(this).hasClass("disable")||(C.addClass("disable"),t=setInterval(function(){return 0>=n?(C.removeClass("disable").val("获取短信验证码"),void clearInterval(t)):void C.val(n--+"秒可重新发送")},1e3),"reg"===e?a="/passport/register/sendBindMsg":"third"===e&&(a="/passport/autouserinfo/sendBindMsg"),p.ajax({type:"POST",url:a,data:{area:S.text().split("+")[1],mobile:j.val(),verifyCode:T.val()}}))}),$[0].onpaste=function(){return!1},b.click(function(){var t;"reg"===e?t="/passport/register/mobileregister":"third"===e&&(t="/passport/autouserinfo/bindMobile"),p(this).hasClass("disable")||p.ajax({type:"POST",url:t,data:{area:S.text().split("+")[1],mobile:j.val(),verifyCode:T.val(),code:_.val(),password:$.val()}}).then(function(e){var t,a,n=0;200===e.code?(a=e.data.href,t=setTimeout(function(){n++},1e3),p.ajax({type:"GET",url:e.data.session}).then(function(e){200===e.code&&3>t&&(clearInterval(t),location.href=a)}),t>=3&&(clearInterval(t),location.href=a)):console.log("网络超时~")})}),p(".change-captcha").click(function(){var e=new Date,t=p(".captcha-img"),a=t.attr("src").split("?")[0];t.attr("src",a+"?t="+e.getTime())})}}),define("js/passport/mail-phone-regx",[],function(e,t,a){var n={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789]{1}[0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/},i=/^[.\-_a-zA-Z0-9]+@[\-_a-zA-Z0-9]+\.[a-zA-Z0-9]/,o=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;t.phoneRegx=n,t.emailRegx=i,t.pwdValidateRegx=o}),define("js/passport/pwd-strength",[],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t,a,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),a=n(e,c),l===a&&i(t,d,a)||(s+=a+o(a,l)),d=t,l=a;return s}a.exports=s}),define("js/passport/back",["jquery","jquery.placeholder"],function(e,t,a){function n(){var e=new Date,t=r("#captcha-img"),a=t.attr("src").split("?")[0];r("#captcha-img").attr("src",a+"?t="+e.getTime())}function i(){C&&x?v.removeClass("disable").prop("disabled",!1):v.addClass("disable").prop("disabled",!0)}function o(e){var t=!0,a="";return e=r.trim(e),""!==e?/^[0-9]+$/.test(e)?c[h.val()].test(e)?t=!0:(a="手机号码格式不正确, 请重新输入",t=!1):l.test(e)?t=!0:(a="邮箱格式不正确, 请重新输入",t=!1):(a="账户名不能为空",t=!1),C=t,{pass:t,errTxt:a}}function s(){var e=r.trim(f.val());return""===e||e.length<b?(x=!1,void i()):void r.ajax({type:"POST",url:"/passport/back/authcode",data:{verifyCode:e,phoneNum:r("#phone-num").val(),area:r("#country-code-hide").val()}}).then(function(e){200===e.code?x=!0:402===e.code?(C=!1,x=!0,w.removeClass("hide").find("em").text("该账号不存在"),p.addClass("error")):400===e.code&&(x=!1,n()),i()})}var r=e("jquery"),d=e("js/passport/mail-phone-regx"),l=d.emailRegx,c=d.phoneRegx,u=e("js/passport/ac-email"),h=r("#country-code-hide"),p=r("#phone-num"),f=r("#captcha"),m=r("#country-code-list"),g=r("#country-code"),v=r("#find-btn"),w=r("#account-err"),y=r("#captcha-err"),b=4,C=!1,x=!1;e("jquery.placeholder"),u(p,function(){var e=o(p.val());e.pass?(w.addClass("hide"),p.removeClass("error")):(w.removeClass("hide").find("em").text(e.errTxt),p.addClass("error")),i()}),f.attr("maxlength",b),r("input").placeholder(),r("#change-captcha, #captcha-img").on("click",function(){n()}),g.on("click",function(e){e.stopPropagation(),"block"===m.css("style")?m.slideUp("fast"):m.slideDown("fast")}),m.delegate("li","click",function(e){var t,a=r(this),n=a.data("cc");e.stopPropagation(),h.val(n),g.find("em").html(a.text()),""!==r.trim(p.val())&&(t=o(p.val()),i(),C?(w.addClass("hide"),p.removeClass("error")):(w.removeClass("hide").text(t.errTxt),p.addClass("error"))),m.slideUp("fast")}),r(document).click(function(){"block"===m.css("display")&&m.slideUp()}),p.keyup(function(){o(r.trim(r(this).val())),i()}).focus(function(){r(this).removeClass("error"),w.addClass("hide")}),f.blur(function(){var e=""===r.trim(f.val())?"验证码不能为空":"验证码不正确";x?(y.addClass("hide"),f.removeClass("error")):(y.removeClass("hide").find("em").text(e),f.addClass("error"),n())}).focus(function(){r(this).removeClass("error"),y.addClass("hide")}).keyup(function(){s()}),r("#find-btn").click(function(e){return/^[0-9]+$/.test(r.trim(p.val()))&&r("#find-form").attr("action","/passport/back/mobile"),r(this).hasClass("disable")?void 0:x&&C?void 0:(e.preventDefault(),!0)})}),define("js/passport/ac-email",["jquery"],function(e,t,a){var n,i=e("jquery"),o={num:["qq.com","163.com","126.com","sina.com","gmail.com","sohu.com","hotmail.com","139.com","189.com"],other:["gmail.com","qq.com","163.com","126.com","sina.com","sohu.com","hotmail.com","139.com","189.com"]};a.exports=function(e,t){var a,s='<ul id="email-autocomplete" class="email-autocomplete hide"></ul>';e.parent().append(s),a=i("#email-autocomplete"),e.on("keyup",function(){var e,t,n,s,r=i.trim(i(this).val()),d="";if(r.indexOf("@")>0){for(e=r.match(/^[0-9]+@(.*)/),e?(n=o.num,t=e[1]):(n=o.other,t=r.match(/@(.*)/)[1]),s=0;s<n.length;s++)n[s].indexOf(t)>-1&&(d+="<li>"+r.slice(0,r.indexOf("@"))+"@"+n[s]+"</li>");""!==d&&/.com$/.test(r)===!1?a.html(d).removeClass("hide"):a.html("").addClass("hide")}}).on("blur",function(){n=setTimeout(function(){a.addClass("hide"),t&&t()},200)}),a.on("click","li",function(){clearTimeout(n),e.val(i(this).text()).focus(),a.addClass("hide"),t&&t()})}}),define("js/passport/login",["jquery","jquery.placeholder"],function(e,t,a){function n(){var e,t=!1,a=l.trim(c.val());return""!==a?/^[0-9]+$/.test(a)?C.phoneRegx[v.val()].test(a)?t=!0:(t=!1,e="手机号码不正确,请重新输入"):C.emailRegx.test(a)?t=!0:(t=!1,e="邮箱格式不正确,请重新输入"):e="请输入账户名",t?(p.addClass("hide"),c.removeClass("error")):(p.removeClass("hide").children("em").text(e),c.addClass("error")),t}function i(){var e,t=!1,a=l.trim(u.val());return""!==a?a.length<6?e="请输入长度为6-20字符的密码":t=!0:e="请输入密码",t?(f.addClass("hide"),u.removeClass("error")):(f.removeClass("hide").children("em").text(e),u.addClass("error")),t}function o(){var e,t=!1,a=l.trim(h.val());return _.is(":hidden")?!0:(""!==a?4!==a.length?e="请输入长度为4字符的验证码":t=!0:e="请输入验证码",t?(m.addClass("hide"),h.removeClass("error")):(m.removeClass("hide").children("em").text(e),h.addClass("error")),t)}function s(){var e=!0,t=l.trim(c.val()),a=l.trim(u.val());return""!==t?e=n()&&i()&&o():(e=!1,c.addClass("error"),""===a?(p.addClass("both-error").removeClass("hide").children("em").text("请输入账户名和密码"),f.addClass("hide"),u.addClass("error")):p.removeClass("hide").children("em").text("请输入账户名")),e}function r(){$.attr("src",j+l.now()),h.val(""),_.removeClass("hide")}var d,l=e("jquery"),c=l("#account"),u=l("#password"),h=l("#captcha"),p=c.siblings(".err-tip"),f=u.siblings(".err-tip"),m=h.siblings(".err-tip"),g=l("#caps-lock"),v=l("#country-code-hide"),w=l("#country-code > em"),y=l("#country-list"),b=l("#email-autocomplete"),C=e("js/passport/mail-phone-regx"),x=e("js/passport/ac-email"),k=l(".remember-me"),j="/passport/images?t=",_=l(".captcha-wrap"),h=_.find("#captcha"),$=_.find("#captcha-img"),m=_.find(".err-tip"),q={checked:"",unchecked:""},T=!1;e("jquery.placeholder"),x(c,function(){n()&&l.ajax({url:"/passport/login/account",type:"GET",data:{account:l.trim(c.val())}}).then(function(e){e.data&&e.data.needCaptcha&&r()})}),l("[placeholder]").placeholder(),l("#country-code").on("click",function(){"none"===y.css("display")&&y.slideDown()}),y.on("click","li",function(){var e=l(this),t=e.data("cc");w.html(e.html()),v.val(t),y.slideUp()}),l(document).on("click",function(e){l(e.target).closest("#country-code").length>0||"block"===y.css("display")&&y.slideUp()}),u.on("blur",function(){i(),g.hasClass("hide")||g.addClass("hide")}).on("keypress",function(e){var t=e.which;return t>=65&&90>=t?void g.removeClass("hide"):void g.addClass("hide")}),h.on("blur",function(){o()}),b.on("click","li",function(){clearTimeout(d),c.val(l(this).text()).focus(),b.addClass("hide")}),k.on("click",function(){var e=l(this);e.toggleClass("checked"),e.hasClass("checked")?e.children("i").html(q.checked):e.children("i").html(q.unchecked)}),l(".va").on("focus",function(){var e=l(this);e.removeClass("error"),e.siblings(".err-tip").addClass("hide")}),_.on("click",".change-captcha, .captcha-img",function(){$.attr("src",j+l.now())}),l("#login-btn").on("click",function(){var e=s();e&&T===!1&&(T=!0,l.ajax({url:"/passport/login/auth",type:"POST",data:{areaCode:v.val().replace("+",""),account:l.trim(c.val()),password:l.trim(u.val()),captcha:l.trim(h.val()),isRemember:k.hasClass("checked")?!0:!1},success:function(e){200===e.code?e.data&&(location.href=e.data.session):("captcha"===e.data.errorType?(m.removeClass("hide").children("em").html(e.message),h.addClass("error").val("")):(f.removeClass("hide").children("em").html(e.message),u.addClass("error").val("")),e.data&&e.data.needCaptcha&&r())},complete:function(){T=!1}}))})}),define("js/passport/reset",["jquery","jquery.placeholder"],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t,a,s=0,r=e.length,d="",l=0,c=0;for(c=0;r>c;c++)t=e.charAt(c),a=n(e,c),l===a&&i(t,d,a)||(s+=a+o(a,l)),d=t,l=a;return s}function r(){var e=l.val(),t=s(e),a=0;switch(a=0===t?0:10>=t?1:20>=t?2:3){case 0:v.removeClass("red yellow green"),g.removeClass("color");break;case 1:v.addClass("red").removeClass("yellow green"),g.filter(".low").addClass("color"),g.filter(".mid,.high").removeClass("color");break;case 2:v.addClass("yellow").removeClass("red green"),g.filter(".low,.mid").addClass("color"),g.filter(".high").removeClass("color");break;case 3:v.addClass("green").removeClass("yellow red"),g.addClass("color")}""===e?w.removeClass("red yes no").addClass("default"):e.length<6||e.length>20?w.removeClass("default yes").addClass("no red"):w.removeClass("default no red").addClass("yes"),m=y.test(e)?!0:!1}var d=e("jquery"),l=d("#pwd"),c=d("#re-input"),u=d("#reset-pwd-btn"),h=d("#pwd-err"),p=d("#repwd-err"),f=d("#pwd-tips"),m=!1,g=d(".pwd-intensity"),v=g.closest(".pwd-intensity-container"),w=d("#pwd-tip1"),y=e("js/passport/mail-phone-regx").pwdValidateRegx;e("jquery.placeholder"),d("input").placeholder(),d(".va").keyup(function(){var e=!0;d(this).hasClass("pwd")?r():""===d(this).val()&&(e=!1),e=e&&m&&l.val()===c.val()?!0:!1,e?u.removeClass("disable").prop("disabled",!1):u.addClass("disable").prop("disabled",!0)}).blur(function(){var e=d(this),t=e.val();e.hasClass("pwd")?""===t?(e.addClass("error"),h.removeClass("hide").find("em").text("请输入密码")):t.length<6||t.length>20?(e.addClass("error"),h.removeClass("hide").find("em").text("密码只支持6-20位")):y.test(t)?(h.addClass("hide"),""!==c.val()&&(t!==c.val()?(c.addClass("error"),p.removeClass("hide").find("em").text("两次密码输入不一致,请重新输入")):(c.removeClass("error"),p.addClass("hide")))):(e.addClass("error"),h.removeClass("hide").find("em").text("密码须字母和数字组合")):""===t?(e.addClass("error"),p.removeClass("hide").find("em").text("请输入密码确认")):""!==l.val()&&t!==l.val()?(e.addClass("error"),p.removeClass("hide").find("em").text("两次密码输入不一致,请重新输入")):(e.removeClass("error"),p.addClass("hide"))}).focus(function(){d(this).removeClass("error"),d(this).hasClass("pwd")?h.addClass("hide"):p.addClass("hide")}),l.focus(function(){h.addClass("hide"),f.removeClass("hide")}).blur(function(){f.addClass("hide")}),d("#pwd, #repwd").keydown(function(e){var t=e.keyCode||e.which;return 32===t?void e.preventDefault():void 0})}),define("js/passport/vertification",["jquery"],function(e,t,a){var n,i,o=e("jquery"),s=o("#send-captcha"),r=o("#captcha-tip"),d=o("#err-tip"),l=o("#next-step");s.click(function(){o.post("/passport/back/sendbackmobile",{mobile:o("#mobile").val(),area:o("#area").val(),verifyCode:o("#captchaPic").val()},function(e){if(200===e.code){if(d.hide(),o(this).hasClass("disable"))return;n=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(n--+"秒后可重新操作"),i=setInterval(function(){0===n?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(n--+"秒后可重新操作")},1e3)}else o(this).addClass("error"),d.removeClass("hide").text("发送失败")})}),o(this).hasClass("disable")||(n=60,s.addClass("disable").attr("disabled",!0),r.removeClass("hide"),s.val(n--+"秒后可重新操作"),i=setInterval(function(){0===n?(clearInterval(i),s.val("发送验证码").removeClass("disable").removeAttr("disabled")):s.val(n--+"秒后可重新操作")},1e3),o("#captcha").keyup(function(){var e=o.trim(o(this).val()),t=this;4===e.length&&o.ajax({type:"POST",url:"/passport/back/backmobile",dataType:"json",data:{code:o("#captcha").val(),verifyCode:o("#captchaPic").val(),area:o("#area").val(),mobile:o("#mobile").val()},success:function(e){200===e.code?(l.removeClass("disable").attr("href",e.data),d.addClass("hide"),o(t).removeClass("error")):(l.addClass("disable"),d.removeClass("hide").find("em").text("验证码输入错误"),o(t).addClass("error"))}})}).blur(function(){var e=o.trim(o(this).val());""===e&&(o(this).addClass("error"),d.removeClass("hide").text("请输入验证码"))}).focus(function(){o(this).removeClass("error")}))}),define("js/passport/thirdlogin",["jquery"],function(e,t,a){function n(){b(".choosetag").on("change",function(){var e="#f02200";"checked"===b(this).attr("checked")?b(".choosewrapper").css({"background-image":'url("'+$+'")'}):(b(".choosewrapper").css({"background-image":"none"}),e="#CCCCCC"),A.css({"background-color":e})})}function i(){return"checked"===b(".choosetag").attr("checked")}function o(){b(".optionshow").on("click",function(){b(".optionslist").toggleClass("hide")})}function s(){var e="";b(document).on("keyup","#validatenum",function(){e=b(this).val(),4===e.length&&(j||(j=!0,b.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:b("#mobile").val(),area:b("#area").val()}}).then(function(e){j=!1,200===e.code?_=!0:alert(e.message)})))})}function r(){b(".optionitem").on("click",function(){var e=b(this),t=e.attr("areanum"),a=e.text();b("#areaname").text(a),b("#areanum").text(t),b("#areacode").val(t),b(".optionslist").addClass("hide")})}function d(){b(document).on("click","body",function(e){var t=b(e.target);t.hasClass("yohoselectarea")||t.hasClass("areaname")||t.hasClass("righttag")||t.hasClass("optionslist")||t.hasClass("optionitem")||b(".optionslist").addClass("hide")})}function l(){var e="",t="";b(".optionitem").each(function(){e=b(this),t=e.attr("areanum").replace(/\+/g,""),e.attr("areanum",t)})}function c(){var e;b(document).on("click","#alreayregist",function(t){e=b(t.target),(e.hasClass("mask")||e.hasClass("backdrop"))&&(b("#alreayregist").hide(),b(".backdrop").hide())}),b(document).on("click","#bindconfirm",function(t){e=b(t.target),(e.hasClass("mask")||e.hasClass("backdrop"))&&(b("#bindconfirm").hide(),b(".backdrop").hide())})}function u(){b(document).on("click","#yohobindbtn",function(e){b(".phonenum").val(""),b("#bindconfirm").hide(),b(".backdrop").hide()}),b(document).on("click","#yohobindbtn2",function(e){b(".phonenum").val(""),b("#alreayregist").hide(),b(".backdrop").hide()})}function h(){return k-=1,0>k?(k=60,void b(".validatewrapper").html(x)):(b(".second").text(k),void window.setTimeout(h,1e3))}function p(e){b(".validatewrapper").html(C),window.setTimeout(h,1e3)}function f(){b(document).on("click","#sendmessage",function(){"disabled"!==b("#sendmessage").attr("disabled")&&(p(b("#mobile").val()),b.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:b("#mobile").val(),area:b("#area").val()}}).then(function(e){200!==e.code&&alert(e.message)}))})}function m(){var e="",t="";t=b("#area").val(),e=b("#mobile").val(),b.ajax({type:"POST",url:"/passport/autouserinfo/bindMobile",data:{area:t,openId:b("#openId").val(),sourceType:b("#sourceType").val(),mobile:e}}).then(function(e){201===e.code?window.location.href="/passport/thirdlogin/bindsuccess":alert(e.message)})}function g(){b(document).on("click","#gotobindphone",function(){_===!0?(b("#inarea").val(b("#areanum").val()),b("#inmobile").val(b("#mobile").val()),m()):alert("请输入正确验证码")})}function v(){var e="",t="";e=b("#mobile").val(),t=b("#areanum").text(),b.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:e,area:t}}).then(function(e){200!==e.code&&console.log(e.message)})}function w(){var e="",t="",a="",n="",o="",s="";b("#bindfirststep").on("click",function(r){if(r.preventDefault(),a=b(".phonenum").val(),n=b("#areanum").text(),i()){if(""===a)return T.find("em").text("手机格式错误"),void T.removeClass("hide");e=b("#openId").val()||"29803EC6D4AAC3AAB8ABDB6AE829D579",t=b("#sourceType").val()||"qq",b.ajax({type:"post",url:"/passport/autouserinfo/bindCheck",data:{mobile:a,area:n,openId:e,sourceType:t},dataType:"json",success:function(e){200===e.code&&(b("#bindmobileform").attr("action","/passport/thirdlogin/noregist"),v(),b("#bindmobileform").submit()),(400===e.code||402===e.code)&&(T.find("em").text("手机格式错误"),T.removeClass("hide")),506===e.code&&(o=e.data.user.username,s=e.data.user.headImg,b("#registphone").text(a),b("#username").text(o),""===s?b("#userphoto").attr("src","http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100"):b("#userphoto").attr("src",s),b("#logindirectly2").attr("href",e.data.user.bindLogin),b(".backdrop").show(),b("#alreayregist").show()),505===e.code&&(o=e.data.user.username,s=e.data.user.headImg,b("#registphonetwo").text(a),b("#username1").text(o),""===s?b("#userphoto1").attr("src","http://img10.static.yhbimg.com/headimg/2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100"):b("#userphoto").attr("src",s),b("#logindirectly").attr("href",e.data.user.bindLogin),b(".backdrop").show(),b("#bindconfirm").show())}})}})}function y(){l(),f(),n(),r(),o(),d(),w(),c(),u(),g(),s()}var b=e("jquery"),C=b("#nopermissionmessage").html(),x=b(".validatewrapper").html(),k=+b(".second").text(),j=!1,_=!1,$="http://cdn.yoho.cn/yohobuy/assets/img/passport/choosed.png",q=b(".bindwrapper"),T=q.find(".phone-err-tip"),A=q.find(".yohobindbtn");y()}),define("js/passport/third-pwd",["jquery"],function(e,t,a){function n(e,t){return e.charCodeAt(t)>=48&&e.charCodeAt(t)<=57?1:e.charCodeAt(t)>=97&&e.charCodeAt(t)<=122?2:e.charCodeAt(t)>=65&&e.charCodeAt(t)<=90?3:4}function i(e,t,a){var n=e.charCodeAt(0),i=t.charCodeAt(0);return n-i===0?!0:4===a||n-i!==1&&n-i!==-1?!1:!0}function o(e,t){return 0===t||e===t?0:4===e||4===t?2:1}function s(e){var t=0,a=e.length,s="",r=0,d=0,l="",c="";for(d;a>d;d++)l=e.charAt(d),c=n(e,d),r===c&&i(l,s,c)||(t+=c+o(c,r)),s=l,r=c;return t}function r(e,t){e.find("em").text(t),e.removeClass("hide")}function d(){return _-=1,0>_?(_=60,void C(".validatewrapper").html(q)):(C(".second").text(_),void window.setTimeout(d,1e3))}function l(){C(".validatewrapper").html($),window.setTimeout(d,1e3)}function c(){var e="",t="";C(document).on("click","#sendmessage",function(){l(),e=C("#mobile").val(),t=C("#area").val(),C.ajax({type:"POST",url:"/passport/autouserinfo/sendBindMsg",data:{mobile:e,area:t}}).then(function(e){200!==e.code&&alert(e.message)})})}function u(){var e="";C(document).on("keyup","#validatenum",function(){C("#err-info").hide(),e=C(this).val(),4===e.length&&(x||(x=!0,C.ajax({type:"POST",url:"/passport/autouserinfo/checkBindMsg",data:{code:e,mobile:C("#mobile").val(),area:C("#area").val()}}).then(function(e){x=!1,200!==e.code?C("#err-info").show():k=!0})))})}function h(){var e=v.val(),t=s(e),a=0;switch(a=0===t?0:10>=t?1:20>=t?2:3){case 0:w.removeClass("red yellow green"),b.removeClass("color");break;case 1:w.addClass("red").removeClass("yellow green"),b.filter(".low").addClass("color"),b.filter(".mid,.high").removeClass("color");break;case 2:w.addClass("yellow").removeClass("red green"),b.filter(".low,.mid").addClass("color"),b.filter(".high").removeClass("color");break;case 3:w.addClass("green").removeClass("yellow red"),b.addClass("color")}""===e?(j=!1,y.removeClass("red yes no").addClass("default")):e.length<6||e.length>20?(j=!1,y.removeClass("default yes").addClass("no red")):(j=!0,y.removeClass("default no red").addClass("yes"))}function p(){C(document).on("keyup",".pwdcontent",function(){h(C(this))}),C(document).on("focus",".pwdcontent",function(){C("#pwd-tips").removeClass("hide")}),C(document).on("blur",".pwdcontent",function(){C("#pwd-tips").addClass("hide")})}function f(){var e="",t="",a="",n="";t=C("#area").val(),a=C("#pwd").val(),e=C("#mobile").val(),n=C("#validatenum").val(),C.ajax({type:"POST",url:"/passport/autouserinfo/bindMobile",data:{area:t,openId:C("#openId").val(),sourceType:C("#sourceType").val(),mobile:e,password:a,code:n}}).then(function(e){200===e.code?window.location.href="/passport/thirdlogin/bindsuccess":alert(e.message)})}function m(){var e="",t="";C("#confirmsubmit").on("click",function(){var a=!0;e=C("#validatenum").val(),t=C("#pwd").val(),""===e?(r(A,"短信验证码不能为空"),a=!1):k===!1&&(r(A,"请输入正确的验证码"),a=!1),""===t?(r(I,"密码不能为空"),a=!1):t.length<6||t.length>20?(r(I,"密码只支持6-20位字符"),a=!1):S.test(t)?j===!1&&(r(I,"请输入符合强度的密码"),a=!1):(r(I,"密码须由字母和数字组合"),a=!1),a&&f()})}function g(){l(),v=C("#pwd"),w=C(".safelevel"),b=C(".pwd-intensity"),y=C("#pwd-tip1"),c(),u(),p(),m()}var v,w,y,b,C=e("jquery"),x=!1,k=!1,j=!1,_="",$="",q="",T=C(".bindwrapper"),A=T.find(".code-err-tip"),I=T.find(".pwd-err-tip"),S=e("js/passport/mail-phone-regx").pwdValidateRegx;$=C("#nopermissionmessage").html(),q=C(".validatewrapper").html(),_=+C(".second").text(),g()}),define("js/order/ensure",["jquery"],function(e,t,a){var n=e("jquery"),i=e("js/order/address"),o={Data:{product:0,activity:0,carriage:0,juan:0,yohocoin:0},UI:{e:{$pan:n(".pan"),$jc:n("#juancode"),$bp:n("#biprice"),$statistics:n("li",".play-total"),$tobi:n("p em",".play-bi-pan .play-pan"),$cancel:n(".cancel",".btn-group"),$total:n("em",".to-play"),$tbody:n("table tbody",".pay-wapper"),$orderSelectionSave:n(".address-list h2 span"),$addAddress:n(".add-address"),$addressManage:n(".address-manage"),$spanPayTypeLegend:n("span.pay-type-legend"),$supportType:n(".support-type"),$existAddressList:n(".exist-address-list").find("li"),$existAddress:n(".exist-address-list").find('input[name="exist-address"]'),$payTimeModify:n(".pay-time-modify"),$switchPayModify:n(".switch-pay-modify")},init:function(){var e=this.e,t=o.Data,a=o.Common;e.$tbody.find("tr").each(function(i){var o=n(this).find("td"),s=e.$tbody.find("tr").length,r=parseFloat(o.eq(1).html())*parseInt(o.eq(3).html());o.eq(4).html(a.strFixed(r)),t.product+=r,i?o.last().remove():o.last().attr("rowspan",s),i===s-1&&e.$tbody.find("tr").eq(0).find("td").last().html("<strong>"+a.strFixed(t.product)+"</strong>")}),this.render(),e.$pan.find("dt").click(function(){var e=n(this).parent("dl.pan");e.find("dd").is(":hidden")?a.winShow(e):a.winHide(e)}),e.$jc.on("focus change",function(e){var t=n(this).prev("label").prev(":radio");"focus"===e.type?t.attr("checked",!0):t.val(n(this).val())}),e.$bp.data("tobi",e.$tobi.html()),e.$bp.on("keyup change",function(){var e=a.enterNUM(n(this).val(),n(this).data("tobi"));n(this).val(e)}),e.$cancel.click(function(){var e=n(this).parents(".pan");a.winHide(e)}),e.$statistics.slice(3,5).find("a").click(function(){var e=n("."+n(this).attr("to"));a.winShow(e)}),e.$orderSelectionSave.click(function(){n(this).data("expand")?(n(".address-list-inner").removeClass("hide"),n(this).removeData("expand").text("[修改]")):(n(".address-list-inner").addClass("hide"),n(this).data("expand","expand").text("[不保存并关闭]"))}),e.$switchPayModify.click(function(){e.$payTimeModify.hasClass("hide")?(e.$payTimeModify.removeClass("hide"),n(this).text("[不保存并关闭]")):(e.$payTimeModify.addClass("hide"),n(this).text("[修改]"))}),e.$spanPayTypeLegend.click(function(){n(this).toggleClass("active"),e.$supportType.toggleClass("hide")}),n(document).on("click",".exist-address-list li",function(){e.$existAddressList.removeClass("active"),n(this).addClass("active"),e.$existAddress.removeAttr("checked"),n(this).find('input[name="exist-address"]').attr("checked","checked"),n(this).hasClass("use-new-address")&&e.$addressManage.removeClass("hide")})},render:function(){var e=this.e,t=o.Data,a=o.Common,i=0;e.$total.html("0.00"),e.$statistics.find("em").html("0.00"),e.$statistics.slice(3,5).hide(),n.each(t,function(n){t.hasOwnProperty(n)&&t[n]&&e.$statistics.eq(i).show().find("em").html(a.strFixed(t[n])),i++}),e.$total.html(a.strFixed(a.calucate()))}},Common:{enterNUM:function(e,t){return e=e.replace(/[^\d]/g,""),e&&t&&(e=parseInt(e),t=parseInt(t),e>t&&(e=t)),e},calucate:function(){var e=o.Data;return n.each(o.Data,function(t,a){e[t]=parseFloat(o.Data[t])}),e.product-e.activity+e.carriage-e.juan-e.yohocoin},winShow:function(e){e.find("dt").show(),e.find("dd").show(),e.attr("class").match(/(-bi-)|(-juan-)/g)&&e.find("dt").hide()},winHide:function(e){e.find("dt").show(),e.find("dd").hide()},strFixed:function(e){return parseFloat(e).toFixed(2)}},Bll:{e:{$juanok:n("#juansubmit"),$juantip:n(".errtip",".play-juan-pan"),$biok:n("#bisubmit"),$carriageGroup:n('input[name="carriagegroup"]')},init:function(){var e,t=this.e,a=o.Data,i=o.Common,s=o.UI;t.$carriageGroup.change(function(){a.carriage=parseFloat(n(this).val()),s.render()}),t.$juanok.click(function(){var r=n('input[name="juangroup"]:checked').val(),d=n(this).parents(".pan");r&&(e={url:"/Order/save/priceByCode",type:"post",data:{code:r},success:function(e){if(200===e.code){if(e.price)return a.juan=e.price,o.UI.render(),void i.winHide(d);s.render()}t.$juantip.html(e.msg)},error:function(){t.$juantip.html("网络出现错误~")}},n.ajax(e))}),t.$biok.click(function(){var e=n(this).parents(".pan");a.yohocoin=parseFloat(s.e.$bp.val())/100,s.render(),i.winHide(e)})}}};o.Data.activity=0,o.Data.carriage=0,o.UI.init(),o.Bll.init(),i.newAddress(),i.modifyAddress(),i.saveAddress()}),define("js/order/address",["jquery"],function(require,exports,module){function structureOption(e,t){var a,n,i;for(a in t)n+=t[a].checked?'<option selected value="'+t[a].value+'">'+t[a].name+"</option>":'<option value="'+t[a].value+'">'+t[a].name+"</option>";e.html(n),"province"===e.attr("name")?i='<option value="0">请选择省份</option>':"city"===e.attr("name")?i='<option value="0">请选择城市</option>':"county"===e.attr("name")&&(i='<option value="0">请选择区县</option>'),e.prepend($(i))}function getAddress(e,t){var a,n;"getProvince"===e.type?(n="getProvince",a=$province):"getCity"===e.type?(n="getCity",a=$city):"getCounty"===e.type&&(n="getCounty",a=$county),$.ajax({type:"post",url:"/order/save/"+n,dataType:"json",data:{id:e.id}}).then(function(e){structureOption(a,e),"function"==typeof t&&t()}).fail(function(){})}function getUserInfo(id){$.ajax({type:"post",url:"getUserInfo",data:{id:id}}).then(function(data){var key;for(key in data)data.hasOwnProperty(key)&&data[key]&&eval("$"+key).val(data[key])}).fail(function(){})}var $=require("jquery"),isProvinceChecked=!1,$addressManage=$(".address-manage"),$province=$addressManage.find('.text-input[name="province"]'),$city=$addressManage.find('.text-input[name="city"]'),$county=$addressManage.find('.text-input[name="county"]'),$selectList=$addressManage.find('.text-input[name="province"], .text-input[name="city"]'),$addressList=$(".address-list"),$name=$addressManage.find('.text-input[name="name"]'),$phone=$addressManage.find('.text-input[name="phone"]'),$telCode=$addressManage.find('.text-input[name="code-tel"]'),$tel=$addressManage.find('.text-input[name="tel"]'),$mail=$addressManage.find('.text-input[name="mail"]'),$address=$addressManage.find('.text-input[name="address"]'),$code=$addressManage.find('.text-input[name="code"]'),$saveBtn=$(".save-btn");exports.newAddress=function(e){var t="undefined"!==e?e:0;t&&getUserInfo(),getAddress({id:t,type:"getProvince"},function(){var e=$province.val();"0"!==e&&getAddress({id:e,type:"getCity"},function(){var e=$city.val();"0"!==e&&getAddress({id:e,type:"getCounty"})})}),$selectList.change(function(){var e=$(this);"province"===e.attr("name")&&getAddress({id:e.val(),type:"getCity"},function(){isProvinceChecked=!0}),"city"===e.attr("name")&&isProvinceChecked&&getAddress({id:e.val(),type:"getCounty"})})},exports.modifyAddress=function(){$addressList.click(function(e){var t=$(e.target),a=t.closest("li").find(".radio").attr("id");t.hasClass("address-modify")?($addressManage.removeClass("hide"),exports.newAddress(a)):t.hasClass("address-del")?$.ajax({type:"post",url:"/order/save/addressDel",data:{id:a}}).then(function(e){e.status&&t.closest("li").remove()}).fail(function(){}):t.hasClass("default-address")&&$.ajax({type:"post",url:"/order/save/defaultAddress",data:{id:a}}).then(function(e){e.status&&t.remove()}).fail(function(){})})},exports.saveAddress=function(){$saveBtn.click(function(){var e=$name.val(),t=$province.val(),a=$city.val(),n=$county.val(),i=$address.val(),o=$phone.val(),s=$telCode.val(),r=$tel.val(),d=$mail.val(),l=$code.val(),c=new Date;
$.ajax({type:"post",url:"/order/save/addressSave",data:{name:e,province:t,city:a,county:n,address:i,phone:o,tel:r,telCode:s,mail:d,code:l,id:1*c}}).then(function(t){var a;t.status&&(a='<li><input class="radio" type="radio" name="address" id="'+1*c+'" /><label for="'+1*c+'"><strong>'+e+"</strong><span>"+i+'</span><a href="javascript:void(0);">设为默认地址</a><div class="order-modify-btn"><span class="address-modify">[修改]</span><span class="address-del">[删除]</span></div></label></li>',$(".use-new-address").before($(a)))}).fail(function(){})})}});