index.js
94.8 KB
define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","handlebars","source-map","index"],function(e,t,o){var n;e("js/common"),e("js/category/entry"),e("js/guang/entry"),e("js/home/entry"),e("js/index/entry"),e("js/passport/entry"),e("js/product/entry"),e("js/me/entry"),o.exports=n}),define("js/common",["jquery"],function(e,t,o){function n(e){var t,o,n=document.cookie;return document.cookie&&""!==document.cookie&&(o=n.indexOf(e+"="),o>-1&&(o+=e.length+1,t=decodeURIComponent(c.trim(n.substring(o,n.indexOf(";",o)))))),t}function i(e,t,o){var n,i,a,s,r="";"undefined"!=typeof t&&(o=o||{},null===t&&(t="",o.expires=-1),o.expires&&("number"==typeof o.expires||o.expires.toUTCString)&&("number"==typeof o.expires?(s=new Date,s.setTime(s.getTime()+24*o.expires*60*60*1e3)):s=o.expires,r="; expires="+s.toUTCString()),n=o.path?"; path="+o.path:"",i=o.domain?"; domain="+o.domain:"",a=o.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,n,i,a].join(""))}function a(){var e,t=n("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function s(){var e=a();return 0===e?0:e[1]}function r(){var e=n("_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-page"),p=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(e,t,o,n,i){var a=t.createElement(o),s=t.getElementsByTagName(o)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[i].p=arguments},a.async=1,a.src=n,s.parentNode.insertBefore(a,s)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.13.6.3/yas-debug.js","_yas"),function(){var e=s();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.13.6.3","yohobuy_m",e,"","")}(),p.on("touchstart","a",function(){p.find("a").removeClass("highlight"),c(this).addClass("highlight")}).on("touchend touchcancel","a",function(){c(this).removeClass("highlight")}),h.on("touchstart",".tap-hightlight",function(){c(this).siblings(".tap-hightlight").removeClass("highlight"),c(this).addClass("highlight")}).on("touchend touchcancel",".tap-hightlight",function(){c(this).removeClass("highlight")}),function(){var e,t,o=0,n="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(t=0;t<n.length&&(!i||!a);t++)e=n[t],i=i||window[e+"RequestAnimationFrame"],a=a||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];i&&a||(i=function(e,t){var n=(new Date).getTime(),i=Math.max(0,16-(n-o)),a=window.setTimeout(function(){e(n+i)},i);return o=n+i,a},a=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=a}(),c.extend({queryString:function(){var e,t,o=[],n=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(t=0;t<n.length;t++)e=n[t].split("="),o.push(e[0]),o[e[0]]=e[1];return o}}),window.cookie=n,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,o){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery"],function(e,t,o){var n=e("jquery"),i=n(".category-nav"),a=n(".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=n(".yoho-header"),t=n("#search-input"),o=n(window).height()-e.outerHeight()-t.outerHeight()-i.outerHeight();a.css("min-height",o),s.height(o)}(),n("#search-input").focus(function(){n(this).blur()}),i.bind("contextmenu",function(e){return!1}),n(".category-container").bind("contextmenu",function(e){return!1}),i.on("touchend touchcancel",function(e){var t=n(e.target).closest("li"),o=t.index();t.hasClass("focus")||(i.find("li.focus").removeClass("focus"),t.addClass("focus"),d.addClass("hide"),d=s.eq(o).removeClass("hide"))}),a.on("touchend",function(e){var t,o,i,a=n(e.target);if(o=a.closest(".p-level-item"),o.length>0){if(i=o.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"),n(this).addClass("highlight")}).on("touchend touchcancel","li",function(){n(this).removeClass("highlight")}),a.find(".sub-level").on("touchstart","li",function(){r.removeClass("highlight"),n(this).addClass("highlight")}).on("touchend touchcancel","li",function(){n(this).removeClass("highlight")}),i.on("touchstart","li",function(){i.find("li").removeClass("bytouch"),n(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,o){function n(){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={},o=0,n="";""!==e&&(p.each(c,function(o,n){p.isArray(n)&&p.each(n,function(n,i){i.name.toLowerCase().indexOf(e)>-1&&(t[o]=t[o]||[],t[o].push(i))})}),p.each(t,function(e,t){var i=['<div class="brand-list bar-',o,'">'];o++,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>"),n+=i.join("")})),p(".search-result").html(n),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(n)}),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,o){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,o){var n,i=e("jquery"),a=e("lazyload"),s=e("swiper"),r=i("#nav-tab > li"),l=i("#ps-content > .content");a(i("img.lazy")),n=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,o){var n,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(){n=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(n),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",o=r(e.target);"1"!==v&&(e.preventDefault(),o.hasClass("like")&&(t="cancel"),r.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:g,opt:t},success:function(e){200===e.code?o.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,o){function n(e){d(e.find("img.lazy")),e.each(function(){var e=s(this),t=e.find(".info-title"),o=e.find(".info-text");t[0].mlellipsis(2),o[0].mlellipsis(2)})}function i(e){var t;"undefined"!=typeof e&&(t=new r(e[0]),t.on("tap",function(e){var t,o,n=s(e.target),i="ok";return t=n.closest(".like-btn"),t.length>0?(e.preventDefault(),t.hasClass("like")&&(i="cancel"),o=n.closest(".guang-info"),void s.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:o.data("id"),opt:i},success:function(e){var o=e.code;200===o&&(t.next(".like-count").text(e.data),t.toggleClass("like"))},error:function(){c.show("网络断开连接了~")}})):(t=n.closest(".collect-btn"),void(t.length>0&&(e.preventDefault(),t.hasClass("collected")&&(i="cancel"),o=n.closest(".guang-info"),s.ajax({type:"POST",url:"/guang/opt/collectArticle",data:{id:o.data("id"),opt:i},success:function(e){e.code&&200===e.code&&t.toggleClass("collected")},error:function(){c.show("网络断开连接了~")}}))))}),n(e.find(".guang-info")))}function a(e,t,o){var i;m||t.end||(1===t.page&&u.showLoadingMask(),i=e.find(".guang-info").length,m=!0,s.ajax({type:"GET",url:o?o:"/guang/index/page",data:t,success:function(o){var a;return" "===o?(t.end=!0,m=!1,p.addClass("hide"),void f.removeClass("hide")):(e.append(o),a=i>0?e.find(".guang-info:gt("+(i-1)+")"):e.find(".guang-info"),n(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=n,t.loadMore=a}),define("js/plugin/tip",["jquery"],function(e,t,o){function n(e,t){var o,n;"undefined"!=typeof e&&(o=e.toString(),n=t&&t>0?t:2e3,i.text(o).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},n))}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=n}),define("js/plugin/loading",["jquery"],function(e,t,o){function n(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 i(){d||(n(),d=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,r=e("jquery"),l=r(".yoho-page"),d=!1;t.init=n,t.showLoadingMask=i,t.hideLoadingMask=a}),define("js/plugin/wx-share",["jquery"],function(e,t,o){var n=e("jquery");o.exports=function(){var e="http://www.yohoshow.com/api/wechat/getSignPackage";n.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var t,o,n,i;void 0!==e&&""!==e&&(t=e.appId.toString(),o=e.timestamp,n=e.nonceStr.toString(),i=e.signature.toString(),wx.config({debug:!1,appId:t,timestamp:o,nonceStr:n,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=n("#shareTitle").val(),t=n("#shareImg").val(),o=n("#shareDesc").val(),i=n("#shareLink").val(),a={title:e,desc:o,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,o){function n(){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"),o=a(this).hasClass("focus");w[t]={page:o?2:1,gender:e,type:t,end:!1}})}(),m.bind("contextmenu",function(e){return!1}),m.on("touchend touchcancel",function(e){var t,o,n=a(e.target).closest(".guang-nav-item");n.hasClass("focus")||(o=n.index(),n.addClass("focus"),g.removeClass("focus"),t=f.eq(o),g=n,v=n.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(n)}),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,o){function n(){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(n)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,t,o){function n(e){var t=e.offset().left,o=-C+t+y/2+"px";r.css({backgroundPosition:o+" bottom"}),v&&b.css({backgroundPosition:o+" bottom"})}function i(e){var t,o,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,o=t.find(".thumb").eq(p),b.find(".thumb.focus").removeClass("focus"),o.addClass("focus")),a.addClass("focus"),n(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,o,n,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(),o=s.outerHeight(),n=s.offset().top-d,void u.on("scroll",function(){var s=-this.y,r=i.className;n-e+t>=s?-1===r.indexOf("fixed-bottom")&&b.addClass("fixed-bottom").removeClass("hide"):n>=s?-1===r.indexOf("hide")&&b.addClass("hide").removeClass("fixed-bottom fixed-top"):n+o-t>=s?-1===r.indexOf("fixed-top")&&b.addClass("fixed-top").removeClass("hide absolute").css("top",""):n+o>=s?(-1===r.indexOf("absolute")&&b.addClass("absolute").removeClass("fixed-top hide"),i.style.top=n+d+o-t-s+"px"):s>n+o&&-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"})),n(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,o){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","hammer","swiper","lazyload","index"],function(e,t,o){function n(){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&&(T?(q.addClass("animate"),T=!1):(q.removeClass("animate"),T=!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"),T=!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 n(),!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?(n(),!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,o){function n(){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&&n()}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,o=c(e.target).closest("li"),n=c(".goods-list");e.preventDefault(),o.hasClass("focus")||(d=o.index(),o.addClass("focus"),l.removeClass("focus"),n.not(".hide").addClass("hide"),t=n.eq(d),t.removeClass("hide"),l=o,c(document).trigger("scroll"),e.srcEvent.stopPropagation())})),p.init(c(".maybe-like")),c(".maybe-like p").on("touchstart",function(e){n()}),c(window).scroll(function(){window.requestAnimationFrame(i)})}),define("js/index/entry",["jquery","hammer"],function(e,t,o){e("js/index/search"),e("js/index/footer"),e("js/index/channel")}),define("js/index/search",["jquery","hammer"],function(e,t,o){var n,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(".history-search"),f=a("#clear-history"),m=e("js/index/write-search"),g=m.getRanToken();n=new r(f[0]),n.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"))}),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,o,n="";if(localStorage&&(t=localStorage.getItem("historys"),t&&t.length>0)){for(t=t.split(g),o=t.length;o>0;o--)e=t[o-1],""!==e&&(n+='<li><a href="/?query='+e+'">'+e+"</li>");h.html(n),f.removeClass("hide"),p.removeClass("hide"),window.rePosFooter()}}(),m.bindWirteLocal(u)}),define("js/plugin/security",["jquery"],function(e,t,o){function n(e){var t,o,n,s=i("input[type!=hidden], textarea"),r=/['"<>&\|]|--/g,l=s.length,d=void 0===e||"boolean"!=typeof e?!0:e;for(o=0;l>o;o++)if(t=s.eq(o).val(),r.test(t))return d?s.eq(o).val(t.replace(r," ")):(n=t.match(r).join(" "),a.show("不可以输入 "+n+" 哦!")),!d&&!0;return!1}var i=e("jquery"),a=e("js/plugin/tip");t.hasDangerInput=n}),define("js/index/write-search",[],function(e,t,o){function n(){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=n,t.bindWirteLocal=i}),define("js/index/footer",["jquery","hammer"],function(e,t,o){function n(){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){n("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,o){var n=e("jquery"),i=e("js/plugin/security"),a=n(".search-box"),s=n(".box"),r=n(".index-search"),l=n(".index-logo"),d=n(".index-channel a"),c=a.children('input[type="text"]'),u=s.children(".no-search"),h=a.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}),a.children(".clear-text").on("touchstart",function(){c.val("").focus().trigger("input")}),a.children(".search-icon").on("touchstart",function(){return i.hasDangerInput()?!1:void r.submit()}),a.keyup(function(e){if(13===e.keyCode){if(i.hasDangerInput())return!1;r.submit()}}),n(".index-channel img").on("load error",function(){window.rePosFooter&&window.rePosFooter()}),d.on("touchstart",function(){d.css({background:"#000",color:"#fff",borderColor:"#fff"}),n(this).css({background:"rgba(255, 255, 255, 0.5)",color:"#000",borderColor:"#000"})}).on("touchend touchcancel",function(){n(this).css({background:"#000",color:"#fff",borderColor:"#fff"})})}),define("js/passport/entry",["jquery"],function(e,t,o){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,o){var n=e("jquery"),i=n("#phone-num"),a=n("#country-select"),s=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),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)?n.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,o){function n(e){var t,o=r(".has-eye");e&&"open"===e.status?o.append('<div class="eye"></div>'):o.append('<div class="eye close"></div>'),t=o.children(".eye"),t.on("touchstart",function(e){var t=r(this),o=t.siblings(".pwd");e.preventDefault(),t.toggleClass("close"),t.hasClass("close")?o.attr("type","password"):o.attr("type","text"),o.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 o=e.siblings(".input");o.val("").trigger("input").focus(),t.preventDefault()}),t.children(".input").bind("input",function(){var e=r(this),t=e.siblings(".clear-input"),o=l(e.val());""===o?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 o=navigator.userAgent;o.match(/uc/i)&&o.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}$/};o.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:n,bindClearEvt:i,pwdValidate:a,selectCssHack:s}}),define("js/passport/register/code",["jquery"],function(e,t,o){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,t,o){var n=e("jquery");o.exports=function(t,o){function i(){n.ajax({url:"/passport/bind/bindMobile",type:"post",data:{areaCode:f.replace("+",""),phoneNum:p,openId:h,sourceType:u,nickname:c,password:""},success:function(e){200===e.code?(g.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):g.show(e.message)},error:function(e){g.show("登录失败,请重试!")}})}function a(){var e,t=59;e=setInterval(function(){0===t?(l.text("重发验证码").removeClass("disable"),clearInterval(e)):l.text("重发验证码 ("+t--+"秒)")},1e3)}var s=n("#captcha"),r=n("#btn-next"),l=n("#captcha-tip"),d=parseInt(n("#isReg").val()),c=n("#nickname").val(),u=n("#sourceType").val(),h=n("#openId").val(),p=n("#phone-num").val(),f=n("#area-code").val().replace("+",""),m=e("js/passport/api"),g=e("js/plugin/tip"),v=n.trim,w=g.show,y=t?"reg":"back";m.bindClearEvt(),s.bind("input",function(){""!==v(s.val())?r.removeClass("disable"):r.addClass("disable")}),l.on("touchstart",function(){l.hasClass("disable")||n.ajax({type:"POST",url:o?"/passport/bind/sendBindMsg":"/passport/"+y+"/sendcode",data:{phoneNum:p,areaCode:f},success:function(e){200===e.code?(l.text("重发验证码 (60秒)").addClass("disable"),a()):w(e.message)}})}),r.on("touchstart",function(){r.hasClass("disable")||n.ajax({type:"POST",url:o?"/passport/bind/checkBindMsg":"/passport/"+y+"/verifycode",data:{phoneNum:p,areaCode:f,code:v(s.val()),token:n("#token").val()
},success:function(e){200===e.code?o?d?i():location.href="/passport/bind/password?phoneNum="+p+"&areaCode="+f+"&openId="+h+"&sourceType="+u+"&nickname="+c:location.href=e.data:w(e.message)}})}),a()}}),define("js/passport/register/password",["jquery"],function(e,t,o){var n=e("jquery"),i=n("#pwd"),a=n("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=n.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位,请重新输入"):n.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:n("#phone-num").val(),areaCode:n("#area-code").val(),token:n("#token").val()},success:function(e){var t;200===e.code?(t=e.data,d("注册成功"),n.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,o){function n(){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,n()}),l.bind("input",function(){p=""===g(l.val())?!1:!0,n()}),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,o;200===e.code?(t=e.data,s.ajax({url:t.session,dataType:"jsonp",success:function(){clearTimeout(o),setTimeout(function(){location.href=t.href},1e3)}}),o=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,o){function n(){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,n()}),l.bind("input",function(){var e=f(l.val());u=""===e?!1:!0,n()}),s.change(function(){r.text(s.val())}),d.on("touchstart",function(){var e=f(a.val()),t=s.val(),o=f(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),h.phoneRegx[t].test(e)&&h.pwdValidate(o)?i.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:t.replace("+",""),account:e,password:o},success:function(e){var t,o;200===e.code?(t=e.data,m("登录成功"),i.ajax({url:t.session,dataType:"jsonp",success:function(){clearTimeout(o),setTimeout(function(){location.href=t.href},1e3)}}),o=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,o){var n=e("jquery"),i=n("#phone-num"),a=n("#country-select"),s=n("#area-code"),r=n("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=n.trim,u=d.show;l.selectCssHack(n("#country-select")),l.bindClearEvt(),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)?n.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,o){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,t,o){var n=e("jquery"),i=n("#email"),a=n("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=n.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)?n.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["jquery"],function(e,t,o){var n=e("jquery"),i=n("#resend"),a=e("js/plugin/tip"),s=a.show;i.on("touchstart",function(e){e.preventDefault(),n.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,o){var n=e("jquery"),i=n("#pwd"),a=n("#btn-ok"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=n.trim,d=r.show,c=n("#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,o=l(i.val()),r=!0;a.hasClass("disable")||(e={password:o},0===c.length&&(r=!1),r?(n.extend(e,{phoneNum:c.val(),areaCode:n("#areaCode").val(),token:n("#token").val()}),t="/passport/back/passwordByMobile"):(n.extend(e,{code:n("#email-code").val()}),t="/passport/back/passwordByEmail"),s.pwdValidate(o)?n.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,o){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,o){function n(e){var t,o,n,i,a,u,f={};if(!d){if(e){for(o in T)T.hasOwnProperty(o)&&(T[o].reload=!0);switch(q.children(".active").removeClass("active"),E.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(E.hasClass("today")?(i="today",a=1):E.hasClass("week")?(i="week",a=2):E.hasClass("sale")&&(i="sale",a=3),n=T[i],u=n.page+1,n.reload)u=1;else if(n.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,o;switch(i){case"today":t=s;break;case"week":t=r;break;case"sale":t=l}" "===e?(n.end=!0,n.reload&&t.html(y)):n.reload?(t.html(e),h(t.find(".lazy"))):(o=t.find(".good-info").length,t.append(e),h(t.find(".good-info:gt("+(o-1)+") .lazy"))),n.reload=!1,n.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!==E&&n()}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/query-param"),C=c.extend({},b),j=new Date,x=j.getMonth()+1,k=j.getDate(),q=c("#list-nav"),T={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},E=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:n,hCbFn:function(){E.addClass("active"),E.siblings(".filter").removeClass("active")}})}}),h(c(".lazy")),q.bind("contextmenu",function(e){return!1}),q.on("touchend touchcancel",function(e){var t,o,i,a=c(e.target).closest("li");if(e.preventDefault(),a.hasClass("filter"))a.hasClass("active")?(f.hideFilter(),E.addClass("active"),a.removeClass("active")):(E=a.siblings(".active"),E.removeClass("active"),a.addClass("active"),f.showFilter());else{if(a.hasClass("today")?o="today":a.hasClass("week")?o="week":a.hasClass("sale")&&(o="sale"),t=T[o],!a.hasClass("active")){if(i=a.siblings(".active"),E=a,i.hasClass("filter"))f.hideFilter();else{switch(g.children(".container:not(.hide)").addClass("hide"),o){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&&n()}e.stopPropagation()}),c(window).scroll(function(){window.requestAnimationFrame(i)}),n(),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,o){function n(){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,o,n=e.closest(".sub-classify"),i=n.siblings(".shower");return e.hasClass("chosed")?n:(n.children(".chosed").removeClass("chosed"),e.addClass("chosed"),t=g.trim(e.html()),o=g.trim(i.html()),i.html(o.substring(0,o.indexOf("</span>")+7)+t.substring(0,t.indexOf("<i"))),0===e.index()?i.addClass("default"):i.removeClass("default"),n)}function d(e){var t,o=e.data("id");t=l(e),p&&p({type:t.data("type"),id:o}),n()}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,o=g(e.target);e.preventDefault(),o.closest(".filter-body").length>0?(t=o.closest(".sub-item"),t.length>0?(t=o.closest("li"),d(t)):(t=o.closest(".classify-item"),e.srcEvent.stopPropagation(),r(t))):(n(),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=n,t.resetFilter=u}),define("js/product/query-param",["jquery"],function(e,t,o){var n=e("jquery"),i={};n(".query-param").each(function(){var e=n(this);i[e.data("attr")]=e.val()}),o.exports=i}),define("js/product/suspend-cart",["jquery"],function(e,t,o){var n=e("jquery"),i=n("#suspend-cart");n.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,o){function n(e){var t,o,n,i,a,l={};if(!s){if(e){for(o in j)j.hasOwnProperty(o)&&(j[o].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"),n=j[i],a=n.page+1,n.reload)a=1;else if(n.end)return;r.extend(l,b,{type:i,order:n.order,page:a}),s=!0,h.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var t,o;switch(i){case"newest":t=m;break;case"price":t=g;break;case"discount":t=v}" "===e?(n.end=!0,n.reload&&t.html(y)):n.reload?(t.html(e),d(t.find(".lazy"))):(o=t.find(".good-info").length,t.append(e),d(t.find(".good-info:gt("+(o-1)+") .lazy"))),n.reload=!1,n.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&&n()}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/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&&(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:n,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,o,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")?o="newest":a.hasClass("price")?o="price":a.hasClass("discount")&&(o="discount"),t=j[o],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"),o){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&&n()}e.stopPropagation()}}),r(window).scroll(function(){window.requestAnimationFrame(i)}),n(),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,o){function n(e){var t,o,n,i,s,r={};if(!a){if(e){for(o in I)I.hasOwnProperty(o)&&(I[o].reload=!0);switch(E.children(".active").removeClass("active"),z.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(T,t)}if(z.hasClass("new")?i="newest":z.hasClass("price")?i="price":z.hasClass("discount")&&(i="discount"),n=I[i],s=n.page+1,n.reload)s=1;else if(n.end)return;d.extend(r,T,{type:i,order:n.order,page:s}),a=!0,v.showLoadingMask(),d.ajax({type:"GET",url:"/index/search/search",data:r,success:function(e){var t,o,r='<p class="no-result">未找到相关搜索结果</p>';switch(i){case"newest":o=y;break;case"price":o=b;break;case"discount":o=C}if(" "===e?(n.end=!0,n.reload&&o.html(r)):n.reload?(o.html(e),u(o.find(".lazy"))):(t=o.find(".good-info").length,o.append(e),u(o.find(".good-info:gt("+(t-1)+") .lazy"))),n.reload=!1,n.page=s,a=!1,v.hideLoadingMask(),window.rePosFooter(),window._yas)switch(i){case"newest":window._yas(1*new Date,"1.0.13.6.3","yohobuy_m",window._ozuid,"",".new-goods .good-info .good-detail-img .good-thumb");break;case"price":window._yas(1*new Date,"1.0.13.6.3","yohobuy_m",window._ozuid,"",".new-goods .good-info .good-detail-img .good-thumb");break;case"discount":window._yas(1*new Date,"1.0.13.6.3","yohobuy_m",window._ozuid,"",".new-goods .good-info .good-detail-img .good-thumb")}}})}}function i(){d(window).scrollTop()+j>d(document).height()-.25*w.height()&&n()}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"),T=e("js/product/query-param"),E=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}},z=E.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:T,success:function(e){w.append(e),f.initFilter({fCbFn:n,hCbFn:function(){z.addClass("active"),z.siblings(".filter").removeClass("active")}})}}),u(d(".lazy")),m.bindWirteLocal(d("#search-form")),E.bind("contextmenu",function(e){return!1}),E.on("touchend touchcancel",function(e){var t,o,i,a=d(e.target).closest("li");if(a.hasClass("filter"))a.hasClass("active")?(f.hideFilter(),z.addClass("active"),a.removeClass("active")):(z=a.siblings(".active"),z.removeClass("active"),a.addClass("active"),f.showFilter());else{if(a.hasClass("new")?o="newest":a.hasClass("price")?o="price":a.hasClass("discount")&&(o="discount"),t=I[o],a.hasClass("active")){if(a.hasClass("new"))return;(a.hasClass("price")||a.hasClass("discount"))&&(a.find(".icon > .iconfont").toggleClass("cur"),z=a,t.reload=!0,t.order=0===t.order?1:0)}else{if(i=a.siblings(".active"),z=a,i.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),o){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&&n()}}),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,o=d(e.target).closest(".btn-col"),n=h.data("id");t=o.hasClass("coled")?"cancel":"ok",d.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:n,opt:t},success:function(e){200===e.code?(o.toggleClass("coled"),"ok"===t?g.show("添加收藏成功"):g.show("取消收藏成功")):400===e.code?location.href=e.data:g.show(e.message)},error:function(){g.show("网络断开连接了~")}})})),n(),E.on("touchstart","li",function(){E.find("li").removeClass("bytouch"),d(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){E.find("li").removeClass("bytouch")})}),define("js/product/detail/detail",["jquery","swiper","hammer","lazyload","index"],function(e,t,o){function n(){var e=a(".cart-bar"),t=setInterval(function(){e?(window.reMarginFooter(".cart-bar"),clearInterval(t)):e=a(".cart-bar")},200)}var i,a=e("jquery"),s=e("swiper"),r=e("hammer"),l=e("lazyload"),d=a(".goodsDiscount .discount-folder"),c=a(".goodsDiscount .first-item span"),u=document.getElementById("goodsDiscount"),h=u&&new r(u),p=a(u).find(".first-item"),f=a(".cart-bar");n(),l(a("img.lazy")),i=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")?(p.removeClass("short-text"),c.removeClass("icon-down").addClass("icon-up").html(""),d.slideDown()):(p.addClass("short-text"),c.removeClass("icon-up").addClass("icon-down").html(""),d.slideUp())}),e("js/product/detail/desc"),e("js/product/detail/comments-consults"),e("js/product/recommend-for-you-product-desc"),a.ajax({type:"GET",url:"/cart/index/count",success:function(e){200===e.code&&f.find(".num-tag").html(e.data.cart_goods_count).removeClass("hide")}}),a(".good-detail-page").length>0&&a("#yoho-footer").css("border-top","1px solid #e0e0e0"),e("js/product/detail/like")}),define("js/product/detail/desc",["jquery","lazyload","swiper","index"],function(e,t,o){function n(e){var t,o;e.length>0&&(t=e[0].getBoundingClientRect().right,o=e.find(".swiper-slide:last-child")[0].getBoundingClientRect().right,0>o-t?e.next(".tips").css("display","none"):e.next(".tips").css("display","block"))}function i(e,t){var o=null;c(e).each(function(n,i){o=c(e).slice(n,n+t),o.length===t&&n%t===0&&c(o).wrapAll(c('<div class="js-wraper"></div>'))})}function a(){v||w||(v=!0,p.showLoadingMask(),c.ajax({type:"GET",url:m,success:function(e){r=c("#productDesc"),r.append(e),window.rePosFooter(),u(r.find("img.lazy")),l=new h("#size-swiper-container",{slidesPerView:"auto"}),d=new h("#reference-swiper-container",{slidesPerView:"auto"}),n(c("#size-swiper-container")),n(c("#reference-swiper-container")),i(".detail .column",2),v=!1,w=!0,p.hideLoadingMask()},error:function(){f.show("网络断开连接了~"),v=!1,p.hideLoadingMask()}}))}function s(){(!w||c(window).scrollTop()+g>=c(document).height()-200)&&a()}var r,l,d,c=e("jquery"),u=e("lazyload"),h=e("swiper"),p=e("js/plugin/loading"),f=e("js/plugin/tip"),m=c("#introUrl").val(),g=c(window).height(),v=!1,w=!1;c(window).scroll(function(){window.requestAnimationFrame(s)})}),define("js/product/detail/comments-consults",["jquery","hammer"],function(e,t,o){var n,i,a=e("jquery"),s=e("js/plugin/tip"),r=e("hammer"),l=document.getElementById("nav-tab"),d=l&&new r(l),c=document.getElementById("goto-consult"),u=c&&new r(c);!function(){i=a("#nav-tab .consults-num").html()-0,n=a("#nav-tab .comments-num").html()-0,a("#nav-tab li").each(function(){a(this).removeClass("focus")}),a("#feedback-content .content").each(function(){a(this).addClass("hide")}),0!==n?(a("#nav-tab .comment-nav").addClass("focus"),a("#feedback-content .comment-content").removeClass("hide")):0!==i&&(a("#nav-tab .consult-nav").addClass("focus"),a("#feedback-content .consult-content").removeClass("hide"))}(),d&&d.on("tap",function(e){var t=a(e.target).closest("li"),o=t.index();t.hasClass("comment-nav")&&0===n?s.show("暂无商品评价"):t.hasClass("focus")||(a("#nav-tab li").each(function(){a(this).removeClass("focus")}),a("#feedback-content .content").each(function(){a(this).addClass("hide")}),t.addClass("focus"),a("#feedback-content .content:eq("+o+")").removeClass("hide"))}),u&&u.on("tap",function(){location.href=a(c).data("href")}),a(".goods-consults-page").length>0&&a("#yoho-header").css("position","fixed").css("top","0")}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,t,o){function n(){h||u||(h=!0,d&&r.get(d).then(function(e){e.length<5?l.css("display","none"):(l.html(e).show(),r("#swiper-recommend").length&&(a=new s("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0}))),h=!1,u=!0,window.rePosFooter()}).fail(function(){l.hide()}))}function i(){(!u||r(window).scrollTop()+c>=r(document).height()-200)&&n()}var a,s=e("swiper"),r=e("jquery"),l=r(".recommend-for-you"),d=r("#preferenceUrl").val(),c=r(window).height(),u=!1,h=!1;r(window).scroll(function(){window.requestAnimationFrame(i)})}),define("js/product/detail/like",["jquery","hammer"],function(e,t,o){var n=e("jquery"),i=e("hammer"),a=e("js/plugin/tip"),s=e("js/cart/chose-panel"),r=document.getElementById("likeBtn"),l=r&&new i(r),d=document.getElementById("addtoCart"),c=d&&new i(d),u=n("#productId").val();l&&l.on("tap",function(e){var t,o,i=n(e.target);i.hasClass("liked")?(t="cancel",o=0):(t="ok",o=1),n.ajax({type:"POST",url:"/product/opt/favoriteProduct",data:{id:u,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)},error:function(){a.show("网络断开连接了~")}}),window._yas&&window._yas.sendCustomInfo({pd:u,fa:o},!0)}),c&&c.on("tap",function(e){s.show(),window._yas&&window._yas.sendCustomInfo({pd:u,by:1},!0)})}),define("js/cart/chose-panel",["jquery"],function(e,t,o){function n(){c(".chose-panel").show(),c("body").css("overflow","hidden"),a=c("#good-num")}function i(){c(".chose-panel").hide(),c("body").css("overflow","auto")}var a,s,r,l,d,c=e("jquery"),u=e("js/plugin/tip"),h=e("js/plugin/loading"),p=/\d+/,f=c(".color-list ul>li"),m=c(".size-list ul>li"),g=f.eq(0).data("id");m.each(function(){l=c(this).data("colorid"),l===g&&c(this).removeClass("hide")}),c(".yoho-page").on("touchstart",".chose-panel",function(e){var t=c(e.target);t.closest(".main").length>0||i()}).on("touchstart","#chose-btn-sure",function(){var e,t,o=c("#good-num").val()-0,n=0,a=c(".num-tag").html()-0;if(s=c(".block-list>ul>li.chosed"),2===s.length&&0===s.closest(".zero-stock").length){if(e=m.closest(".chosed").data("skuid"),t=c('[data-id="'+e+'"]').closest(".advance-block").data("promotion-id"),d)return!1;d=!0,h.showLoadingMask(),c.ajax({method:"POST",url:"/cart/index/add",data:{productSku:e,buyNumber:o,promotionId:t,isEdit:n}}).done(function(e){200===e.code&&(h.hideLoadingMask(),c(".num-tag").html(a+o),c(".num-tag").removeClass("hide"),d=!1,i())}).fail(function(){u.show("网络出了点问题~"),d=!1})}}).on("touchstart",".block",function(e){var t,o,n,i=c(this),a=c(e.target).closest(".chose-items"),r=i.closest(".block-list").siblings(":first"),d=(i.data("numstr")+"").split("/");if(i.siblings(".chosed").removeClass("chosed"),i.toggleClass("chosed"),o=i.index(),s=c(".block-list>ul>li.chosed"),i.closest(".block-list").hasClass("color-list")&&c(".chose-panel").find(".thumb").addClass("hide").eq(o).removeClass("hide"),0===s.length)i.closest("ul>li").each(function(){c(this).removeClass("zero-stock"),0===c(this).data("num")-0&&c(this).addClass("zero-stock")}),r.find("ul>li").each(function(){c(this).removeClass("zero-stock"),0===c(this).data("num")-0&&c(this).addClass("zero-stock")});else if(1===s.length&&i.hasClass("chosed"))for(i.closest(".block-list").hasClass("color-list")&&(m.addClass("hide"),m.each(function(){l=c(this).data("colorid"),l===i.data("id")&&c(this).removeClass("hide")})),t=(s.data("numstr")+"").split("/"),r.find(".block").removeClass("zero-stock"),n=0;n<t.length;n++)0===t[n]-0&&r.find(".block").eq(n).addClass("zero-stock");else if(1!==s.length||i.hasClass("chosed")){if(2===s.length){for(r.find(".block").removeClass("zero-stock"),n=0;n<d.length;n++)0===d[n]-0&&r.find(".block").eq(n).addClass("zero-stock");t=r.find(".chosed").data("numstr").split("/"),a.find(".num .left-num").html("剩余"+t[o]+"件"),2===s.closest(".zero-stock").length?(c("#chose-btn-sure").css("background-color","#c0c0c0"),c("#chose-btn-sure").html("已售罄")):(c("#chose-btn-sure").css("background-color","#eb0313"),c("#chose-btn-sure").html("确定"))}}else c("#chose-btn-sure").css("background-color","#eb0313"),c("#chose-btn-sure").html("确定"),r.find("ul>li").each(function(){c(this).removeClass("zero-stock"),0===c(this).data("num")-0&&c(this).addClass("zero-stock")}),a.find(".num .left-num").html("")}).on("touchstart",".btn-minus",function(){var e=+a.val(),t=c(".block-list>ul>li.chosed"),o=p.exec(c(".num .left-num").html());t.length<2||1!==e&&0!==o-0&&a.val(e-1)}).on("touchstart",".btn-plus",function(){var e=+a.val();c(".block-list>ul>li.chosed").length<2||(r=p.exec(c(".num .left-num").html()),e-0!==r-0&&0!==r-0&&a.val(e+1))}),t.show=n}),define("js/product/detail/consultform",["jquery"],function(e,t,o){var n,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 n?!1:(e=d.val(),e&&"请输入咨询内容"!==e?(n=!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||"网络出了点问题~"),n=!1,s.hideLoadingMask()):(a.show("提交成功~"),setTimeout(function(){window.history.go(-1)},3e3))}).fail(function(){a.show("网络出了点问题~"),n=!1}),!1):(a.show("咨询内容不能为空"),!1))})}),define("js/product/newsale/hot-rank",["jquery","swiper","lazyload","index"],function(e,t,o){function n(e,t,o,n){h.showLoadingMask(),d.ajax({type:"GET",url:"/product/newsale/selectHotrank?"+t,dataType:"html",data:{page:e,tab_id:o,notab:n},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,n(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>';e("js/product/suspend-cart"),d(window).scroll(function(){window.requestAnimationFrame(i)}),n(p,m,g,f),d("#hotRank").on("touchend touchcancel",function(e){var t=t||window.event,o=t.target||t.srcElement;"span"===o.nodeName.toLowerCase()&&(d(".s-goods-nav .nav-item").removeClass("active"),o.parentNode.className="active "+o.parentNode.className,g=o.getAttribute("data-id")?o.getAttribute("data-id"):"",m=o.getAttribute("data-sort")?o.getAttribute("data-sort"):"",p=1,f=1,n(p,m,g,f))}),d("#hotRank").bind("contextmenu",function(e){return!1}),d("#hotRank").on("touchstart",function(e){var t=t||window.event,o=t.target||t.srcElement;"span"===o.nodeName.toLowerCase()&&(o.parentNode.className="bgActive "+o.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,o){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"),e("js/me/currency")}),define("js/me/order",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,o){
function n(e){var t={type:p,page:f.page+1},o=e&&!e.noLoadingMask;m||(m=!0,o&&g.showLoadingMask(),s.ajax({type:"GET",url:"/home/getOrders",data:t,success:function(e){var n;" "!==e?(f.page=t.page,1===t.page?(u.html(e),l(u.find(".lazy"),{try_again_css:"order-failure"})):(n=u.children(".order").length,u.append(e),l(u.children(".order:gt("+(n-1)+")").find(".lazy"),{try_again_css:"order-failure"})),window.rePosFooter()):f.end=!0,m=!1,o&&g.hideLoadingMask()}}))}function i(){f.end===!1&&s(window).scrollTop()+h>s(document).height()-.25*c.height()&&n({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({try_again_css:"order-failure"}),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,o,n,i=s(e.target);i.closest(".locHref").length>0||(t=i.closest(".order"),o=t.data("id"),i.closest(".del").length>0?v.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/delOrder",data:{id:o},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:o},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(".order-goods").length>0&&(n=t.data("href"),location.href=n))}),s(window).scroll(function(){window.requestAnimationFrame(i)}),n()}),define("js/me/dialog",["jquery","handlebars","source-map","hammer"],function(e,t,o){var n,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 o,i,r,d=a(e);s(".dialog-wrapper").remove(),s("body").append(s(d)),o=s(".dialog-box"),n=s(".dialog-wrapper"),r=new l(document.getElementById("dialog-wrapper")),e.fast?n.css({display:"block"}):n.fadeIn(),o.css({top:"50%",marginTop:-(o.height()/2)}),e.autoHide&&(i=1e3,e.autoHide>1&&(i=e.autoHide),setTimeout(function(){n.fadeOut()},i)),r.on("tap",function(e){s(e.target).hasClass("dialog-left-btn")?n.fadeOut():s(e.target).hasClass("dialog-right-btn")&&t()})}}),define("js/me/order-detail",["jquery","lazyload","hammer","handlebars","source-map"],function(e,t,o){var n,i=e("jquery"),a=e("lazyload"),s=e("hammer"),r=e("js/me/dialog"),l=e("js/plugin/tip"),d=i("#order-detail").data("id");a({try_again_css:"order-failure"}),n=new s(document.getElementsByClassName("opt")[0]),n.on("tap",function(e){var t=i(e.target);t.hasClass("btn-del")?r.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){i.ajax({type:"GET",url:"/home/delOrder",data:{id:d}}).then(function(e){i("#dialog-wrapper").hide(),e||l.show("网络错误"),200===e.code?l.show("删除成功"):l.show(e.message||"网络错误"),window.location.href="/home/orders"}).fail(function(){l.show("网络错误")})}):t.hasClass("btn-cancel")&&r.showDialog({dialogText:"确定取消订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){i.ajax({type:"GET",url:"/home/cancelOrder",data:{id:d}}).then(function(e){i("#dialog-wrapper").hide(),e||l.show("网络错误"),200===e.code?l.show("取消成功"):l.show(e.message||"网络错误"),window.location.href="/home/orders"}).fail(function(){l.show("网络错误")})})})}),define("js/me/fav",["jquery","hammer","swiper","handlebars","source-map","index"],function(e,t,o){function n(e){p.filter(".active").removeClass("active"),p.eq(e).addClass("active"),f.filter(".show").removeClass("show"),f.eq(e).addClass("show")}function i(e){var t,o,n=/container-(\d+)['"]{1}/gi,i=/\d+/,a=e.match(n),s=a.length;for(t=0;s>t;t++)o=a[t].match(i)[0],m[o]=new u("#swiper-container-"+o,{slidesPerView:"auto",grabCursor:!0,slideElement:"li",wrapperClass:"swiper-wrapper-"+o,lazyLoading:!0,watchSlidesVisibility:!0})}function a(e,t,o){"favBrand"===t?q=!0:k=!0,d.ajax({method:"post",url:"/home/"+t,data:{page:o},success:function(o){"favBrand"===t?v.addClass("hide"):g.addClass("hide")," "===o?(e.closest(".fav-type").find(".fav-content-loading").addClass("hide"),e.closest(".fav-type").find(".fav-null-box").removeClass("hide")):"end"===o?e.closest(".fav-type").find(".fav-load-background").removeClass("fav-load-background").html("没有更多了"):o.length>10&&(e.append(o),e.closest(".fav-type").find(".fav-content-loading").remove(),"favBrand"===t?(i(o),q=!1):k=!1),window.rePosFooter()}})}function s(){d(window).scrollTop()+w>=d(document).height()-.25*C.height()-y&&(T?(v.filter(".hide").removeClass("hide"),q||(x++,a(C,"favBrand",x))):(g.filter(".hide").removeClass("hide"),k||(j++,a(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(".fav-load-more"),v=d(".fav-brand-load-more"),w=d(window).height(),y=d("#yoho-footer").height(),b=d(".fav-product-list"),C=d(".fav-brand-swiper-wrapper"),j=1,x=1,k=!0,q=!0,T=!1;d("#fav-tab").hasClass("brand-tab")?(n(1),a(C,"favBrand",1),T=!0,window.rePosFooter()):(n(0),a(b,"favProduct",1),T=!1,window.rePosFooter()),r=new c(document.getElementById("fav-tab")),r.on("tap",function(e){var t,o=d(e.target).closest("li");0===o.length||o.hasClass("active")||(t=o.index(),0===t?(T=!1,0===b.find("li").length&&b.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(b,"favProduct",1)):(T=!0,0===C.find("div").length&&C.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(C,"favBrand",1)),n(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(s),d(document).on("touchend",".swiper-header",function(){var e=d(this).find(".fav-more").attr("href");window.location.href=e})}),define("js/me/suggest",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,o){var n,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.upload"),a='{{# imgList}}<li>{{# imgUrl}}<img src="{{.}}" /><span class="upload-img-remove"></span>{{/ imgUrl}}</li>{{/ imgList}}',s=c.compile(a),r("#upload-img").upload({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(),n=new l(document.getElementById("yoho-header")),n.on("tap",function(e){var t=r("#suggest-textarea").val(),o=/\S+/;if(r(e.target).hasClass("nav-btn")){if(!o.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.upload",["jquery"],function(e,t,o){var n=e("jquery");!function(e){var t={init:function(o){return this.each(function(){var n=e(this);n.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=n.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},o);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 o=a.inputTemplate.clone(),i=o.name="input"+a.inputCount++;s.multi&&o.attr("multiple",!0),s.fileType&&o.attr("accept",s.fileType),o.bind("change",function(){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var o=this.files.length;if(a.queue.selected=o,a.queue.count+o>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(n,"QUEUE_LIMIT_EXCEEDED");else{for(var r=0;o>r;r++)file=this.files[r],a.addQueueItem(file);a.inputs[i]=this,a.createInput()}s.auto&&t.upload.call(n),"function"==typeof s.onSelect&&s.onSelect.call(n,a.queue)}),a.currentInput&&a.currentInput.hide(),a.button.append(o),a.currentInput=o},a.destroyInput=function(t){e(a.inputs[t]).remove(),delete a.inputs[t],a.inputCount--},a.drop=function(o){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var i=o.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(n,"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(n),"function"==typeof s.onDrop&&s.onDrop.call(n,i.files,i.files.length),o.preventDefault(),o.stopPropagation()},a.fileExistsInQueue=function(e){for(var t in a.inputs){input=a.inputs[t],limit=input.files.length;for(var o=0;o<limit;o++)if(existingFile=input.files[o],existingFile.name==e.name&&!existingFile.complete)return!0}return!1},a.removeExistingFile=function(e){for(var o in a.inputs){input=a.inputs[o],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(n,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(o){if(e.inArray("onAddQueueItem",s.overrideEvents)<0){a.removeExistingFile(o),o.queueItem=a.queueItem.clone(),o.queueItem.attr("id",s.id+"-file-"+a.fileID++),o.queueItem.find(".close").bind("click",function(){return t.cancel.call(n,o),!1});var i=o.name;i.length>s.truncateLength&&0!=s.truncateLength&&(i=i.substring(0,s.truncateLength)+"..."),o.queueItem.find(".filename").html(i),o.queueItem.data("file",o),a.queueEl.append(o.queueItem)}"function"==typeof s.onAddQueueItem&&s.onAddQueueItem.call(n,o),o.size>s.fileSizeLimit&&0!=s.fileSizeLimit?a.error("FILE_SIZE_LIMIT_EXCEEDED",o):(a.queue.queued++,a.queue.count++)},a.removeQueueItem=function(t,o,n){n||(n=0);var i=o?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(n).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 o=0;o<limit;o++)file=input.files[o],file.skip||file.complete||e++}return e},a.checkExists=function(o){if(e.inArray("onCheck",s.overrideEvents)<0){e.ajaxSetup({async:!1});var i=e.extend(s.formData,{filename:o.name});if(e.post(s.checkScript,i,function(e){o.exists=parseInt(e)}),o.exists&&!confirm("A file named "+o.name+" already exists in the upload folder.\nWould you like to replace it?"))return t.cancel.call(n,o),!0}return"function"==typeof s.onCheck&&s.onCheck.call(n,o,o.exists),!1},a.uploadFile=function(t,o){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,o):a.error(t.xhr.responseText,t,o):404==this.status?a.error("404_FILE_NOT_FOUND",t,o):403==this.status?a.error("403_FORBIDDEN",t,o):a.error("Unknown Error",t,o))}),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 n=this.status;404==n?a.error("404_FILE_NOT_FOUND",t,o):"Invalid file type."!=t.xhr.responseText?a.uploadComplete(e,t,o):a.error(t.xhr.responseText,t,o)},!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(n,t),xhr.sendAsBinary(c)},l.readAsBinaryString(t)}},a.progress=function(t,o){if(e.inArray("onProgress",s.overrideEvents)<0){if(t.lengthComputable)var i=Math.round(t.loaded/t.total*100);o.queueItem.find(".fileinfo").html(" - "+i+"%"),o.queueItem.find(".progress-bar").css("width",i+"%")}"function"==typeof s.onProgress&&s.onProgress.call(n,o,t)},a.error=function(o,i,r){if(e.inArray("onError",s.overrideEvents)<0){switch(o){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(n,o,i),i.skip=!0,"404_FILE_NOT_FOUND"==o?a.uploads.errors++:a.queue.errors++,r&&t.upload.call(n,null,!0)},a.uploadComplete=function(o,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(n,i,i.xhr.responseText),s.removeCompleted&&setTimeout(function(){t.cancel.call(n,i)},3e3),i.complete=!0,a.uploads.successful++,a.uploads.count++,a.uploads.current--,delete i.xhr,r&&t.upload.call(n,null,!0)},a.queueComplete=function(){"function"==typeof s.onQueueComplete&&s.onQueueComplete.call(n,a.uploads)},!(window.File&&window.FileList&&window.Blob&&(window.FileReader||window.FormData)))return"function"==typeof s.onFallback&&s.onFallback.call(n),!1;if(s.id="uploadifive-"+n.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}),n.before(a.button).appendTo(a.button).hide(),a.createInput.call(n),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 o=Array.prototype.map.call(e,t),n=new Uint8Array(o);this.send(n.buffer)}),"function"==typeof s.onInit&&s.onInit.call(n)})},debug:function(){return this.each(function(){console.log(e(this).data("uploadifive"))})},clearQueue:function(){this.each(function(){var o=e(this),n=o.data("uploadifive"),a=n.settings;for(var s in n.inputs)for(input=n.inputs[s],limit=input.files.length,i=0;i<limit;i++)file=input.files[i],t.cancel.call(o,file);"function"==typeof a.onClearQueue&&a.onClearQueue.call(o,e("#"+n.settings.queueID))})},cancel:function(o,n){this.each(function(){var i=e(this),a=i.data("uploadifive"),s=a.settings;"string"==typeof o&&(isNaN(o)||(fileID="uploadifive-"+e(this).attr("id")+"-file-"+o),o=e("#"+fileID).data("file")),o.skip=!0,a.filesCancelled++,o.uploading&&(a.uploads.current--,o.uploading=!1,o.xhr.abort(),delete o.xhr,t.upload.call(i)),e.inArray("onCancel",s.overrideEvents)<0&&a.removeQueueItem(o,n),"function"==typeof s.onCancel&&s.onCancel.call(i,o)})},upload:function(t,o){this.each(function(){var n=e(this),i=n.data("uploadifive"),a=i.settings;if(t)i.uploadFile.call(n,t);else if(i.uploads.count+i.uploads.current<a.uploadLimit||0==a.uploadLimit){if(!o){i.uploads.attempted=0,i.uploads.successsful=0,i.uploads.errors=0;var s=i.filesToUpload();"function"==typeof a.onUpload&&a.onUpload.call(n,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(n,"UPLOAD_LIMIT_EXCEEDED",i.filesToUpload()))})},destroy:function(){this.each(function(){var o=e(this),n=o.data("uploadifive"),i=n.settings;t.clearQueue.call(o),i.queueID||e("#"+i.queueID).remove(),o.siblings("input").remove(),o.show().insertBefore(n.button),n.button.remove(),"function"==typeof i.onDestroy&&i.onDestroy.call(o)})}};e.fn.upload=function(o){return t[o]?t[o].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof o&&o?void e.error("The method "+o+" does not exist in $.uploadify"):t.init.apply(this,arguments)}}(n)}),define("js/me/index",["jquery","swiper","index"],function(e,t,o){var n,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"),n=a.data("avatar"),r.src=n,r.onload=function(){a.css("background-image","url("+n+")")},i(".yoho-page").on("touchstart",".list-item, .type-item, .order-title",function(){s.removeClass("highlight"),i(this).addClass("highlight")}).on("touchend touchcancel",".list-item, .type-item, .order-title",function(){i(this).removeClass("highlight")})}),define("js/product/recommend-for-you",["swiper","jquery","index"],function(e,t,o){var n,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&&(n=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,o){function n(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,n(d,c),window.rePosFooter()})}),a(window).scroll(function(){return a(window).scrollTop()+a(window).height()>a("body").height()-1?(c++,void n(d,c)):void 0}),n(d,c)}),define("js/me/online-service",["jquery"],function(e,t,o){var n=e("jquery"),i=n(".question-tab .tab-item");i.on("touchend",function(){var e=n(this).data("tab");e='[data-tab-name="'+e+'"]',i.removeClass("current"),n(this).addClass("current"),n(".question-list").removeClass("current"),n(e).addClass("current")}),n(".yoho-page").on("touchstart",".connect-item, .question-item",function(){n(this).siblings().removeClass("highlight"),n(this).addClass("highlight")}).on("touchend touchcancel",".connect-item, .question-item",function(){n(this).removeClass("highlight")})}),define("js/me/address",["jquery"],function(e,t,o){var n,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 n=null,c.fadeOut(),!1}).on("touchend",".confim",function(){return s.showLoadingMask(),c.fadeOut(),i.ajax({method:"POST",url:"/home/delAddress",data:{id:n}}).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(){n=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(){return n=i(this).data("id"),c.fadeIn(),!1})}),define("js/me/browse-record",["jquery","lazyload","handlebars","source-map","hammer"],function(e,t,o){function n(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(o){" "===o?(p=!0,c.addClass("hide"),u.removeClass("hide")):(0===t?(l.html(o),a()):(l.append(o),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(),n(s.hideLoadingMask),i(window).scroll(function(){p||m+i(window).scrollTop()>i(document).height()-.25*l.height()&&n()}),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,o){var n,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=[],b=i.queryString();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 n?!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()?(n=!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||"网络出了点问题~"),n=!1,l.hideLoadingMask()):"shopping"===b.refer?window.location.href="/shoppingCart/selectAddress":window.location.href="/home/address"}).fail(function(){s.show("网络出了点问题~"),n=!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 o=new a(t);o.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 o=new a(t);o.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,o){function n(){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(n)}),define("js/me/pay",["jquery","hammer"],function(e,t,o){function n(){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(o){200===o.code?(t=o.data.jsApiParameters,i(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,o=null;e.each(function(e,n){t=p(n).find(".icon").find("div"),t.length>0&&(o=p(n).attr("id"),"alipay"!==o&&d(t,b[o]))})}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",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)),n()):n(),y&&y.on("tap",function(){a(v)}),f.showLoadingMask(),p(document).ready(h)}),define("js/me/personal-details",["jquery"],function(e,t,o){var n,i=e("jquery"),a=i(".user-avatar"),s=new Image;n=a.data("avatar"),s.src=n,s.onload=function(){a.css("background-image","url("+n+")")}}),define("js/me/currency",["jquery"],function(e,t,o){function n(e){i.ajax({type:"POST",url:"/home/ajaxCurrencyDetail",dataType:"html",data:{page:e},success:function(e){i(".coin-detail").append(e),window.rePosFooter()}})}var i=e("jquery"),a=1;i(window).scroll(function(){return i(window).scrollTop()+i(window).height()>i("body").height()-1?(a++,void n(a)):void 0}),n(a)});