index.js 44.6 KB
define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","index"],function(e,a,s){var n;e("js/common"),e("js/category/entry"),e("js/guang/entry"),e("js/home/entry"),e("js/index/entry"),e("js/passport/entry"),e("js/product/entry"),s.exports=n}),define("js/common",["jquery"],function(e,a,s){function n(e){var a,s,n=document.cookie;return document.cookie&&""!==document.cookie&&(s=n.indexOf(e+"="),s>-1&&(s+=e.length+1,a=decodeURIComponent(d.trim(n.substring(s,n.indexOf(";",s)))))),a}function t(e,a,s){var n,t,o,i,r="";"undefined"!=typeof a&&(s=s||{},null===a&&(a="",s.expires=-1),s.expires&&("number"==typeof s.expires||s.expires.toUTCString)&&("number"==typeof s.expires?(i=new Date,i.setTime(i.getTime()+24*s.expires*60*60*1e3)):i=s.expires,r="; expires="+i.toUTCString()),n=s.path?"; path="+s.path:"",t=s.domain?"; domain="+s.domain:"",o=s.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(a),r,n,t,o].join(""))}function o(){var e,a=n("_UID");return"undefined"==typeof a?0:(e=a.split("::"),"undefined"==typeof e||e.length<4?0:e)}function i(){var e=o();return 0===e?0:e[1]}function r(){var e=n("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function l(){0!==c.length&&(d("body").height()<=d(window).height()?c.addClass("bottom"):c.removeClass("bottom"))}var d=e("jquery"),c=d("#yoho-footer");!function(){var e=c.children(".op-row"),a=o();d("body").height()<=d(window).height()&&c.addClass("bottom"),0===a?e.prepend('<a href="/signin.html?refer='+location.href+'">登录</a><span class="sep-line">|</span><a href="/reg.html">注册</a>'):e.prepend('Hi,<a class="user-name" href="/home?tmp='+Math.random()+'">'+a[0]+'</a><a href="/passport/signout/index?token='+a[3]+'">退出</a>'),e.find(".back-to-top").on("touchend",function(){return d(window).scrollTop(0),!1}),c.removeClass("hide")}(),function(){var e=i();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.8","yohobuy_m",e,"")}(),window.cookie=n,window.setCookie=t,window.getUser=o,window.getUid=i,window.getShoppingKey=r,window.rePosFooter=l}),define("js/category/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery","hammer"],function(e,a,s){var n,t,o=e("jquery"),i=e("hammer"),r=o(".category-nav"),l=o(".category-container"),d=l.children(".content"),c=d.not(".hide");!function(){var e=o(".yoho-header"),a=o("#search-input"),s=o(window).height()-e.outerHeight()-a.outerHeight()-r.outerHeight();l.css("min-height",s),d.height(s)}(),o("#search-input").focus(function(){o(this).blur()}),n=new i(r[0]),n.on("tap",function(e){var a=o(e.target).closest("li"),s=a.index();a.hasClass("focus")||(r.find("li.focus").removeClass("focus"),a.addClass("focus"),c.addClass("hide"),c=d.eq(s).removeClass("hide"))}),t=new i(l[0]),t.on("tap",function(e){var a,s,n,t=o(e.target);if(s=t.closest(".p-level-item"),s.length>0){if(n=s.index(),a=t.closest(".content").find(".sub-level"),t.hasClass("focus"))return;t.closest(".primary-level").children(".focus").removeClass("focus"),t.addClass("focus"),a.not(".hide").addClass("hide"),a.eq(n).removeClass("hide")}})}),define("js/category/brand",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){function n(){var e=(f.val()+"").toLowerCase(),a={},s=0,n="";g.each(h,function(s,n){g.isArray(n)&&g.each(n,function(n,t){t.name.toLowerCase().indexOf(e)>-1&&(a[s]=a[s]||[],a[s].push(t))})}),g.each(a,function(e,a){var t=['<div class="brand-list bar-',s,'">'];s++,t.push('<div class="title-bar"><h2>'),t.push(e),t.push("</h2></div>"),g.each(a,function(e,a){t.push('<p><a href="'+a.url+'">'+a.name),a.isNew&&t.push('<i class="icon-hot">HOT</i>'),a.isHot&&t.push('<i class="icon-new">NEW</i>'),t.push("</a></p>")}),t.push("</div>"),n+=t.join("")}),g(".search-result").html(n),g(".search-result .brand-list p").each(function(e){u=new m(g(".search-result .brand-list p").eq(e)[0]),u.on("tap",function(){i=g(".search-result .brand-list p").eq(e).find("a").html(),r=g(".search-result .brand-list p").eq(e).find("a").attr("href"),localStorage.getItem("yohoHistory")&&(p=localStorage.getItem("yohoHistory"),k.push(p)),k.toString().split(i).length<2&&k.push('{"searchName":"'+i+'","searchHref":"'+i+'"}'),localStorage.setItem("yohoHistory",k)})})}var t,o,i,r,l,d,c,u,p,l,h,f,d,g=e("jquery"),m=e("hammer"),v=e("swiper"),w=e("lazyload"),y=g(".brand-list"),b=g(".search-icon"),C=g(".newbrand-search").outerHeight(),j=g(".yoho-header").outerHeight(),x=parseInt(C)+parseInt(j)-1,k=[];t=new v(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),w(g("img.lazy")),g(".yoho-header").css({"z-index":2,position:"fixed",top:0}),o=g('<div class="title-bar fixed-title-bar"><h2></h2></div>'),o.css({position:"fixed",top:x}).hide(),l=x+g(".hot-brand").outerHeight()+g(".banner-top").outerHeight(),g(".brand-list").last().append(o),g(window).scroll(function(){var e=g(window).scrollTop();y.eq(0).offset().top<l&&o.hide(),y.each(function(){var a=g(this).offset().top-x;e>=a&&o.css({display:"block"}).find("h2").html(g(this).find(".title-bar").text())})}),g(".brand-search-page").length&&(h=g.parseJSON(g("#brands-data").html()),f=g("#keyword"),f.on("input",function(){g(".history").css("display","none"),f.val().length?(n(),b.css("color","#000"),g(this).closest(".search-box").css("width","11.25rem"),g(".search-action").show()):(b.css("color","#b2b2b2"),g(this).closest(".search-box").css("width","12.5rem"),g(".search-action").hide())}).focus(),d=new m(g(".clear-text")[0]),d.on("tap",function(e){e.preventDefault(),g(".search-result").html(""),g("#keyword").val("").trigger("input"),e.srcEvent.stopPropagation()}),g("form.search-box").on("submit",function(){return!1}),localStorage&&localStorage.getItem("yohoHistory")?(p=g.parseJSON("["+localStorage.getItem("yohoHistory")+"]"),p&&g.each(p,function(e,a){g('<a href="'+a.searchHref+'">'+a.searchName+"</a>").appendTo(".historyList")})):g(".history").css("display","none"),c=new m(g(".removeHistory")[0]),c.on("tap",function(e){g(".historyList").html(" "),localStorage.clear()}))}),define("js/guang/entry",["jquery","hammer","lazyload","swiper","mlellipsis","iscroll-probe","index"],function(e,a,s){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail")}),define("js/guang/plus-star/list",["jquery","hammer","lazyload","swiper","index"],function(e,a,s){var n,t,o=e("jquery"),i=e("hammer"),r=e("lazyload"),l=e("swiper"),d=o("#nav-tab > li"),c=o("#ps-content > .content");r(o("img.lazy")),n=new l(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),t=new i(document.getElementById("nav-tab")),t.on("tap",function(e){var a=o(e.target).closest("li");a.hasClass("focus")||(d.toggleClass("focus"),c.toggleClass("hide"),o(document).trigger("scroll"))})}),define("js/guang/plus-star/detail",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){var n,t,o,i,r=e("jquery"),l=e("hammer"),d=e("mlellipsis"),c=e("lazyload"),u=r("#intro"),p=r("#intro-more-txt"),h=r("#related-infos-container"),f=e("js/guang/info"),g=e("js/plugin/tip"),m=r("#brand-info").data("id");e("js/plugin/wx-share"),d.init(),c(r("img.lazy")),u[0].mlellipsis(3),setTimeout(function(){n=u.text(),t=u.attr("title")}),f.initInfosEvt(h),o=new l(document.getElementById("more-intro")),o.on("tap",function(e){var a=r(e.target).closest("#more-intro");a.toggleClass("spread"),a.hasClass("spread")?(u.text(t),p.text("收起")):(u.text(n),p.text("more"),r(window).scrollTop(0,400)),e.preventDefault()}),i=new l(document.getElementById("brand-like")),i.on("tap",function(e){var a="ok",s=r(e.target);e.preventDefault(),s.hasClass("like")&&(a="cancel"),r.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:m,opt:a},success:function(e){200===e.code?s.toggleClass("like"):400===e.code||412===e.code?location.href=e.data:g.show(e.message)},error:function(){g.show("网络断开连接了~")}})})}),define("js/guang/info",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){function n(e){d(e.find("img.lazy")),e.each(function(){var e=i(this),a=e.find(".info-title"),s=e.find(".info-text");a[0].mlellipsis(2),s[0].mlellipsis(2)})}function t(e){var a=new r(e[0]);a.on("tap",function(e){var a,s,n,t=i(e.target),o="ok";a=t.closest(".like-btn"),a.length>0&&(a.hasClass("like")&&(o="cancel"),n=t.closest(".guang-info"),i.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:n.data("id"),opt:o},success:function(e){var s=e.code;200===s&&(a.next(".like-count").text(e.data),a.toggleClass("like"))},error:function(){c.show("网络断开连接了~")}})),s=t.closest(".collect-btn"),s.length>0&&(s.hasClass("collected")&&(o="cancel"),n=t.closest(".guang-info"),i.ajax({type:"POST",url:"/guang/opt/collectArticle",data:{id:n.data("id"),opt:o},success:function(e){e.code&&200===e.code&&s.toggleClass("collected")},error:function(){c.show("网络断开连接了~")}}))}),n(e.find(".guang-info"))}function o(e,a){var s;g||a.end||(1===a.page&&u.showLoadingMask(),s=e.find(".guang-info").length,g=!0,i.ajax({type:"GET",url:" /guang/index/page",data:a,success:function(t){var o;return" "===t?(a.end=!0,g=!1,h.addClass("hide"),void f.removeClass("hide")):(e.append(t),o=s>0?e.find(".guang-info:gt("+(s-1)+")"):e.find(".guang-info"),n(o),1===a.page&&(u.hideLoadingMask(),h.removeClass("hide"),window.rePosFooter()),a.page++,void(g=!1))},error:function(){c.show("网络断开连接了~"),g=!1}}))}var i=e("jquery"),r=e("hammer"),l=e("mlellipsis"),d=e("lazyload"),c=e("js/plugin/tip"),u=e("js/plugin/loading"),p=i("#load-more-info"),h=i(""),f=i(""),g=!1;l.init(),p.length>0&&(h=p.children(".loading"),f=p.children(".no-more")),a.initInfosEvt=t,a.setLazyLoadAndMellipsis=n,a.loadMore=o}),define("js/plugin/tip",["jquery"],function(e,a,s){function n(e,a){var s,n;"undefined"!=typeof e&&(s=e.toString(),n=a&&a>0?a:2e3,t.text(s).show(),o=setTimeout(function(){"block"===t.css("display")&&t.hide()},n))}var t,o,i=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';i(".yoho-page").append(e),t=i("#yoho-tip"),t.on("touchend",function(){t.hide(),clearTimeout(o)})}(),a.show=n}),define("js/plugin/loading",["jquery"],function(e,a,s){function n(e){var a='<div class="loading-mask hide"><div class="loading"></div></div>';d=!0,void 0===e&&(e=l),e.append(a),i=e.children(".loading-mask")}function t(){d||(n(),d=!0),i.removeClass("hide")}function o(){i.addClass("hide")}var i,r=e("jquery"),l=r(".yoho-page"),d=!1;a.init=n,a.showLoadingMask=t,a.hideLoadingMask=o}),define("js/plugin/wx-share",["jquery"],function(e,a,s){var n=e("jquery");s.exports=function(){var e="http://www.yohoshow.com/api/wechat/getSignPackage";n.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var a,s,n,t;void 0!==e&&""!==e&&(a=e.appId.toString(),s=e.timestamp,n=e.nonceStr.toString(),t=e.signature.toString(),wx.config({debug:!1,appId:a,timestamp:s,nonceStr:n,signature:t,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","translateVoice","startRecord","stopRecord","onRecordEnd","playVoice","pauseVoice","stopVoice","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"]}))}),wx.ready(function(){var e=n("#shareTitle").val(),a=n("#shareImg").val(),s=n("#shareDesc").val(),t=n("#shareLink").val(),o={title:e,desc:s,imgUrl:a,link:t};wx.onMenuShareAppMessage(o),wx.onMenuShareTimeline(o),wx.onMenuShareQQ(o),wx.onMenuShareWeibo(o)})}}),define("js/guang/home",["jquery","hammer","swiper","mlellipsis","lazyload","index"],function(e,a,s){var n,t,o=e("jquery"),i=e("hammer"),r=e("swiper"),l=e("js/guang/info"),d=l.loadMore,c=o("#load-more-info"),u=o(""),p=o(""),h=o(window).height(),f=o("#info-list"),g=f.children(".info-list"),m=o("#guang-nav"),v=m.children(".focus"),w=v.data("type"),y={};c.length>0&&(u=c.children(".loading"),p=c.children(".no-more")),n=new r(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination",autoplay:3e3}),l.initInfosEvt(f),function(){var e=o("#gender").val();m.children(".guang-nav-item").each(function(){var a=o(this).data("type"),s=o(this).hasClass("focus");y[a]={page:s?2:1,gender:e,type:a,end:!1}})}(),t=new i(m[0]),t.on("tap",function(e){var a,s,n=o(e.target).closest(".guang-nav-item");n.hasClass("focus")||(s=n.index(),n.addClass("focus"),v.removeClass("focus"),a=g.eq(s),v=n,w=n.data("type"),1===y[w].page?(u.addClass("hide"),p.addClass("hide"),d(a,y[w])):y[w].end?(u.addClass("hide"),p.removeClass("hide")):(u.removeClass("hide"),p.addClass("hide")),g.not(".hide").addClass("hide"),a.removeClass("hide"),1===y[w].page&&window.rePosFooter())}),o(document).scroll(function(){var e=g.not(".hide");o(window).scrollTop()+h>=o(document).height()-.25*e.height()&&d(e,y[w])})}),define("js/guang/list",["jquery","hammer","mlellipsis","lazyload"],function(e,a,s){var n=e("jquery"),t=e("js/guang/info"),o=t.loadMore,i=n(window).height(),r=n("#author-infos"),l=n("#tag"),d=n("#gender"),c=n("#isApp"),u={page:2,end:!1},p=n("#info-list");t.initInfosEvt(p),r.length>0&&n.extend(u,{authorId:r.data("id")}),l.length>0&&n.extend(u,{tag:l.val(),gender:d.val(),isApp:c.val()}),n(document).scroll(function(){n(window).scrollTop()+i>=n(document).height()-.25*p.height()&&o(p,u)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,a,s){function n(e){var a=e.offset().left,s=-b+a+w/2+"px";i.css({backgroundPosition:s+" bottom"}),m&&y.css({backgroundPosition:s+" bottom"})}function t(e){var a,s,t,p=u(e.currentTarget),f=p.index();p.hasClass("focus")||(r.filter(".focus").removeClass("focus"),m&&(a=p.closest(".fixed-thumb-container").length>0?i:y,s=a.find(".thumb").eq(f),y.find(".thumb.focus").removeClass("focus"),s.addClass("focus")),p.addClass("focus"),n(p),l.not(".hide").addClass("hide"),t=l.eq(f),t.removeClass("hide"),h(t.find(".lazy")),m?c&&c.scrollToElement(d,400):u("body").animate({scrollTop:o.offset().top},400),c&&c.refresh())}var o,i,r,l,d,c,u=e("jquery"),p=e("mlellipsis"),h=e("lazyload"),f=e("iscroll-probe"),g=u(".author .intro"),m=navigator.userAgent.indexOf("iPhone")>0?!0:!1,v=u(".collocation-block").length>0?!0:!1,w=0,y=u(""),d=document.querySelector("#wrapper .collocation-block"),b=u(window).width();e("js/plugin/wx-share")(),m&&(u(".yoho-header").length>0?u("#wrapper").addClass("ios has-head"):u("#wrapper").addClass("ios")),p.init(),h(u(".lazy")),u(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(o=u(".collocation-block"),i=o.children(".thumb-container"),r=i.find("li"),l=o.find(".prod"),w=r.width(),m&&(y=u("#wrapper").after(i.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),h(y.find(".lazy"),{event:"sporty"})),n(r.filter(".focus")),i.delegate(".thumb","touchend",t),m&&y.delegate(".thumb","touchend",t)),window.onload=function(){var e,a,s,n,t,r=u("#scroller");if(m){if(c=new f("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),!v)return void c.on("scroll",function(){r.trigger("scroll")});e=u(window).height(),t=y[0],a=i.height(),s=o.height(),n=o.offset().top,c.on("scroll",function(){var o=-this.y,i=t.className;n-e+a>=o?-1===i.indexOf("fixed-bottom")&&y.addClass("fixed-bottom").removeClass("hide"):n>=o?-1===i.indexOf("hide")&&y.addClass("hide").removeClass("fixed-bottom fixed-top"):n+s-a>=o?-1===i.indexOf("fixed-top")&&y.addClass("fixed-top").removeClass("hide absolute").css("top",""):n+s>=o?(-1===i.indexOf("absolute")&&y.addClass("absolute").removeClass("fixed-top hide"),t.style.top=n+s-a-o+"px"):o>n+s&&-1===i.indexOf("hide")&&y.addClass("hide").removeClass("absolute"),r.trigger("scroll")})}}}),define("js/home/entry",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","hammer","swiper","lazyload","index"],function(e,a,s){function n(){b.hasClass("menu-open")&&(b.removeClass("menu-open"),m(".overlay").hide(),m(".sub-nav").removeClass("show"),j.removeClass("on"),m("body").css({height:"auto",overflow:"auto"}))}function t(){k+=10,q.css({transform:"rotateX("+k+"deg)","-webkit-transform":"rotateX("+k+"deg)","-moz-transform":"rotateX("+k+"deg)"}),k/90%2===1&&(z?(q.addClass("animate"),z=!1):(q.removeClass("animate"),z=!0)),k/90%2===0&&k%360!==0?window.setTimeout(t,3e3):k%360===0?window.setTimeout(t,6e4):c(function(){t()})}var o,i,r,l,d,c,u,p,h,f,g,m=e("jquery"),v=e("hammer"),w=e("swiper"),y=e("lazyload"),b=m(".mobile-wrap"),C=m(".overlay"),j=m(".side-nav"),x=m(".sub-nav"),k=0,q=m(".home-header .logo"),z=!0;e("js/home/maybe-like"),y(m("img.lazy")),g=new v(m(".nav-btn")[0]),g.on("tap",function(e){return e.preventDefault(),b.addClass("menu-open"),C.show().css("opacity",.3),j.addClass("on"),m("body").css({height:m(window).height(),width:m(window).width(),overflow:"hidden"}),e.srcEvent.stopPropagation(),!1}),m(".overlay").on("touchend",function(e){return n(),!1}),j.on("touchend","li",function(e){return m(this).find(".sub-nav").size()>0&&(m(".sub-nav").removeClass("show"),m(this).find(".sub-nav").addClass("show")),e.stopPropagation(),e.target.pathname===location.pathname?(n(),!1):void 0}),x.each(function(){m(this).find("li").eq(0).on("touchend",function(e){return m(".sub-nav").removeClass("show"),e.stopPropagation(),!1})}).on("touchend",function(e){e.currentTarget!==e.target&&x.find("li").removeClass("current")}),m(".banner-swiper").find("li").size()>1&&(o=new w(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),r=new w(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),i=new w(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),m(".trend-topic-swiper").find("li").size()>1&&(l=new w(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),m(".category-swiper").each(function(e,a){h="category-swiper"+e,m(this).addClass(h),m("."+h).find(".swiper-slide").size()>1&&(d=new w("."+h,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+h+" .pagination-inner"}))}),c=function(){var e=null,a=["webkit","moz","ms"];for(p=0;p<a.length;p++)u=a[p]+"RequestAnimationFrame",window[u]&&(f=!0,e=u);return f?function(a){window[e](a)}:function(e){window.setTimeout(e,67)}}(),setTimeout(t,3e3),m("#yoho-footer").css({"margin-bottom":"2.5rem"}),a.set=function(e){window.setCookie("_Channel",e,{expires:365,domain:".m.yohobuy.com"})}}),define("js/home/maybe-like",["jquery","hammer","lazyload"],function(e,a,s){function n(){m||(m=!0,p.showLoadingMask(),d.ajax({type:"GET",url:i,data:{page:v+1},success:function(e){return" "===e?(m=!1,p.hideLoadingMask(),void(w&&(i="1,3"===w?"/boys/bottomBanner":"/girls/bottomBanner",d.ajax({type:"GET",url:i,success:function(e){e&&e.img&&(d("#load-more-img").show(),d("#load-more-img a").attr("href",e.url),d("#load-more-img a > img").attr("src",e.img))},error:function(){}})))):(o=g.find(".good-info").length,g.append(e),h(0===o?g.find(".good-info").find("img.lazy"):g.find(".good-info:gt("+(o-1)+")").find("img.lazy")),m=!1,p.hideLoadingMask(),void v++)},error:function(){u.show("网络断开连接了~"),m=!1,p.hideLoadingMask()}}))}var t,o,i,r,l,d=e("jquery"),c=e("hammer"),u=e("js/plugin/tip"),p=e("js/plugin/loading"),h=e("lazyload"),f=d(window).height(),g=d("#goods-list"),m=!1,v=0,w=null,y=d(".mobile-wrap").hasClass("kids-wrap")?!0:!1,b=d(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,C=d("#maybe-like-nav");y?i="/product/recom/maylikekids":b?i="/product/recom/maylikelife":(w=d(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",i="/product/recom/maylike?gender="+w),r=C.children(".focus"),b&&(t=new c(C[0]),t.on("tap",function(e){var a,s=d(e.target).closest("li"),n=d(".goods-list");e.preventDefault(),s.hasClass("focus")||(l=s.index(),s.addClass("focus"),r.removeClass("focus"),n.not(".hide").addClass("hide"),a=n.eq(l),a.removeClass("hide"),r=s,d(document).trigger("scroll"),e.srcEvent.stopPropagation())})),p.init(d(".maybe-like")),d(".maybe-like p").on("touchstart",function(e){n()}),d(window).scroll(function(){d(window).scrollTop()+f>=d(document).height()&&n()})}),define("js/index/entry",["jquery","hammer"],function(e,a,s){e("js/index/search"),e("js/index/footer"),e("js/index/channel")}),define("js/index/search",["jquery","hammer"],function(e,a,s){var n,t,o=e("jquery"),i=e("hammer"),r=o("#search-input input"),l=o("#search-input .clear-input"),d=o(".search-icon"),c=o("#search-form"),u=o(".history"),p=o("#clear-history"),h=e("js/index/write-search"),f=h.getRanToken();n=new i(p[0]),n.on("tap",function(){localStorage.removeItem("historys"),u.html("")}),r.on("input",function(){""===r.val()?(d.css("color","#b2b2b2"),l.addClass("hide")):(d.css("color","#000"),l.removeClass("hide"))}),t=new i(l[0]),t.on("tap",function(){r.val("").trigger("input")}),function(){var e,a,s,n="";if(localStorage&&(a=localStorage.getItem("historys"),a&&a.length>0)){for(a=a.split(f),s=0;s<a.length;s++)e=a[s],""!==e&&(n+='<li><a href="/?query='+e+'">'+e+"</li>");u.html(n),p.removeClass("hide")}}(),h.bindWirteLocal(c)}),define("js/index/write-search",[],function(e,a,s){function n(){return o}function t(e){e.on("submit",function(){var e,a=this.query.value;if(localStorage){if(e=localStorage.getItem("historys"),e=e?e:"",e.indexOf(o+a+o)>-1)return;""===e&&(a=o+a),e+=a+o,localStorage.setItem("historys",e)}})}var o=" ??++ ";a.getRanToken=n,a.bindWirteLocal=t}),define("js/index/footer",["jquery","hammer"],function(e,a,s){function n(){var e="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445",a=new Date;setTimeout(function(){new Date-a<2e3&&(window.location=e)},500)}var t,o=e("jquery"),i=e("hammer");o("#float-layer-close").on("touchend",function(e){return o("#float-layer-app").hide(),window.setCookie("_float-layer-app","id490655927",{domain:".yohobuy.com"}),window.setCookie("_float-layer-app-close",1,{domain:".yohobuy.com",expires:1}),!1}),o("#float-layer-btn")&&o("#float-layer-btn")[0]&&(t=new i(o("#float-layer-btn")[0]),t.on("tap",function(e){n("bottom"),e.srcEvent.stopPropagation()}),window.cookie("_float-layer-app")?o("#float-layer-app").hide():o("#float-layer-app").show())}),define("js/index/channel",["jquery"],function(e,a,s){var n=e("jquery"),t=n(".search-box"),o=n(".index-search"),i=n(".index-logo"),r=t.children('input[type="text"]'),l=o.children(".no-search"),d=t.children(".search-icon");e("js/common"),r.on("focus",function(){o.addClass("action"),i.addClass("action")}).on("input",function(){""===r.val()?d.addClass("empty"):d.removeClass("empty")}),l.on("touchstart",function(){o.removeClass("action"),i.removeClass("action"),r.blur()}),t.children(".clear-text").on("touchstart",function(){r.val("").focus().trigger("input")}),t.children(".search-icon").on("touchstart",function(){o.submit()})}),define("js/passport/entry",["jquery"],function(e,a,s){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password")}),define("js/passport/register/register",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#phone-num"),o=n("#country-select"),i=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),t.bind("input",function(){""===c(t.val())?r.addClass("disable"):r.removeClass("disable")}),o.change(function(){i.text(o.val())}),r.on("touchstart",function(){var e=c(t.val()),a=o.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?n.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["jquery"],function(e,a,s){function n(e){var a,s=r(".has-eye");e&&"open"===e.status?s.append('<div class="eye"></div>'):s.append('<div class="eye close"></div>'),a=s.children(".eye"),a.on("touchstart",function(e){var a=r(this),s=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?s.attr("type","password"):s.attr("type","text"),s.focus()})}function t(){var e,a=r(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var s=e.siblings(".input");s.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=r(this),a=e.siblings(".clear-input"),s=l(e.val());""===s?a.hide():a.show()})}function o(e){return e.length>=6&&e.length<=20?!0:!1}function i(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var s=navigator.userAgent;s.match(/uc/i)&&s.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var r=e("jquery"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+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][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};s.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:n,bindClearEvt:t,pwdValidate:o,selectCssHack:i}}),define("js/passport/register/code",["jquery"],function(e,a,s){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,a,s){var n=e("jquery");s.exports=function(a){function s(){var e,a=59;e=setInterval(function(){0===a?(i.text("重发验证码").removeClass("disable"),clearInterval(e)):i.text("重发验证码 ("+a--+"秒)")},1e3)}var t=n("#captcha"),o=n("#btn-next"),i=n("#captcha-tip"),r=n("#phone-num").val(),l=n("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),u=n.trim,p=c.show,h=a?"reg":"back";d.bindClearEvt(),t.bind("input",function(){""!==u(t.val())?o.removeClass("disable"):o.addClass("disable")}),i.on("touchstart",function(){i.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+h+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(i.text("重发验证码 (60秒)").addClass("disable"),s()):p(e.message)}})}),o.on("touchstart",function(){o.hasClass("disable")||n.ajax({type:"POST",url:"/passport/"+h+"/verifycode",data:{phoneNum:r,areaCode:l,code:u(t.val()),token:n("#token").val()},success:function(e){200===e.code?location.href=e.data:p(e.message)}})}),s()}}),define("js/passport/register/password",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#pwd"),o=n("#btn-sure"),i=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show;i.bindEyesEvt({status:"open"}),t.bind("input",function(){""===l(t.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=l(t.val());o.hasClass("disable")||(i.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):n.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:n("#phone-num").val(),areaCode:n("#area-code").val(),token:n("#token").val()},success:function(e){200===e.code?(d("注册成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}))})}),define("js/passport/login/login",["jquery"],function(e,a,s){function n(){p&&h?d.removeClass("disable"):d.addClass("disable")}function t(){c.show(),u.show()}function o(){c.hide(),u.hide()}var i=e("jquery"),r=i("#account"),l=i("#pwd"),d=i("#btn-login"),c=i("#retrive-pwd-mask"),u=i("#retrive-pwd-ways"),p=!1,h=!1,f=e("js/passport/api"),g=e("js/plugin/tip"),m=i.trim,v=g.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){p=""!==m(r.val())?!0:!1,n()}),l.bind("input",function(){h=""===m(l.val())?!1:!0,n()}),d.on("touchstart",function(){var e=m(r.val()),a=m(l.val());d.hasClass("disable")||((/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(a)?i.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:a},success:function(e){200===e.code?(v("登录成功"),setTimeout(function(){location.href=e.data},1e3)):v(e.message)},error:function(){v("网络断开连接啦~")}}):v("账号或密码有错误,请重新输入"))}),i("#forget-pwd").on("touchstart",function(){t()}),c.on("touchstart",function(){o()}),i("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),o()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,a,s){function n(){c&&u?d.removeClass("disable"):d.addClass("disable")}var t=e("jquery"),o=t("#phone-num"),i=t("#country-select"),r=t("#area-code"),l=t("#pwd"),d=t("#btn-login"),c=!1,u=!1,p=e("js/passport/api"),h=e("js/plugin/tip"),f=t.trim,g=h.show;p.selectCssHack(i),p.bindEyesEvt(),p.bindClearEvt(),o.bind("input",function(){c=""===f(o.val())?!1:!0,n()}),l.bind("input",function(){var e=f(l.val());u=""===e?!1:!0,n()}),i.change(function(){r.text(i.val())}),d.on("touchstart",function(){var e=f(o.val()),a=i.val(),s=f(l.val());d.hasClass("disable")||(p.phoneRegx[a].test(e)&&p.pwdValidate(s)?t.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:a.replace("+",""),account:e,password:s},success:function(e){200===e.code?(g("登录成功"),setTimeout(function(){location.href=e.data},1e3)):g(e.message)},error:function(){g("网络断开连接啦~")}}):g("账号或密码有错误,请重新输入"))}),o.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#phone-num"),o=n("#country-select"),i=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),t.bind("input",function(){""===c(t.val())?r.addClass("disable"):r.removeClass("disable")}),o.change(function(){i.text(o.val())}),r.on("touchstart",function(){var e=c(t.val()),a=o.val();r.hasClass("disable")||(l.phoneRegx[a].test(e)?n.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:a.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["jquery"],function(e,a,s){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#email"),o=n("#btn-sure"),i=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show;i.bindClearEvt(),t.bind("input",function(){""===l(t.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e=l(t.val());o.hasClass("disable")||(i.emailRegx.test(e)?n.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#resend"),o=e("js/plugin/tip"),i=o.show;t.on("touchstart",function(e){e.preventDefault(),n.ajax({url:t.data("url"),type:"GET",success:function(e){i(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#pwd"),o=n("#btn-ok"),i=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show,c=n("#phone-num");i.bindEyesEvt({status:"open"}),t.bind("input",function(){""===l(t.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e,a,s=l(t.val()),r=!0;o.hasClass("disable")||(e={password:s},0===c.length&&(r=!1),r?(n.extend(e,{phoneNum:c.val(),areaCode:n("#areaCode").val(),token:n("#token").val()
}),a="/passport/back/passwordByMobile"):(n.extend(e,{code:n("#email-code").val()}),a="/passport/back/passwordByEmail"),i.pwdValidate(s)?n.ajax({type:"POST",url:a,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/product/entry",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail")}),define("js/product/newsale/newarrival",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){function n(e){var a,s,n,t,l,u,p={};if(!d){if(e){for(s in T)T.hasOwnProperty(s)&&(T[s].reload=!0);switch(z.children(".active").removeClass("active"),S.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id};break;case"limit":a={limit:e.id};break;case"channel":a={channel:e.id};break;case"p_d":a={p_d:e.id}}c.extend(C,a)}if(S.hasClass("today")?(t="today",l=1):S.hasClass("week")?(t="week",l=2):S.hasClass("sale")&&(t="sale",l=3),n=T[t],u=n.page+1,n.reload)u=1;else if(n.end)return;c.extend(p,C,{dayLimit:l,page:u}),d=!0,m.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:p,success:function(e){var a,s;switch(t){case"today":a=o;break;case"week":a=i;break;case"sale":a=r}" "===e?(n.end=!0,n.reload&&a.html(b)):n.reload?(a.html(e),h(a.find(".lazy"))):(s=a.find(".good-info").length,a.append(e),h(a.find(".good-info:gt("+(s-1)+") .lazy"))),n.reload=!1,n.page=u,d=!1,m.hideLoadingMask(),window.rePosFooter()},error:function(){f.show("网络断开连接了~"),d=!1,m.hideLoadingMask()}})}}var t,o,i,r,l,d,c=e("jquery"),u=e("swiper"),p=e("hammer"),h=e("lazyload"),f=e("js/plugin/tip"),g=e("js/plugin/filter"),m=e("js/plugin/loading"),v=c("#goods-container"),w=v.children(),o=c(w.get(0)),i=c(w.get(1)).addClass("hide"),r=c(w.get(2)).addClass("hide"),y=c(window).height(),b='<p class="no-result">未找到相关搜索结果</p>',C={gender:c("#gender").val(),brand:c("#brand").val(),sort:c("#sort").val(),msort:c("#msort").val(),misort:c("#misort").val(),color:c("#color").val(),size:c("#size").val(),price:c("#price").val(),discount:c("#discount").val(),limit:c("#limit").val(),channel:c("#channel").val(),p_d:c("#p_d").val(),dayLimit:1},j=c.extend({},C),x=new Date,k=x.getMonth()+1,q=x.getDate(),z=c("#list-nav"),T={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},S=z.find(".active");e("js/product/suspend-cart"),c("#today a").text(k+"月"+q+"号"),c(".swiper-container .swiper-slide").length>1&&(t=new u(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner"})),c.ajax({type:"GET",url:"/product/newsale/filter",data:C,success:function(e){v.append(e),g.initFilter({fCbFn:n,hCbFn:function(){S.addClass("active"),S.siblings(".filter").removeClass("active")}})}}),h(c(".lazy")),l=new p(z[0]),l.on("tap",function(e){var a,s,t,l=c(e.target).closest("li");if(e.preventDefault(),l.hasClass("filter"))l.hasClass("active")?(g.hideFilter(),S.addClass("active"),l.removeClass("active")):(S=l.siblings(".active"),S.removeClass("active"),l.addClass("active"),g.showFilter());else{if(l.hasClass("today")?s="today":l.hasClass("week")?s="week":l.hasClass("sale")&&(s="sale"),a=T[s],!l.hasClass("active")){if(t=l.siblings(".active"),S=l,t.hasClass("filter"))g.hideFilter();else{switch(v.children(".container:not(.hide)").addClass("hide"),s){case"today":o.removeClass("hide");break;case"week":i.removeClass("hide");break;case"sale":r.removeClass("hide")}g.resetFilter(),C=c.extend({},j)}t.removeClass("active"),l.addClass("active")}a.reload&&n()}e.srcEvent.stopPropagation()}),c(window).scroll(function(){c(window).scrollTop()+y>c(document).height()-.25*v.height()-50&&void 0!==S&&n()}),n()}),define("js/plugin/filter",["jquery","hammer"],function(e,a,s){function n(){c.addClass("hide")}function t(){c.removeClass("hide")}function o(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function i(e){var a,s,n=e.closest(".sub-classify"),t=n.siblings(".shower");return e.hasClass("chosed")?n:(n.children(".chosed").removeClass("chosed"),e.addClass("chosed"),a=f.trim(e.html()),s=f.trim(t.html()),t.html(s.substring(0,s.indexOf("</span>")+7)+a.substring(0,a.indexOf("<i"))),0===e.index()?t.addClass("default"):t.removeClass("default"),n)}function r(e){var a,s=e.data("id");a=i(e),u&&u({type:a.data("type"),id:s}),n()}function l(e){var a;u=e.fCbFn,p=e.hCbFn,h=e.missStatus,c=f(".filter-mask"),a=new g(c[0]),a.on("tap",function(e){var a,s=f(e.target);e.preventDefault(),s.closest(".filter-body").length>0?(a=s.closest(".sub-item"),a.length>0?(a=s.closest("li"),r(a)):(a=s.closest(".classify-item"),e.srcEvent.stopPropagation(),o(a))):(n(),p&&p())})}function d(){"undefined"!=typeof c&&(f(".sub-classify").each(function(){i(f(this).children(":first-child"))}),o(f(".classify > :first-child")))}var c,u,p,h,f=e("jquery"),g=e("hammer");a.initFilter=l,a.showFilter=t,a.hideFilter=n,a.resetFilter=d}),define("js/product/suspend-cart",["jquery"],function(e,a,s){var n=e("jquery"),t=n("#suspend-cart");n.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&t.find(".cart-count").html(e.data.cart_goods_count).removeClass("hide")}})}),define("js/product/newsale/discount",["jquery","swiper","hammer","lazyload","index"],function(e,a,s){function n(e){var a,s,n,t,o,l={};if(!i){if(e){for(s in x)x.hasOwnProperty(s)&&(x[s].reload=!0);switch(j.children(".active").removeClass("active"),k.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}r.extend(C,a)}if(k.hasClass("new")?t="newest":k.hasClass("price")?t="price":k.hasClass("discount")&&(t="discount"),n=x[t],o=n.page+1,n.reload)o=1;else if(n.end)return;r.extend(l,C,{type:t,order:n.order,page:o}),i=!0,h.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var a,s;switch(t){case"newest":a=m;break;case"price":a=v;break;case"discount":a=w}" "===e?(n.end=!0,n.reload&&a.html(b)):n.reload?(a.html(e),c(a.find(".lazy"))):(s=a.find(".good-info").length,a.append(e),c(a.find(".good-info:gt("+(s-1)+") .lazy"))),n.reload=!1,n.page=o,i=!1,h.hideLoadingMask(),window.rePosFooter()},error:function(){u.show("网络断开连接了~"),i=!1,h.hideLoadingMask()}})}}var t,o,i,r=e("jquery"),l=e("swiper"),d=e("hammer"),c=e("lazyload"),u=e("js/plugin/tip"),p=e("js/plugin/filter"),h=e("js/plugin/loading"),f=r("#goods-container"),g=f.children(),m=r(g.get(0)),v=r(g.get(1)),w=r(g.get(2)),y=r(window).height(),b='<p class="no-result">未找到相关搜索结果</p>',C={gender:r("#gender").val(),brand:r("#brand").val(),sort:r("#sort").val(),msort:r("#msort").val(),misort:r("#misort").val(),color:r("#color").val(),size:r("#size").val(),price:r("#price").val(),discount:r("#discount").val()},j=r("#list-nav"),x={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},k=j.find(".active");e("js/product/suspend-cart"),r(".swiper-container .swiper-slide").length>1&&(t=new l(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner"})),r.ajax({type:"GET",url:"/product/newsale/filter",data:C,success:function(e){f.append(e),p.initFilter({fCbFn:n,hCbFn:function(){k.addClass("active"),k.siblings(".filter").removeClass("active")},missStatus:!0})}}),c(r(".lazy")),o=new d(j[0]),o.on("tap",function(e){var a,s,t,o=r(e.target).closest("li");if(e.preventDefault(),"undefined"!=typeof o&&0!==o.length){if(o.hasClass("filter"))o.hasClass("active")?(p.hideFilter(),k.addClass("active"),o.removeClass("active")):(k=o.siblings(".active"),k.removeClass("active"),o.addClass("active"),p.showFilter());else{if(o.hasClass("new")?s="newest":o.hasClass("price")?s="price":o.hasClass("discount")&&(s="discount"),a=x[s],o.hasClass("active")){if(o.hasClass("new"))return;(o.hasClass("price")||o.hasClass("discount"))&&(o.find(".icon > .iconfont").toggleClass("cur"),k=o,a.reload=!0,a.order=0===a.order?1:0)}else{if(t=o.siblings(".active"),k=o,t.hasClass("filter"))p.hideFilter();else switch(f.children(".container:not(.hide)").addClass("hide"),s){case"newest":m.removeClass("hide");break;case"price":v.removeClass("hide");break;case"discount":w.removeClass("hide")}t.removeClass("active"),o.addClass("active")}a.reload&&n()}e.srcEvent.stopPropagation()}}),r(window).scroll(function(){r(window).scrollTop()+y>r(document).height()-.25*f.height()-50&&void 0!==k&&n()}),n()}),define("js/product/list",["jquery","hammer","lazyload"],function(e,a,s){function n(e){var a,s,n,o,i,r={};if(!t){if(e){for(s in q)q.hasOwnProperty(s)&&(q[s].reload=!0);switch(k.children(".active").removeClass("active"),z.addClass("active"),e.type){case"gender":a={gender:e.id};break;case"brand":a={brand:e.id};break;case"sort":a={sort:e.id};break;case"color":a={color:e.id};break;case"size":a={size:e.id};break;case"price":a={price:e.id};break;case"discount":a={discount:e.id}}d.extend(x,a)}if(z.hasClass("new")?o="newest":z.hasClass("price")?o="price":z.hasClass("discount")&&(o="discount"),n=q[o],i=n.page+1,n.reload)i=1;else if(n.end)return;d.extend(r,x,{type:o,order:n.order,page:i}),t=!0,v.showLoadingMask(),d.ajax({type:"GET",url:"/index/search/search",data:r,success:function(e){var a,s,r='<p class="no-result">未找到相关搜索结果</p>';switch(o){case"newest":s=y;break;case"price":s=b;break;case"discount":s=C}" "===e?(n.end=!0,n.reload&&s.html(r)):n.reload?(s.html(e),u(s.find(".lazy"))):(a=s.find(".good-info").length,s.append(e),u(s.find(".good-info:gt("+(a-1)+") .lazy"))),n.reload=!1,n.page=i,t=!1,v.hideLoadingMask(),window.rePosFooter()}})}}var t,o,i,r,l,d=e("jquery"),c=e("hammer"),u=e("lazyload"),p=d("#brand-header"),h=d("#intro-box"),f=e("js/plugin/filter"),g=e("js/index/write-search"),m=e("js/plugin/tip"),v=e("js/plugin/loading"),w=d("#goods-container"),y=w.children(".new-goods"),b=w.children(".price-goods"),C=w.children(".discount-goods"),j=d(window).height(),x={gender:d("#gender").val(),brand:d("#brand").val(),sort:d("#sort").val(),msort:d("#msort").val(),misort:d("#misort").val(),color:d("#color").val(),size:d("#size").val(),price:d("#price").val(),discount:d("#discount").val(),query:d("#query").val()},k=d("#list-nav"),q={newest:{order:1,reload:!0,page:0,end:!1},price:{order:0,reload:!0,page:0,end:!1},discount:{order:0,reload:!0,page:0,end:!1}},z=k.find(".active");e("js/product/suspend-cart"),d.ajax({type:"GET",url:"/search/filter",data:x,success:function(e){w.append(e),f.initFilter({fCbFn:n,hCbFn:function(){z.addClass("active"),z.siblings(".filter").removeClass("active")}})}}),u(d(".lazy")),g.bindWirteLocal(d("#search-form")),o=new c(k[0]),o.on("tap",function(e){var a,s,t,o=d(e.target).closest("li");if(o.hasClass("filter"))o.hasClass("active")?(f.hideFilter(),z.addClass("active"),o.removeClass("active")):(z=o.siblings(".active"),z.removeClass("active"),o.addClass("active"),f.showFilter());else{if(o.hasClass("new")?s="newest":o.hasClass("price")?s="price":o.hasClass("discount")&&(s="discount"),a=q[s],o.hasClass("active")){if(o.hasClass("new"))return;(o.hasClass("price")||o.hasClass("discount"))&&(o.find(".icon > .iconfont").toggleClass("cur"),z=o,a.reload=!0,a.order=0===a.order?1:0)}else{if(t=o.siblings(".active"),z=o,t.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),s){case"newest":y.removeClass("hide");break;case"price":b.removeClass("hide");break;case"discount":C.removeClass("hide")}t.removeClass("active"),o.addClass("active")}a.reload&&n()}}),d(window).scroll(function(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&n()}),p.length>0&&(i=new c(p.children(".btn-intro")[0]),i.on("tap",function(){h.removeClass("hide"),d("body").addClass("overflow-hidden")}),r=new c(document.getElementById("intro-box")),r.on("tap",function(e){var a=d(e.target);e.srcEvent.preventDefault(),(0===a.closest("#brand-intro").length||a.hasClass("close-intro"))&&(h.addClass("hide"),d("body").removeClass("overflow-hidden"))}),l=new c(p.children(".btn-col")[0]),l.on("tap",function(){var e,a=d(this),s=p.data("id");e=a.hasClass("coled")?"cancel":"ok",d.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:s,opt:e},success:function(e){200===e.code?a.toggleClass("coled"):400===e.code?location.href=e.data:m.show(e.message)},error:function(){m.show("网络断开连接了~")}})})),n()}),define("js/product/detail/detail",["jquery","swiper","lazyload","index"],function(e,a,s){var n,t=e("jquery"),o=e("swiper"),i=e("lazyload");i(t("img.lazy")),n=new o(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,paginationClickable:!0,pagination:".swiper-pagination",nextButton:".swiper-button-next",prevButton:".swiper-button-prev"})});