index.js
88.3 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 a(e,t,n){var o,a,i,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:"",a=n.domain?"; domain="+n.domain:"",i=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,o,a,i].join(""))}function i(){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=i();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=i();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(" "),a=window.requestAnimationFrame,i=window.cancelAnimationFrame;for(t=0;t<o.length&&(!a||!i);t++)e=o[t],a=a||window[e+"RequestAnimationFrame"],i=i||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];a&&i||(a=function(e,t){var o=(new Date).getTime(),a=Math.max(0,16-(o-n)),i=window.setTimeout(function(){e(o+a)},a);return n=o+a,i},i=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=a,window.cancelAnimationFrame=i}(),window.cookie=o,window.setCookie=a,window.getUser=i,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"),a=o(".category-nav"),i=o(".category-container"),s=i.children(".content"),r=i.find(".sub-level li"),l=i.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()-a.outerHeight();i.css("min-height",n),s.height(n)}(),o("#search-input").focus(function(){o(this).blur()}),a.bind("contextmenu",function(e){return!1}),o(".category-container").bind("contextmenu",function(e){return!1}),a.on("touchend touchcancel",function(e){var t=o(e.target).closest("li"),n=t.index();t.hasClass("focus")||(a.find("li.focus").removeClass("focus"),t.addClass("focus"),d.addClass("hide"),d=s.eq(n).removeClass("hide"))}),i.on("touchend",function(e){var t,n,a,i=o(e.target);if(n=i.closest(".p-level-item"),n.length>0){if(a=n.index(),t=i.closest(".content").find(".sub-level"),i.hasClass("focus"))return;i.closest(".primary-level").children(".focus").removeClass("focus"),i.addClass("focus"),t.not(".hide").addClass("hide"),t.eq(a).removeClass("hide")}}),i.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")}),i.find(".sub-level").on("touchstart","li",function(){r.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),a.on("touchstart","li",function(){a.find("li").removeClass("bytouch"),o(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){a.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 a(){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 i(){var e=(u.val()+"").toLowerCase(),t={},n=0,o="";""!==e&&(p.each(c,function(n,o){p.isArray(o)&&p.each(o,function(o,a){a.name.toLowerCase().indexOf(e)>-1&&(t[n]=t[n]||[],t[n].push(a))})}),p.each(t,function(e,t){var a=['<div class="brand-list bar-',n,'">'];n++,a.push('<div class="title-bar"><h2>'),a.push(e),a.push("</h2></div>"),p.each(t,function(e,t){a.push('<p><a href="'+t.url+'">'+t.name),t.isNew&&a.push('<i class="icon-new">NEW</i>'),t.isHot&&a.push('<i class="icon-hot">HOT</i>'),a.push("</a></p>")}),a.push("</div>"),o+=a.join("")})),p(".search-result").html(o),a()}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)}),a(),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()),i()}).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,a=e("jquery"),i=e("lazyload"),s=e("swiper"),r=a("#nav-tab > li"),l=a("#ps-content > .content");i(a("img.lazy")),o=new s(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination"}),a("#nav-tab").bind("contextmenu",function(e){return!1}),a("#nav-tab").on("touchend touchcancel",function(e){var t=a(e.target).closest("li");t.hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),a(document).trigger("scroll"))}),a("#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,a,i,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(),a=u.attr("title")}),f.initInfosEvt(p),i=new l(document.getElementById("more-intro")),i.on("tap",function(e){var t=r(e.target).closest("#more-intro");t.toggleClass("spread"),t.hasClass("spread")?(u.text(a),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 a(e){var t;"undefined"!=typeof e&&(t=new r(e[0]),t.on("tap",function(e){var t,n,o=s(e.target),a="ok";return t=o.closest(".like-btn"),t.length>0?(e.preventDefault(),t.hasClass("like")&&(a="cancel"),n=o.closest(".guang-info"),void s.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:n.data("id"),opt:a},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")&&(a="cancel"),n=o.closest(".guang-info"),s.ajax({type:"POST",url:"/guang/opt/collectArticle",data:{id:n.data("id"),opt:a},success:function(e){e.code&&200===e.code&&t.toggleClass("collected")},error:function(){c.show("网络断开连接了~")}}))))}),o(e.find(".guang-info")))}function i(e,t,n){var a;m||t.end||(1===t.page&&u.showLoadingMask(),a=e.find(".guang-info").length,m=!0,s.ajax({type:"GET",url:n?n:"/guang/index/page",data:t,success:function(n){var i;return" "===n?(t.end=!0,m=!1,p.addClass("hide"),void f.removeClass("hide")):(e.append(n),i=a>0?e.find(".guang-info:gt("+(a-1)+")"):e.find(".guang-info"),o(i),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=a,t.setLazyLoadAndMellipsis=o,t.loadMore=i}),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,a.text(n).show(),i=setTimeout(function(){"block"===a.css("display")&&a.hide()},o))}var a,i,s=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),a=s("#yoho-tip"),a.on("touchend",function(){a.hide(),clearTimeout(i)})}(),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><div></div><div></div></div></div>';d=!0,void 0===e&&(e=l),e.append(t),s=e.children(".loading-mask")}function a(){d||(o(),d=!0),s.removeClass("hide")}function i(){s.addClass("hide")}var s,r=e("jquery"),l=r(".yoho-page"),d=!1;t.init=o,t.showLoadingMask=a,t.hideLoadingMask=i}),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,a;void 0!==e&&""!==e&&(t=e.appId.toString(),n=e.timestamp,o=e.nonceStr.toString(),a=e.signature.toString(),wx.config({debug:!1,appId:t,timestamp:n,nonceStr:o,signature:a,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(),a=o("#shareLink").val(),i={title:e,desc:n,imgUrl:t,link:a};wx.onMenuShareAppMessage(i),wx.onMenuShareTimeline(i),wx.onMenuShareQQ(i),wx.onMenuShareWeibo(i)})}}),define("js/guang/home",["jquery","swiper","hammer","mlellipsis","lazyload","index"],function(e,t,n){function o(){var e=f.not(".hide");i(window).scrollTop()+h>=i(document).height()-.25*e.height()&&l(e,w[v])}var a,i=e("jquery"),s=e("swiper"),r=e("js/guang/info"),l=r.loadMore,d=i("#load-more-info"),c=i(""),u=i(""),h=i(window).height(),p=i("#info-list"),f=p.children(".info-list"),m=i("#guang-nav"),g=m.children(".focus"),v=g.data("type"),w={};d.length>0&&(c=d.children(".loading"),u=d.children(".no-more")),a=new s(".swiper-container",{lazyLoading:!0,pagination:".swiper-pagination",autoplay:3e3}),r.initInfosEvt(p),function(){var e=i("#gender").val();m.children(".guang-nav-item").each(function(){var t=i(this).data("type"),n=i(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=i(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())}),i(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(){a(window).scrollTop()+r>=a(document).height()-.25*p.height()&&s(p,h)}var a=e("jquery"),i=e("js/guang/info"),s=i.loadMore,r=a(window).height(),l=a("#author-infos"),d=a("#tag"),c=a("#gender"),u=a("#isApp"),h={page:2,end:!1},p=a("#info-list");i.initInfosEvt(p),l.length>0&&a.extend(h,{authorId:l.data("id"),isApp:u.val()}),d.length>0&&a.extend(h,{tag:d.val(),gender:c.val(),isApp:u.val()}),a(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 a(e){var t,n,a,i=h(e.currentTarget),p=i.index();i.hasClass("focus")||(l.filter(".focus").removeClass("focus"),v&&(t=i.closest(".fixed-thumb-container").length>0?r:b,n=t.find(".thumb").eq(p),b.find(".thumb.focus").removeClass("focus"),n.addClass("focus")),i.addClass("focus"),o(i),d.not(".hide").addClass("hide"),a=d.eq(p),a.removeClass("hide"),f(a.find(".lazy")),v?u&&u.scrollToElement(c,400):h("body").animate({scrollTop:s.offset().top},400),u&&u.refresh())}function i(){var e,t,n,o,a,i=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,a=b[0],t=r.outerHeight(),n=s.outerHeight(),o=s.offset().top-d,void u.on("scroll",function(){var s=-this.y,r=a.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"),a.style.top=o+d+n-t-s+"px"):s>o+n&&-1===r.indexOf("hide")&&b.addClass("hide").removeClass("absolute"),i.trigger("scroll")})):void u.on("scroll",function(){i.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",a),v&&b.delegate(".thumb","touchend",a)),v&&i()}}),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 a(){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(a,3e3):k%360===0?window.setTimeout(a,6e4):c(function(){a()})}var i,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&&(i=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(a,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 a(){c(window).scrollTop()+m>=c(document).height()-200&&o()}var i,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&&(i=new u(j[0]),i.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(a)})}),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,a,i=e("jquery"),s=e("js/plugin/security"),r=e("hammer"),l=i("#search-input input"),d=i("#search-input .clear-input"),c=i(".search-icon"),u=i("#search-form"),h=i(".history"),p=i(".history-search"),f=i("#clear-history"),m=e("js/index/write-search"),g=m.getRanToken();o=new r(f[0]),o.on("tap",function(){localStorage.removeItem("historys"),h.html(""),p.hide(),f.hide(),window.rePosFooter()}),l.on("input",function(){""===l.val()?(c.css("color","#b2b2b2"),d.addClass("hide")):(c.css("color","#666"),d.removeClass("hide"))}),a=new r(d[0]),a.on("tap",function(){l.val("").trigger("input")}),i("#search").on("touchend",function(){return s.hasDangerInput()?!1:(i(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(g),n=0;n<t.length;n++)e=t[n],""!==e&&(o+='<li><a href="/?query='+e+'">'+e+"</li>");h.html(o),f.removeClass("hide"),p.removeClass("hide"),window.rePosFooter()}}(),m.bindWirteLocal(u)}),define("js/plugin/security",["jquery"],function(e,t,n){function o(e){var t,n,o,s=a("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(" "),i.show("不可以输入 "+o+" 哦!")),!d&&!0;return!1}var a=e("jquery"),i=e("js/plugin/tip");t.hasDangerInput=o}),define("js/index/write-search",[],function(e,t,n){function o(){return i}function a(e){e.on("submit",function(){var e,t=this.query.value;if(localStorage){if(e=localStorage.getItem("historys"),e=e?e:"",e.indexOf(i+t+i)>-1)return;""===e&&(t=i+t),e+=t+i,localStorage.setItem("historys",e)}})}var i=" ??++ ";t.getRanToken=o,t.bindWirteLocal=a}),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 a,i=e("jquery"),s=e("hammer");e("js/common"),i("#float-layer-close").on("touchend",function(e){return i("#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}),i("#float-layer-btn")&&i("#float-layer-btn")[0]&&(a=new s(i("#float-layer-btn")[0]),a.on("tap",function(e){o("bottom"),e.srcEvent.stopPropagation()}),"function"!=typeof window.cookie||window.cookie("_float-layer-app")?i("#float-layer-app").hide():i("#float-layer-app").show())}),define("js/index/channel",["jquery"],function(e,t,n){var o=e("jquery"),a=e("js/plugin/security"),i=o(".search-box"),s=o(".box"),r=o(".index-search"),l=o(".index-logo"),d=o(".index-channel a"),c=i.children('input[type="text"]'),u=s.children(".no-search"),h=i.children(".search-icon");e("js/common"),c.on("focus",function(){s.addClass("action"),l.addClass("action")}).on("input",function(){""===c.val()?h.addClass("empty"):h.removeClass("empty")}),u.on("touchend",function(){return s.removeClass("action"),l.removeClass("action"),c.blur(),!1}),i.children(".clear-text").on("touchstart",function(){c.val("").focus().trigger("input")}),i.children(".search-icon").on("touchstart",function(){return a.hasDangerInput()?!1:void r.submit()}),i.keyup(function(e){if(13===e.keyCode){if(a.hasDangerInput())return!1;r.submit()}}),o(".index-channel img").on("load error",function(){window.rePosFooter&&window.rePosFooter()}),d.on("touchstart",function(){d.css({background:"#000",color:"#fff",borderColor:"#fff"}),o(this).css({background:"rgba(255, 255, 255, 0.5)",color:"#000",borderColor:"#000"})}).on("touchend touchcancel",function(){o(this).css({background:"#000",color:"#fff",borderColor:"#fff"})})}),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"),a=o("#phone-num"),i=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(),a.bind("input",function(){""===c(a.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){s.text(i.val())}),r.on("touchstart",function(){var e=c(a.val()),t=i.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 a(){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 i(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:a,pwdValidate:i,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 a=o("#captcha"),i=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(),a.bind("input",function(){""!==u(a.val())?i.removeClass("disable"):i.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)}})}),i.on("touchstart",function(){i.hasClass("disable")||o.ajax({type:"POST",url:"/passport/"+p+"/verifycode",data:{phoneNum:r,areaCode:l,code:u(a.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"),a=o("#pwd"),i=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindEyesEvt({status:"open"}),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(a.val());i.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 a(){c.show(),u.show()}function i(){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(){a()}),c.on("touchstart",function(){i()}),s("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),i()}),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 a=e("jquery"),i=a("#phone-num"),s=a("#country-select"),r=a("#area-code"),l=a("#pwd"),d=a("#btn-login"),c=!1,u=!1,h=e("js/passport/api"),p=e("js/plugin/tip"),f=a.trim,m=p.show;h.selectCssHack(s),h.bindEyesEvt(),h.bindClearEvt(),i.bind("input",function(){c=""===f(i.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(i.val()),t=s.val(),n=f(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),h.phoneRegx[t].test(e)&&h.pwdValidate(n)?a.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("登录成功"),a.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("账号或密码有错误,请重新输入"))}),i.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#phone-num"),i=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(),a.bind("input",function(){""===c(a.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){s.text(i.val())}),r.on("touchstart",function(){var e=c(a.val()),t=i.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"),a=o("#email"),i=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindClearEvt(),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(a.val());i.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"),a=o("#resend"),i=e("js/plugin/tip"),s=i.show;a.on("touchstart",function(e){e.preventDefault(),o.ajax({url:a.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"),a=o("#pwd"),i=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"}),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e,t,n=l(a.val()),r=!0;i.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,a,i,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")?(a="today",i=1):T.hasClass("week")?(a="week",i=2):T.hasClass("sale")&&(a="sale",i=3),o=E[a],u=o.page+1,o.reload)u=1;else if(o.end)return;c.extend(f,b,{dayLimit:i,page:u}),d=!0,m.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:f,success:function(e){var t,n;switch(a){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 a(){c(window).scrollTop()+w>c(document).height()-.25*g.height()-50&&void 0!==T&&o()}var i,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/query-param"),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&&(i=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,a,i=c(e.target).closest("li");if(e.preventDefault(),i.hasClass("filter"))i.hasClass("active")?(f.hideFilter(),T.addClass("active"),i.removeClass("active")):(T=i.siblings(".active"),T.removeClass("active"),i.addClass("active"),f.showFilter());else{if(i.hasClass("today")?n="today":i.hasClass("week")?n="week":i.hasClass("sale")&&(n="sale"),t=E[n],!i.hasClass("active")){if(a=i.siblings(".active"),T=i,a.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)}a.removeClass("active"),i.addClass("active")}t.reload&&o()}e.stopPropagation()}),c(window).scroll(function(){window.requestAnimationFrame(a)}),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 a(){h.removeClass("hide")}function i(){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"),a=o.siblings(".shower");return e.hasClass("chosed")?o:(o.children(".chosed").removeClass("chosed"),e.addClass("chosed"),t=g.trim(e.html()),n=g.trim(a.html()),a.html(n.substring(0,n.indexOf("</span>")+7)+t.substring(0,t.indexOf("<i"))),0===e.index()?a.addClass("default"):a.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,i(),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=a,t.hideFilter=o,t.resetFilter=u}),define("js/product/query-param",["jquery"],function(e,t,n){var o=e("jquery"),a={};o(".query-param").each(function(){var e=o(this);a[e.data("attr")]=e.val()}),n.exports=a}),define("js/product/suspend-cart",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#suspend-cart");o.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&a.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,a,i,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")?a="newest":x.hasClass("price")?a="price":x.hasClass("discount")&&(a="discount"),o=j[a],i=o.page+1,o.reload)i=1;else if(o.end)return;r.extend(l,b,{type:a,order:o.order,page:i}),s=!0,h.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var t,n;switch(a){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=i,s=!1,h.hideLoadingMask(),window.rePosFooter()},error:function(){c.show("网络断开连接了~"),s=!1,h.hideLoadingMask()}})}}function a(){r(window).scrollTop()+w>r(document).height()-.25*p.height()-50&&void 0!==x&&o()}var i,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/query-param"),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&&(i=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,a,i=r(e.target).closest("li");if(e.preventDefault(),"undefined"!=typeof i&&0!==i.length){if(i.hasClass("filter"))i.hasClass("active")?(u.hideFilter(),x.addClass("active"),i.removeClass("active")):(x=i.siblings(".active"),x.removeClass("active"),i.addClass("active"),u.showFilter());else{if(i.hasClass("new")?n="newest":i.hasClass("price")?n="price":i.hasClass("discount")&&(n="discount"),t=j[n],i.hasClass("active")){if(i.hasClass("new"))return;(i.hasClass("price")||i.hasClass("discount"))&&(i.find(".icon > .iconfont").toggleClass("cur"),x=i,t.reload=!0,t.order=0===t.order?1:0)}else{if(a=i.siblings(".active"),x=i,a.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")}a.removeClass("active"),i.addClass("active")}t.reload&&o()}e.stopPropagation()}}),r(window).scroll(function(){window.requestAnimationFrame(a)}),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,a,s,r={};if(!i){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")?a="newest":L.hasClass("price")?a="price":L.hasClass("discount")&&(a="discount"),o=I[a],s=o.page+1,o.reload)s=1;else if(o.end)return;d.extend(r,E,{type:a,order:o.order,page:s}),i=!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(a){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,i=!1,v.hideLoadingMask(),window.rePosFooter()}})}}function a(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&o()}var i,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/query-param"),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,a,i=d(e.target).closest("li");if(i.hasClass("filter"))i.hasClass("active")?(f.hideFilter(),L.addClass("active"),i.removeClass("active")):(L=i.siblings(".active"),L.removeClass("active"),i.addClass("active"),f.showFilter());else{if(i.hasClass("new")?n="newest":i.hasClass("price")?n="price":i.hasClass("discount")&&(n="discount"),t=I[n],i.hasClass("active")){if(i.hasClass("new"))return;(i.hasClass("price")||i.hasClass("discount"))&&(i.find(".icon > .iconfont").toggleClass("cur"),L=i,t.reload=!0,t.order=0===t.order?1:0)}else{if(a=i.siblings(".active"),L=i,a.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")}a.removeClass("active"),i.addClass("active")}t.reload&&o()}}),d(window).scroll(function(){window.requestAnimationFrame(a)}),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=i(".cart-bar"),t=setInterval(function(){e?(window.reMarginFooter(".cart-bar"),clearInterval(t)):e=i(".cart-bar")},200)}var a,i=e("jquery"),s=e("swiper"),r=e("hammer"),l=e("lazyload"),d=i(".goodsDiscount .discount-folder"),c=i(".goodsDiscount .first-item span"),u=document.getElementById("goodsDiscount"),h=u&&new r(u),p=i(".cart-bar"),f=navigator.userAgent.toLowerCase().toString();e("js/product/detail/desc"),e("js/product/detail/comments-consults"),e("js/product/recommend-for-you-product-desc"),o(),l(i("img.lazy")),a=new s(".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===d.children().length&&(d.css("display","none"),c.html("")),h&&d.children().length>0&&h.on("tap",function(e){d.is(":hidden")?(c.removeClass("icon-down").addClass("icon-up").html(""),d.slideDown()):(c.removeClass("icon-up").addClass("icon-down").html(""),d.slideUp())}),i.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&p.find(".num-tag").html(e.data.cart_goods_count).removeClass("hide")}}),f.indexOf("mqqbrowser")>-1&&i(".detail > div").removeClass("column").addClass("oldbox"),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 a(){g||v||(g=!0,h.showLoadingMask(),d.ajax({type:"GET",url:f,success:function(e){s=d("#productDesc"),s.append(e),window.rePosFooter(),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 i(){(!v||d(window).scrollTop()+m>=d(document).height()-50)&&a()}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(i)})}),define("js/product/detail/comments-consults",["jquery","hammer"],function(e,t,n){var o,a,i=e("jquery"),s=e("js/plugin/tip"),r=e("hammer"),l=i(".consult-content-footer")[0],d=l&&new r(l),c=document.getElementById("nav-tab"),u=c&&new r(c),h=document.getElementById("goto-consult"),p=h&&new r(h);!function(){a=i("#nav-tab .consults-num").html()-0,o=i("#nav-tab .comments-num").html()-0,i("#nav-tab li").each(function(){i(this).removeClass("focus")}),i("#feedback-content .content").each(function(){i(this).addClass("hide")}),0!==o?(i("#nav-tab .comment-nav").addClass("focus"),i("#feedback-content .comment-content").removeClass("hide")):0!==a&&(i("#nav-tab .consult-nav").addClass("focus"),i("#feedback-content .consult-content").removeClass("hide"))}(),u&&u.on("tap",function(e){var t=i(e.target).closest("li"),n=t.index();t.hasClass("comment-nav")&&0===o?s.show("暂无商品评价"):t.hasClass("focus")||(i("#nav-tab li").each(function(){i(this).removeClass("focus")}),i("#feedback-content .content").each(function(){i(this).addClass("hide")}),t.addClass("focus"),i("#feedback-content .content:eq("+n+")").removeClass("hide"))}),d&&d.on("tap",function(){location.href=i(l).data("href")}),p&&p.on("tap",function(){location.href=i(h).data("href")}),i(".goods-consults-page").length>0&&i("#yoho-header").css("position","fixed").css("top","0")}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,t,n){var o,a=e("swiper"),i=e("jquery"),s=i(".recommend-for-you"),r=i("#preferenceUrl").val();r&&i.get(r).then(function(e){s.html(e).show(),i("#swiper-recommend").length&&(o=new a("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0})),window.rePosFooter()}).fail(function(){s.hide()})}),define("js/product/detail/like",["jquery","hammer"],function(e,t,n){var o=e("jquery"),a=e("hammer"),i=e("js/plugin/tip"),s=document.getElementById("likeBtn"),r=s&&new a(s),l=document.getElementById("addtoCart"),d=l&&new a(l),c=o("#productId").val();r&&r.on("tap",function(e){var t,n,a=o(e.target);a.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?(a.toggleClass("liked"),"cancel"===t?i.show("取消收藏成功"):"ok"===t&&i.show("收藏成功")):400===e.code?location.href=e.data:i.show(e.message),window._yas&&window._yas.sendCustomInfo({pd:c,fa:n})},error:function(){i.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,a=e("jquery"),i=e("js/plugin/tip"),s=e("js/plugin/loading"),r=a(".consult-form"),l=a("#submit"),d=a("#content"),c=a("#product_id").val();l.on("touchend",function(){return d.blur(),r.submit(),!1}).on("touchstart",function(){a(this).addClass("highlight")}).on("touchend touchcancel",function(){a(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(),a.ajax({method:"POST",url:"/product/detail/consultsubmit",data:{product_id:c,content:e}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(i.show(e.message||"网络出了点问题~"),o=!1,s.hideLoadingMask()):(i.show("提交成功~"),setTimeout(function(){window.history.go(-1)},3e3))}).fail(function(){i.show("网络出了点问题~"),o=!1}),!1):(i.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"),i=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 a(){2!==p&&(d(window).scrollTop()+i<s+d("#hotRank").height()-100||(p=2,f=1,o(p,m,g,f)))}var i,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(a)}),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"),{try_again_css:"order-failure"})):(o=u.children(".order").length,u.append(e),l(u.children(".order:gt("+(o-1)+")").find(".lazy"),{try_again_css:"order-failure"})),window.rePosFooter()):f.end=!0,m=!1,n&&g.hideLoadingMask()}}))}function a(){f.end===!1&&s(window).scrollTop()+h>s(document).height()-.25*c.height()&&o({noLoadingMask:!0})}var i,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({try_again_css:"order-failure"}),function(){var e=d.length;4!==e&&d.width(100/e+"%")}(),g.init(s("body")),i=new r(document.getElementById("order-container")),i.on("tap",function(e){var t,n,o,a=s(e.target);a.closest(".locHref").length>0||(t=a.closest(".order"),n=t.data("id"),a.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})}})}):a.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})}})}):a.closest(".order-goods").length>0&&(o=t.data("href"),location.href=o))}),s(window).scroll(function(){window.requestAnimationFrame(a)}),o()}),define("js/me/dialog",["jquery","handlebars","source-map","hammer"],function(e,t,n){var o,a,i,s=e("jquery"),r=e("handlebars"),l=e("hammer");a='<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>',i=r.compile(a),t.showDialog=function(e,t){var n,a,r,d=i(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&&(a=1e3,e.autoHide>1&&(a=e.autoHide),setTimeout(function(){o.fadeOut()},a)),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,a=e("jquery"),i=e("lazyload"),s=e("hammer"),r=a("#order-detail").data("id");i({try_again_css:"order-failure"}),o=new s(document.getElementsByClassName("opt")[0]),o.on("tap",function(e){var t=a(e.target);t.hasClass("btn-del")?confirm("确定删除订单吗?")&&a.ajax({type:"GET",url:"/home/delOrder",data:{id:r}}):t.hasClass("btn-cancel")&&confirm("确定取消订单吗?")&&a.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 a(e){var t,n,o=/container-(\d+)['"]{1}/gi,a=/\d+/,i=e.match(o),s=i.length;for(t=0;s>t;t++)n=i[t].match(a)[0],m[n]=new u("#swiper-container-"+n,{slidesPerView:"auto",grabCursor:!0,slideElement:"li",wrapperClass:"swiper-wrapper-"+n,lazyLoading:!0,watchSlidesVisibility:!0})}function i(e,t,n){"favBrand"===t?q=!0:k=!0,d.ajax({method:"post",url:"/home/"+t,data:{page:n},success:function(n){if("favBrand"===t?w.addClass("hide"):v.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?(a(n),q=!1):k=!1,window.rePosFooter()}window.rePosFooter()}})}function s(){d(window).scrollTop()+y>=d(document).height()-g&&(E?(w.filter(".hide").removeClass("hide"),q||(x++,i(C,"favBrand",x))):(v.filter(".hide").removeClass("hide"),k||(j++,i(b,"favProduct",j))))}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=d("#yoho-footer").height(),v=d(".fav-load-more"),w=d(".fav-brand-load-more"),y=d(window).height(),b=d(".fav-product-list"),C=d(".fav-brand-swiper-wrapper"),j=1,x=1,k=!0,q=!0,E=!1;d("#fav-tab").hasClass("brand-tab")?(o(1),i(C,"favBrand",1),E=!0,window.rePosFooter()):(o(0),i(b,"favProduct",1),E=!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?(E=!1,0===b.find("li").length&&b.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&i(b,"favProduct",1)):(E=!0,0===C.find("div").length&&C.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&i(C,"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,a,i,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"),i='{{# imgList}}<li>{{# imgUrl}}<img src="{{.}}" /><span class="upload-img-remove"></span>{{/ imgUrl}}</li>{{/ imgList}}',s=c.compile(i),r("#upload-img").uploadifive({auto:!0,fileType:"image*/*",uploadScript:"/home/suggestimgUpload",fileObjName:"fileData",fileSizeLimit:300,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")&&(a=new l(document.getElementById("img-form")),a.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 a=e.extend(s.formData,{filename:n.name});if(e.post(s.checkScript,a,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 a=Math.round(t.loaded/t.total*100);n.queueItem.find(".fileinfo").html(" - "+a+"%"),n.queueItem.find(".progress-bar").css("width",a+"%")}"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 a=e(this),i=a.data("uploadifive"),s=i.settings;"string"==typeof n&&(isNaN(n)||(fileID="uploadifive-"+e(this).attr("id")+"-file-"+n),n=e("#"+fileID).data("file")),n.skip=!0,i.filesCancelled++,n.uploading&&(i.uploads.current--,n.uploading=!1,n.xhr.abort(),delete n.xhr,t.upload.call(a)),e.inArray("onCancel",s.overrideEvents)<0&&i.removeQueueItem(n,o),"function"==typeof s.onCancel&&s.onCancel.call(a,n)})},upload:function(t,n){this.each(function(){var o=e(this),a=o.data("uploadifive"),i=a.settings;if(t)a.uploadFile.call(o,t);else if(a.uploads.count+a.uploads.current<i.uploadLimit||0==i.uploadLimit){if(!n){a.uploads.attempted=0,a.uploads.successsful=0,a.uploads.errors=0;var s=a.filesToUpload();"function"==typeof i.onUpload&&i.onUpload.call(o,s)}e("#"+i.queueID).find(".uploadifive-queue-item").not(".error, .complete").each(function(){return _file=e(this).data("file"),a.uploads.current>=i.simUploadLimit&&0!==i.simUploadLimit||a.uploads.current>=i.uploadLimit&&0!==i.uploadLimit||a.uploads.count>=i.uploadLimit&&0!==i.uploadLimit?!1:void(i.checkScript?(_file.checking=!0,skipFile=a.checkExists(_file),_file.checking=!1,skipFile||a.uploadFile(_file,!0)):a.uploadFile(_file,!0))}),0==e("#"+i.queueID).find(".uploadifive-queue-item").not(".error, .complete").size()&&a.queueComplete()}else 0==a.uploads.current&&(e.inArray("onError",i.overrideEvents)<0&&a.filesToUpload()>0&&0!=i.uploadLimit&&alert("The maximum upload limit has been reached."),"function"==typeof i.onError&&i.onError.call(o,"UPLOAD_LIMIT_EXCEEDED",a.filesToUpload()))})},destroy:function(){this.each(function(){var n=e(this),o=n.data("uploadifive"),a=o.settings;t.clearQueue.call(n),a.queueID||e("#"+a.queueID).remove(),n.siblings("input").remove(),n.show().insertBefore(o.button),o.button.remove(),"function"==typeof a.onDestroy&&a.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,a=e("jquery"),i=a(".user-avatar"),s=a(".list-item"),r=new Image;e("js/product/recommend-for-you"),e("js/product/suspend-cart"),o=i.data("avatar"),r.src=o,r.onload=function(){i.css("background-image","url("+o+")")},a(".yoho-page").on("touchstart",".list-item, .type-item",function(){s.removeClass("highlight"),a(this).addClass("highlight")}).on("touchend touchcancel",".list-item, .type-item",function(){a(this).removeClass("highlight")})}),define("js/product/recommend-for-you",["swiper","jquery","index"],function(e,t,n){var o,a=e("swiper"),i=e("jquery"),s=i(".recommend-for-you");i.get("/home/preference").then(function(e){s.html(e).show(),i("#swiper-recommend").length&&(o=new a("#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(),i.ajax({type:"POST",url:"/home/couponData",dataType:"html",data:{status:e,page:t},success:function(e){i("#employ").append(e),window.rePosFooter(),l.hideLoadingMask()}})}var a,i=e("jquery"),s=e("hammer"),r=e("mlellipsis"),l=e("js/plugin/loading"),d=0,c=1;r.init(),i(".yoho-footer").css("border-top","1px solid #e0e0e0"),i(".employ span").each(function(e){a=new s(i(".employ span")[e]),a.on("tap",function(t){i(".employ span").removeClass("active").eq(e).addClass("active"),i("#employ").html(" "),d=e,c=1,o(d,c),window.rePosFooter()})}),i(window).scroll(function(){return i(window).scrollTop()+i(window).height()>i("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"),a=o(".question-tab .tab-item");a.on("touchend",function(){var e=o(this).data("tab");e='[data-tab-name="'+e+'"]',a.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,a=e("jquery"),i=e("js/plugin/tip"),s=e("js/plugin/loading"),r=a(".action"),l=a(".add-address"),d=a("#yoho-footer"),c=a(".confim-mask"),u=a(".page-wrap"),h=a(".address-item");u.first().css("min-height",function(){return a(window).height()-a("#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(),a.ajax({method:"POST",url:"/home/delAddress",data:{id:o}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(i.show(e.message||"网络出了点问题~"),s.hideLoadingMask()):window.location.reload()}).fail(function(){i.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?(i.show("您最多添加5个收货地址"),!1):void 0}),r.on("touchend",".del",function(){o=a(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,a.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),i()):(l.append(n),i(l.find(".browse-record-good:gt("+(t-1)+") .lazy"))),window.rePosFooter(),h++,e&&e())},complete:function(){f=!1}}))}var a=e("jquery"),i=e("lazyload"),s=e("js/plugin/loading"),r=e("js/me/dialog"),l=a(".records"),d=a(".load-more"),c=d.children(".more"),u=d.children(".no-more"),h=0,p=!1,f=!1,m=a(window).height();s.init(),s.showLoadingMask(),o(s.hideLoadingMask),a(window).scroll(function(){p||m+a(window).scrollTop()>a(document).height()-.25*l.height()&&o()}),l.on("touchstart",".del-icon",function(){var e=a(this).closest(".browse-record-good"),t=e.data("skn");r.showDialog({dialogText:"确定删除此条浏览记录吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){a.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,a=e("jquery"),i=e("hammer"),s=e("js/plugin/tip"),r=e("js/plugin/security"),l=e("js/plugin/loading"),d=a(".edit-address"),c=a(".submit"),u=a(".my-edit-address-page"),h=a(".my-address-list-page"),p=a(".nav-back"),f=a(".nav-title"),m=a("input, textarea"),g=f.html(),v=a(".area"),w="edit",y=[];a(u,h).css("min-height",function(){return a(window).height()-a("#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:a(this).find('[name="consignee"]').val()?a(this).find('[name="mobile"]').val()?a(this).find('[name="area_code"]').val()&&a(this).find('[name="area"]').val()?a(this).find('[name="address"]').val()?(o=!0,l.showLoadingMask(),a.ajax({method:"POST",url:"/home/saveAddress",data:a(this).serialize()}).then(function(e){"object"!==a.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(){a(this).addClass("highlight")}).on("touchend touchcancel",function(){a(this).removeClass("highlight")}),a.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 i(t);n.on("tap",function(e){var t=a(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 i(t);n.on("tap",function(e){var t=a(e.target);y.push(t.children(".caption").text()),a('[name="area"]').val(y.join(" ")),a('[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(){a(this).addClass("highlight")}).on("touchend touchcancel","li",function(){a(this).removeClass("highlight")})}).fail(function(){s.show("获取省市区列表失败")})}),define("js/me/logistic",["jquery"],function(e,t,n){function o(){l+r>s?window.rePosFooter():i.css("border-top","1px solid #f1f1f1")}var a=e("jquery"),i=a("#yoho-footer"),s=window.outerHeight,r=document.body.offsetHeight,l=i.height();a(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 a(e,t){window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getBrandWCPayRequest",t,function(t){window.location.href="/home/orders/detail?order_code="+e})}function i(e){var t;void 0===typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",a,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",a),document.attachEvent("onWeixinJSBridgeReady",a)):p.ajax({type:"GET",url:"/shopping/pay/wechatwapapi?order_code="+e,dataType:"json",success:function(n){200===n.code?(t=n.data.jsApiParameters,a(e,t)):m.show("微信支付调取失败")},error:function(){m.show("请刷新本页面,完成微信支付")}})}function s(){var e=window.navigator.userAgent.toLowerCase();return e.indexOf("micromessenger")>0?!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(){i(v)}),f.showLoadingMask(),window.onload=h}),define("js/me/personal-details",["jquery"],function(e,t,n){var o,a=e("jquery"),i=a(".user-avatar"),s=new Image;o=i.data("avatar"),s.src=o,s.onload=function(){i.css("background-image","url("+o+")")}});