index.js 134 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"),e("js/cart/entry"),o.exports=n}),define("js/common",["jquery","hammer"],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(h.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=navigator.cookieEnabled?!0:!1;return"undefined"!=typeof navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!==document.cookie.indexOf("testcookie")?!0:!1),e}function s(){var e,t=n("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function r(){var e=s();return 0===e?0:e[1]}function d(){var e=n("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function l(){var e;0!==f.length&&(e=Math.min(h(window).height(),window.screen.availHeight),h("body").height()<=e-parseInt(f.css("height"),0)?f.addClass("bottom"):f.removeClass("bottom"))}function c(e){var t=h(e).outerHeight();e&&f.css("margin-bottom",t+"px")}function u(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var h=e("jquery"),p=e("hammer"),f=h("#yoho-footer"),m=h(".yoho-page"),g=h(".yoho-header");!function(){var e,t=f.children(".op-row"),o=h(".back-to-top"),n=s();l(),0===n?t.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>'):t.prepend('<span>Hi,</span><a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+n[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index?token='+n[3]+'">退出</a>'),o.length>0&&(e=new p(o[0]),e.on("tap",function(e){return h(window).scrollTop(0),e.srcEvent.preventDefault(),!1})),f.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.14/yas.js","_yas"),function(){var e=r();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.14","yohobuy_m",e,"","")}(),g.on("touchstart","a",function(){g.find("a").removeClass("highlight"),h(this).addClass("highlight")}).on("touchend touchcancel","a",function(){h(this).removeClass("highlight")}),m.on("touchstart",".tap-hightlight",function(){h(this).siblings(".tap-hightlight").removeClass("highlight"),h(this).addClass("highlight")}).on("touchend touchcancel",".tap-hightlight",function(){h(this).removeClass("highlight")}),h(".nav-home").on("touchstart",function(){h(".homebuttom").toggleClass("hide")}),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}(),h.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}}),11===h(".user-name").text().length&&h(".user-name").html(u(h(".user-name").text())),window.cookie=n,window.setCookie=i,window.isCookiesEnabled=a,window.getUser=s,window.getUid=r,window.getShoppingKey=d,window.rePosFooter=l,window.reMarginFooter=c}),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"),d=a.find(".primary-level li"),l=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"),l.addClass("hide"),l=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(){d.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();w.eq(0).offset().top<l&&r.hide(),w.each(function(){var t=p(this).offset().top-k;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,d,l,c,u,h,p=e("jquery"),f=e("hammer"),m=e("swiper"),g=e("js/plugin/loading"),v=e("lazyload"),w=p(".brand-list"),y=p(".search-icon"),b=p(".genderNav li"),C=p(".search-action"),j=p(".newbrand-search").outerHeight(),x=p(".yoho-header").outerHeight(),k=parseInt(j)+parseInt(x)-1;g.showLoadingMask(),v(p("img.lazy")),p(".yoho-header").css({"z-index":2,position:"fixed",top:0}),function(){p(".banner-top").length>0&&p(".hot-brands").css("padding-top","0"),p(".hide-when-loading").show(),g.hideLoadingMask(),s=new m(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),d=new m(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"})}(),r=p('<div class="title-bar fixed-title-bar"><h2></h2></div>'),r.css({position:"fixed",top:k}).hide(),l=k+p(".hot-brands").outerHeight()+p(".banner-top").outerHeight(),w.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?(y.css("color","#444"),C.show().find(".clear-text").show()):(y.css("color","#b2b2b2"),C.find(".clear-text").hide()),a()}).focus(),y.css("color","#444"),u.closest(".search-box").css("width","11.25rem"),C.show().find(".clear-text").hide(),h=new f(p(".clear-text")[0]),h.on("tap",function(e){p(".search-result").html(""),p("#keyword").val("").trigger("input"),e.preventDefault(),e.srcEvent.stopPropagation()}),p("form.search-box").on("submit",function(){return!1})),b.length>0&&b.on("touchstart",function(){function e(){window.location.search="channel="+t}var t=p(this).data("id")+1;p(".genderNav ul .active").removeClass("active"),p(this).addClass("active"),p(".hide-when-loading").hide(),g.showLoadingMask(),setTimeout(e.bind(this),100)})}),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>';l=!0,void 0===e&&(e=d),e.append(t),s=e.children(".loading-mask")}function i(){l||(n(),l=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,r=e("jquery"),d=r(".yoho-page"),l=!1;t.init=n,t.showLoadingMask=i,t.hideLoadingMask=a}),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"),d=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"),d.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","swiper","index"],function(e,t,o){var n,i,a,s,r=e("jquery"),d=e("hammer"),l=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"),l.init(),c(r("img.lazy")),u[0].mlellipsis(3),setTimeout(function(){n=u.text(),i=u.attr("title")}),f.initInfosEvt(p),a=new d(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 d(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"),m.show(e.message)):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","swiper","index"],function(e,t,o){function n(e){void 0!==typeof e&&(y[e]=new u(".swiper-cont-"+e,{lazyLoading:!0,wrapperClass:"swiper-wrap-"+e,pagination:".swiper-pagi-"+e,autoplay:3e3}))}function i(e){c(e.find("img.lazy")),e.each(function(){var e=r(this),t=e.find(".info-title"),o=e.find(".info-text");t[0].mlellipsis(2),o[0].mlellipsis(2)})}function a(e){var t;"undefined"!=typeof e&&(t=new d(e[0]),t.on("tap",function(e){var t,o,n=r(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 r.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(){h.show("网络断开连接了~")}})):(t=n.closest(".collect-btn"),void(t.length>0&&(e.preventDefault(),t.hasClass("collected")&&(i="cancel"),o=n.closest(".guang-info"),r.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(){h.show("网络断开连接了~")}}))))}),i(e.find(".guang-info")))}function s(e,t,o){var a;w||t.end||(1===t.page&&p.showLoadingMask(),a=e.find(".guang-info").length,w=!0,r.ajax({type:"GET",url:o?o:"/guang/index/page",data:t,success:function(o){var s;return" "===o?(t.end=!0,w=!1,m.addClass("hide"),void g.removeClass("hide")):(e.append(o),v=e.find(".swiper-container"),v.length&&(v.addClass("swiper-cont-"+t.type),v.children(".swiper-wrapper").addClass("swiper-wrap-"+t.type),v.children(".swiper-pagination").addClass("swiper-pagi-"+t.type),n(t.type)),s=a>0?e.find(".guang-info:gt("+(a-1)+")"):e.find(".guang-info"),i(s),1===t.page&&(p.hideLoadingMask(),m.removeClass("hide"),window.rePosFooter()),t.page++,w=!1,void delete t.isTab)},error:function(){h.show("网络断开连接了~"),w=!1,delete t.isTab}}))}var r=e("jquery"),d=e("hammer"),l=e("mlellipsis"),c=e("lazyload"),u=e("swiper"),h=e("js/plugin/tip"),p=e("js/plugin/loading"),f=r("#load-more-info"),m=r(""),g=r(""),v=r(""),w=!1,y={};l.init(),f.length>0&&(m=f.children(".loading"),g=f.children(".no-more")),t.mySwiper=y,t.initSwiper=n,t.initInfosEvt=a,t.setLazyLoadAndMellipsis=i,t.loadMore=s}),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/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","hammer","mlellipsis","lazyload","swiper","index"],function(e,t,o){function n(){var e=h.not(".hide");i(window).scrollTop()+c>=i(document).height()-.25*e.height()&&s(e,g[m])}var i=e("jquery"),a=e("js/guang/info"),s=a.loadMore,r=i("#load-more-info"),d=i(""),l=i(""),c=i(window).height(),u=i("#info-list"),h=u.children(".info-list"),p=i("#guang-nav"),f=p.children(".focus"),m=f.data("type"),g={};r.length>0&&(d=r.children(".loading"),l=r.children(".no-more")),a.initSwiper(m),a.initInfosEvt(u),function(){var e=i("#gender").val();p.children(".guang-nav-item").each(function(){var t=i(this).data("type"),o=i(this).hasClass("focus");g[t]={page:o?2:1,gender:e,type:t,end:!1}})}(),p.bind("contextmenu",function(e){return!1}),p.on("touchend touchcancel",function(e){var t,o,n=i(e.target).closest(".guang-nav-item");n.hasClass("focus")||(o=n.index(),n.addClass("focus"),f.removeClass("focus"),t=h.eq(o),f=n,m=n.data("type"),1===g[m].page?(d.addClass("hide"),l.addClass("hide"),g[m].isTab=!0,s(t,g[m])):g[m].end?(d.addClass("hide"),l.removeClass("hide")):(d.removeClass("hide"),l.addClass("hide")),h.not(".hide").addClass("hide"),t.removeClass("hide"),1===g[m].page&&window.rePosFooter())}),i(document).scroll(function(){window.requestAnimationFrame(n)}),p.on("touchstart",function(e){var t=e.target||e.srcElement;t.className="bytouch "+t.className}).on("touchend touchcancel",function(){p.find("li").removeClass("bytouch")})}),define("js/guang/list",["jquery","hammer","mlellipsis","lazyload","swiper","index"],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(),d=i("#author-infos"),l=i("#tag"),c=i("#gender"),u=i("#isApp"),h={page:2,end:!1},p=i("#info-list");a.initInfosEvt(p),d.length>0&&i.extend(h,{authorId:d.data("id"),isApp:u.val()}),l.length>0&&i.extend(h,{tag:l.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")||(d.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),l.not(".hide").addClass("hide"),i=l.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"),d=h(".yoho-header"),l=0;return d.length>0&&(l=d.outerHeight()),u=new m("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),w?(e=h(window).height()-l,i=b[0],t=r.outerHeight(),o=s.outerHeight(),n=s.offset().top-l,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+l+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,d,l,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"),d=r.find("li"),l=s.find(".prod"),y=d.width(),v&&(b=h("#wrapper").after(r.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),f(b.find(".lazy"),{event:"sporty"})),n(d.filter(".focus")),r.delegate(".thumb","touchend",i),v&&b.delegate(".thumb","touchend",i)),v&&a()}}),define("js/home/entry",["jquery","swiper","lazyload","hammer","index"],function(e,t,o){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","swiper","lazyload","hammer","index"],function(e,t,o){function n(){x=!1,v.hasClass("menu-open")&&(v.removeClass("menu-open"),w.hide(),p(".sub-nav").removeClass("show"),y.removeClass("on"))}function i(e){e.find("li").on("touchstart",function(){e.find(".highlight").removeClass("highlight"),p(this).addClass("highlight")}).on("touchend touchcancel",function(){p(this).removeClass("highlight")})}function a(){C+=10,j.css({transform:"rotateX("+C+"deg)","-webkit-transform":"rotateX("+C+"deg)","-moz-transform":"rotateX("+C+"deg)"}),C/90%2===1&&(k?(j.addClass("animate"),k=!1):(j.removeClass("animate"),k=!0)),C/90%2===0&&C%360!==0?window.setTimeout(a,3e3):C%360===0?window.setTimeout(a,6e4):window.requestAnimationFrame(a)}var s,r,d,l,c,u,h,p=e("jquery"),f=e("swiper"),m=e("lazyload"),g=e("js/plugin/notice-scroll"),v=p(".mobile-wrap"),w=p(".overlay"),y=p(".side-nav"),b=p(".sub-nav"),C=0,j=p(".home-header .logo"),x=!1,k=!0,T=e("js/home/fastclick");T(document.body),m(p("img.lazy")),g(".notice",1e3*p(".notice").data("time")),p(".nav-btn").on("touchstart",function(){return y.css("pointer-events","none"),v.addClass("menu-open"),w.show().css("opacity",.3),y.addClass("on"),x=!0,setTimeout(function(){y.css("pointer-events","auto")},400),!1}),w.on("touchstart",function(){return n(),!1}),y.on("touchmove scroll",function(){return!1}),y.on("touchend","li",function(e){return p(this).find(".sub-nav").size()>0&&(p(".sub-nav").removeClass("show"),p(this).find(".sub-nav").addClass("show"),p(this).find(".highlight").removeClass("highlight")),e.target.pathname===location.pathname?(n(),!1):void 0}),b.each(function(){p(this).find("li").eq(0).on("click",function(){return p(".sub-nav").removeClass("show"),!1})}).on("touchstart",function(e){e.currentTarget!==e.target&&b.find("li").removeClass("current")}),i(y),i(b),p(".banner-swiper").find("li").size()>1&&(s=new f(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),d=new f(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"}),r=new f(".recommend-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"recommend-list",slideElement:"li"}),p(".trend-topic-swiper").find("li").size()>1&&(l=new f(".trend-topic-swiper",{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".trend-topic-content .pagination-inner"})),p(".fresh-list-swiper").find("li").size()>1&&(u=new f(".fresh-list-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,grabCursor:!0,slidesPerView:"auto",slideElement:"li",watchSlidesVisibility:!0})),p(".category-swiper").each(function(e,t){h="category-swiper"+e,p(this).addClass(h),p("."+h).find(".swiper-slide").size()>1&&(c=new f("."+h,{loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:"."+h+" .pagination-inner"}))}),setTimeout(a,3e3),p(".home-header .iconfont").on("touchstart",function(){p(this).addClass("highlight")}).on("touchend touchcancel",function(){p(this).removeClass("highlight")}),window.reMarginFooter(".footer-tab"),t.set=function(e){window.setCookie("_Channel",e,{expires:365,domain:".m.yohobuy.com"})},e("js/home/maybe-like")()}),define("js/plugin/notice-scroll",["jquery"],function(e,t,o){function n(e,t){var o=i(e),n=o.find(".notice-item"),a=n.length,s=1;e=e||".notice",t=t||3e3,a>1&&setInterval(function(){s>=a&&(s=0),n.fadeOut(),o.find(".item-"+s).fadeIn(),s++},t)}var i=e("jquery");o.exports=n}),define("js/home/fastclick",[],function(e,t,o){!function(){"use strict";function e(t,o){function i(e,t){return function(){return e.apply(t,arguments)}}var a;if(o=o||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=o.touchBoundary||10,this.layer=t,this.tapDelay=o.tapDelay||200,this.tapTimeout=o.tapTimeout||700,!e.notNeeded(t)){for(var s=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],r=this,d=0,l=s.length;l>d;d++)r[s[d]]=i(r[s[d]],r);n&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,o,n){var i=Node.prototype.removeEventListener;"click"===e?i.call(t,e,o.hijacked||o,n):i.call(t,e,o,n)},t.addEventListener=function(e,o,n){var i=Node.prototype.addEventListener;"click"===e?i.call(t,e,o.hijacked||(o.hijacked=function(e){e.propagationStopped||o(e)}),n):i.call(t,e,o,n)}),"function"==typeof t.onclick&&(a=t.onclick,t.addEventListener("click",function(e){a(e)},!1),t.onclick=null)}}var t=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!t,i=/iP(ad|hone|od)/.test(navigator.userAgent)&&!t,a=i&&/OS 4_\d(_\d)?/.test(navigator.userAgent),s=i&&/OS [6-7]_\d/.test(navigator.userAgent),r=navigator.userAgent.indexOf("BB10")>0;e.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(i&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},e.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},e.prototype.sendClick=function(e,t){var o,n;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),n=t.changedTouches[0],o=document.createEvent("MouseEvents"),o.initMouseEvent(this.determineEventType(e),!0,!0,window,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),o.forwardedTouchEvent=!0,e.dispatchEvent(o)},e.prototype.determineEventType=function(e){return n&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;i&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},e.prototype.updateScrollParent=function(e){var t,o;if(t=e.fastClickScrollParent,!t||!t.contains(e)){o=e;do{if(o.scrollHeight>o.offsetHeight){t=o,e.fastClickScrollParent=o;break}o=o.parentElement}while(o)}t&&(t.fastClickLastScrollTop=t.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},e.prototype.onTouchStart=function(e){var t,o,n;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),o=e.targetTouches[0],i){if(n=window.getSelection(),n.rangeCount&&!n.isCollapsed)return!0;if(!a){if(o.identifier&&o.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=o.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=o.pageX,this.touchStartY=o.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},e.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],o=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>o||Math.abs(t.pageY-this.touchStartY)>o?!0:!1},e.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},e.prototype.onTouchEnd=function(e){var t,o,r,d,l,c=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,o=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,s&&(l=e.changedTouches[0],c=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||c,c.fastClickScrollParent=this.targetElement.fastClickScrollParent),r=c.tagName.toLowerCase(),"label"===r){if(t=this.findControl(c)){if(this.focus(c),n)return!1;c=t}}else if(this.needsFocus(c))return e.timeStamp-o>100||i&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(c),this.sendClick(c,e),i&&"select"===r||(this.targetElement=null,e.preventDefault()),!1);return i&&!a&&(d=c.fastClickScrollParent,d&&d.fastClickLastScrollTop!==d.scrollTop)?!0:(this.needsClick(c)||(e.preventDefault(),this.sendClick(c,e)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},e.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},e.prototype.destroy=function(){var e=this.layer;n&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},e.notNeeded=function(e){var t,o,i,a;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(r&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(a=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],a>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},e.attach=function(t,o){return new e(t,o)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof o&&o.exports?(o.exports=e.attach,o.exports.FastClick=e):window.FastClick=e}()}),define("js/home/maybe-like",["jquery","hammer","lazyload"],function(e,t,o){o.exports=function(t){function o(){v||(v=!0,p.showLoadingMask(),c.ajax({type:"GET",url:s,data:{page:w+1},success:function(e){return" "===e?(v=!1,p.hideLoadingMask(),void(y&&!t&&(s="1,3"===y?"/boys/bottomBanner":"/girls/bottomBanner",
c.ajax({type:"GET",url:s,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(){}})))):(e.length>1&&(l?null:l=c("#yoho-footer"),l.hasClass("bottom")?l.removeClass("bottom"):null),a=g.find(".good-info").length,g.append(e),f(0===a?g.find(".good-info").find("img.lazy"):g.find(".good-info:gt("+(a-1)+")").find("img.lazy")),v=!1,p.hideLoadingMask(),void w++)},error:function(){h.show("网络断开连接了~"),v=!1,p.hideLoadingMask()}}))}function n(){c(window).scrollTop()+m>=c(document).height()-200&&o()}var i,a,s,r,d,l,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="kids"===t||c(".mobile-wrap").hasClass("kids-wrap")?!0:!1,C="lifestyle"===t||c(".mobile-wrap").hasClass("lifestyle-wrap")?!0:!1,j=c("#maybe-like-nav");b?s="/product/recom/maylikekids":C?s="lifestyle"===t?"/product/recom/maylike?gender=1,3":"/product/recom/maylikelife":(y="boys"===t||c(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",s="/product/recom/maylike?gender="+y),r=j.children(".focus"),C&&(i=j[0]?new u(j[0]):void 0,i&&i.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"),r.removeClass("focus"),n.not(".hide").addClass("hide"),t=n.eq(d),t.removeClass("hide"),r=o,c(document).trigger("scroll"),e.srcEvent.stopPropagation())})),p.init(c(".maybe-like")),c(".maybe-like p").on("touchstart",function(e){o()}),t&&o(),c(window).scroll(function(){window.requestAnimationFrame(n)})}}),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"),d=a("#search-input input"),l=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()}),d.on("input",function(){""===d.val()?(c.css("color","#b2b2b2"),l.addClass("hide")):(c.css("color","#666"),l.removeClass("hide"))}),i=new r(l[0]),i.on("tap",function(){d.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,d=s.length,l=void 0===e||"boolean"!=typeof e?!0:e;for(o=0;d>o;o++)if(t=s.eq(o).val(),r.test(t))return l?s.eq(o).val(t.replace(r," ")):(n=t.match(r).join(" "),a.show("不可以输入 "+n+" 哦!")),!l&&!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","hammer"],function(e,t,o){var n=e("jquery"),i=e("js/plugin/security"),a=n(".search-box"),s=n(".box"),r=n(".index-search"),d=n(".index-logo"),l=n(".index-channel a:not(#yohood)"),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"),d.addClass("action")}).on("input",function(){""===c.val()?h.addClass("empty"):h.removeClass("empty")}),u.on("touchend",function(){return s.removeClass("action"),d.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()}),l.on("touchstart",function(){l.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","handlebars","source-map","hammer"],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"),e("js/passport/bind/bind"),e("js/passport/bind/code"),e("js/passport/bind/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"),d=e("js/passport/api"),l=e("js/plugin/tip"),c=n.trim,u=l.show,h=!1;d.selectCssHack(n("#country-select")),d.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();if(!r.hasClass("disable"))return h?!1:void(d.phoneRegx[t].test(e)?(h=!0,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),h=!1)},error:function(e){u("出错了,请重试"),h=!1}})):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=d(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"),d=r.trim,l=/^([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:l,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?(d.text("重发验证码").removeClass("disable"),clearInterval(e)):d.text("重发验证码 ("+t--+"秒)")},1e3)}var s=n("#captcha"),r=n("#btn-next"),d=n("#captcha-tip"),l=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")}),d.on("touchstart",function(){d.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?(d.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?l?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"),d=n.trim,l=r.show;s.bindEyesEvt({status:"open"}),i.bind("input",function(){""===d(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e=d(i.val());a.hasClass("disable")||(s.pwdValidate(e)===!1?l("密码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,l("注册成功"),n.ajax({url:t.session,dataType:"jsonp"}),setTimeout(function(){location.href=t.href},1e3)):l(e.message)}}))})}),define("js/passport/login/login",["jquery"],function(e,t,o){function n(){h&&p?l.removeClass("disable"):l.addClass("disable")}function i(){c.show(),u.show()}function a(){c.hide(),u.hide()}var s=e("jquery"),r=s("#account"),d=s("#pwd"),l=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()}),d.bind("input",function(){p=""===g(d.val())?!1:!0,n()}),l.on("touchstart",function(){var e=g(r.val()),t=g(d.val());l.hasClass("disable")||(l.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(){l.text("登录").removeClass("disable")}}):(v("账号或密码有错误,请重新输入"),l.text("登录").removeClass("disable")))}),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"),d.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,t,o){function n(){c&&u?l.removeClass("disable"):l.addClass("disable")}var i=e("jquery"),a=i("#phone-num"),s=i("#country-select"),r=i("#area-code"),d=i("#pwd"),l=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()}),d.bind("input",function(){var e=f(d.val());u=""===e?!1:!0,n()}),s.change(function(){r.text(s.val())}),l.on("touchstart",function(){var e=f(a.val()),t=s.val(),o=f(d.val());l.hasClass("disable")||(l.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(){l.text("登录").removeClass("disable")}}):(m("账号或密码有错误,请重新输入"),l.text("登录").removeClass("disable")))}),a.trigger("input"),d.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"),d=e("js/passport/api"),l=e("js/plugin/tip"),c=n.trim,u=l.show;d.selectCssHack(n("#country-select")),d.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")||(d.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"),d=n.trim,l=r.show;s.bindClearEvt(),i.bind("input",function(){""===d(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e=d(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:l(e.message)}}):l("邮箱格式不正确,请重新输入"))})}),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(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"),d=n.trim,l=r.show,c=n("#phone-num");s.bindEyesEvt({status:"open"}),i.bind("input",function(){""===d(i.val())?a.addClass("disable"):a.removeClass("disable")}),a.on("touchstart",function(){var e,t,o=d(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?(l("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):l(e.message)}}):l("密码6-20位,请重新输入"))})}),define("js/passport/bind/bind",["jquery","handlebars","source-map","hammer"],function(e,t,o){function n(e,t,o){return v?!1:(v=!0,u.addClass("disable").html("绑定中..."),void i.ajax({type:"POST",url:"/passport/bind/sendBindMsg",data:{phoneNum:t,areaCode:o.replace("+","")},success:function(t){location.href=e},error:function(){p.show("出错了,请重试!"),u.removeClass("disable").html("下一步"),v=!1}}))}var i=e("jquery"),a=i("#phone-num"),s=i("#country-select"),r=i("#area-code"),d=i("#openId"),l=i("#nickname"),c=i("#sourceType"),u=i("#btn-next"),h=e("js/passport/api"),p=e("js/plugin/tip"),f=e("js/me/dialog"),m=i.trim,g=p.show,v=!1;h.selectCssHack(i("#country-select")),h.bindClearEvt(),a.bind("input",function(){""===m(a.val())?u.addClass("disable"):u.removeClass("disable")}),s.change(function(){r.text(s.val())}),u.on("touchstart",function(){var e=m(a.val()),t=m(d.val()),o=m(l.val()),r=m(c.val()),p=s.val();u.hasClass("disable")||(h.phoneRegx[p].test(e)?i.ajax({url:"/passport/bind/bindCheck",type:"POST",data:{areaCode:p.replace("+",""),phoneNum:e,openId:t,sourceType:r,nickname:o},success:function(t){200===t.code?1===t.data.isReg?f.showDialog({dialogText:"该手机号已注册过有货\n"+e+",确定绑定吗?",hasFooter:{leftBtnText:"更换号码",rightBtnText:"继续绑定"}},function(){n(t.data.next,e,p)}):n(t.data.next,e,p):g(t.message)}}):g("手机号格式不正确,请重新输入"))})}),define("js/me/dialog",["jquery","handlebars","source-map","hammer"],function(e,t,o){function n(){return void 0===a&&(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 tap-hightlight">{{.}}</span>{{/ leftBtnText}}{{# rightBtnText}}<span class="dialog-right-btn tap-hightlight">{{.}}</span>{{/ rightBtnText}}</div>{{/ hasFooter}}</div></div>',s=d.compile(a)),s}var i,a,s,r=e("jquery"),d=e("handlebars"),l=e("hammer");t.showDialog=function(e,t,o,a){var s,d,c,u=n(),h=u(e);r(".dialog-wrapper").remove(),r("body").append(r(h)),s=r(".dialog-box"),i=r(".dialog-wrapper"),c=new l(document.getElementById("dialog-wrapper")),e.fast?i.css({display:"block"}):i.fadeIn(),a&&(r(".dialog-wrapper .dialog-footer > span").css("width","100%"),r(".dialog-wrapper .dialog-content").css({"padding-left":"1.85rem","padding-right":"1.85rem"}),i.css("z-index","10")),s.css({top:"50%",marginTop:-(s.height()/2)}),e.autoHide&&(d=1e3,e.autoHide>1&&(d=e.autoHide),setTimeout(function(){i.fadeOut()},d)),i.on("touchmove",function(){return!1}),c.on("tap",function(e){r(e.target).hasClass("dialog-left-btn")?("function"==typeof o&&o(),i.fadeOut()):r(e.target).hasClass("dialog-right-btn")&&t(),e.preventDefault(),e.srcEvent.stopPropagation()})},t.hideDialog=function(){r(".dialog-wrapper").remove()}}),define("js/passport/bind/code",["jquery"],function(e,t,o){e("js/passport/code")(!0,!0)}),define("js/passport/bind/password",["jquery"],function(e,t,o){function n(e){i.ajax({url:"/passport/bind/bindMobile",type:"post",data:{areaCode:m.replace("+",""),phoneNum:f,openId:p,sourceType:h,nickname:u,password:e},success:function(e){200===e.code?(d.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):d.show(e.message)},error:function(e){d.show("登录失败,请重试!")}})}var i=e("jquery"),a=i("#pwd"),s=i("#btn-sure"),r=e("js/passport/api"),d=e("js/plugin/tip"),l=i.trim,c=d.show,u=i("#nickname").val(),h=i("#sourceType").val(),p=i("#openId").val(),f=i("#phone-num").val(),m=i("#area-code").val().replace("+","");r.bindEyesEvt({status:"open"}),a.bind("input",function(){""===l(a.val())?s.addClass("disable"):s.removeClass("disable")}),s.on("touchstart",function(){var e=l(a.val());s.hasClass("disable")||(r.pwdValidate(e)===!1?c("密码6-20位,请重新输入"):n(e))})}),define("js/product/entry",["jquery","swiper","lazyload","hammer","handlebars","source-map","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(!l){if(e){for(o in q)q.hasOwnProperty(o)&&(q[o].reload=!0);switch(T.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=q[i],u=n.page+1,n.reload)u=1;else if(n.end)return;c.extend(f,b,{dayLimit:a,page:u}),l=!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=d}" "===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,l=!1,m.hideLoadingMask(),window.rePosFooter()},error:function(){p.show("网络断开连接了~"),l=!1,m.hideLoadingMask()}})}}function i(){c(window).scrollTop()+w>c(document).height()-.25*g.height()-50&&void 0!==E&&n()}var a,s,r,d,l,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"),d=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(),T=c("#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=T.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")),T.bind("contextmenu",function(e){return!1}),T.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=q[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":d.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(),T.on("touchstart","li",function(e){c(this).addClass("bytouch")}).on("touchend touchcancel",function(){T.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 d(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 l(e){var t,o=e.data("id");t=d(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"),l(t)):(t=o.closest(".classify-item"),e.srcEvent.stopPropagation(),r(t))):(n(),f&&f())})}function u(){"undefined"!=typeof h&&(g(".sub-classify").each(function(){d(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){var t;200===e.code&&(t=e.data.cart_goods_count,t>99&&(t="99+"),0===t&&n(".cart-count").remove(),i.find(".cart-count").html(t).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,d={};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(d,b,{type:i,order:n.order,page:a}),s=!0,h.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:d,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),l(t.find(".lazy"))):(o=t.find(".good-info").length,t.append(e),l(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"),d=e("swiper"),l=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:1,reload:!0,page:0,end:!1},discount:{order:1,reload:!0,page:0,end:!1}},x=C.find(".active");e("js/product/suspend-cart"),r(".swiper-container .swiper-slide").length>1&&(a=new d(".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})}}),l(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"),L.addClass("active"),e.type){case"gender":t={gender:e.id};break;case"brand":t={brand:e.id};break;case"sort":t={sort:e.id};break;case"color":t={color:e.id};break;case"size":t={size:e.id};break;case"price":t={price:e.id};break;case"discount":t={discount:e.id}}l.extend(q,t)}if(L.hasClass("new")?i="newest":L.hasClass("price")?i="price":L.hasClass("discount")&&(i="discount"),n=I[i],s=n.page+1,n.reload)s=1;else if(n.end)return;l.extend(r,q,{type:i,order:n.order,page:s}),a=!0,v.showLoadingMask(),l.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.14","yohobuy_m",window._ozuid,"",l(".new-goods .good-info .good-detail-img .good-thumb"));break;case"price":window._yas(1*new Date,"1.0.14","yohobuy_m",window._ozuid,"",l(".price-goods .good-info .good-detail-img .good-thumb"));break;case"discount":window._yas(1*new Date,"1.0.14","yohobuy_m",window._ozuid,"",l(".discount-goods .good-info .good-detail-img .good-thumb"))}}})}}function i(){l(window).scrollTop()+j>l(document).height()-.25*w.height()&&n()}var a,s,r,d,l=e("jquery"),c=e("hammer"),u=e("lazyload"),h=l("#brand-header"),p=l("#intro-box"),f=e("js/plugin/filter"),m=e("js/index/write-search"),g=e("js/plugin/tip"),v=e("js/plugin/loading"),w=l("#goods-container"),y=w.children(".new-goods"),b=w.children(".price-goods"),C=w.children(".discount-goods"),j=l(window).height(),x=l("#search-input input"),k=l(".search-icon"),T=l("#search-input .clear-input"),q=e("js/product/query-param"),E=l("#list-nav"),I={newest:{order:1,reload:!0,page:0,end:!1},price:{order:1,reload:!0,page:0,end:!1},discount:{order:1,reload:!0,page:0,end:!1}},L=E.find(".active");x.on("input",function(){""===x.val()?(k.css("color","#b2b2b2"),T.addClass("hide")):(k.css("color","#666"),T.removeClass("hide"))}),T.on("touchend",function(){x.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){w.append(e),f.initFilter({fCbFn:n,hCbFn:function(){L.addClass("active"),L.siblings(".filter").removeClass("active")}})}}),u(l(".lazy")),m.bindWirteLocal(l("#search-form")),E.bind("contextmenu",function(e){return!1}),E.on("touchend touchcancel",function(e){var t,o,i,a=l(e.target).closest("li");if(a.hasClass("filter"))a.hasClass("active")?(f.hideFilter(),
L.addClass("active"),a.removeClass("active")):(L=a.siblings(".active"),L.removeClass("active"),a.addClass("active"),f.showFilter());else{if(a.hasClass("new")?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"),L=a,t.reload=!0,t.order=0===t.order?1:0)}else{if(i=a.siblings(".active"),L=a,i.hasClass("filter"))f.hideFilter();else switch(w.children(".container:not(.hide)").addClass("hide"),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()}}),l(window).scroll(function(){window.requestAnimationFrame(i)}),h.length>0&&(s=new c(h.children(".btn-intro")[0]),s.on("tap",function(){p.removeClass("hide"),l("body").addClass("overflow-hidden")}),r=new c(document.getElementById("intro-box")),r.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"))}),d=new c(h.children(".btn-col")[0]),d.on("tap",function(e){var t,o=l(e.target).closest(".btn-col"),n=h.data("id");t=o.hasClass("coled")?"cancel":"ok",l.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"),l(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){E.find("li").removeClass("bytouch")})}),define("js/product/detail/detail",["jquery","swiper","hammer","lazyload","handlebars","source-map","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"),d=e("lazyload"),l=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"),m=a('input[name="limitCodeUrl"]').val(),g=e("js/me/dialog");n(),e("js/product/detail/like"),d(a("img.lazy")),a("#goodsDiscount h1").length<1&&a(".dropdown").remove(),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===l.children().length&&(l.css("display","none"),c.html("")),h&&l.children().length>0&&h.on("tap",function(e){l.is(":hidden")?(p.removeClass("short-text"),c.removeClass("icon-down").addClass("icon-up").html("&#xe608;"),l.slideDown()):(p.addClass("short-text"),c.removeClass("icon-up").addClass("icon-down").html("&#xe609;"),l.slideUp())}),a("#limit-sale").on("touchend",function(e){var t,o,n=a("#loginUrl").val();e.stopPropagation(),n?window.location=n:(g.showDialog({dialogText:"进入有货APP,获取限购码",hasFooter:{rightBtnText:"打开Yoho!Buy有货APP"}},function(){o=document.createElement("iframe"),o.src=m,o.style.display="none",document.body.appendChild(o),window.location.href=m,t=Date.now(),window.setTimeout(function(){document.body.removeChild(o),Date.now()-t<3200&&(window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho")},3e3)},void 0,!0),a(".dialog-wrapper").off("touchstart").on("touchstart",function(e){e.stopPropagation(),a(e.target).hasClass("dialog-wrapper")&&g.hideDialog()}))}),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){var t;if(200===e.code){if(t=e.data.cart_goods_count||0,0===t)return!1;t>99&&(t="99+"),f.find(".num-tag").html(t).removeClass("hide")}}}),a(".good-detail-page").length>0&&a("#yoho-footer").css("border-top","1px solid #e0e0e0")}),define("js/product/detail/like",["jquery"],function(e,t,o){var n=e("jquery"),i=e("js/plugin/tip"),a=e("js/cart/chose-panel"),s=n("#productId").val(),r=n("#productSkn").val(),d=n("#limitProductCode").val();n("#likeBtn").on("touchstart",function(){var e,t,o=n(this);return o.hasClass("liked")?(e="cancel",t=0):(e="ok",t=1),n.ajax({type:"POST",url:"/product/opt/favoriteProduct",data:{id:s,opt:e},success:function(t){200===t.code?(o.toggleClass("liked"),"cancel"===e?i.show("取消收藏成功"):"ok"===e&&i.show("收藏成功")):400===t.code?location.href=t.data:i.show(t.message)},error:function(){i.show("网络断开连接了~")}}),window._yas&&window._yas.sendCustomInfo({pd:s,fa:t},!0),!1}),n("#addtoCart").on("touchstart",function(){return n(".cart-bar").hide(),d&&a.setLimitGoodModeWithSknId(d,r),a.show(),window._yas&&window._yas.sendCustomInfo({pd:s,by:1},!0),!1})}),define("js/cart/chose-panel",["jquery"],function(e,t,o){function n(){var e=N(".chose-panel").find(".num .btn>.iconfont");e.hasClass("disabled")?null:e.addClass("disabled"),V.off("touchstart",".btn-minus"),V.off("touchstart",".btn-plus")}function i(){x=!1,k=!1,T=null,D=N.queryString(),v=N(".chose-panel").find(".thumb"),_=N(".chose-panel .main .chose-items"),S=N(".chose-items"),q=N(".size-list ul"),I=N(".color-list ul"),w=N("#left-num"),z=N(".cart-bar"),C=0,j=0,F=0}function a(e,t){N("#chose-btn-sure").html("确认"),F=1,M=e,P=t}function s(e,t){n(),N("#chose-btn-sure").html("立即购买"),O=e,B=t}function r(){var e=N(".chose-panel"),t=N("#promotionId");e&&e.remove(),t&&t.remove()}function d(){return x||k?x?k?!0:(A.show("请选择尺码~"),!1):(A.show("请选择颜色~"),!1):(A.show("请选择颜色和尺码~"),!1)}function l(e,t){e&&(U.html(e),""!==N("#promotionId").val()&&n(),i()),N(".chose-panel").show(),m=N("#good-num"),L=t,R.disableScroll(_)}function c(){N(".chose-panel").hide(),R.enableScroll(_),z.length>0&&z.show()}function u(){g=S.find(".chosed"),2===g.closest(".zero-stock").length?N("#chose-btn-sure").css("background-color","#c0c0c0").html("已售罄"):O?N("#chose-btn-sure").css("background-color","#eb0313").html("立即购买"):N("#chose-btn-sure").css("background-color","#eb0313").html(F?"确认":"加入购物车")}function h(e){e>0?(W.length>0?S.find(".num .left-num").html("即将售罄"):S.find(".num .left-num").html("剩余"+e+"件"),w.val(e)):(S.find(".num .left-num").html(""),w.val(0))}function p(e){var t,o,n;if(C&&T&&T.length>0){for(T.removeClass("chosed"),t=q.eq(e).children(),n=0;n<t.length;n++)if(N(t[n]).data("id")===T.data("id"))return T=N(t[n]),o="#"+T.data("id"),C=N(o).data("index"),T.addClass("chosed"),T.data("num");return T=null,k=!1,I.eq(C).addClass("hide"),I.eq(0).removeClass("hide"),C=0,-1}return 0}function f(e){return j&&E&&E.length>0?(E.removeClass("chosed"),E=N(I.eq(e).children().get(j-1)),E.addClass("chosed"),E.data("num")):0}var m,g,v,w,y,b,C,j,x,k,T,q,E,I,L,S,D,_,z,F,P,M,O,B,N=e("jquery"),A=e("js/plugin/tip"),H=e("js/plugin/loading"),R=e("js/plugin/inner-scroll"),U=N("#chose-panel"),W=N(".soonSoldOut-tag"),V=N(".yoho-page");i(),V.on("touchstart",".chose-panel",function(e){var t=N(e.target);if(!(t.closest(".main").length>0))return c(),!1}),V.on("touchstart",".color-list .block",function(){var e,t=N(this),o=t.index();t.hasClass("chosed")?(S.find(".num .left-num").html(""),w.val(0),x=!1,q.eq(j).addClass("hide"),q.eq(0).removeClass("hide"),j=0,p(0)):(x=!0,q.eq(j).addClass("hide"),e=p(o+1),h(e),q.eq(o+1).removeClass("hide"),j=o+1,E=t,v.addClass("hide").eq(o).removeClass("hide")),t.siblings(".chosed").removeClass("chosed"),-1===e?(E=N(I.eq(0).children().get(o)),E.addClass("chosed")):t.toggleClass("chosed"),N("#good-num").val(1),u()}).on("touchstart",".size-list .block",function(){var e,t,o=N(this);o.hasClass("chosed")?(S.find(".num .left-num").html(""),w.val(0),k=!1,I.eq(C).addClass("hide"),I.eq(0).removeClass("hide"),C=0,f(0)):(k=!0,e=N("#"+o.data("id")).data("index")-1,I.eq(C).addClass("hide"),t=f(e+1),h(t),I.eq(e+1).removeClass("hide"),C=e+1,T=o),o.siblings(".chosed").removeClass("chosed"),o.toggleClass("chosed"),N("#good-num").val(1),u()}),V.on("touchstart",".btn-minus",function(){var e=parseInt(m.val(),10);return y=N("#left-num").val(),d()?1===e||0===y-0?void A.show("您选择的数量不能为零~"):0>e?void A.show("您选择的数量不能为负数~"):void m.val(e-1):void 0}).on("touchstart",".btn-plus",function(){var e=parseInt(m.val(),10);return y=N("#left-num").val(),d()&&e-0!==y&&0!==y?e>y-1?void A.show("您选择的数量超过了最大库存量~"):void m.val(e+1):void 0}).on("touchstart","#chose-btn-sure",function(){var e,t,o,n,i=N("#good-num").val()-0,a=parseInt(m.val(),10);if(d()&&"已售罄"!==N("#chose-btn-sure").html()){if(y=N("#left-num").val()-0,a>y)return void A.show("您选择的数量超过了最大库存量~");if(0>a)return void A.show("您选择的数量小于一件~");if(g=N(".block-list>ul>li.chosed"),2===g.length&&0===g.closest(".zero-stock").length){if(e=T.data("skuid"),t=N("#promotionId").val(),b)return!1;if(b=!0,H.showLoadingMask(),F)o={new_product_sku:e,old_product_sku:M,buy_number:i,selected:P},n="/cart/index/modify";else{if(O)return N(this).css("background-color","#ccc").removeAttr("id"),n=N("#limitProductPay").val()+"?limitproductcode="+O+"&sku="+e+"&skn="+B+"&buy_number="+i,r(),H.showLoadingMask(),N.ajax({url:n}).then(function(e){e.error?(A.show(e.message),setTimeout(function(){location.reload()},2e3)):location.href=n}).fail(function(){A.show("网络异常!"),setTimeout(function(){location.reload()},2e3)}),!1;o={productSku:e,buyNumber:i,promotionId:t,isEdit:F,cartType:D.cartType},n="/cart/index/add"}N.ajax({method:"POST",url:n,data:o}).done(function(e){var t;H.hideLoadingMask(),200!==e.code||F||(t=e.data.goods_count,t>99&&(t="99+"),N(".num-tag").html(t).removeClass("hide"),b=!1,L&&L()),e.message&&!F&&A.show(e.message),c(),F&&(H.showLoadingMask(),setTimeout(function(){window.location.href="/cart/index/index?cartType="+N("#cartType").val()},1))}).fail(function(){A.show("网络出了点问题~")}).always(function(){b=!1})}}}),t.init=i,t.show=l,t.remove=r,t.setEditModeWithSknId=a,t.disableNumEdit=n,t.setLimitGoodModeWithSknId=s}),define("js/plugin/inner-scroll",["jquery"],function(e,t,o){function n(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.returnValue=!1}function i(e){e=e||window.event,e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!1}function a(e){var t=e.wheelDelta||e.originalEvent.wheelDelta||e.detail||0,o=d(this).get(0);return i(e),d(o).height()+o.scrollTop>=o.scrollHeight&&0>t?(n(e),!1):0===o.scrollTop&&t>0?(n(e),!1):void 0}function s(e){var t,o;e.on("mousewheel",a),e.on("touchstart",function(e){t=e.originalEvent.changedTouches[0].pageX,o=e.originalEvent.changedTouches[0].pageY}),e.on("touchmove",function(e){var n=e.originalEvent.changedTouches[0].pageX-t,i=e.originalEvent.changedTouches[0].pageY-o,a=d(this).get(0);return e.stopPropagation(),Math.abs(i)<Math.abs(n)?(e.preventDefault(),!1):d(a).height()+a.scrollTop>=a.scrollHeight&&0>i?(e.preventDefault(),!1):0===a.scrollTop&&i>0?(e.preventDefault(),!1):void 0}),d(document).on("mousewheel",n),d(document).on("touchmove",n)}function r(e){e.off("touchstart"),e.off("touchmove"),e.off("mousewheel"),d(document).off("mousewheel",n),d(document).off("touchmove",n)}var d=e("jquery");t.enableScroll=r,t.disableScroll=s}),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")),d=new h("#size-swiper-container",{slidesPerView:"auto"}),l=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,d,l,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"),d=document.getElementById("nav-tab"),l=d&&new r(d),c=document.getElementById("goto-consult"),u=c&&new r(c),h=document.getElementById("readmore"),p=h&&new r(h);!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"))}(),l&&l.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).find("a").attr("href")}),a(".goods-consults-page").length>0&&a("#yoho-header").css("position","fixed").css("top","0"),a(".goods-consults-page").length>0&&a("#yoho-footer").css("border-top","1px solid #e0e0e0"),p&&p.on("tap",function(){return a(".readmore").hide(),a(".goods-consults.customer-consults").removeClass("customer-consults"),!1}),e("js/product/detail/fav")}),define("js/product/detail/fav",["jquery","hammer"],function(e,t,o){function n(e){var t=e.find(".animate-count");t.css("display","inline"),t.animate({opacity:.25,fontSize:"0.7rem",right:"-=5"},300,function(){t.css("display","none")})}var i,a,s=e("jquery"),r=e("hammer"),d=e("js/plugin/tip"),l=s("#goods-consults")[0],c=l&&new r(l);!function(){var e=window.location.search.substring(1);i=e.split("&")[0].split("=")[1],a=e.split("&")[1]?e.split("&")[1].split("=")[1]:void 0}(),c&&c.on("tap",function(e){var t,o=s(e.target).closest("li"),r=o.closest(".consult-item").data("id"),l=o.find(".count").html()-0;o.hasClass("highlight")||(o.hasClass("fav")?t="/product/detail/consultupvote":o.hasClass("useful")&&(t="/product/detail/consultuseful"),s.ajax({method:"post",url:t,data:{id:r,productId:i,total:a}}).done(function(e){200===e.code?(n(o),o.addClass("highlight"),o.find(".count").html(l+1)):401===e.code&&(location.href=e.data)}).fail(function(e){d.show("网络断开连接了~")}))})}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,t,o){function n(){h||u||(h=!0,l&&r.get(l).then(function(e){e.length<5?d.css("display","none"):(d.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(){d.hide()}))}function i(){(!u||r(window).scrollTop()+c>=r(document).height()-200)&&n()}var a,s=e("swiper"),r=e("jquery"),d=r(".recommend-for-you"),l=r("#preferenceUrl").val(),c=r(window).height(),u=!1,h=!1;r(window).scroll(function(){window.requestAnimationFrame(i)})}),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"),d=i("#submit"),l=i("#content"),c=i("#product_id").val();d.on("touchend",function(){return l.blur(),r.submit(),!1}).on("touchstart",function(){i(this).addClass("highlight")}).on("touchend touchcancel",function(){i(this).removeClass("highlight")}),l.on("focus",function(){"请输入咨询内容"===l.val()&&l.val("")}).on("blur",function(){""===l.val()&&l.val("请输入咨询内容")}),r.on("submit",function(){var e;return n?!1:(e=l.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(),l.ajax({type:"GET",url:"/product/newsale/selectHotrank?"+t,dataType:"html",data:{page:e,tab_id:o,notab:n},success:function(t){" "===t?l(".rank-main").length<1&&l(".goods-nav").length<1?l("#hotRank").html(v):1===e&&(d=l(".goods-nav").prop("outerHTML"),l("#hotRank").html(d+v)):(l(".no-result").remove(),1===e&&l(".rank-main").remove(),l("#hotRank").append(t)),u(l("img.lazy")),l(".rank-main ul li:gt(9)").find(".item-content i").removeClass("top"),a=l(window).height(),0!==l(".rank-main").length?(l("#yoho-footer").css("position","static"),s=l(".rank-main").find("ul").offset().top):l("#yoho-footer").css("position","fixed"),r=new c(".s-goods-nav",{grabCursor:!0,slidesPerView:"auto",slideElement:"li"}),h.hideLoadingMask()}})}function i(){2!==p&&(l(window).scrollTop()+a<s+l("#hotRank").height()-100||(p=2,f=1,n(p,m,g,f)))}var a,s,r,d,l=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"),l(window).scroll(function(){window.requestAnimationFrame(i)}),n(p,m,g,f),l("#hotRank").on("touchend touchcancel",function(e){var t=t||window.event,o=t.target||t.srcElement;"span"===o.nodeName.toLowerCase()&&(l(".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))}),l("#hotRank").bind("contextmenu",function(e){return!1}),l("#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(){l(".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"),e("js/me/currency-new")}),define("js/me/order",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,o){function n(e){var t={type:f,page:m.page+1},o=e&&!e.noLoadingMask;g||(g=!0,o&&v.showLoadingMask(),s.ajax({type:"GET",url:"/home/getOrders",data:t,success:function(e){var n;" "!==e?(m.page=t.page,1===t.page?(h.html(e),d(h.find(".lazy"),{try_again_css:"order-failure"})):(n=h.children(".order").length,h.append(e),d(h.children(".order:gt("+(n-1)+")").find(".lazy"),{try_again_css:"order-failure"})),window.rePosFooter()):m.end=!0,g=!1,o&&v.hideLoadingMask()}}))}function i(){m.end===!1&&s(window).scrollTop()+p>s(document).height()-.25*u.height()&&n({noLoadingMask:!0})}var a,s=e("jquery"),r=e("hammer"),d=e("lazyload"),l=e("js/plugin/tip"),c=s("#order-nav > li"),u=s("#order-container"),h=u.children(".orders:not(.hide)"),p=s(window).height(),f=c.filter(".active").data("type"),m={page:0,end:!1},g=!1,v=e("js/plugin/loading"),w=e("js/me/dialog");d({try_again_css:"order-failure"}),function(){var e=c.length;4!==e&&c.width(100/e+"%")}(),v.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?w.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/delOrder",data:{id:o},success:function(e){w.hideDialog(),e.message&&l.show(e.message),200===e.code&&window.location.reload()},error:function(){l.show("取消订单失败")}})}):i.closest(".cancel").length>0?w.showDialog({dialogText:"确定取消订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/cancelOrder",data:{id:o},success:function(e){e.message&&l.show(e.message),200===e.code&&setTimeout(function(){window.location.reload()},2e3)},error:function(){l.show("取消订单失败")}})}):i.closest(".order-goods").length>0&&(n=t.data("href"),location.href=n))}),s(window).scroll(function(){window.requestAnimationFrame(i)}),n()}),define("js/me/order-detail",["jquery","lazyload","hammer","handlebars","source-map"],function(e,t,o){function n(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var i,a=e("jquery"),s=e("lazyload"),r=e("hammer"),d=e("js/me/dialog"),l=e("js/plugin/tip"),c=a("#order-detail").data("id");s({try_again_css:"order-failure"}),i=new r(document.getElementsByClassName("opt")[0]),i.on("tap",function(e){var t=a(e.target);t.hasClass("btn-del")?d.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){a.ajax({type:"GET",url:"/home/delOrder",data:{id:c}}).then(function(e){a("#dialog-wrapper").hide(),"object"===a.type(e)&&(e.message&&l.show(e.message),setTimeout(function(){window.location.href="/home/orders"},2e3))}).fail(function(){l.show("网络错误")})}):t.hasClass("btn-cancel")&&d.showDialog({dialogText:"确定取消订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){a.ajax({type:"GET",url:"/home/cancelOrder",data:{id:c}}).then(function(e){a("#dialog-wrapper").hide(),"object"===a.type(e)&&(e.message&&l.show(e.message),setTimeout(function(){window.location.href="/home/orders"},2e3))}).fail(function(){l.show("网络错误")})})}),a(".name-phone span").html(n(a(".name-phone span").html()))}),define("js/me/fav",["jquery","hammer","swiper","handlebars","source-map","index"],function(e,t,o){function n(e){f.filter(".active").removeClass("active"),f.eq(e).addClass("active"),m.filter(".show").removeClass("show"),m.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],g[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:T=!0,l.ajax({method:"post",url:"/home/"+t,data:{page:o},success:function(o){var n=e.closest(".fav-type").find(".fav-content-loading");"favBrand"===t?w.addClass("hide"):v.addClass("hide")," "===o?(n.addClass("hide"),e.closest(".fav-type").find(".fav-null-box").removeClass("hide"),window.rePosFooter()):"end"===o?(n&&!n.hasClass("hide")&&n.addClass("hide"),e.closest(".fav-type").find(".fav-load-background").removeClass("fav-load-background").html("没有更多了"),q=!0,T=!0):o.length>10&&(e.append(o),n.remove(),"favBrand"===t?(i(o),q=!1):T=!1),window.rePosFooter()}})}function s(){l(window).scrollTop()+y>=l(document).height()-.25*j.height()-b&&(E?(w.filter(".hide").removeClass("hide"),q||(k++,a(j,"favBrand",k))):(v.filter(".hide").removeClass("hide"),T||(x++,a(C,"favProduct",x))))}var r,d,l=e("jquery"),c=e("hammer"),u=e("swiper"),h=e("js/me/dialog"),p=e("js/plugin/tip"),f=l("#fav-tab > li"),m=l(".fav-content > .fav-type"),g={},v=l(".fav-load-more"),w=l(".fav-brand-load-more"),y=l(window).height(),b=l("#yoho-footer").height(),C=l(".fav-product-list"),j=l(".fav-brand-swiper-wrapper"),x=1,k=1,T=!0,q=!0,E=!1;l("#fav-tab").hasClass("brand-tab")?(n(1),a(j,"favBrand",1),E=!0,window.rePosFooter()):(n(0),a(C,"favProduct",1),E=!1,window.rePosFooter()),r=new c(document.getElementById("fav-tab")),r.on("tap",function(e){var t,o=l(e.target).closest("li");0===o.length||o.hasClass("active")||(t=o.index(),0===t?(E=!1,0===C.find("li").length&&C.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(C,"favProduct",1)):(E=!0,0===j.find("div").length&&j.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&a(j,"favBrand",1)),n(t),window.rePosFooter())}),d=new c(document.getElementById("fav-content")),d.on("tap",function(e){var t="";l(e.target).hasClass("del-fav")&&h.showDialog({dialogText:"您确定要取消收藏吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){t=l(e.target).closest("li").attr("data-id"),l.ajax({method:"post",url:"/home/favoriteDel",data:{id:t}}).then(function(t){200===t.code?(h.showDialog({autoHide:!0,fast:!0,dialogText:"已经取消收藏"}),l(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:"网络错误~"})})})}),l(window).scroll(s),l(document).on("touchend",".swiper-header",function(){var e=l(this).find(".fav-more").attr("href");e&&(window.location.href=e)}),l(".invalidGoods").on("touchstart touchend",function(e){var t=l(e.target).closest("span");if(!t.hasClass("del-fav"))return p.show("商品已下架"),!1})}),define("js/me/suggest",["jquery","hammer","lazyload","handlebars","source-map"],function(e,t,o){var n,i,a,s,r=e("jquery"),d=e("hammer"),l=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++}}),l(),n=new d(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 d(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++,d=i.files.length;if(a.queue.selected=d,a.queue.count+d>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 l=0;d>l;l++)file=i.files[l],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 d=new FileReader;d.onload=function(i){var r="-------------------------"+(new Date).getTime(),d="--",l="\r\n",c="";c+=d+r+l,c+='Content-Disposition: form-data; name="'+s.fileObjName+'"',t.name&&(c+='; filename="'+t.name+'"'),c+=l,c+="Content-Type: application/octet-stream"+l+l,c+=i.target.result+l;for(key in s.formData)c+=d+r+l,c+='Content-Disposition: form-data; name="'+key+'"'+l+l,c+=s.formData[key]+l;c+=d+r+d+l,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)},d.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 d=s.dropTarget?e(s.dropTarget):a.queueEl.get(0);d.addEventListener("dragleave",function(e){e.preventDefault(),e.stopPropagation()},!1),d.addEventListener("dragenter",function(e){e.preventDefault(),e.stopPropagation()},!1),d.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation()},!1),d.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=e("js/plugin/notice-scroll"),s=i(".user-avatar"),r=i(".list-item"),d=new Image;e("js/product/recommend-for-you"),e("js/product/suspend-cart"),n=s.data("avatar"),d.src=n,d.onload=function(){s.css("background-image","url("+n+")")},a(".notice",1e3*i(".notice").data("time")),i(".yoho-page").on("touchstart",".list-item, .type-item, .order-title",function(){r.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(),s.ajax({type:"POST",url:"/home/couponData",dataType:"html",data:{status:e,page:t},success:function(e){s("#employ").append(e),window.rePosFooter(),l.hideLoadingMask()}})}function i(){return s(window).scrollTop()+s(window).height()>s("body").height()-100?(u++,void n(c,u)):void 0}var a,s=e("jquery"),r=e("hammer"),d=e("mlellipsis"),l=e("js/plugin/loading"),c=0,u=1;d.init(),s(".yoho-footer").css("border-top","1px solid #e0e0e0"),s(".employ span").each(function(e){a=new r(s(".employ span")[e]),a.on("tap",function(t){s(".employ span").removeClass("active").eq(e).addClass("active"),s("#employ").html(" "),c=e,u=1,n(c,u),window.rePosFooter()})}),s(window).scroll(function(){window.requestAnimationFrame(i)}),n(c,u)}),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","hammer"],function(e,t,o){function n(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var i,a=e("jquery"),s=e("js/plugin/tip"),r=e("js/plugin/loading"),d=a(".action"),l=a(".add-address"),c=a("#yoho-footer"),u=a(".confim-mask"),h=a(".page-wrap"),p=a(".address-item");e("js/common"),h.first().css("min-height",function(){return a(window).height()-a("#yoho-header").height()-c.height()}),window.rePosFooter(),u.on("touchend",".cancel",function(e){return i=null,u.fadeOut(),!1}).on("touchend",".confim",function(){return r.showLoadingMask(),u.fadeOut(),a.ajax({method:"POST",url:"/home/delAddress",data:{id:i}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(s.show(e.message||"网络出了点问题~"),r.hideLoadingMask()):window.location.reload()}).fail(function(){s.show("网络出了点问题~"),r.hideLoadingMask()}).always(function(){i=null}),!1}),p.length<5&&l.attr("href",l.data("href")),l.on("touchend",function(){return p.length>=5?(s.show("您最多添加5个收货地址"),!1):void 0}),d.on("touchend",".del",function(){return i=a(this).data("id"),u.fadeIn(),!1}),d.on("touchstart","a,span",function(){a(this).css("background","#eee")}).on("touchend touchcancel","a,span",function(){a(this).css("background","transparent")}),a(".tel").each(function(e){a(".tel").eq(e).html(n(a(".tel").eq(e).html()))})}),define("js/me/browse-record",["jquery","lazyload","handlebars","source-map","hammer"],function(t,o,n){function i(e){var t=c.children(".browse-record-good").length;g||(1===f&&u.removeClass("hide"),g=!0,a.ajax({type:"GET",url:"/home/recordContent",data:{page:f+1},success:function(o){" "===o?(m=!0,h.addClass("hide"),p.removeClass("hide")):(0===t?(c.html(o),s()):(c.append(o),s(c.find(".browse-record-good:gt("+(t-1)+") .lazy"))),window.rePosFooter(),f++,e&&e())},complete:function(){g=!1}}))}var a=t("jquery"),s=t("lazyload"),r=t("js/plugin/loading"),d=t("js/plugin/tip"),l=t("js/me/dialog"),c=a(".records"),u=a(".load-more"),h=u.children(".more"),p=u.children(".no-more"),f=0,m=!1,g=!1,v=a(window).height();r.init(),r.showLoadingMask(),i(r.hideLoadingMask),a(window).scroll(function(){m||v+a(window).scrollTop()>a(document).height()-.25*c.height()&&i()}),c.on("touchstart",".del-icon",function(){var e=a(this).closest(".browse-record-good"),t=e.data("skn");l.showDialog({dialogText:"确定删除此条浏览记录吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){a.ajax({type:"GET",url:"/home/delRecord",data:{skn:t},success:function(e){200===e.code&&(l.showDialog({dialogText:"删除浏览记录成功",autoHide:2e3,fast:!0}),setTimeout(function(){window.history.go(0)},1200))}})})}),a(".deps").on("touchstart","span",function(){a(this).css("background","#eee")}).on("touchend touchcancel","span",function(){a(this).css("background","transparent")}),a(".invalidGoods").on("touchstart touchend",function(){var t=a(e.target).closest("span");if(!t.hasClass("del-icon"))return d.show("商品已下架"),!1})}),define("js/me/address-act",["jquery","hammer"],function(e,t,o){function n(e){m.html(e),b.on("touchend",function(){f.hide(),m.show(),C="list",v.html("地区选择")}),m.find(".address").each(function(e,t){var o=new d(t);o.on("tap",function(e){var t=r(e.target);"li"!==e.target.tagName.toLowerCase()&&(t=t.parent("li")),j.push(t.children(".caption").text().trim()),t.siblings().hide(),t.children("ul").show().children("li").show(),e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),m.find(".address-last").each(function(e,t){var o=new d(t);o.on("tap",function(e){var t=r(e.target);j.push(t.text().trim()),r('[name="area"]').val(j.join(" ")),r('[name="area_code"]').val(t.data("id")),f.show(),C="edit",v.html(y),m.hide(),m.find("ul").hide().find("li").removeClass("highlight"),m.children("ul").show().children("li").show(),j=[],e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),m.on("touchstart","li",function(){r(this).addClass("highlight")}).on("touchend touchcancel","li",function(){r(this).removeClass("highlight")})}function i(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var a,s,r=e("jquery"),d=e("hammer"),l=e("js/plugin/tip"),c=e("js/plugin/security"),u=e("js/plugin/loading"),h=r(".edit-address"),p=r(".submit"),f=r(".my-edit-address-page"),m=r(".my-address-list-page"),g=r(".nav-back"),v=r(".nav-title"),w=r("input, textarea"),y=v.html(),b=r(".area"),C="edit",j=[],x=r.queryString();r(f,m).css("min-height",function(){return r(window).height()-r("#yoho-header").height()}),g.attr("href","javascript:void(0);"),g.on("touchend",function(e){"list"===C?(m.hide(),f.show(),e.preventDefault(),C="edit",v.html(y),m.hide(),m.find("ul").hide().find("li").removeClass("highlight"),m.children("ul").show().children("li").show(),j=[]):window.history.go(-1)}),h.on("submit",function(){return a?!1:c.hasDangerInput(!1)?!1:r(this).find('[name="consignee"]').val()?r(this).find('[name="mobile"]').val()?r(this).find('[name="area_code"]').val()&&r(this).find('[name="area"]').val()?r(this).find('[name="address"]').val()?(a=!0,u.showLoadingMask(),p.css("background","#777"),r.ajax({method:"POST",url:"/home/saveAddress",data:r(this).serialize()}).then(function(e){"object"!==r.type(e)&&(e={}),200!==e.code?(l.show(e.message||"网络出了点问题~"),a=!1,u.hideLoadingMask()):"shopping"===x.refer?window.location.href="/cart/index/selectAddress":window.location.href="/home/address"}).fail(function(){l.show("网络出了点问题~"),a=!1,u.hideLoadingMask(),p.css("background","#444")}),!1):(l.show("地址不能为空"),!1):(l.show("省市区不能为空"),!1):(l.show("手机号不能为空"),!1):(l.show("收件人不能为空"),!1)}),p.on("touchend",function(){return c.hasDangerInput(!1)?!1:(w.blur(),h.submit(),!1)}).on("touchstart",function(){r(this).addClass("highlight")}).on("touchend touchcancel",function(){r(this).removeClass("highlight")}),window.localStorage&&window.localStorage.getItem&&(s=window.localStorage.getItem("chinaAddressList")),s?n(s):r.ajax({method:"GET",url:"/home/locationList",timeout:6e4}).then(function(e){n(e),window.localStorage&&window.localStorage.setItem&&window.localStorage.setItem("chinaAddressList",e)}).fail(function(){l.show("获取省市区列表失败")}),r(".phone").html(i(r(".phone").html())),r(".phone").on("touchend",function(){r(this).css("display","none"),r('input[name = "mobile"]').attr("type","text")}),r('input[name = "mobile"]').on("blur",function(){r(".phone").css("display","block"),r(".phone").html(r('input[name = "mobile"]').val()),r('input[name = "mobile"]').attr("type","hidden")})}),define("js/me/logistic",["jquery","hammer","lazyload"],function(e,t,o){function n(){l+d>r?window.rePosFooter():s.css("border-top","1px solid #f1f1f1")}function i(){return window.cookie("_Channel")||"boys"}var a=e("jquery"),s=a("#yoho-footer"),r=window.outerHeight,d=document.body.offsetHeight,l=s.height();a(document).ready(n),e("js/home/maybe-like")(i()),a(window).scrollTop(1).scrollTop(0)}),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)):f.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)):g.show("微信支付调取失败")},error:function(){g.show("请刷新本页面,完成微信支付")}})}function s(){var e=window.navigator.userAgent.toLowerCase();return e.indexOf("micromessenger")>0}function r(){var e=f(".app");e.each(function(e,t){return"weixin"===f(t).parent().attr("id")?(f(t).parent().css("display","none"),!1):void 0})}function d(){s()||r()}function l(e,t){f(e).css("background-position-y",t)}function c(){var e=f(".box"),t=null,o=null;e.each(function(e,n){t=f(n).find(".icon").find("div"),t.length>0&&(o=f(n).attr("id"),"alipay"!==o&&l(t,C[o]))})}function u(){f(".payapp-list").css("visibility","visible")}function h(){var e=f(".box");e.on("touchstart",function(e){f(this).addClass("bytouch")}).on("touchend touchcancel",function(){e.removeClass("bytouch")})}function p(){d(),m.hideLoadingMask(),u(),c(),h()}var f=e("jquery"),m=e("js/plugin/loading"),g=e("js/plugin/tip"),v=e("hammer"),w=document.getElementById("ordercode").value,y=document.getElementById("weixin"),b=y&&new v(y),C={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(),b&&b.on("tap",function(){a(w)}),m.showLoadingMask(),f(document).ready(p)}),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){a.ajax({type:"POST",url:"/home/ajaxCurrencyDetail",dataType:"html",data:{page:e},success:function(e){a(".coin-detail").append(e),window.rePosFooter()}})}function i(){return a(window).scrollTop()+a(window).height()>a("body").height()-100?(r++,void n(r)):void 0}var a=e("jquery"),s=e("js/plugin/loading"),r=1;s.showLoadingMask(),a(window).scroll(function(){window.requestAnimationFrame(i)}),n(r),a(document).ready(s.hideLoadingMask)}),define("js/me/currency-new",["jquery","hammer","lazyload"],function(e,t,o){function n(){return window.cookie("_Channel")||"boys"}e("js/home/maybe-like")(n())}),define("js/cart/entry",["jquery","mlellipsis","hammer","handlebars","source-map","swiper","lazyload","index"],function(e,t,o){e("js/cart/cart"),e("js/cart/gift-advance"),e("js/cart/order-ensure"),e("js/cart/select-coupon"),e("js/cart/select-address")}),define("js/cart/cart",["jquery","mlellipsis","hammer","handlebars","source-map","swiper","lazyload","index"],function(e,t,o){function n(){return window.isCookiesEnabled()?p(".cart-goods").length<=0&&!q:p(".cart-goods").length<=0}function i(){return b.not(".hide")}function a(){i().find(".shopping-cart-good .name").each(function(){this.mlellipsis(2)}),T=!0}function s(){return i().find(".cart-goods .icon-cb-checked").length>0?!0:!1}function r(){var e=i().find(".freebie");return e.length<=0?!1:!0}function d(){var e,t=!1;return"ordinary"===C?e=p(".common .low-stocks"):"advance"===C&&(e=p(".presell .low-stocks")),e.length<=0?t:(e.each(function(e,o){p(o).parent().parent().parent().siblings(".checkbox").hasClass("icon-cb-checked")&&(E+=1,t=!0)}),t)}function l(){v.showDialog({dialogText:"您还未选择赠品,是否去选择赠品",hasFooter:{leftBtnText:"我不要赠品",rightBtnText:"去选择"}},function(){window.location.href=i().find(".freebie > a").attr("href")},function(){var e=window.cookie("order-info");e&&window.setCookie("order-info",""),window.location.href="/cart/index/orderEnsure?cartType="+C})}var c,u,h,p=e("jquery"),f=e("mlellipsis"),m=e("hammer"),g=e("js/cart/chose-panel"),v=e("js/me/dialog"),w=e("js/plugin/loading"),y=e("js/plugin/tip"),b=p(".cart-content"),C=p("#cartType").val(),j=p(".cart-nav"),x=p(".shopping-cart-page"),k=!1,T=!1,q="true"===window.cookie("_yoho-cart-refreshByDelete")?!0:!1,E=0;w.showLoadingMask(),n()?e("js/product/recommend-for-you"):(q&&p("body").css("background-color","#f0f0f0"),e("js/cart/good")),x.css("display","block"),w.hideLoadingMask(),window.setCookie("_yoho-cart-refreshByDelete",!1),f.init(),"function"==typeof window.cookie&&"y"===window.cookie("_hasShowCartPresellTip")?(p("#presell-tip").removeClass("show").addClass("hide"),k=!0):p("#presell-tip").removeClass("hide").addClass("show"),"advance"===C&&(b.toggleClass("hide"),p("#common-cart-nav").removeClass("active"),p("#presell-cart-nav").addClass("active"),a(),p(window).trigger("scroll")),j.length>0&&(c=new m(document.getElementsByClassName("cart-nav")[0]),c.on("tap",function(e){var t=p(e.target).closest("li");t.hasClass("active")||("ordinary"===C?(C="advance",p("#cartType").val("advance")):(C="ordinary",p("#cartType").val("ordinary")),t.siblings(".active").removeClass("active"),t.addClass("active"),b.toggleClass("hide"),T===!1&&a(),p(window).trigger("scroll"))}),k||setTimeout(function(){p("#presell-tip").removeClass("show").addClass("hide"),window.setCookie("_hasShowCartPresellTip","y")},3e3)),p(".advance-buy").length>0&&(u=new m(document.getElementsByClassName("advance-buy")[0]),u.on("tap",function(e){window.location.href="/cart/index/advanceBuy?cartType="+C})),p(".freebie").length>0&&(h=new m(document.getElementsByClassName("freebie")[0]),h.on("tap",function(e){window.location.href="/cart/index/gift?cartType="+C})),p(".btn-balance").on("touchend",function(){var e=window.cookie("order-info");return E=0,d()?(y.show("所选商品中有"+E+"种库存不足的商品"),!1):r()?(l(),!1):void(s()?(e&&window.setCookie("order-info",""),window.location.href="/cart/index/orderEnsure?cartType="+C):y.show("请先勾选商品"))}),p(".off-shell-goods").on("touchstart touchend",function(e){var t=p(e.target).closest("span");if(!t.hasClass("icon-del"))return y.show("商品已下架"),!1}),p(".chose").on("touchend",function(){g.show()}),j.on("touchstart","li",function(e){p(this).addClass("bytouch")}).on("touchend touchcancel",function(){j.find("li").removeClass("bytouch")}),p(window).scrollTop(1).scrollTop(0)}),define("js/cart/good",["jquery","mlellipsis","lazyload","handlebars","source-map","hammer"],function(e,t,o){function n(e){this.goods_type=e.goods_type,this.buy_number=e.buy_number,this.product_sku=e.product_sku,this.selected=e.selected,this.hasPromotion=e.hasPromotion}function i(e,t,o,n,i){var a=l(e);return a.hasClass("chose-panel")?(d=i,u.remove(),a.appendTo("#mainCart"),u.init(),u.setEditModeWithSknId(t,o),n||u.disableNumEdit(),void u.show()):(m.show("出错啦!"),!1)}function a(e,t){v||(v=!0,l.ajax({url:"select",type:"post",data:{skuList:JSON.stringify(e)},success:function(e){200===e.code?t():m.show(e.message)},error:function(){m.show("网络异常")},complete:function(){v=!1}}))}function s(){var e,t=l(".shopping-cart-good .icon-cb-checked"),o=l(".shopping-cart-good .icon-checkbox");g.hasClass("icon-cb-checked")?(g.removeClass("icon-cb-checked").addClass("icon-checkbox"),e=!0):(g.removeClass("icon-checkbox").addClass("icon-cb-checked"),e=!1),e?t.each(function(e,t){l(t).removeClass("icon-cb-checked").addClass("icon-checkbox")}):o.each(function(e,t){l(t).removeClass("icon-checkbox").addClass("icon-cb-checked")}),window.location.href="/cart/index/index?cartType="+l("#cartType").val()}function r(e,t,o){var i={},s=l(".cart-content:not(.hide) .shopping-cart-good"),r=null,d=[];i.goods_type=t,i.selected=e?"N":"Y",s.each(function(e,t){r=l(t),i.product_sku=l(t).data("id"),i.hasPromotion=l(t).data("promotion"),i.buy_number=r.find(".count").eq(0).text().trim().replace("×",""),d.push(new n(i))}),a(d,o)}var d,l=e("jquery"),c=e("mlellipsis"),u=e("js/cart/chose-panel"),h=e("js/plugin/loading"),p=e("lazyload"),f=e("js/me/dialog"),m=e("js/plugin/tip"),g=l(".balance .checkbox"),v=!1;c.init(),p({try_again_css:"order-failure"}),setTimeout(function(){l(".shopping-cart-good .name").each(function(){this.mlellipsis(2)})},0),l(".cart-goods").on("touchstart",".checkbox",function(){var e=l(this),t=e.closest(".shopping-cart-good"),o=t.data("id"),i=t.data("promotion"),a=[],s={};return!e.hasClass("icon-cb-checked")&&e.siblings(".info").find(".low-stocks").length>0?(m.show("库存不足,无法购买"),!1):(s.goods_type=l("#cartType").val(),s.selected=e.hasClass("icon-cb-checked")?"N":"Y",s.product_sku=o,s.hasPromotion=i,s.buy_number=t.find(".count").eq(0).text().trim().replace("×",""),a.push(new n(s)),void l.ajax({type:"post",url:"select",data:{skuList:JSON.stringify(a)}}).then(function(t){200===t.code?(e.hasClass("icon-cb-checked")?e.removeClass("icon-cb-checked").addClass("icon-checkbox"):e.removeClass("icon-checkbox").addClass("icon-cb-checked"),window.location.href="/cart/index/index?cartType="+l("#cartType").val()):400===t.code&&m.show("网络异常")},function(){m.show("网络异常")}))}),l(".icon-edit").on("touchstart",function(e){var t,o,n,a,s,r=l(this),c=r.closest(".shopping-cart-good").data("skn");return r.parents(".off-shell-goods").length?(m.show("商品已下架"),!1):c===d?void u.show():(t=r.closest(".info").siblings(".checkbox"),o=r.closest(".deps").siblings(".few-tag"),n=r.closest(".shopping-cart-good").data("id"),a=r.data("count"),s=o.hasClass("gift-tag")||o.hasClass("plus-tag")?!1:!0,e.stopPropagation(),h.showLoadingMask(),void l.ajax({url:"/cart/index/goodinfo",data:{skn:c,buy_num:a},success:function(e){i(e,n,t.hasClass("icon-cb-checked"),s,c)},error:function(){m.show("网络异常"),window.location.reload()},complete:function(){h.hideLoadingMask()}}))}),l(".icon-del").on("touchstart",function(e){var t=l(this);e.stopPropagation(),f.showDialog({dialogText:"您确定要从购物车中删除吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){var e=t.closest(".shopping-cart-good").data("id"),o=t.closest(".shopping-cart-good").data("promotion"),n=t.data("count");l.ajax({method:"post",url:"/cart/index/del",data:{sku:e,hasPromotion:o,count:n}}).then(function(e){200===e.code?(f.showDialog({dialogText:"删除成功",autoHide:!0,fast:!0}),window.setCookie("_yoho-cart-refreshByDelete",!0),window.location.href="/cart/index/index?cartType="+l("#cartType").val()):m.show(e.message)},function(){m.show("网络异常"),window.location.reload()})})}),g.on("touchend",function(){var e=l("#cartType").val(),t=l(this).hasClass("icon-cb-checked");if("ordinary"===e){if(!t&&l(".common .low-stocks").length>0)return m.show("所选商品中含有库存不足的商品"),!1}else if("advance"===e&&!t&&l(".presell .low-stocks").length>0)return m.show("所选商品中含有库存不足的商品"),!1;r(t,e,s)}),l(".down").on("touchend",function(){u.show()})}),define("js/cart/gift-advance",["jquery","mlellipsis","lazyload","hammer"],function(e,t,o){function n(e,t){l.showLoadingMask(),i.get("/cart/index/giftinfo",{skn:e,promotionId:t}).then(function(e){return e?void c.show(e,function(){window.location.href="/cart/index/index?cartType="+h.cartType}):void d.show("网络错误")},function(){d.show("网络错误")}).always(function(){l.hideLoadingMask()})}var i=e("jquery"),a=e("mlellipsis"),s=e("lazyload"),r=e("hammer"),d=e("js/plugin/tip"),l=e("js/plugin/loading"),c=e("js/cart/chose-panel"),u=i(".gift-advance-page"),h=i.queryString();e("js/common"),s(i(".lazy")),a.init(),u.find(".chose").each(function(e,t){var o=new r(t);o.on("tap",function(e){var t=i(e.target),o=t.closest(".gift-advance-good").data("id"),a=t.closest(".advance-block").data("promotion-id");n(o,a)})}),setTimeout(function(){i(".gift-advance-good .name").each(function(){this.mlellipsis(2)})},0)}),define("js/cart/order-ensure",["jquery","lazyload","hammer"],function(e,t,o){function n(){var e,t=location.search.substr(1).split("&"),o=[],n={};for(e=0;e<t.length;e++)o=t[e].split("="),n[o[0]]=o[1],o=[];return n}function i(){return n().limitproductcode}function a(){var e=k("yohoCoin");m.showLoadingMask(),h.ajax({method:"POST",url:"/cart/index/orderCompute",data:{cartType:k("cartType")||"ordinary",deliveryId:k("deliveryId"),paymentTypeId:k("paymentTypeId"),couponCode:k("couponCode"),yohoCoin:e,skuList:i()?k("skuList"):void 0}}).then(function(e){"object"!==h.type(e)?window.location.reload():(void 0!==typeof e.last_order_amount&&(e.last_order_amount=(+e.last_order_amount).toFixed(2)),e.use_yoho_coin&&(b.find("em").html("- ¥ "+e.use_yoho_coin),C.html("已抵¥"+e.use_yoho_coin),b.find("em").show(),C.show()),u="",e.promotion_formula_list&&(h.each(e.promotion_formula_list,function(e,t){u+="<li><p>"+t.promotion+"</p><span>"+t.promotion_amount+"</span></li>"}),h(".price-cost span").html("¥"+e.last_order_amount),h(".bill span").html("¥"+e.last_order_amount),h(".total").html(u)))}).fail(function(){window.location.reload()}).always(function(){m.hideLoadingMask()})}function s(){var e=v.find('[name="invoice-title"]').val()||k("invoiceText"),t=h("#msg").find("input").val()||k("msg");if(l)return!1;if(k("invoice")){if(!e)return void f.show("请输入发票抬头");if(e.length>30)return void f.show("发票抬头不得超过30个汉字")}return t&&t.length>40?void f.show("留言不得超过40个汉字"):(m.showLoadingMask(),l=!0,void h.ajax({method:"POST",url:"/cart/index/orderSub",data:{addressId:k("addressId"),cartType:k("cartType")||"ordinary",deliveryId:k("deliveryId"),deliveryTimeId:k("deliveryTimeId"),invoiceText:k("invoice")?e:null,invoiceType:k("invoice")?v.find(".invoice-type").val()||k("invoiceType"):null,msg:t,paymentTypeId:k("paymentTypeId"),paymentType:k("paymentType"),couponCode:k("couponCode"),yohoCoin:k("yohoCoin"),skuList:i()?k("skuList"):void 0}}).then(function(e){var t;return e?void(200===e.code?(t=2===d?"/cart/index/paySuccess?order_code="+e.data.order_code:"/home/orders/pay?order_code="+e.data.order_code,window.setCookie("order-info",""),window.location.href=t):e.message&&f.show(e.message)):void f.show("系统繁忙,请稍后再试!")}).fail(function(){f.show("系统繁忙,请稍后再试!")}).always(function(){l=!1,m.hideLoadingMask()}))}function r(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var d,l,c,u,h=e("jquery"),p=e("lazyload"),f=e("js/plugin/tip"),m=e("js/plugin/loading"),g=e("js/cart/order-info"),v=h(".invoice"),w=h(".coupon-use.used"),y=h(".address-wrap"),b=h(".coin-check"),C=h(".coin .used"),j=h(".sub-block"),x=h.queryString(),k=g.orderInfo;e("js/common"),p(),window.getUid()!==k("uid")&&(g.init(),window.location.reload()),w.data("name")!==k("couponName")&&(k("couponCode",null),k("couponName",null)),document.referrer&&-1!==document.referrer.indexOf("/cart/index/index")&&(k("couponCode",null),k("couponName",null)),i()&&function(){var e=[],t=n();t.type="limitcode",e.push(t),k("skuList",JSON.stringify(e)),k("limitUrlSufix",location.search)}(),(x.cartType||x.carttype||!k("cartType"))&&k("cartType",x.cartType||x.carttype||"ordinary"),
h(".checkbox").on("touchstart",function(){var e=h(this);return e.hasClass("icon-cb-radio")?void e.removeClass("icon-cb-radio").addClass("icon-radio"):void(e.hasClass("icon-radio")&&e.removeClass("icon-radio").addClass("icon-cb-radio"))}),v.on("touchend",".checkbox",function(){var e=h(this);e.hasClass("icon-cb-radio")&&v.addClass("focus"),e.hasClass("icon-radio")&&v.removeClass("focus")}),k("addressId")||k("addressId",y.data("id")),h(".dispatch-mode").on("touchend","li",function(){k("deliveryId",h(this).data("id")),a()}),h(".dispatch-time").on("touchend","li",function(){k("deliveryTimeId",h(this).data("id"))}),h(".coin").on("touchend",function(){var e=h(this);e.find(".checkbox").hasClass("icon-cb-radio")?(k("yohoCoin",e.data("yoho-coin")),e.find(".can-use").hide()):(k("yohoCoin",0),e.find(".coin-check em").hide(),e.find(".can-use").show(),e.find(".used").hide()),a()}),v.on("touchend",".checkbox",function(e){var t=h(this);k("invoice",t.hasClass("icon-cb-radio")),e.preventDefault(),e.stopPropagation()}),v.find('[name="invoice-title"]').on("blur",function(){k("invoiceText",h(this).val())}).end().find(".invoice-type").on("change",function(){k("invoiceType",h(this).val())}),h("#msg").find("textarea").on("blur",function(){k("msg",h(this).val())}),h(".pay-mode").on("click","li",function(){var e=h(this);k("paymentTypeId",e.data("pay-id")),k("paymentType",e.data("pay-type")),d=e.data("pay-type")}),h("form").on("submit",function(){return!1}),h(".dispatch").on("touchend","h3",function(){h(this).siblings("ul").is(":hidden")?(h(".dispatch h3").removeClass("border-none"),h(this).addClass("border-none"),h(".down").removeClass("hide"),h(".up").addClass("hide"),h(".up",this).removeClass("hide"),h(".down",this).addClass("hide"),h(".dispatch ul").hide(),h(this).siblings("ul").show()):(h(this).removeClass("border-none"),h(".down",this).removeClass("hide"),h(".up",this).addClass("hide"),h(this).siblings("ul").hide())}),j.on("touchstart","li",function(){h.each(h(this).parents("ul").find("i"),function(){h(this).parents("ul").find("i").removeClass("icon-cb-radio").addClass("icon-radio")}),h(this).parents("ul").hide(),h(".down").removeClass("hide"),h(".up").addClass("hide"),h(".dispatch h3").removeClass("border-none"),c=h(this).find("span").html(),h(this).parents(".sub-block").find("h3 span").html(c),h(this).find("i").hasClass("icon-cb-radio")?h(this).find("i").addClass("icon-radio"):h(this).find("i").hasClass("icon-radio")&&h(this).find("i").addClass("icon-cb-radio")}),h(".bill a").on("touchstart",function(){k("paymentTypeId",h(".delivery-id .icon-cb-radio").data("id")),k("paymentType",h(".payment-type .icon-cb-radio").data("id")),d=h(".payment-type .icon-cb-radio").data("id"),s()}),h(".info-phone").html(r(h(".info-phone").html()))}),define("js/cart/order-info",["jquery","hammer"],function(e,t,o){function n(){a={uid:window.getUid(),deliveryId:i(".dispatch-mode .chosed").data("id")||1,deliveryTimeId:1,paymentTypeId:1,yohoCoin:0,addressId:null,couponCode:null,couponName:null,invoice:null,invoiceText:null,invoiceType:null,msg:null,cartType:"ordinary"},window.setCookie("order-info",JSON.stringify(a))}var i=e("jquery"),a=window.cookie("order-info");e("js/common");try{a=JSON.parse(a)}catch(s){n()}t.init=n,t.orderInfo=function(e,t){return void 0===t?a[e]:(a[e]=t,void window.setCookie("order-info",JSON.stringify(a)))}}),define("js/cart/select-coupon",["jquery","handlebars","source-map","hammer","mlellipsis"],function(e,t,o){function n(){var e=r(".null"),t=r(".nav-title").height(),o=e.height();return 0===e.length?!1:void e.css({top:b/2-o/2+t})}function i(e){var t=[];return r.isArray(e)?(e.length<10&&(m=!1),e.length||2!==f?(r.each(e,function(e,o){o.notAvailable&&t.push(o)}),y.append(g({coupons:e})).find(".employ-main").each(function(e,t){var o=new l(t);o.on("tap",function(e){var t=r(e.srcEvent.currentTarget),o=t.data("coupon-code");r.ajax({method:"POST",url:"/cart/index/couponSearch",data:{couponCode:o}}).then(function(e){200===e.code?(p("couponCode",e.data.coupon_code),p("couponName",e.data.coupon_title),window.location.href="/cart/index/orderEnsure"):e.message&&h.show(e.message)}).fail(function(){h.show("网络错误")})})}),t.length&&r(".not-avaliable-coupon-line").show(),r("#coupon-list-not").append(v({notAvailableCoupons:t})),void window.rePosFooter()):(r(".coupin-wrap").html(r("#tmpl-no-coupon").html()),void n())):void f--}function a(){m&&(s||(u.showLoadingMask(),f+=1,s=!0,r.ajax({type:"POST",url:"/cart/index/couponList",dataType:"json",data:{page:f}}).then(i).fail(function(){f-=1}).always(function(){s=!1,u.hideLoadingMask()})))}var s,r=e("jquery"),d=e("handlebars"),l=e("hammer"),c=e("mlellipsis"),u=e("js/plugin/loading"),h=e("js/plugin/tip"),p=e("js/cart/order-info").orderInfo,f=1,m=!0,g=d.compile(r("#tmpl-coupon").html()),v=d.compile(r("#tmpl-coupon-not-avaliable").html()),w=r("#new-coupon"),y=r("#coupon-list"),b=r(window).height();e("js/common"),c.init(),w.on("submit",function(){var e=r(this);return e.find('[name="couponCode"]').val()?(r.ajax({method:"POST",url:"/cart/index/couponSearch",data:e.serialize()}).then(function(e){e.message&&h.show(e.message),200===e.code&&(h.show("优惠券可用"),p("couponCode",e.data.coupon_code),p("couponName",e.data.coupon_title),window.location.href="/cart/index/orderEnsure")}).fail(function(){h.show("网络错误")}),!1):(h.show("请输入优惠券码"),!1)}),y.on("touchstart",".employ-main",function(){var e=r(this);e.siblings().removeClass("focus"),e.addClass("focus")}).on("touchend touchcancel",".employ-main",function(){var e=r(this);e.siblings().removeClass("focus"),e.removeClass("focus")}),r("body").on("touchend",".not-use",function(){p("couponCode",null),p("couponName",null)}),w.find("input").on("input",function(){""!==r(this).val()?w.find(".submit").css("background","#444"):w.find(".submit").css("background","#b0b0b0")}),a()}),define("js/cart/select-address",["jquery","hammer"],function(e,t,o){function n(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var i,a=e("jquery"),s=e("js/cart/order-info").orderInfo,r=a(".confim-mask");e("js/common"),a(".address-item").on("touchend",function(){var e=a(this),t=e.data("address-id"),o={address_id:e.data("address-id"),consignee:e.find(".name").text(),mobile:e.find(".tel").text(),address_info:e.find(".address-info").text(),is_support:e.data("is-support")};s("addressId",t),s("address",o),window.location.href=e.data("href")+(s("limitUrlSufix")||"")}).on("touchend",".edit",function(){return window.location.href=a(this).data("href"),!1}).on("touchstart",".del",function(){i=a(this).data("id")}),r.on("touchend",".confim",function(){s("addressId")===i&&(s("addressId",null),s("address",null))}),a(".tel").each(function(e){a(".tel").eq(e).html(n(a(".tel").eq(e).html()))})});