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