index.js 88.8 KB
define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","handlebars","source-map","index"],function(e,t,n){var o;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"),e("js/me/entry"),n.exports=o}),define("js/common",["jquery"],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(c.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}function l(){var e;0!==u.length&&(e=Math.min(c(window).height(),window.screen.availHeight),c("body").height()<=e-parseInt(u.css("height"),0)?u.addClass("bottom"):u.removeClass("bottom"))}function d(e){var t=c(e).outerHeight();e&&u.css("margin-bottom",t+"px")}var c=e("jquery"),u=c("#yoho-footer"),h=c(".yoho-header");!function(){var e=u.children(".op-row"),t=a();l(),0===t?e.prepend('<a href="http://m.yohobuy.com/signin.html?refer='+location.href+'">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):e.prepend('<span>Hi,</span><a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+t[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+t[3]+'">退出</a>'),e.find(".back-to-top").on("touchend",function(){return c(window).scrollTop(0),!1}),u.removeClass("hide")}(),function(){var e=s();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.13.2","yohobuy_m",e,"")}(),h.on("touchstart","a",function(){h.find("a").removeClass("highlight"),c(this).addClass("highlight")}).on("touchend touchcancel","a",function(){c(this).removeClass("highlight")}),function(){var e,t,n=0,o="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(t=0;t<o.length&&(!i||!a);t++)e=o[t],i=i||window[e+"RequestAnimationFrame"],a=a||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];i&&a||(i=function(e,t){var o=(new Date).getTime(),i=Math.max(0,16-(o-n)),a=window.setTimeout(function(){e(o+i)},i);return n=o+i,a},a=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=a}(),window.cookie=o,window.setCookie=i,window.getUser=a,window.getUid=s,window.getShoppingKey=r,window.rePosFooter=l,window.reMarginFooter=d}),define("js/category/entry",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery"],function(e,t,n){var o=e("jquery"),i=o(".category-nav"),a=o(".category-container"),s=a.children(".content"),r=a.find(".sub-level li"),l=a.find(".primary-level li"),d=s.not(".hide");!function(){var e=o(".yoho-header"),t=o("#search-input"),n=o(window).height()-e.outerHeight()-t.outerHeight()-i.outerHeight();a.css("min-height",n),s.height(n)}(),o("#search-input").focus(function(){o(this).blur()}),i.bind("contextmenu",function(e){return!1}),o(".category-container").bind("contextmenu",function(e){return!1}),i.on("touchend touchcancel",function(e){var t=o(e.target).closest("li"),n=t.index();t.hasClass("focus")||(i.find("li.focus").removeClass("focus"),t.addClass("focus"),d.addClass("hide"),d=s.eq(n).removeClass("hide"))}),a.on("touchend",function(e){var t,n,i,a=o(e.target);if(n=a.closest(".p-level-item"),n.length>0){if(i=n.index(),t=a.closest(".content").find(".sub-level"),a.hasClass("focus"))return;a.closest(".primary-level").children(".focus").removeClass("focus"),a.addClass("focus"),t.not(".hide").addClass("hide"),t.eq(i).removeClass("hide")}}),a.find(".primary-level").on("touchstart touchend touchcancel","li",function(){l.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),a.find(".sub-level").on("touchstart","li",function(){r.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),i.on("touchstart","li",function(){i.find("li").removeClass("bytouch"),o(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){i.find("li").removeClass("bytouch")})}),define("js/category/brand",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){function o(){var e=p(window).scrollTop();v.eq(0).offset().top<d&&r.hide(),v.each(function(){var t=p(this).offset().top-C;e>=t&&r.css({display:"block"}).find("h2").html(p(this).find(".title-bar").text())})}function i(){var e=p(".brand-list").find("p");e.on("touchstart",function(){e.css("background","#fff"),p(this).css("background","#eee")}).on("touchend touchcancel",function(){p(this).css("background","#fff")})}function a(){var e=(u.val()+"").toLowerCase(),t={},n=0,o="";""!==e&&(p.each(c,function(n,o){p.isArray(o)&&p.each(o,function(o,i){i.name.toLowerCase().indexOf(e)>-1&&(t[n]=t[n]||[],t[n].push(i))})}),p.each(t,function(e,t){var i=['<div class="brand-list bar-',n,'">'];n++,i.push('<div class="title-bar"><h2>'),i.push(e),i.push("</h2></div>"),p.each(t,function(e,t){i.push('<p><a href="'+t.url+'">'+t.name),t.isNew&&i.push('<i class="icon-new">NEW</i>'),t.isHot&&i.push('<i class="icon-hot">HOT</i>'),i.push("</a></p>")}),i.push("</div>"),o+=i.join("")})),p(".search-result").html(o),i()}var s,r,l,d,c,u,h,p=e("jquery"),f=e("hammer"),m=e("swiper"),g=e("lazyload"),v=p(".brand-list"),w=p(".search-icon"),y=p(".newbrand-search").outerHeight(),b=p(".yoho-header").outerHeight(),C=parseInt(y)+parseInt(b)-1;l=new m(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),s=new m(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),g(p("img.lazy")),p(".yoho-header").css({"z-index":2,position:"fixed",top:0}),p(".banner-top").length>0&&p(".hot-brands").css("padding-top","0"),r=p('<div class="title-bar fixed-title-bar"><h2></h2></div>'),r.css({position:"fixed",top:C}).hide(),d=C+p(".hot-brands").outerHeight()+p(".banner-top").outerHeight(),v.last().append(r),p(window).scroll(function(){window.requestAnimationFrame(o)}),i(),p(".brand-search-page").length&&(c=p.parseJSON(p("#brands-data").html()),u=p("#keyword"),u.on("input",function(){u.val().length?(w.css("color","#000"),p(this).closest(".search-box").css("width","11.25rem"),p(".search-action").show()):(w.css("color","#b2b2b2"),p(this).closest(".search-box").css("width","12.5rem"),p(".search-action").hide()),a()}).focus(),h=new f(p(".clear-text")[0]),h.on("tap",function(e){e.preventDefault(),p(".search-result").html(""),p("#keyword").val("").trigger("input"),e.srcEvent.stopPropagation()}),p("form.search-box").on("submit",function(){return!1}))}),define("js/guang/entry",["jquery","lazyload","swiper","hammer","mlellipsis","iscroll-probe","index"],function(e,t,n){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","lazyload","swiper","index"],function(e,t,n){var o,i=e("jquery"),a=e("lazyload"),s=e("swiper"),r=i("#nav-tab > li"),l=i("#ps-content > .content");a(i("img.lazy")),o=new s(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),i("#nav-tab").bind("contextmenu",function(e){return!1}),i("#nav-tab").on("touchend touchcancel",function(e){var t=i(e.target).closest("li");t.hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),i(document).trigger("scroll"))}),i("#nav-tab").on("touchstart",function(e){var t=e.target||e.srcElement;t.className="bytouch "+t.className}).on("touchend touchcancel",function(){r.removeClass("bytouch")})}),define("js/guang/plus-star/detail",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){var o,i,a,s,r=e("jquery"),l=e("hammer"),d=e("mlellipsis"),c=e("lazyload"),u=r("#intro"),h=r("#intro-more-txt"),p=r("#related-infos-container"),f=e("js/guang/info"),m=e("js/plugin/tip"),g=r("#brand-info").data("id"),v=r("#jump-to-app").val();e("js/plugin/wx-share"),d.init(),c(r("img.lazy")),u[0].mlellipsis(3),setTimeout(function(){o=u.text(),i=u.attr("title")}),f.initInfosEvt(p),a=new l(document.getElementById("more-intro")),a.on("tap",function(e){var t=r(e.target).closest("#more-intro");t.toggleClass("spread"),t.hasClass("spread")?(u.text(i),h.text("收起")):(u.text(o),h.text("more"),r(window).scrollTop(0,400)),e.preventDefault()}),s=new l(document.getElementById("brand-like")),s.on("tap",function(e){var t="ok",n=r(e.target);"1"!==v&&(e.preventDefault(),n.hasClass("like")&&(t="cancel"),r.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:g,opt:t},success:function(e){200===e.code?n.toggleClass("like"):400===e.code||412===e.code?location.href=e.data:m.show(e.message)},error:function(){m.show("网络断开连接了~")}}))})}),define("js/guang/info",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){function o(e){d(e.find("img.lazy")),e.each(function(){var e=s(this),t=e.find(".info-title"),n=e.find(".info-text");t[0].mlellipsis(2),n[0].mlellipsis(2)})}function i(e){var t;"undefined"!=typeof e&&(t=new r(e[0]),t.on("tap",function(e){var t,n,o=s(e.target),i="ok";return t=o.closest(".like-btn"),t.length>0?(e.preventDefault(),t.hasClass("like")&&(i="cancel"),n=o.closest(".guang-info"),void s.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:n.data("id"),opt:i},success:function(e){var n=e.code;200===n&&(t.next(".like-count").text(e.data),t.toggleClass("like"))},error:function(){c.show("网络断开连接了~")}})):(t=o.closest(".collect-btn"),void(t.length>0&&(e.preventDefault(),t.hasClass("collected")&&(i="cancel"),n=o.closest(".guang-info"),s.ajax({type:"POST",url:"/guang/opt/collectArticle",data:{id:n.data("id"),opt:i},success:function(e){e.code&&200===e.code&&t.toggleClass("collected")},error:function(){c.show("网络断开连接了~")}}))))}),o(e.find(".guang-info")))}function a(e,t,n){var i;m||t.end||(1===t.page&&u.showLoadingMask(),i=e.find(".guang-info").length,m=!0,s.ajax({type:"GET",url:n?n:"/guang/index/page",data:t,success:function(n){var a;return" "===n?(t.end=!0,m=!1,p.addClass("hide"),void f.removeClass("hide")):(e.append(n),a=i>0?e.find(".guang-info:gt("+(i-1)+")"):e.find(".guang-info"),o(a),1===t.page&&(u.hideLoadingMask(),p.removeClass("hide"),window.rePosFooter()),t.page++,void(m=!1))},error:function(){c.show("网络断开连接了~"),m=!1}}))}var s=e("jquery"),r=e("hammer"),l=e("mlellipsis"),d=e("lazyload"),c=e("js/plugin/tip"),u=e("js/plugin/loading"),h=s("#load-more-info"),p=s(""),f=s(""),m=!1;l.init(),h.length>0&&(p=h.children(".loading"),f=h.children(".no-more")),t.initInfosEvt=i,t.setLazyLoadAndMellipsis=o,t.loadMore=a}),define("js/plugin/tip",["jquery"],function(e,t,n){function o(e,t){var n,o;"undefined"!=typeof e&&(n=e.toString(),o=t&&t>0?t:2e3,i.text(n).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},o))}var i,a,s=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),i=s("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(a)})}(),t.show=o}),define("js/plugin/loading",["jquery"],function(e,t,n){function o(e){var t='<div class="loading-mask hide"><div class="loading"></div></div>';d=!0,void 0===e&&(e=l),e.append(t),s=e.children(".loading-mask")}function i(){d||(o(),d=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,r=e("jquery"),l=r(".yoho-page"),d=!1;t.init=o,t.showLoadingMask=i,t.hideLoadingMask=a}),define("js/plugin/wx-share",["jquery"],function(e,t,n){var o=e("jquery");n.exports=function(){var e="http://www.yohoshow.com/api/wechat/getSignPackage";o.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var t,n,o,i;void 0!==e&&""!==e&&(t=e.appId.toString(),n=e.timestamp,o=e.nonceStr.toString(),i=e.signature.toString(),wx.config({debug:!1,appId:t,timestamp:n,nonceStr:o,signature:i,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=o("#shareTitle").val(),t=o("#shareImg").val(),n=o("#shareDesc").val(),i=o("#shareLink").val(),a={title:e,desc:n,imgUrl:t,link:i};wx.onMenuShareAppMessage(a),wx.onMenuShareTimeline(a),wx.onMenuShareQQ(a),wx.onMenuShareWeibo(a)})}}),define("js/guang/home",["jquery","swiper","hammer","mlellipsis","lazyload","index"],function(e,t,n){function o(){var e=f.not(".hide");a(window).scrollTop()+h>=a(document).height()-.25*e.height()&&l(e,w[v])}var i,a=e("jquery"),s=e("swiper"),r=e("js/guang/info"),l=r.loadMore,d=a("#load-more-info"),c=a(""),u=a(""),h=a(window).height(),p=a("#info-list"),f=p.children(".info-list"),m=a("#guang-nav"),g=m.children(".focus"),v=g.data("type"),w={};d.length>0&&(c=d.children(".loading"),u=d.children(".no-more")),i=new s(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination",autoplay:3e3}),r.initInfosEvt(p),function(){var e=a("#gender").val();m.children(".guang-nav-item").each(function(){var t=a(this).data("type"),n=a(this).hasClass("focus");w[t]={page:n?2:1,gender:e,type:t,end:!1}})}(),m.bind("contextmenu",function(e){return!1}),m.on("touchend touchcancel",function(e){var t,n,o=a(e.target).closest(".guang-nav-item");o.hasClass("focus")||(n=o.index(),o.addClass("focus"),g.removeClass("focus"),t=f.eq(n),g=o,v=o.data("type"),1===w[v].page?(c.addClass("hide"),u.addClass("hide"),l(t,w[v])):w[v].end?(c.addClass("hide"),u.removeClass("hide")):(c.removeClass("hide"),u.addClass("hide")),f.not(".hide").addClass("hide"),t.removeClass("hide"),1===w[v].page&&window.rePosFooter())}),a(document).scroll(function(){window.requestAnimationFrame(o)}),m.on("touchstart",function(e){var t=e.target||e.srcElement;t.className="bytouch "+t.className}).on("touchend touchcancel",function(){m.find("li").removeClass("bytouch")})}),define("js/guang/list",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){function o(){i(window).scrollTop()+r>=i(document).height()-.25*p.height()&&s(p,h)}var i=e("jquery"),a=e("js/guang/info"),s=a.loadMore,r=i(window).height(),l=i("#author-infos"),d=i("#tag"),c=i("#gender"),u=i("#isApp"),h={page:2,end:!1},p=i("#info-list");a.initInfosEvt(p),l.length>0&&i.extend(h,{authorId:l.data("id"),isApp:u.val()}),d.length>0&&i.extend(h,{tag:d.val(),gender:c.val(),isApp:u.val()}),i(window).scroll(function(){window.requestAnimationFrame(o)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,t,n){function o(e){var t=e.offset().left,n=-C+t+y/2+"px";r.css({backgroundPosition:n+" bottom"}),v&&b.css({backgroundPosition:n+" bottom"})}function i(e){var t,n,i,a=h(e.currentTarget),p=a.index();a.hasClass("focus")||(l.filter(".focus").removeClass("focus"),v&&(t=a.closest(".fixed-thumb-container").length>0?r:b,n=t.find(".thumb").eq(p),b.find(".thumb.focus").removeClass("focus"),n.addClass("focus")),a.addClass("focus"),o(a),d.not(".hide").addClass("hide"),i=d.eq(p),i.removeClass("hide"),f(i.find(".lazy")),v?u&&u.scrollToElement(c,400):h("body").animate({scrollTop:s.offset().top},400),u&&u.refresh())}function a(){var e,t,n,o,i,a=h("#scroller"),l=h(".yoho-header"),d=0;return l.length>0&&(d=l.outerHeight()),u=new m("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),w?(e=h(window).height()-d,i=b[0],t=r.outerHeight(),n=s.outerHeight(),o=s.offset().top-d,void u.on("scroll",function(){var s=-this.y,r=i.className;o-e+t>=s?-1===r.indexOf("fixed-bottom")&&b.addClass("fixed-bottom").removeClass("hide"):o>=s?-1===r.indexOf("hide")&&b.addClass("hide").removeClass("fixed-bottom fixed-top"):o+n-t>=s?-1===r.indexOf("fixed-top")&&b.addClass("fixed-top").removeClass("hide absolute").css("top",""):o+n>=s?(-1===r.indexOf("absolute")&&b.addClass("absolute").removeClass("fixed-top hide"),i.style.top=o+d+n-t-s+"px"):s>o+n&&-1===r.indexOf("hide")&&b.addClass("hide").removeClass("absolute"),a.trigger("scroll")})):void u.on("scroll",function(){a.trigger("scroll")})}var s,r,l,d,c,u,h=e("jquery"),p=e("mlellipsis"),f=e("lazyload"),m=e("iscroll-probe"),g=h(".author .intro"),v=!1,w=h(".collocation-block").length>0?!0:!1,y=0,b=h(""),c=document.querySelector("#wrapper .collocation-block"),C=h(window).width();e("js/plugin/wx-share")(),window.onload=function(){u&&u.refresh()},t.i=function(e){var t=navigator.userAgent.indexOf("iPhone")>0?!0:!1;v=t&&e,p.init(),f(h(".lazy")),h(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),g.offset()&&parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(h(".yoho-header").length>0?h("#wrapper").addClass("ios has-head"):h("#wrapper").addClass("ios")),w&&(s=h(".collocation-block"),r=s.children(".thumb-container"),l=r.find("li"),d=s.find(".prod"),y=l.width(),v&&(b=h("#wrapper").after(r.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),f(b.find(".lazy"),{event:"sporty"})),o(l.filter(".focus")),r.delegate(".thumb","touchend",i),v&&b.delegate(".thumb","touchend",i)),v&&a()}}),define("js/home/entry",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){function o(){b.hasClass("menu-open")&&(b.removeClass("menu-open"),g(".overlay").hide(),g(".sub-nav").removeClass("show"),j.removeClass("on"),g("body").css({height:"auto",overflow:"auto"}))}function i(){k+=10,q.css({transform:"rotateX("+k+"deg)","-webkit-transform":"rotateX("+k+"deg)","-moz-transform":"rotateX("+k+"deg)"}),k/90%2===1&&(E?(q.addClass("animate"),E=!1):(q.removeClass("animate"),E=!0)),k/90%2===0&&k%360!==0?window.setTimeout(i,3e3):k%360===0?window.setTimeout(i,6e4):c(function(){i()})}var a,s,r,l,d,c,u,h,p,f,m,g=e("jquery"),v=e("hammer"),w=e("swiper"),y=e("lazyload"),b=g(".mobile-wrap"),C=g(".overlay"),j=g(".side-nav"),x=g(".sub-nav"),k=0,q=g(".home-header .logo"),E=!0;e("js/home/maybe-like"),y(g("img.lazy")),m=new v(g(".nav-btn")[0]),m.on("tap",function(e){return e.preventDefault(),b.addClass("menu-open"),C.show().css("opacity",.3),j.addClass("on"),g("body").css({height:g(window).height(),width:g(window).width(),overflow:"hidden"}),e.srcEvent.stopPropagation(),!1}),g(".overlay").on("touchstart",function(e){return o(),!1}),j.on("touchstart","li",function(e){return g(this).find(".sub-nav").size()>0&&(g(".sub-nav").removeClass("show"),g(this).find(".sub-nav").addClass("show")),e.stopPropagation(),e.target.pathname===location.pathname?(o(),!1):void 0}),x.each(function(){g(this).find("li").eq(0).on("touchstart",function(e){return g(".sub-nav").removeClass("show"),e.stopPropagation(),!1})}).on("touchstart",function(e){e.currentTarget!==e.target&&x.find("li").removeClass("current")}),j.children("ul").children("li").on("touchstart",function(){j.children("ul").children("li").css("background","#fff"),g(this).css("background","#eee")}).on("touchend touchcancel",function(){g(this).css("background","#fff")}),g(".banner-swiper").find("li").size()>1&&(a=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"}),s=new w(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),g(".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"})),g(".category-swiper").each(function(e,t){p="category-swiper"+e,g(this).addClass(p),g("."+p).find(".swiper-slide").size()>1&&(d=new w("."+p,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+p+" .pagination-inner"}))}),c=function(){var e=null,t=["webkit","moz","ms"];for(h=0;h<t.length;h++)u=t[h]+"RequestAnimationFrame",window[u]&&(f=!0,e=u);return f?function(t){window[e](t)}:function(e){window.setTimeout(e,67)}}(),setTimeout(i,3e3),g(".home-header .iconfont").on("touchstart",function(){g(this).addClass("highlight")}).on("touchend touchcancel",function(){g(this).removeClass("highlight")}),window.reMarginFooter(".footer-tab"),t.set=function(e){window.setCookie("_Channel",e,{expires:365,domain:".m.yohobuy.com"})}}),define("js/home/maybe-like",["jquery","hammer","lazyload"],function(e,t,n){function o(){v||(v=!0,p.showLoadingMask(),c.ajax({type:"GET",url:r,data:{page:w+1},success:function(e){return" "===e?(v=!1,p.hideLoadingMask(),void(y&&(r="1,3"===y?"/boys/bottomBanner":"/girls/bottomBanner",c.ajax({type:"GET",url:r,success:function(e){e&&e.img&&(c("#load-more-img").show(),c("#load-more-img a").attr("href",e.url),c("#load-more-img a > img").attr("src",e.img))},error:function(){}})))):(s=g.find(".good-info").length,g.append(e),f(0===s?g.find(".good-info").find("img.lazy"):g.find(".good-info:gt("+(s-1)+")").find("img.lazy")),v=!1,p.hideLoadingMask(),void w++)},error:function(){h.show("网络断开连接了~"),v=!1,p.hideLoadingMask()}}))}function i(){c(window).scrollTop()+m>=c(document).height()-200&&o()}var a,s,r,l,d,c=e("jquery"),u=e("hammer"),h=e("js/plugin/tip"),p=e("js/plugin/loading"),f=e("lazyload"),m=c(window).height(),g=c("#goods-list"),v=!1,w=0,y=null,b=c(".mobile-wrap").hasClass("kids-wrap")?!0:!1,C=c(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,j=c("#maybe-like-nav");b?r="/product/recom/maylikekids":C?r="/product/recom/maylikelife":(y=c(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",r="/product/recom/maylike?gender="+y),l=j.children(".focus"),C&&(a=new u(j[0]),a.on("tap",function(e){var t,n=c(e.target).closest("li"),o=c(".goods-list");e.preventDefault(),n.hasClass("focus")||(d=n.index(),n.addClass("focus"),l.removeClass("focus"),o.not(".hide").addClass("hide"),t=o.eq(d),t.removeClass("hide"),l=n,c(document).trigger("scroll"),e.srcEvent.stopPropagation())})),p.init(c(".maybe-like")),c(".maybe-like p").on("touchstart",function(e){o()}),c(window).scroll(function(){window.requestAnimationFrame(i)})}),define("js/index/entry",["jquery","hammer"],function(e,t,n){e("js/index/search"),e("js/index/footer"),e("js/index/channel")}),define("js/index/search",["jquery","hammer"],function(e,t,n){var o,i,a=e("jquery"),s=e("js/plugin/security"),r=e("hammer"),l=a("#search-input input"),d=a("#search-input .clear-input"),c=a(".search-icon"),u=a("#search-form"),h=a(".history"),p=a("#clear-history"),f=e("js/index/write-search"),m=f.getRanToken();o=new r(p[0]),o.on("tap",function(){localStorage.removeItem("historys"),h.html(""),window.rePosFooter()}),l.on("input",function(){""===l.val()?(c.css("color","#b2b2b2"),d.addClass("hide")):(c.css("color","#666"),d.removeClass("hide"))}),i=new r(d[0]),i.on("tap",function(){l.val("").trigger("input")}),a("#search").on("touchend",function(){return s.hasDangerInput()?!1:(a(this).closest("form").submit(),!1)}),function(){var e,t,n,o="";if(localStorage&&(t=localStorage.getItem("historys"),t&&t.length>0)){for(t=t.split(m),n=0;n<t.length;n++)e=t[n],""!==e&&(o+='<li><a href="/?query='+e+'">'+e+"</li>");h.html(o),p.removeClass("hide"),window.rePosFooter()}}(),f.bindWirteLocal(u)}),define("js/plugin/security",["jquery"],function(e,t,n){function o(e){var t,n,o,s=i("input[type!=hidden], textarea"),r=/['"<>&\|]|--/g,l=s.length,d=void 0===e||"boolean"!=typeof e?!0:e;for(n=0;l>n;n++)if(t=s.eq(n).val(),r.test(t))return d?s.eq(n).val(t.replace(r," ")):(o=t.match(r).join(" "),a.show("不可以输入 "+o+" 哦!")),!d&&!0;return!1}var i=e("jquery"),a=e("js/plugin/tip");t.hasDangerInput=o}),define("js/index/write-search",[],function(e,t,n){function o(){return a}function i(e){e.on("submit",function(){var e,t=this.query.value;if(localStorage){if(e=localStorage.getItem("historys"),e=e?e:"",e.indexOf(a+t+a)>-1)return;""===e&&(t=a+t),e+=t+a,localStorage.setItem("historys",e)}})}var a=" ??++ ";t.getRanToken=o,t.bindWirteLocal=i}),define("js/index/footer",["jquery","hammer"],function(e,t,n){function o(){var e="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho&g_f=995445",t=new Date;setTimeout(function(){new Date-t<2e3&&(window.location=e)},500)}var i,a=e("jquery"),s=e("hammer");e("js/common"),a("#float-layer-close").on("touchend",function(e){return a("#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}),a("#float-layer-btn")&&a("#float-layer-btn")[0]&&(i=new s(a("#float-layer-btn")[0]),i.on("tap",function(e){o("bottom"),e.srcEvent.stopPropagation()}),"function"!=typeof window.cookie||window.cookie("_float-layer-app")?a("#float-layer-app").hide():a("#float-layer-app").show())}),define("js/index/channel",["jquery"],function(e,t,n){function o(){var e=window.innerHeight,t=p.height(),n=h.scrollTop();w?i=y-e>200?n+y+x>=t?0:t-y-n-x:t-e-n:(y=e,i=t-e-n+x,w=!0),f.css({position:"relative",bottom:i+"px"})}var i,a=e("jquery"),s=e("js/plugin/security"),r=a(".search-box"),l=a(".box"),d=a(".index-search"),c=a(".index-logo"),u=a(".index-channel a"),h=a(window),p=a(document),f=a("#float-layer-app"),m=r.children('input[type="text"]'),g=l.children(".no-search"),v=r.children(".search-icon"),w=!1,y=0,b=f.height(),C=parseInt(f.css("padding-top")),j=parseInt(f.css("padding-bottom")),x=b+C+j;e("js/common"),m.on("focus",function(){l.addClass("action"),c.addClass("action")}).on("input",function(){""===m.val()?v.addClass("empty"):v.removeClass("empty")}),g.on("touchend",function(){return l.removeClass("action"),c.removeClass("action"),m.blur(),!1}),r.children(".clear-text").on("touchstart",function(){m.val("").focus().trigger("input")}),r.children(".search-icon").on("touchstart",function(){return s.hasDangerInput()?!1:void d.submit()}),a(".index-channel img").on("load error",function(){window.rePosFooter&&window.rePosFooter()}),u.on("touchstart",function(){u.css({background:"#000",color:"#fff",borderColor:"#fff"}),a(this).css({background:"rgba(255, 255, 255, 0.5)",color:"#000",borderColor:"#000"})}).on("touchend touchcancel",function(){a(this).css({background:"#000",color:"#fff",borderColor:"#fff"})}),a(window).scroll(function(){window.requestAnimationFrame(o)}),p.on("ready",o)}),define("js/passport/entry",["jquery"],function(e,t,n){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,t,n){var o=e("jquery"),i=o("#phone-num"),a=o("#country-select"),s=o("#area-code"),r=o("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=o.trim,u=d.show;l.selectCssHack(o("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),a.change(function(){s.text(a.val())}),r.on("touchstart",function(){var e=c(i.val()),t=a.val();r.hasClass("disable")||(l.phoneRegx[t].test(e)?o.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:t.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["jquery"],function(e,t,n){function o(e){var t,n=r(".has-eye");e&&"open"===e.status?n.append('<div class="eye"></div>'):n.append('<div class="eye close"></div>'),t=n.children(".eye"),t.on("touchstart",function(e){var t=r(this),n=t.siblings(".pwd");e.preventDefault(),t.toggleClass("close"),t.hasClass("close")?n.attr("type","password"):n.attr("type","text"),n.focus()})}function i(){var e,t=r(".has-clear");t.append('<div class="clear-input"></div>'),e=t.children(".clear-input"),e.on("touchstart",function(t){var n=e.siblings(".input");n.val("").trigger("input").focus(),t.preventDefault()}),t.children(".input").bind("input",function(){var e=r(this),t=e.siblings(".clear-input"),n=l(e.val());""===n?t.hide():t.show()})}function a(e){return e.length>=6&&e.length<=20?!0:!1}function s(e){function t(){var t=e.find("option:selected").text().length;switch(t){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var n=navigator.userAgent;n.match(/uc/i)&&n.match(/android/i)?e.change(function(){t()}):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}$/};n.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:o,bindClearEvt:i,pwdValidate:a,selectCssHack:s}}),define("js/passport/register/code",["jquery"],function(e,t,n){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,t,n){var o=e("jquery");n.exports=function(t){function n(){var e,t=59;e=setInterval(function(){0===t?(s.text("重发验证码").removeClass("disable"),clearInterval(e)):s.text("重发验证码 ("+t--+"秒)")},1e3)}var i=o("#captcha"),a=o("#btn-next"),s=o("#captcha-tip"),r=o("#phone-num").val(),l=o("#area-code").val().replace("+",""),d=e("js/passport/api"),c=e("js/plugin/tip"),u=o.trim,h=c.show,p=t?"reg":"back";d.bindClearEvt(),i.bind("input",function(){""!==u(i.val())?a.removeClass("disable"):a.addClass("disable")}),s.on("touchstart",function(){s.hasClass("disable")||o.ajax({type:"POST",url:"/passport/"+p+"/sendcode",data:{phoneNum:r,areaCode:l},success:function(e){200===e.code?(s.text("重发验证码 (60秒)").addClass("disable"),n()):h(e.message)}})}),a.on("touchstart",function(){a.hasClass("disable")||o.ajax({type:"POST",url:"/passport/"+p+"/verifycode",data:{phoneNum:r,areaCode:l,code:u(i.val()),token:o("#token").val()},success:function(e){200===e.code?location.href=e.data:h(e.message)}})}),n()}}),define("js/passport/register/password",["jquery"],function(e,t,n){var o=e("jquery"),i=o("#pwd"),a=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindEyesEvt({status:"open"}),i.bind("input",function(){""===l(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e=l(i.val());a.hasClass("disable")||(s.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):o.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:o("#phone-num").val(),areaCode:o("#area-code").val(),token:o("#token").val()},success:function(e){var t;200===e.code?(t=e.data,d("注册成功"),o.ajax({url:t.session,dataType:"jsonp"}),setTimeout(function(){location.href=t.href},1e3)):d(e.message)}}))})}),define("js/passport/login/login",["jquery"],function(e,t,n){function o(){h&&p?d.removeClass("disable"):d.addClass("disable")}function i(){c.show(),u.show()}function a(){c.hide(),u.hide();
}var s=e("jquery"),r=s("#account"),l=s("#pwd"),d=s("#btn-login"),c=s("#retrive-pwd-mask"),u=s("#retrive-pwd-ways"),h=!1,p=!1,f=e("js/passport/api"),m=e("js/plugin/tip"),g=s.trim,v=m.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){h=""!==g(r.val())?!0:!1,o()}),l.bind("input",function(){p=""===g(l.val())?!1:!0,o()}),d.on("touchstart",function(){var e=g(r.val()),t=g(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),(/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(t)?s.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:t},success:function(e){var t,n;200===e.code?(t=e.data,s.ajax({url:t.session,dataType:"jsonp",success:function(){clearTimeout(n),setTimeout(function(){location.href=t.href},1e3)}}),n=setTimeout(function(){location.href=t.href},3e3),v("登录成功")):v(e.message)},error:function(){v("网络断开连接啦~")},complete:function(){d.text("登录").removeClass("disable")}}):v("账号或密码有错误,请重新输入"))}),s("#forget-pwd").on("touchstart",function(){i()}),c.on("touchstart",function(){a()}),s("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),a()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,t,n){function o(){c&&u?d.removeClass("disable"):d.addClass("disable")}var i=e("jquery"),a=i("#phone-num"),s=i("#country-select"),r=i("#area-code"),l=i("#pwd"),d=i("#btn-login"),c=!1,u=!1,h=e("js/passport/api"),p=e("js/plugin/tip"),f=i.trim,m=p.show;h.selectCssHack(s),h.bindEyesEvt(),h.bindClearEvt(),a.bind("input",function(){c=""===f(a.val())?!1:!0,o()}),l.bind("input",function(){var e=f(l.val());u=""===e?!1:!0,o()}),s.change(function(){r.text(s.val())}),d.on("touchstart",function(){var e=f(a.val()),t=s.val(),n=f(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),h.phoneRegx[t].test(e)&&h.pwdValidate(n)?i.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:t.replace("+",""),account:e,password:n},success:function(e){var t,n;200===e.code?(t=e.data,m("登录成功"),i.ajax({url:t.session,dataType:"jsonp",success:function(){clearTimeout(n),setTimeout(function(){location.href=t.href},1e3)}}),n=setTimeout(function(){location.href=t.href},3e3),m("登录成功")):m(e.message)},error:function(){m("网络断开连接啦~")},complete:function(){d.text("登录").removeClass("disable")}}):m("账号或密码有错误,请重新输入"))}),a.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,t,n){var o=e("jquery"),i=o("#phone-num"),a=o("#country-select"),s=o("#area-code"),r=o("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=o.trim,u=d.show;l.selectCssHack(o("#country-select")),l.bindClearEvt(),i.bind("input",function(){""===c(i.val())?r.addClass("disable"):r.removeClass("disable")}),a.change(function(){s.text(a.val())}),r.on("touchstart",function(){var e=c(i.val()),t=a.val();r.hasClass("disable")||(l.phoneRegx[t].test(e)?o.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:t.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,t,n){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,t,n){var o=e("jquery"),i=o("#email"),a=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindClearEvt(),i.bind("input",function(){""===l(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e=l(i.val());a.hasClass("disable")||(s.emailRegx.test(e)?o.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,t,n){var o=e("jquery"),i=o("#resend"),a=e("js/plugin/tip"),s=a.show;i.on("touchstart",function(e){e.preventDefault(),o.ajax({url:i.data("url"),type:"GET",success:function(e){s(200===e.code?e.message:e.message)}})})}),define("js/passport/back/new-password",["jquery"],function(e,t,n){var o=e("jquery"),i=o("#pwd"),a=o("#btn-ok"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show,c=o("#phone-num");s.bindEyesEvt({status:"open"}),i.bind("input",function(){""===l(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e,t,n=l(i.val()),r=!0;a.hasClass("disable")||(e={password:n},0===c.length&&(r=!1),r?(o.extend(e,{phoneNum:c.val(),areaCode:o("#areaCode").val(),token:o("#token").val()}),t="/passport/back/passwordByMobile"):(o.extend(e,{code:o("#email-code").val()}),t="/passport/back/passwordByEmail"),s.pwdValidate(n)?o.ajax({type:"POST",url:t,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","lazyload","hammer","index"],function(e,t,n){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail"),e("js/product/detail/consultform"),e("js/product/newsale/hot-rank")}),define("js/product/newsale/newarrival",["jquery","swiper","lazyload","hammer","index"],function(e,t,n){function o(e){var t,n,o,i,a,u,f={};if(!d){if(e){for(n in E)E.hasOwnProperty(n)&&(E[n].reload=!0);switch(q.children(".active").removeClass("active"),T.addClass("active"),e.type){case"gender":t={gender:e.id};break;case"brand":t={brand:e.id};break;case"sort":t={sort:e.id};break;case"color":t={color:e.id};break;case"size":t={size:e.id};break;case"price":t={price:e.id};break;case"discount":t={discount:e.id};break;case"limit":t={limit:e.id};break;case"channel":t={channel:e.id};break;case"p_d":t={p_d:e.id}}c.extend(b,t)}if(T.hasClass("today")?(i="today",a=1):T.hasClass("week")?(i="week",a=2):T.hasClass("sale")&&(i="sale",a=3),o=E[i],u=o.page+1,o.reload)u=1;else if(o.end)return;c.extend(f,b,{dayLimit:a,page:u}),d=!0,m.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:f,success:function(e){var t,n;switch(i){case"today":t=s;break;case"week":t=r;break;case"sale":t=l}" "===e?(o.end=!0,o.reload&&t.html(y)):o.reload?(t.html(e),h(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),h(t.find(".good-info:gt("+(n-1)+") .lazy"))),o.reload=!1,o.page=u,d=!1,m.hideLoadingMask(),window.rePosFooter()},error:function(){p.show("网络断开连接了~"),d=!1,m.hideLoadingMask()}})}}function i(){c(window).scrollTop()+w>c(document).height()-.25*g.height()-50&&void 0!==T&&o()}var a,s,r,l,d,c=e("jquery"),u=e("swiper"),h=e("lazyload"),p=e("js/plugin/tip"),f=e("js/plugin/filter"),m=e("js/plugin/loading"),g=c("#goods-container"),v=g.children(),s=c(v.get(0)),r=c(v.get(1)).addClass("hide"),l=c(v.get(2)).addClass("hide"),w=c(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b=e("js/product/extract-url"),C=c.extend({},b),j=new Date,x=j.getMonth()+1,k=j.getDate(),q=c("#list-nav"),E={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},T=q.find(".active");e("js/product/suspend-cart"),c("#today a").text(x+"月"+k+"号"),c(".swiper-container .swiper-slide").length>1&&(a=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:b,success:function(e){g.append(e),f.initFilter({fCbFn:o,hCbFn:function(){T.addClass("active"),T.siblings(".filter").removeClass("active")}})}}),h(c(".lazy")),q.bind("contextmenu",function(e){return!1}),q.on("touchend touchcancel",function(e){var t,n,i,a=c(e.target).closest("li");if(e.preventDefault(),a.hasClass("filter"))a.hasClass("active")?(f.hideFilter(),T.addClass("active"),a.removeClass("active")):(T=a.siblings(".active"),T.removeClass("active"),a.addClass("active"),f.showFilter());else{if(a.hasClass("today")?n="today":a.hasClass("week")?n="week":a.hasClass("sale")&&(n="sale"),t=E[n],!a.hasClass("active")){if(i=a.siblings(".active"),T=a,i.hasClass("filter"))f.hideFilter();else{switch(g.children(".container:not(.hide)").addClass("hide"),n){case"today":s.removeClass("hide");break;case"week":r.removeClass("hide");break;case"sale":l.removeClass("hide")}f.resetFilter(),b=c.extend({},C)}i.removeClass("active"),a.addClass("active")}t.reload&&o()}e.stopPropagation()}),c(window).scroll(function(){window.requestAnimationFrame(i)}),o(),q.on("touchstart","li",function(e){c(this).addClass("bytouch")}).on("touchend touchcancel",function(){q.find("li").removeClass("bytouch")})}),define("js/plugin/filter",["jquery","hammer"],function(e,t,n){function o(){h.addClass("hide")}function i(){h.removeClass("hide")}function a(){var e=g(".filter-body .classify");e.on("touchstart",".shower",function(){e.removeClass("highlight"),g(this).addClass("highlight")}).on("touchend touchcancel",".shower",function(){g(this).removeClass("highlight")})}function s(){var e=g(".filter-body .sub-item");e.on("touchstart",function(){e.removeClass("highlight"),g(this).addClass("highlight")}).on("touchend touchcancel",function(){g(this).removeClass("highlight")})}function r(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function l(e){var t,n,o=e.closest(".sub-classify"),i=o.siblings(".shower");return e.hasClass("chosed")?o:(o.children(".chosed").removeClass("chosed"),e.addClass("chosed"),t=g.trim(e.html()),n=g.trim(i.html()),i.html(n.substring(0,n.indexOf("</span>")+7)+t.substring(0,t.indexOf("<i"))),0===e.index()?i.addClass("default"):i.removeClass("default"),o)}function d(e){var t,n=e.data("id");t=l(e),p&&p({type:t.data("type"),id:n}),o()}function c(e){var t;p=e.fCbFn,f=e.hCbFn,m=e.missStatus,a(),s(),h=g(".filter-mask"),t=new v(h[0]),t.on("tap",function(e){var t,n=g(e.target);e.preventDefault(),n.closest(".filter-body").length>0?(t=n.closest(".sub-item"),t.length>0?(t=n.closest("li"),d(t)):(t=n.closest(".classify-item"),e.srcEvent.stopPropagation(),r(t))):(o(),f&&f())})}function u(){"undefined"!=typeof h&&(g(".sub-classify").each(function(){l(g(this).children(":first-child"))}),r(g(".classify > :first-child")))}var h,p,f,m,g=e("jquery"),v=e("hammer");t.initFilter=c,t.showFilter=i,t.hideFilter=o,t.resetFilter=u}),define("js/product/extract-url",[],function(e,t,n){var o,i,a,s={},r=window.location.search.split("?")[1],l=r?r.split("&"):[];for(o=l.length;o>0;o--)i=l[o-1].split("="),a=i[1],i=i[0],s[i]=a,("discount"===i||"p_d"===i)&&(s.discount=a,s.p_d=a);if("undefined"==typeof s.gender)switch(window.cookie("_Channel")){case"boys":s.gender="1,3";break;case"girls":s.gender="2,3";break;default:s.gender="1,2,3"}n.exports=s}),define("js/product/suspend-cart",["jquery"],function(e,t,n){var o=e("jquery"),i=o("#suspend-cart");o.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&i.find(".cart-count").html(e.data.cart_goods_count).removeClass("hide")}})}),define("js/product/newsale/discount",["jquery","swiper","lazyload","hammer","index"],function(e,t,n){function o(e){var t,n,o,i,a,l={};if(!s){if(e){for(n in j)j.hasOwnProperty(n)&&(j[n].reload=!0);switch(C.children(".active").removeClass("active"),x.addClass("active"),e.type){case"gender":t={gender:e.id};break;case"brand":t={brand:e.id};break;case"sort":t={sort:e.id};break;case"color":t={color:e.id};break;case"size":t={size:e.id};break;case"price":t={price:e.id};break;case"discount":t={discount:e.id}}r.extend(b,t)}if(x.hasClass("new")?i="newest":x.hasClass("price")?i="price":x.hasClass("discount")&&(i="discount"),o=j[i],a=o.page+1,o.reload)a=1;else if(o.end)return;r.extend(l,b,{type:i,order:o.order,page:a}),s=!0,h.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var t,n;switch(i){case"newest":t=m;break;case"price":t=g;break;case"discount":t=v}" "===e?(o.end=!0,o.reload&&t.html(y)):o.reload?(t.html(e),d(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),d(t.find(".good-info:gt("+(n-1)+") .lazy"))),o.reload=!1,o.page=a,s=!1,h.hideLoadingMask(),window.rePosFooter()},error:function(){c.show("网络断开连接了~"),s=!1,h.hideLoadingMask()}})}}function i(){r(window).scrollTop()+w>r(document).height()-.25*p.height()-50&&void 0!==x&&o()}var a,s,r=e("jquery"),l=e("swiper"),d=e("lazyload"),c=e("js/plugin/tip"),u=e("js/plugin/filter"),h=e("js/plugin/loading"),p=r("#goods-container"),f=p.children(),m=r(f.get(0)),g=r(f.get(1)),v=r(f.get(2)),w=r(window).height(),y='<p class="no-result">未找到相关搜索结果</p>',b=e("js/product/extract-url"),C=r("#list-nav"),j={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}},x=C.find(".active");e("js/product/suspend-cart"),r(".swiper-container .swiper-slide").length>1&&(a=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:b,success:function(e){p.append(e),u.initFilter({fCbFn:o,hCbFn:function(){x.addClass("active"),x.siblings(".filter").removeClass("active")},missStatus:!0})}}),d(r(".lazy")),C.bind("contextmenu",function(e){return!1}),C.on("touchend touchcancel",function(e){var t,n,i,a=r(e.target).closest("li");if(e.preventDefault(),"undefined"!=typeof a&&0!==a.length){if(a.hasClass("filter"))a.hasClass("active")?(u.hideFilter(),x.addClass("active"),a.removeClass("active")):(x=a.siblings(".active"),x.removeClass("active"),a.addClass("active"),u.showFilter());else{if(a.hasClass("new")?n="newest":a.hasClass("price")?n="price":a.hasClass("discount")&&(n="discount"),t=j[n],a.hasClass("active")){if(a.hasClass("new"))return;(a.hasClass("price")||a.hasClass("discount"))&&(a.find(".icon > .iconfont").toggleClass("cur"),x=a,t.reload=!0,t.order=0===t.order?1:0)}else{if(i=a.siblings(".active"),x=a,i.hasClass("filter"))u.hideFilter();else switch(p.children(".container:not(.hide)").addClass("hide"),n){case"newest":m.removeClass("hide");break;case"price":g.removeClass("hide");break;case"discount":v.removeClass("hide")}i.removeClass("active"),a.addClass("active")}t.reload&&o()}e.stopPropagation()}}),r(window).scroll(function(){window.requestAnimationFrame(i)}),o(),C.on("touchstart","li",function(e){r(this).addClass("bytouch")}).on("touchend touchcancel",function(){C.find("li").removeClass("bytouch")})}),define("js/product/list",["jquery","hammer","lazyload"],function(e,t,n){function o(e){var t,n,o,i,s,r={};if(!a){if(e){for(n in I)I.hasOwnProperty(n)&&(I[n].reload=!0);switch(T.children(".active").removeClass("active"),L.addClass("active"),e.type){case"gender":t={gender:e.id};break;case"brand":t={brand:e.id};break;case"sort":t={sort:e.id};break;case"color":t={color:e.id};break;case"size":t={size:e.id};break;case"price":t={price:e.id};break;case"discount":t={discount:e.id}}d.extend(E,t)}if(L.hasClass("new")?i="newest":L.hasClass("price")?i="price":L.hasClass("discount")&&(i="discount"),o=I[i],s=o.page+1,o.reload)s=1;else if(o.end)return;d.extend(r,E,{type:i,order:o.order,page:s}),a=!0,v.showLoadingMask(),d.ajax({type:"GET",url:"/index/search/search",data:r,success:function(e){var t,n,r='<p class="no-result">未找到相关搜索结果</p>';switch(i){case"newest":n=y;break;case"price":n=b;break;case"discount":n=C}" "===e?(o.end=!0,o.reload&&n.html(r)):o.reload?(n.html(e),u(n.find(".lazy"))):(t=n.find(".good-info").length,n.append(e),u(n.find(".good-info:gt("+(t-1)+") .lazy"))),o.reload=!1,o.page=s,a=!1,v.hideLoadingMask(),window.rePosFooter()}})}}function i(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&o()}var a,s,r,l,d=e("jquery"),c=e("hammer"),u=e("lazyload"),h=d("#brand-header"),p=d("#intro-box"),f=e("js/plugin/filter"),m=e("js/index/write-search"),g=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=d("#search-input input"),k=d(".search-icon"),q=d("#search-input .clear-input"),E=e("js/product/extract-url"),T=d("#list-nav"),I={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}},L=T.find(".active");x.on("input",function(){""===x.val()?(k.css("color","#b2b2b2"),q.addClass("hide")):(k.css("color","#666"),q.removeClass("hide"))}),q.on("touchend",function(){x.val("").trigger("input")}),d("#search").on("touchend",function(){return d(this).closest("form").submit(),!1}),e("js/product/suspend-cart"),d.ajax({type:"GET",url:"/search/filter",data:E,success:function(e){w.append(e),f.initFilter({fCbFn:o,hCbFn:function(){L.addClass("active"),L.siblings(".filter").removeClass("active")}})}}),u(d(".lazy")),m.bindWirteLocal(d("#search-form")),T.bind("contextmenu",function(e){return!1}),T.on("touchend touchcancel",function(e){var t,n,i,a=d(e.target).closest("li");if(a.hasClass("filter"))a.hasClass("active")?(f.hideFilter(),L.addClass("active"),a.removeClass("active")):(L=a.siblings(".active"),L.removeClass("active"),a.addClass("active"),f.showFilter());else{if(a.hasClass("new")?n="newest":a.hasClass("price")?n="price":a.hasClass("discount")&&(n="discount"),t=I[n],a.hasClass("active")){if(a.hasClass("new"))return;(a.hasClass("price")||a.hasClass("discount"))&&(a.find(".icon > .iconfont").toggleClass("cur"),L=a,t.reload=!0,t.order=0===t.order?1:0)}else{if(i=a.siblings(".active"),L=a,i.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),n){case"newest":y.removeClass("hide");break;case"price":b.removeClass("hide");break;case"discount":C.removeClass("hide")}i.removeClass("active"),a.addClass("active")}t.reload&&o()}}),d(window).scroll(function(){window.requestAnimationFrame(i)}),h.length>0&&(s=new c(h.children(".btn-intro")[0]),s.on("tap",function(){p.removeClass("hide"),d("body").addClass("overflow-hidden")}),r=new c(document.getElementById("intro-box")),r.on("tap",function(e){var t=d(e.target);e.srcEvent.preventDefault(),(0===t.closest("#brand-intro").length||t.hasClass("close-intro"))&&(p.addClass("hide"),d("body").removeClass("overflow-hidden"))}),l=new c(h.children(".btn-col")[0]),l.on("tap",function(e){var t,n=d(e.target).closest(".btn-col"),o=h.data("id");t=n.hasClass("coled")?"cancel":"ok",d.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:o,opt:t},success:function(e){200===e.code?(n.toggleClass("coled"),"ok"===t?g.show("添加收藏成功"):g.show("取消收藏成功")):400===e.code?location.href=e.data:g.show(e.message)},error:function(){g.show("网络断开连接了~")}})})),o(),T.on("touchstart","li",function(){T.find("li").removeClass("bytouch"),d(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){T.find("li").removeClass("bytouch")}),window._yas&&window._yas(1*new Date,"1.0.13.2","yohobuy_m",window._ozuid,"#goods-container >div >div .good-thumb >img")}),define("js/product/detail/detail",["jquery","swiper","hammer","lazyload","index"],function(e,t,n){function o(){var e=r(".cart-bar"),t=setInterval(function(){e?(window.reMarginFooter(".cart-bar"),clearInterval(t)):e=r(".cart-bar")},200)}var i,a,s,r=e("jquery"),l=e("swiper"),d=e("hammer"),c=e("lazyload"),u=r(".goodsDiscount .discount-folder"),h=r(".goodsDiscount .first-item span"),p=document.getElementById("goodsDiscount"),f=p&&new d(p),m=r(".cart-bar"),g=r(".goodsSubtitle");if(e("js/product/detail/desc"),e("js/product/detail/comments-consults"),e("js/product/recommend-for-you-product-desc"),o(),c(r("img.lazy")),i=new l(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner",nextButton:".my-swiper-button-next",prevButton:".my-swiper-button-prev",spaceBetween:3}),0===r(".goodsDiscount .discount-folder").children().length&&(u.css("display","none"),h.html("")),f&&f.on("tap",function(e){return u.is(":hidden")?(h.removeClass("icon-down").addClass("icon-up").html("&#xe608;"),u.slideDown()):(h.removeClass("icon-up").addClass("icon-down").html("&#xe609;"),u.slideUp()),!1}),r.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&m.find(".num-tag").html(e.data.cart_goods_count).removeClass("hide")}}),g[0])for(a=g.height(),s=g.find("span");s.outerHeight()>a;)s.text(s.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/,"..."));e("js/product/detail/like")}),define("js/product/detail/desc",["jquery","lazyload","swiper","index"],function(e,t,n){function o(e){var t,n;e.length>0&&(t=e[0].getBoundingClientRect().right,n=e.find(".swiper-slide:last-child")[0].getBoundingClientRect().right,0>n-t?e.next(".tips").css("display","none"):e.next(".tips").css("display","block"))}function i(){g||v||(g=!0,h.showLoadingMask(),d.ajax({type:"GET",url:f,success:function(e){s=d("#productDesc"),s.append(e),c(s.find("img.lazy")),r=new u("#size-swiper-container",{slidesPerView:"auto"}),l=new u("#reference-swiper-container",{slidesPerView:"auto"}),o(d("#size-swiper-container")),o(d("#reference-swiper-container")),g=!1,v=!0,h.hideLoadingMask()},error:function(){p.show("网络断开连接了~"),g=!1,h.hideLoadingMask()}}))}function a(){(!v||d(window).scrollTop()+m>=d(document).height()-50)&&i()}var s,r,l,d=e("jquery"),c=e("lazyload"),u=e("swiper"),h=e("js/plugin/loading"),p=e("js/plugin/tip"),f=d("#introUrl").val(),m=d(window).height(),g=!1,v=!1;d(window).scroll(function(){window.requestAnimationFrame(a)})}),define("js/product/detail/comments-consults",["jquery","hammer"],function(e,t,n){function o(){r(window).scrollTop()>r("#yoho-header").outerHeight()?(g.css("position","fixed"),g.css("top","0")):g.css("position","static")}function i(){o()}var a,s,r=e("jquery"),l=e("js/plugin/tip"),d=e("hammer"),c=document.getElementById("consult-content-footer"),u=c&&new d(c),h=document.getElementById("nav-tab"),p=h&&new d(h),f=document.getElementById("goto-consult"),m=f&&new d(f),g=r("#goto-consult");!function(){s=r("#nav-tab .consults-num").html()-0,a=r("#nav-tab .comments-num").html()-0,r("#nav-tab li").each(function(){r(this).removeClass("focus")}),r("#feedback-content .content").each(function(){r(this).addClass("hide")}),0!==a?(r("#nav-tab .comment-nav").addClass("focus"),r("#feedback-content .comment-content").removeClass("hide")):0!==s&&(r("#nav-tab .consult-nav").addClass("focus"),r("#feedback-content .consult-content").removeClass("hide"))}(),p&&p.on("tap",function(e){var t=r(e.target).closest("li"),n=t.index();t.hasClass("comment-nav")&&0===a?l.show("暂无商品评价"):t.hasClass("focus")||(r("#nav-tab li").each(function(){r(this).removeClass("focus")}),r("#feedback-content .content").each(function(){r(this).addClass("hide")}),t.addClass("focus"),r("#feedback-content .content:eq("+n+")").removeClass("hide"))}),u&&u.on("tap",function(){location.href=r(c).find("a").attr("href")}),m&&m.on("tap",function(){location.href=r(f).find("a").attr("href")}),r(window).scroll(function(){window.requestAnimationFrame(i)})}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,t,n){var o,i=e("swiper"),a=e("jquery"),s=a(".recommend-for-you"),r=a("#preferenceUrl").val();r&&a.get(r).then(function(e){s.html(e).show(),a("#swiper-recommend").length&&(o=new i("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0}))}).fail(function(){s.hide()})}),define("js/product/detail/like",["jquery","hammer"],function(e,t,n){var o=e("jquery"),i=e("hammer"),a=e("js/plugin/tip"),s=document.getElementById("likeBtn"),r=s&&new i(s),l=document.getElementById("addtoCart"),d=l&&new i(l),c=o("#productId").val();r&&r.on("tap",function(e){var t,n,i=o(e.target);i.hasClass("liked")?(t="cancel",n=0):(t="ok",n=1),o.ajax({type:"POST",url:"/product/opt/favoriteProduct",data:{id:c,opt:t},success:function(e){200===e.code?(i.toggleClass("liked"),"cancel"===t?a.show("取消收藏成功"):"ok"===t&&a.show("收藏成功")):400===e.code?location.href=e.data:a.show(e.message),window._yas&&window._yas.sendCustomInfo({pd:c,fa:n})},error:function(){a.show("网络断开连接了~")}})}),d&&d.on("tap",function(e){window._yas&&window._yas.sendCustomInfo({pd:c,by:1})})}),define("js/product/detail/consultform",["jquery"],function(e,t,n){var o,i=e("jquery"),a=e("js/plugin/tip"),s=e("js/plugin/loading"),r=i(".consult-form"),l=i("#submit"),d=i("#content"),c=i("#product_id").val();l.on("touchend",function(){return d.blur(),r.submit(),!1}).on("touchstart",function(){i(this).addClass("highlight")}).on("touchend touchcancel",function(){i(this).removeClass("highlight")}),d.on("focus",function(){"请输入咨询内容"===d.val()&&d.val("")}).on("blur",function(){""===d.val()&&d.val("请输入咨询内容")}),r.on("submit",function(){var e;return o?!1:(e=d.val(),e&&"请输入咨询内容"!==e?(o=!0,s.showLoadingMask(),i.ajax({method:"POST",url:"/product/detail/consultsubmit",data:{product_id:c,content:e}}).then(function(e){"object"!==i.type(e)&&(e={}),200!==e.code?(a.show(e.message||"网络出了点问题~"),o=!1,s.hideLoadingMask()):(a.show("提交成功~"),setTimeout(function(){window.history.go(-1)},3e3))}).fail(function(){a.show("网络出了点问题~"),o=!1}),!1):(a.show("咨询内容不能为空"),!1))})}),define("js/product/newsale/hot-rank",["jquery","swiper","lazyload","index"],function(e,t,n){function o(e,t,n,o){h.showLoadingMask(),d.ajax({type:"GET",url:"/product/newsale/selectHotrank?"+t,dataType:"html",data:{page:e,tab_id:n,notab:o},success:function(t){" "===t?d(".rank-main").length<1&&d(".goods-nav").length<1?d("#hotRank").html(v):1===e&&(l=d(".goods-nav").prop("outerHTML"),d("#hotRank").html(l+v)):(d(".no-result").remove(),1===e&&d(".rank-main").remove(),d("#hotRank").append(t)),u(d("img.lazy")),d(".rank-main ul li:gt(9)").find(".item-content i").removeClass("top"),a=d(window).height(),0!==d(".rank-main").length?(d("#yoho-footer").css("position","static"),s=d(".rank-main").find("ul").offset().top):d("#yoho-footer").css("position","fixed"),r=new c(".s-goods-nav",{grabCursor:!0,slidesPerView:"auto",slideElement:"li"}),h.hideLoadingMask()}})}function i(){2!==p&&(d(window).scrollTop()+a<s+d("#hotRank").height()-100||(p=2,f=1,o(p,m,g,f)))}var a,s,r,l,d=e("jquery"),c=e("swiper"),u=e("lazyload"),h=e("js/plugin/loading"),p=1,f=0,m="",g="",v='<p class="no-result">未找到相关搜索结果</p>';d(window).scroll(function(){window.requestAnimationFrame(i)}),o(p,m,g,f),d("#hotRank").on("touchend touchcancel",function(e){var t=t||window.event,n=t.target||t.srcElement;"span"===n.nodeName.toLowerCase()&&(d(".s-goods-nav .nav-item").removeClass("active"),n.parentNode.className="active "+n.parentNode.className,g=n.getAttribute("data-id")?n.getAttribute("data-id"):"",m=n.getAttribute("data-sort")?n.getAttribute("data-sort"):"",p=1,f=1,o(p,m,g,f))}),d("#hotRank").bind("contextmenu",function(e){return!1}),d("#hotRank").on("touchstart",function(e){var t=t||window.event,n=t.target||t.srcElement;"span"===n.nodeName.toLowerCase()&&(n.parentNode.className="bgActive "+n.parentNode.className)}).on("touchend touchcancel",function(){d(".s-goods-nav .nav-item").removeClass("bgActive")})}),define("js/me/entry",["jquery","hammer","lazyload","handlebars","source-map","swiper","mlellipsis","index"],function(e,t,n){e("js/me/order"),e("js/me/order-detail"),e("js/me/fav"),e("js/me/suggest"),e("js/me/index"),e("js/me/coupons"),e("js/me/online-service"),e("js/me/address"),e("js/me/suggest"),e("js/me/browse-record"),e("js/me/address-act"),e("js/me/logistic"),e("js/me/pay"),e("js/me/personal-details")}),define("js/me/order",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,n){function o(e){var t={type:p,page:f.page+1},n=e&&!e.noLoadingMask;m||(m=!0,n&&g.showLoadingMask(),s.ajax({type:"GET",url:"/home/getOrders",data:t,success:function(e){var o;" "!==e?(f.page=t.page,1===t.page?(u.html(e),l(u.find(".lazy"))):(o=u.children(".order").length,u.append(e),l(u.children(".order:gt("+(o-1)+")").find(".lazy"))),window.rePosFooter()):f.end=!0,m=!1,n&&g.hideLoadingMask()}}))}function i(){f.end===!1&&s(window).scrollTop()+h>s(document).height()-.25*c.height()&&o({noLoadingMask:!0})}var a,s=e("jquery"),r=e("hammer"),l=e("lazyload"),d=s("#order-nav > li"),c=s("#order-container"),u=c.children(".orders:not(.hide)"),h=s(window).height(),p=d.filter(".active").data("type"),f={page:0,end:!1},m=!1,g=e("js/plugin/loading"),v=e("js/me/dialog");l(),function(){var e=d.length;4!==e&&d.width(100/e+"%")}(),g.init(s("body")),a=new r(document.getElementById("order-container")),a.on("tap",function(e){var t,n,o,i=s(e.target);i.closest(".locHref").length>0||(t=i.closest(".order"),n=t.data("id"),i.closest(".del").length>0?v.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/delOrder",data:{id:n},success:function(e){200===e.code&&(v.showDialog({dialogText:"删除订单成功",autoHide:!0,fast:!0}),history.go(0))},error:function(){v.showDialog({dialogText:"删除订单失败",autoHide:!0,fast:!0})}})}):i.closest(".cancel").length>0?v.showDialog({dialogText:"确定取消订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/cancelOrder",data:{id:n},success:function(e){200===e.code&&(v.showDialog({dialogText:"取消订单成功",autoHide:!0,fast:!0}),history.go(0))},error:function(){v.showDialog({dialogText:"取消订单失败",autoHide:!0,fast:!0})}})}):(o=t.data("href"),location.href=o))}),s(window).scroll(function(){window.requestAnimationFrame(i)}),o()}),define("js/me/dialog",["jquery","handlebars","source-map","hammer"],function(e,t,n){var o,i,a,s=e("jquery"),r=e("handlebars"),l=e("hammer");i='<div id="dialog-wrapper" class="dialog-wrapper"><div class="dialog-box">{{# hasHeader}}{{/ hasHeader}}<div class="dialog-content">{{dialogText}}</div>{{# hasFooter}}<div class="dialog-footer">{{# leftBtnText}}<span class="dialog-left-btn">{{.}}</span>{{/ leftBtnText}}{{# rightBtnText}}<span class="dialog-right-btn">{{.}}</span>{{/ rightBtnText}}</div>{{/ hasFooter}}</div></div>',a=r.compile(i),t.showDialog=function(e,t){var n,i,r,d=a(e);s(".dialog-wrapper").remove(),s("body").append(s(d)),n=s(".dialog-box"),o=s(".dialog-wrapper"),r=new l(document.getElementById("dialog-wrapper")),e.fast?o.css({display:"block"}):o.fadeIn(),n.css({top:"50%",marginTop:-(n.height()/2)}),e.autoHide&&(i=1e3,e.autoHide>1&&(i=e.autoHide),setTimeout(function(){o.fadeOut()},i)),r.on("tap",function(e){s(e.target).hasClass("dialog-left-btn")?o.fadeOut():s(e.target).hasClass("dialog-right-btn")&&t()})}}),define("js/me/order-detail",["jquery","lazyload","hammer"],function(e,t,n){var o,i=e("jquery"),a=e("lazyload"),s=e("hammer"),r=i("#order-detail").data("id");a(),o=new s(document.getElementsByClassName("opt")[0]),o.on("tap",function(e){var t=i(e.target);t.hasClass("btn-del")?confirm("确定删除订单吗?")&&i.ajax({type:"GET",url:"/home/delOrder",data:{id:r}}):t.hasClass("btn-cancel")&&confirm("确定取消订单吗?")&&i.ajax({type:"GET",url:"/home/cancelOrder",data:{id:r}})})}),define("js/me/fav",["jquery","hammer","swiper","handlebars","source-map","index"],function(e,t,n){function o(e){p.filter(".active").removeClass("active"),p.eq(e).addClass("active"),f.filter(".show").removeClass("show"),f.eq(e).addClass("show")}function i(){var e,t;for(m=d(".swiper-container"),e=0;e<m.length;e++)t=m.eq(e).attr("data-id"),g[t]&&g[t].destroy(!0,!0),g[t]=new u("#swiper-container-"+t,{slidesPerView:"auto",grabCursor:!0,slideElement:"li",wrapperClass:"swiper-wrapper-"+t,lazyLoading:!0,watchSlidesVisibility:!0})}function a(e,t,n){"favBrand"===t?E=!0:q=!0,d.ajax({method:"post",url:"/home/"+t,data:{page:n},success:function(n){if("favBrand"===t?y.addClass("hide"):w.addClass("hide")," "===n)e.closest(".fav-type").find(".fav-content-loading").addClass("hide"),e.closest(".fav-type").find(".fav-null-box").removeClass("hide");else if("end"===n)e.closest(".fav-type").find(".fav-load-background").removeClass("fav-load-background").html("没有更多了");else{if(!(n.length>10))return;e.append(n),e.closest(".fav-type").find(".fav-content-loading").remove(),"favBrand"===t?(i(),E=!1):q=!1,window.rePosFooter()}window.rePosFooter()}})}function s(){d(window).scrollTop()+b>=d(document).height()-v&&(T?(y.filter(".hide").removeClass("hide"),E||(k++,a(j,"favBrand",k))):(w.filter(".hide").removeClass("hide"),q||(x++,a(C,"favProduct",x))))}var r,l,d=e("jquery"),c=e("hammer"),u=e("swiper"),h=e("js/me/dialog"),p=d("#fav-tab > li"),f=d(".fav-content > .fav-type"),m="",g={},v=d("#yoho-footer").height(),w=d(".fav-load-more"),y=d(".fav-brand-load-more"),b=d(window).height(),C=d(".fav-product-list"),j=d(".fav-brand-swiper-wrapper"),x=1,k=1,q=!0,E=!0,T=!1;
d("#fav-tab").hasClass("brand-tab")?(o(1),a(j,"favBrand",1),T=!0,window.rePosFooter()):(o(0),a(C,"favProduct",1),T=!1,window.rePosFooter()),r=new c(document.getElementById("fav-tab")),r.on("tap",function(e){var t,n=d(e.target).closest("li");0===n.length||n.hasClass("active")||(t=n.index(),0===t?(T=!1,0===C.find("li").length&&C.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(C,"favProduct",1)):(T=!0,0===j.find("div").length&&j.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(j,"favBrand",1)),o(t),window.rePosFooter())}),l=new c(document.getElementById("fav-content")),l.on("tap",function(e){var t="";d(e.target).hasClass("del-fav")&&h.showDialog({dialogText:"您确定要取消收藏吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){t=d(e.target).closest("li").attr("data-id"),d.ajax({method:"post",url:"/home/favoriteDel",data:{id:t}}).then(function(t){200===t.code?(h.showDialog({autoHide:!0,fast:!0,dialogText:"已经取消收藏"}),d(e.target).closest("li").remove()):400===t.code?h.showDialog({autoHide:!0,fast:!0,dialogText:t.message}):h.showDialog({autoHide:!0,fast:!0,dialogText:"取消收藏失败"})}).fail(function(){h.showDialog({autoHide:!0,dialogText:"网络错误~"})})})}),d(window).scroll(function(){window.requestAnimationFrame(s)})}),define("js/me/suggest",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,n){var o,i,a,s,r=e("jquery"),l=e("hammer"),d=e("lazyload"),c=e("handlebars"),u=e("js/me/dialog"),h=r(".upload-img-list"),p=r(".suggest-item .like-btn"),f=r(".suggest-item .dislike-btn"),m=r(".img-add"),g="",v=0;e("js/me/jquery.uploadifive"),a='{{# imgList}}<li>{{# imgUrl}}<img src="{{.}}" /><span class="upload-img-remove"></span>{{/ imgUrl}}</li>{{/ imgList}}',s=c.compile(a),r("#upload-img").uploadifive({auto:!0,fileType:"image*/*",uploadScript:"/home/suggestimgUpload",fileObjName:"fileData",fileSizeLimit:1024,height:"100%",width:"100%",multi:!1,onAddQueueItem:function(e){h.html(s({imgList:!0}))},onUploadComplete:function(e,t){h.html(""),g=JSON.parse(t).imgList[0].imgRelUrl,h.html(s(JSON.parse(t))),m.hide(),v++}}),d(),o=new l(document.getElementById("yoho-header")),o.on("tap",function(e){var t=r("#suggest-textarea").val(),n=/\S+/;if(r(e.target).hasClass("nav-btn")){if(!n.test(t))return void u.showDialog({autoHide:!0,dialogText:"意见不能为空"});r.ajax({method:"post",url:"/home/savesuggest",data:{content:t,image:g}}).then(function(e){200===e.code?(u.showDialog({autoHide:!0,dialogText:"提交成功"}),setTimeout(function(){location.pathname="home/suggest"},2e3)):u.showDialog({autoHide:!0,dialogText:"提交失败~"})}).fail(function(){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})}}),null!==document.getElementById("img-form")&&(i=new l(document.getElementById("img-form")),i.on("tap",function(e){r(e.target).hasClass("upload-img-remove")&&(h.html(""),g="",v--,setTimeout(function(){m.show()},50))})),p.bind("click",function(){var e=r(this).closest(".suggest-item").attr("data-id"),t=r(this);r.ajax({method:"post",url:"/home/upAndDown",data:{suggest_id:e,reliable:1}}).then(function(e){200===e.code&&(t.closest(".suggest-type").removeClass("show"),t.closest(".suggest-item").find(".suggest-good").addClass("show"))}).fail(function(e){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})}),f.bind("click",function(){var e=r(this).closest(".suggest-item").attr("data-id"),t=r(this);r.ajax({method:"post",url:"/home/upAndDown",data:{suggest_id:e,reliable:2}}).then(function(e){200===e.code&&(t.closest(".suggest-type").removeClass("show"),t.closest(".suggest-item").find(".suggest-bad").addClass("show"))}).fail(function(e){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})})}),define("js/me/jquery.uploadifive",["jquery"],function(e,t,n){var o=e("jquery");!function(e){var t={init:function(n){return this.each(function(){var o=e(this);o.data("uploadifive",{inputs:{},inputCount:0,fileID:0,queue:{count:0,selected:0,replaced:0,errors:0,queued:0,cancelled:0},uploads:{current:0,attempts:0,successful:0,errors:0,count:0}});var a=o.data("uploadifive"),s=a.settings=e.extend({auto:!0,buttonClass:!1,buttonText:"Select Files",checkScript:!1,dnd:!0,dropTarget:!1,fileObjName:"Filedata",fileSizeLimit:0,fileType:!1,formData:{},height:30,itemTemplate:!1,method:"post",multi:!0,overrideEvents:[],queueID:!1,queueSizeLimit:0,removeCompleted:!1,simUploadLimit:0,truncateLength:0,uploadLimit:0,uploadScript:"uploadifive.php",width:100},n);if(isNaN(s.fileSizeLimit)){var r=1.024*parseInt(s.fileSizeLimit);s.fileSizeLimit.indexOf("KB")>-1?s.fileSizeLimit=1e3*r:s.fileSizeLimit.indexOf("MB")>-1?s.fileSizeLimit=1e6*r:s.fileSizeLimit.indexOf("GB")>-1&&(s.fileSizeLimit=1e9*r)}else s.fileSizeLimit=1024*s.fileSizeLimit;if(a.inputTemplate=e('<input type="file">').css({"font-size":s.height+"px",opacity:0,position:"absolute",right:"-3px",top:"-3px","z-index":999}),a.createInput=function(){var n=a.inputTemplate.clone(),i=n.name="input"+a.inputCount++;s.multi&&n.attr("multiple",!0),s.fileType&&n.attr("accept",s.fileType),n.bind("change",function(){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var n=this.files.length;if(a.queue.selected=n,a.queue.count+n>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(o,"QUEUE_LIMIT_EXCEEDED");else{for(var r=0;n>r;r++)file=this.files[r],a.addQueueItem(file);a.inputs[i]=this,a.createInput()}s.auto&&t.upload.call(o),"function"==typeof s.onSelect&&s.onSelect.call(o,a.queue)}),a.currentInput&&a.currentInput.hide(),a.button.append(n),a.currentInput=n},a.destroyInput=function(t){e(a.inputs[t]).remove(),delete a.inputs[t],a.inputCount--},a.drop=function(n){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var i=n.dataTransfer,r=i.name="input"+a.inputCount++,l=i.files.length;if(a.queue.selected=l,a.queue.count+l>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(o,"QUEUE_LIMIT_EXCEEDED");else{for(var d=0;l>d;d++)file=i.files[d],a.addQueueItem(file);a.inputs[r]=i}s.auto&&t.upload.call(o),"function"==typeof s.onDrop&&s.onDrop.call(o,i.files,i.files.length),n.preventDefault(),n.stopPropagation()},a.fileExistsInQueue=function(e){for(var t in a.inputs){input=a.inputs[t],limit=input.files.length;for(var n=0;n<limit;n++)if(existingFile=input.files[n],existingFile.name==e.name&&!existingFile.complete)return!0}return!1},a.removeExistingFile=function(e){for(var n in a.inputs){input=a.inputs[n],limit=input.files.length;for(var i=0;i<limit;i++)existingFile=input.files[i],existingFile.name!=e.name||existingFile.complete||(a.queue.replaced++,t.cancel.call(o,existingFile,!0))}},0==s.itemTemplate?a.queueItem=e('<div class="uploadifive-queue-item">                        <a class="close" href="#">X</a>                        <div><span class="filename"></span><span class="fileinfo"></span></div>                        <div class="progress">                            <div class="progress-bar"></div>                        </div>                    </div>'):a.queueItem=e(s.itemTemplate),a.addQueueItem=function(n){if(e.inArray("onAddQueueItem",s.overrideEvents)<0){a.removeExistingFile(n),n.queueItem=a.queueItem.clone(),n.queueItem.attr("id",s.id+"-file-"+a.fileID++),n.queueItem.find(".close").bind("click",function(){return t.cancel.call(o,n),!1});var i=n.name;i.length>s.truncateLength&&0!=s.truncateLength&&(i=i.substring(0,s.truncateLength)+"..."),n.queueItem.find(".filename").html(i),n.queueItem.data("file",n),a.queueEl.append(n.queueItem)}"function"==typeof s.onAddQueueItem&&s.onAddQueueItem.call(o,n),n.size>s.fileSizeLimit&&0!=s.fileSizeLimit?a.error("FILE_SIZE_LIMIT_EXCEEDED",n):(a.queue.queued++,a.queue.count++)},a.removeQueueItem=function(t,n,o){o||(o=0);var i=n?0:500;t.queueItem&&(" - Completed"!=t.queueItem.find(".fileinfo").html()&&t.queueItem.find(".fileinfo").html(" - Cancelled"),t.queueItem.find(".progress-bar").width(0),t.queueItem.delay(o).fadeOut(i,function(){e(this).remove()}),delete t.queueItem,a.queue.count--)},a.filesToUpload=function(){var e=0;for(var t in a.inputs){input=a.inputs[t],limit=input.files.length;for(var n=0;n<limit;n++)file=input.files[n],file.skip||file.complete||e++}return e},a.checkExists=function(n){if(e.inArray("onCheck",s.overrideEvents)<0){e.ajaxSetup({async:!1});var i=e.extend(s.formData,{filename:n.name});if(e.post(s.checkScript,i,function(e){n.exists=parseInt(e)}),n.exists&&!confirm("A file named "+n.name+" already exists in the upload folder.\nWould you like to replace it?"))return t.cancel.call(o,n),!0}return"function"==typeof s.onCheck&&s.onCheck.call(o,n,n.exists),!1},a.uploadFile=function(t,n){if(!t.skip&&!t.complete&&!t.uploading)if(t.uploading=!0,a.uploads.current++,a.uploads.attempted++,xhr=t.xhr=new XMLHttpRequest,"function"==typeof FormData||"object"==typeof FormData){var r=new FormData;r.append(s.fileObjName,t);for(i in s.formData)r.append(i,s.formData[i]);xhr.open(s.method,s.uploadScript,!0),xhr.upload.addEventListener("progress",function(e){e.lengthComputable&&a.progress(e,t)},!1),xhr.addEventListener("load",function(e){4==this.readyState&&(t.uploading=!1,200==this.status?"Invalid file type."!==t.xhr.responseText?a.uploadComplete(e,t,n):a.error(t.xhr.responseText,t,n):404==this.status?a.error("404_FILE_NOT_FOUND",t,n):403==this.status?a.error("403_FORBIDDEN",t,n):a.error("Unknown Error",t,n))}),xhr.send(r)}else{var l=new FileReader;l.onload=function(i){var r="-------------------------"+(new Date).getTime(),l="--",d="\r\n",c="";c+=l+r+d,c+='Content-Disposition: form-data; name="'+s.fileObjName+'"',t.name&&(c+='; filename="'+t.name+'"'),c+=d,c+="Content-Type: application/octet-stream"+d+d,c+=i.target.result+d;for(key in s.formData)c+=l+r+d,c+='Content-Disposition: form-data; name="'+key+'"'+d+d,c+=s.formData[key]+d;c+=l+r+l+d,xhr.upload.addEventListener("progress",function(e){a.progress(e,t)},!1),xhr.addEventListener("load",function(e){t.uploading=!1;var o=this.status;404==o?a.error("404_FILE_NOT_FOUND",t,n):"Invalid file type."!=t.xhr.responseText?a.uploadComplete(e,t,n):a.error(t.xhr.responseText,t,n)},!1);var u=s.uploadScript;if("get"==s.method){var h=e(s.formData).param();u+=h}xhr.open(s.method,s.uploadScript,!0),xhr.setRequestHeader("Content-Type","multipart/form-data; boundary="+r),"function"==typeof s.onUploadFile&&s.onUploadFile.call(o,t),xhr.sendAsBinary(c)},l.readAsBinaryString(t)}},a.progress=function(t,n){if(e.inArray("onProgress",s.overrideEvents)<0){if(t.lengthComputable)var i=Math.round(t.loaded/t.total*100);n.queueItem.find(".fileinfo").html(" - "+i+"%"),n.queueItem.find(".progress-bar").css("width",i+"%")}"function"==typeof s.onProgress&&s.onProgress.call(o,n,t)},a.error=function(n,i,r){if(e.inArray("onError",s.overrideEvents)<0){switch(n){case"404_FILE_NOT_FOUND":errorMsg="404 Error";break;case"403_FORBIDDEN":errorMsg="403 Forbidden";break;case"FORBIDDEN_FILE_TYPE":errorMsg="Forbidden File Type";break;case"FILE_SIZE_LIMIT_EXCEEDED":errorMsg="File Too Large";break;default:errorMsg="Unknown Error"}i.queueItem.addClass("error").find(".fileinfo").html(" - "+errorMsg),i.queueItem.find(".progress").remove()}"function"==typeof s.onError&&s.onError.call(o,n,i),i.skip=!0,"404_FILE_NOT_FOUND"==n?a.uploads.errors++:a.queue.errors++,r&&t.upload.call(o,null,!0)},a.uploadComplete=function(n,i,r){e.inArray("onUploadComplete",s.overrideEvents)<0&&(i.queueItem.find(".progress-bar").css("width","100%"),i.queueItem.find(".fileinfo").html(" - Completed"),i.queueItem.find(".progress").slideUp(250),i.queueItem.addClass("complete")),"function"==typeof s.onUploadComplete&&s.onUploadComplete.call(o,i,i.xhr.responseText),s.removeCompleted&&setTimeout(function(){t.cancel.call(o,i)},3e3),i.complete=!0,a.uploads.successful++,a.uploads.count++,a.uploads.current--,delete i.xhr,r&&t.upload.call(o,null,!0)},a.queueComplete=function(){"function"==typeof s.onQueueComplete&&s.onQueueComplete.call(o,a.uploads)},!(window.File&&window.FileList&&window.Blob&&(window.FileReader||window.FormData)))return"function"==typeof s.onFallback&&s.onFallback.call(o),!1;if(s.id="uploadifive-"+o.attr("id"),a.button=e('<div id="'+s.id+'" class="uploadifive-button">'+s.buttonText+"</div>"),s.buttonClass&&a.button.addClass(s.buttonClass),a.button.css({height:s.height,"line-height":s.height+"px",overflow:"hidden",position:"relative","text-align":"center",width:s.width}),o.before(a.button).appendTo(a.button).hide(),a.createInput.call(o),s.queueID?a.queueEl=e("#"+s.queueID):(s.queueID=s.id+"-queue",a.queueEl=e('<div id="'+s.queueID+'" class="uploadifive-queue" />'),a.button.after(a.queueEl)),s.dnd){var l=s.dropTarget?e(s.dropTarget):a.queueEl.get(0);l.addEventListener("dragleave",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("dragenter",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("drop",a.drop,!1)}XMLHttpRequest.prototype.sendAsBinary||(XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var n=Array.prototype.map.call(e,t),o=new Uint8Array(n);this.send(o.buffer)}),"function"==typeof s.onInit&&s.onInit.call(o)})},debug:function(){return this.each(function(){console.log(e(this).data("uploadifive"))})},clearQueue:function(){this.each(function(){var n=e(this),o=n.data("uploadifive"),a=o.settings;for(var s in o.inputs)for(input=o.inputs[s],limit=input.files.length,i=0;i<limit;i++)file=input.files[i],t.cancel.call(n,file);"function"==typeof a.onClearQueue&&a.onClearQueue.call(n,e("#"+o.settings.queueID))})},cancel:function(n,o){this.each(function(){var i=e(this),a=i.data("uploadifive"),s=a.settings;"string"==typeof n&&(isNaN(n)||(fileID="uploadifive-"+e(this).attr("id")+"-file-"+n),n=e("#"+fileID).data("file")),n.skip=!0,a.filesCancelled++,n.uploading&&(a.uploads.current--,n.uploading=!1,n.xhr.abort(),delete n.xhr,t.upload.call(i)),e.inArray("onCancel",s.overrideEvents)<0&&a.removeQueueItem(n,o),"function"==typeof s.onCancel&&s.onCancel.call(i,n)})},upload:function(t,n){this.each(function(){var o=e(this),i=o.data("uploadifive"),a=i.settings;if(t)i.uploadFile.call(o,t);else if(i.uploads.count+i.uploads.current<a.uploadLimit||0==a.uploadLimit){if(!n){i.uploads.attempted=0,i.uploads.successsful=0,i.uploads.errors=0;var s=i.filesToUpload();"function"==typeof a.onUpload&&a.onUpload.call(o,s)}e("#"+a.queueID).find(".uploadifive-queue-item").not(".error, .complete").each(function(){return _file=e(this).data("file"),i.uploads.current>=a.simUploadLimit&&0!==a.simUploadLimit||i.uploads.current>=a.uploadLimit&&0!==a.uploadLimit||i.uploads.count>=a.uploadLimit&&0!==a.uploadLimit?!1:void(a.checkScript?(_file.checking=!0,skipFile=i.checkExists(_file),_file.checking=!1,skipFile||i.uploadFile(_file,!0)):i.uploadFile(_file,!0))}),0==e("#"+a.queueID).find(".uploadifive-queue-item").not(".error, .complete").size()&&i.queueComplete()}else 0==i.uploads.current&&(e.inArray("onError",a.overrideEvents)<0&&i.filesToUpload()>0&&0!=a.uploadLimit&&alert("The maximum upload limit has been reached."),"function"==typeof a.onError&&a.onError.call(o,"UPLOAD_LIMIT_EXCEEDED",i.filesToUpload()))})},destroy:function(){this.each(function(){var n=e(this),o=n.data("uploadifive"),i=o.settings;t.clearQueue.call(n),i.queueID||e("#"+i.queueID).remove(),n.siblings("input").remove(),n.show().insertBefore(o.button),o.button.remove(),"function"==typeof i.onDestroy&&i.onDestroy.call(n)})}};e.fn.uploadifive=function(n){return t[n]?t[n].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof n&&n?void e.error("The method "+n+" does not exist in $.uploadify"):t.init.apply(this,arguments)}}(o)}),define("js/me/index",["jquery","swiper","index"],function(e,t,n){var o,i=e("jquery"),a=i(".user-avatar"),s=i(".list-item"),r=new Image;e("js/product/recommend-for-you"),e("js/product/suspend-cart"),o=a.data("avatar"),r.src=o,r.onload=function(){a.css("background-image","url("+o+")")},i(".yoho-page").on("touchstart",".list-item, .type-item",function(){s.removeClass("highlight"),i(this).addClass("highlight")}).on("touchend touchcancel",".list-item, .type-item",function(){i(this).removeClass("highlight")})}),define("js/product/recommend-for-you",["swiper","jquery","index"],function(e,t,n){var o,i=e("swiper"),a=e("jquery"),s=a(".recommend-for-you");a.get("/home/preference").then(function(e){s.html(e).show(),a("#swiper-recommend").length&&(o=new i("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0}))}).fail(function(){s.hide()})}),define("js/me/coupons",["jquery","hammer","mlellipsis"],function(e,t,n){function o(e,t){l.showLoadingMask(),a.ajax({type:"POST",url:"/home/couponData",dataType:"html",data:{status:e,page:t},success:function(e){a("#employ").append(e),window.rePosFooter(),l.hideLoadingMask()}})}var i,a=e("jquery"),s=e("hammer"),r=e("mlellipsis"),l=e("js/plugin/loading"),d=0,c=1;r.init(),a(".yoho-footer").css("border-top","1px solid #e0e0e0"),a(".employ span").each(function(e){i=new s(a(".employ span")[e]),i.on("tap",function(t){a(".employ span").removeClass("active").eq(e).addClass("active"),a("#employ").html(" "),d=e,c=1,o(d,c),window.rePosFooter()})}),a(window).scroll(function(){return a(window).scrollTop()+a(window).height()>a("body").height()-1?(c++,void o(d,c)):void 0}),o(d,c)}),define("js/me/online-service",["jquery"],function(e,t,n){var o=e("jquery"),i=o(".question-tab .tab-item");i.on("touchend",function(){var e=o(this).data("tab");e='[data-tab-name="'+e+'"]',i.removeClass("current"),o(this).addClass("current"),o(".question-list").removeClass("current"),o(e).addClass("current")}),o(".yoho-page").on("touchstart",".connect-item, .question-item",function(){o(this).siblings().removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel",".connect-item, .question-item",function(){o(this).removeClass("highlight")})}),define("js/me/address",["jquery"],function(e,t,n){var o,i=e("jquery"),a=e("js/plugin/tip"),s=e("js/plugin/loading"),r=i(".action"),l=i(".add-address"),d=i("#yoho-footer"),c=i(".confim-mask"),u=i(".page-wrap"),h=i(".address-item");u.first().css("min-height",function(){return i(window).height()-i("#yoho-header").height()-d.height()}),window.rePosFooter(),c.on("touchend",".cancel",function(e){return o=null,c.fadeOut(),!1}).on("touchend",".confim",function(){return s.showLoadingMask(),c.fadeOut(),i.ajax({method:"POST",url:"/home/delAddress",data:{id:o}}).then(function(e){"object"!==i.type(e)&&(e={}),200!==e.code?(a.show(e.message||"网络出了点问题~"),s.hideLoadingMask()):window.location.reload()}).fail(function(){a.show("网络出了点问题~"),s.hideLoadingMask()}).always(function(){o=null}),!1}),h.length<5&&l.attr("href",l.data("href")),l.on("touchend",function(){return h.length>=5?(a.show("您最多添加5个收货地址"),!1):void 0}),r.on("touchend",".del",function(){o=i(this).data("id"),c.fadeIn()})}),define("js/me/browse-record",["jquery","lazyload","handlebars","source-map","hammer"],function(e,t,n){function o(e){var t=l.children(".browse-record-good").length;f||(1===h&&d.removeClass("hide"),f=!0,i.ajax({type:"GET",url:"/home/recordContent",data:{page:h+1},success:function(n){" "===n?(p=!0,c.addClass("hide"),u.removeClass("hide")):(0===t?(l.html(n),a()):(l.append(n),a(l.find(".browse-record-good:gt("+(t-1)+") .lazy"))),window.rePosFooter(),h++,e&&e())},complete:function(){f=!1}}))}var i=e("jquery"),a=e("lazyload"),s=e("js/plugin/loading"),r=e("js/me/dialog"),l=i(".records"),d=i(".load-more"),c=d.children(".more"),u=d.children(".no-more"),h=0,p=!1,f=!1,m=i(window).height();s.init(),s.showLoadingMask(),o(s.hideLoadingMask),i(window).scroll(function(){p||m+i(window).scrollTop()>i(document).height()-.25*l.height()&&o()}),l.on("touchstart",".del-icon",function(){var e=i(this).closest(".browse-record-good"),t=e.data("skn");r.showDialog({dialogText:"确定删除此条浏览记录吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){i.ajax({type:"GET",url:"/home/delRecord",data:{skn:t},success:function(e){200===e.code&&(r.showDialog({dialogText:"删除浏览记录成功",autoHide:2e3,fast:!0}),setTimeout(function(){window.history.go(0)},1200))}})})})}),define("js/me/address-act",["jquery","hammer"],function(e,t,n){var o,i=e("jquery"),a=e("hammer"),s=e("js/plugin/tip"),r=e("js/plugin/security"),l=e("js/plugin/loading"),d=i(".edit-address"),c=i(".submit"),u=i(".my-edit-address-page"),h=i(".my-address-list-page"),p=i(".nav-back"),f=i(".nav-title"),m=i("input, textarea"),g=f.html(),v=i(".area"),w="edit",y=[];i(u,h).css("min-height",function(){return i(window).height()-i("#yoho-header").height()}),p.attr("href","javascript:void(0);"),p.on("touchend",function(e){"list"===w?(h.hide(),u.show(),e.preventDefault(),w="edit",f.html(g),h.hide(),h.find("ul").hide().find("li").removeClass("highlight"),h.children("ul").show().children("li").show(),y=[]):window.history.go(-1)}),d.on("submit",function(){return o?!1:r.hasDangerInput(!1)?!1:i(this).find('[name="consignee"]').val()?i(this).find('[name="mobile"]').val()?i(this).find('[name="area_code"]').val()&&i(this).find('[name="area"]').val()?i(this).find('[name="address"]').val()?(o=!0,l.showLoadingMask(),i.ajax({method:"POST",url:"/home/saveAddress",data:i(this).serialize()}).then(function(e){"object"!==i.type(e)&&(e={}),200!==e.code?(s.show(e.message||"网络出了点问题~"),o=!1,l.hideLoadingMask()):window.location.href="/home/address"}).fail(function(){s.show("网络出了点问题~"),o=!1}),!1):(s.show("地址不能为空"),!1):(s.show("省市区不能为空"),!1):(s.show("手机号不能为空"),!1):(s.show("收件人不能为空"),!1)}),c.on("touchend",function(){return r.hasDangerInput(!1)?!1:(m.blur(),d.submit(),!1)}).on("touchstart",function(){i(this).addClass("highlight")}).on("touchend touchcancel",function(){i(this).removeClass("highlight")}),i.get("/home/locationList").then(function(e){h.html(e),v.on("touchend",function(){u.hide(),h.show(),w="list",f.html("地区选择")}),h.find(".address").each(function(e,t){var n=new a(t);n.on("tap",function(e){var t=i(e.target);"li"!==e.target.tagName.toLowerCase()&&(t=t.parent("li")),y.push(t.children(".caption").text()),t.siblings().hide(),t.children("ul").show().children("li").show(),e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),h.find(".address-last").each(function(e,t){var n=new a(t);n.on("tap",function(e){var t=i(e.target);y.push(t.children(".caption").text()),i('[name="area"]').val(y.join(" ")),i('[name="area_code"]').val(t.data("id")),u.show(),w="edit",f.html(g),h.hide(),h.find("ul").hide().find("li").removeClass("highlight"),h.children("ul").show().children("li").show(),y=[],e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),h.on("touchstart","li",function(){i(this).addClass("highlight")}).on("touchend touchcancel","li",function(){i(this).removeClass("highlight")})}).fail(function(){s.show("获取省市区列表失败")})}),define("js/me/logistic",["jquery"],function(e,t,n){function o(){l+r>s?window.rePosFooter():a.css("border-top","1px solid #f1f1f1")}var i=e("jquery"),a=i("#yoho-footer"),s=window.outerHeight,r=document.body.offsetHeight,l=a.height();i(document).ready(o)}),define("js/me/pay",["jquery","hammer"],function(e,t,n){function o(){document.addEventListener("WeixinJSBridgeReady",function(){window.WeixinJSBridge&&window.WeixinJSBridge.call("hideOptionMenu")})}function i(e,t){window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getBrandWCPayRequest",t,function(t){window.location.href="/home/orders/detail?order_code="+e})}function a(e){var t;void 0===typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):p.ajax({type:"GET",url:"/shopping/pay/wechatwapapi?order_code="+e,dataType:"json",success:function(n){200===n.code?(t=n.data.jsApiParameters,i(e,t)):m.show("微信支付调取失败")},error:function(){m.show("请刷新本页面,完成微信支付")}})}function s(){var e=navigator.userAgent.toLowerCase();return"micromessenger"===e.match(/MicroMessenger/i)?!0:!1}function r(){var e=p(".app");e.each(function(e,t){return"weixin"===p(t).parent().attr("id")?(p(t).parent().css("display","none"),!1):void 0})}function l(){s()||r()}function d(e,t){p(e).css("background-position-y",t)}function c(){var e=p(".box"),t=null,n=null;e.each(function(e,o){t=p(o).find(".icon").find("div"),t.length>0&&(n=p(o).attr("id"),"alipay"!==n&&d(t,b[n]))})}function u(){var e=p(".payapp-list");e.css("visibility","visible")}function h(){l(),f.hideLoadingMask(),u(),c()}var p=e("jquery"),f=e("js/plugin/loading"),m=e("js/plugin/tip"),g=e("hammer"),v=document.getElementById("ordercode").value,w=document.getElementById("weixin"),y=w&&new g(w),b={baidu:"-2.7rem",weixin:"-1.2rem",QQ:"-5.4rem",bank:"-4rem"};window.wx&&wx.hideOptionMenu(),void 0===typeof WeixinJSBridge?(document.addEventListener?document.addEventListener("WeixinJSBridgeReady",o,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",o),document.attachEvent("onWeixinJSBridgeReady",o)),o()):o(),y&&y.on("tap",function(){a(v)}),f.showLoadingMask(),window.onload=h}),define("js/me/personal-details",["jquery"],function(e,t,n){var o,i=e("jquery"),a=i(".user-avatar"),s=new Image;o=a.data("avatar"),s.src=o,s.onload=function(){a.css("background-image","url("+o+")")}});