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