index.js 171 KB
define("index",["jquery","hammer","swiper","lazyload","mlellipsis","iscroll-probe","handlebars","source-map","index"],function(e,t,n){var o;e("js/common"),e("js/category/entry"),e("js/guang/entry"),e("js/home/entry"),e("js/index/entry"),e("js/passport/entry"),e("js/product/entry"),e("js/me/entry"),e("js/cart/entry"),e("js/life/entry"),n.exports=o}),define("js/common",["jquery","hammer"],function(e,t,n){function o(e){var t,n,o=document.cookie;return document.cookie&&""!==document.cookie&&(n=o.indexOf(e+"="),n>-1&&(n+=e.length+1,t=decodeURIComponent(h.trim(o.substring(n,o.indexOf(";",n)))))),t}function a(e,t,n){var o,a,i,s,r="";"undefined"!=typeof t&&(n=n||{},null===t&&(t="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(s=new Date,s.setTime(s.getTime()+24*n.expires*60*60*1e3)):s=n.expires,r="; expires="+s.toUTCString()),o=n.path?"; path="+n.path:"",a=n.domain?"; domain="+n.domain:"",i=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,o,a,i].join(""))}function i(){var e=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!==document.cookie.indexOf("testcookie")),e}function s(){var e,t=o("_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 l(){var e=o("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function d(){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,n=f.children(".op-row"),o=h(".back-to-top"),a=s();d(),0===a?(/MicroMessenger/i.test(navigator.userAgent)?(t="//m.yohobuy.com/passport/login/wechat?refer="+location.href,h(".login-btn").attr("href",t)):t="//m.yohobuy.com/signin.html?refer="+location.href,n.prepend('<a href="'+t+'">登录</a><span class="sep-line">|</span><a href="//m.yohobuy.com/reg.html">注册</a>')):n.prepend('<span>Hi,</span><a class="user-name" href="//m.yohobuy.com/home?tmp='+Math.random()+'">'+a[0]+'</a><a href="//m.yohobuy.com/passport/signout/index?token='+a[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,n,o,a){var i=t.createElement(n),s=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=a,e[a]=function(){e[a].p=arguments},i.async=1,i.src=o,s.parentNode.insertBefore(i,s)}(window,document,"script",("https:"===document.location.protocol?"https":"http")+"://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js","_yas"),function(){var e,t,n=r(),o=!1,a=3;n=0===n?"":n,window._ozuid=n,window._yas&&(window._yas(1*new Date,"1.0.15","yohobuy_m",n,"",""),e=function(e){var t={};e&&e&&e.length>a&&(t={page:e[0],floor:e[1],data:/_[1|0]$/.test(e.join("_"))?e[2]:e.slice(2).join("_")},window._yas.sendCustomInfo&&window._yas.sendCustomInfo(t,Boolean(parseInt(e[3])||1)))},t=function(){h(".buriedpoint").off("click"),h(document).on("click",".buriedpoint",function(t){var n=h(this).attr("data-bp-id")||"",i=n.split("_"),s=h(t.target),r=s.parents(".buriedpoint").length;!o&&i&&i.length>=a&&e(i),(s.hasClass("buriedpoint")&&r>0||r>=2)&&(o=!0)})},t(),h(document).on("rebindBpEvent",t),h(document).on("shouldSendBpData",function(t,n){var a;n&&n.length&&n.length>0&&(o=!1,a=n.split("_"),e(a))}))}(),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,n=0,o="webkit moz ms o".split(" "),a=window.requestAnimationFrame,i=window.cancelAnimationFrame;for(t=0;t<o.length&&(!a||!i);t++)e=o[t],a=a||window[e+"RequestAnimationFrame"],i=i||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];a&&i||(a=function(e,t){var o=(new Date).getTime(),a=Math.max(0,16-(o-n)),i=window.setTimeout(function(){e(o+a)},a);return n=o+a,i},i=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=a,window.cancelAnimationFrame=i}(),h.extend({queryString:function(){var e,t,n=[],o=window.location.search.slice(1).split("&");for(t=0;t<o.length;t++)e=o[t].split("="),n.push(e[0]),n[e[0]]=e[1];return n}}),11===f.find(".user-name").text().length&&f.find(".user-name").html(u(f.find(".user-name").text())),window.cookie=o,window.setCookie=a,window.isCookiesEnabled=i,window.getUser=s,window.getUid=r,window.getShoppingKey=l,window.rePosFooter=d,window.reMarginFooter=c}),define("js/category/entry",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){e("js/category/index"),e("js/category/brand")}),define("js/category/index",["jquery"],function(e,t,n){var o=e("jquery"),a=o(".category-nav"),i=o(".category-container"),s=i.children(".content"),r=i.find(".sub-level li"),l=i.find(".primary-level li"),d=s.not(".hide");!function(){var e=o(".yoho-header"),t=o("#search-input"),n=o(window).height()-e.outerHeight()-t.outerHeight()-a.outerHeight();i.css("min-height",n),s.height(n)}(),o("#search-input").focus(function(){o(this).blur()}),a.bind("contextmenu",function(e){return!1}),o(".category-container").bind("contextmenu",function(e){return!1}),a.on("touchend touchcancel",function(e){var t=o(e.target).closest("li"),n=t.index();t.hasClass("focus")||(a.find("li.focus").removeClass("focus"),t.addClass("focus"),d.addClass("hide"),d=s.eq(n).removeClass("hide"))}),i.on("touchend",function(e){var t,n,a,i=o(e.target);if(n=i.closest(".p-level-item"),n.length>0){if(a=n.index(),t=i.closest(".content").find(".sub-level"),i.hasClass("focus"))return;i.closest(".primary-level").children(".focus").removeClass("focus"),i.addClass("focus"),t.not(".hide").addClass("hide"),t.eq(a).removeClass("hide")}}),i.find(".primary-level").on("touchstart touchend touchcancel","li",function(){l.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),i.find(".sub-level").on("touchstart","li",function(){r.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),a.on("touchstart","li",function(){a.find("li").removeClass("bytouch"),o(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){a.find("li").removeClass("bytouch")})}),define("js/category/brand",["jquery","hammer","swiper","lazyload","index"],function(e,t,n){function o(){var e=y(".brand-list").find("p");e.on("touchstart",function(){e.css("background","#fff"),y(this).css("background","#eee")}).on("touchend touchcancel",function(){y(this).css("background","#fff")})}function a(e){y.ajax({type:"POST",url:"/brands/addBrandSearch",data:"brandName="+encodeURIComponent(e),success:function(e){},error:function(){}})}function i(e,t){return e.time>t.time?1:e.time<t.time?-1:0}function s(){H.val().length?(E.css("color","#444"),z.show().find(".clear-text").show()):(E.css("color","#b2b2b2"),z.find(".clear-text").hide()),d()}function r(){var e="test",t=Window.prototype.localStorage;try{return t.setItem(e,"testValue"),t.removeItem(e),!0}catch(n){return!1}}function l(e,t){e.on("click","p , li",function(e){var n,o,i,l,d,c=y(this).find("a"),u=new Date,h=c.attr("brandName")+T+u.getTime();if(n=c.attr("brandName"),o=c.attr("brandId"),i=c.attr("brandDomain"),l=c.attr("href"),e.preventDefault(),F.length>0)return a(n),t?void(location.href=l):(H.val(n),void s());if(localStorage){if(r()&&(d=localStorage.getItem("historys-brand")),d=d?d:"",d.indexOf(k+h+k)>-1)return H.val(n),void s();""===d&&(h=k+h),d+=h+k,r()&&localStorage.setItem("historys-brand",d)}return t?void(location.href=l):(H.val(n),void s())})}function d(){var e=(H.val()+"").toLowerCase(),t={},n=0,a="";""!==e&&(y.each(g,function(n,o){y.isArray(o)&&y.each(o,function(o,a){a.searchName.toLowerCase().indexOf(e)>-1&&(t[n]=t[n]||[],t[n].push(a))})}),y.each(t,function(e,t){var o=['<div class="brand-list bar-',n,'">'];n++,o.push('<div class="title-bar"><h2>'),o.push(e),o.push("</h2></div>"),y.each(t,function(e,t){o.push('<p><a href="'+t.url+'" brandName = "'+t.name+'" brandId = "'+t.brandId+'" brandDomain = "'+t.brandDomain+'">'+t.name),t.isNew&&o.push('<i class="icon-new">NEW</i>'),t.isHot&&o.push('<i class="icon-hot">HOT</i>'),o.push("</a></p>")}),o.push("</div>"),a+=o.join("")})),e.length>0?y(".search-brand-page").addClass("hide"):y(".search-brand-page").removeClass("hide"),y(".search-result").html(a),o(),l(y(".brand-list"),!0)}function c(){var e=y(window).scrollTop();q.eq(0).offset().top<m&&p.hide(),q.each(function(){var t=y(this).offset().top-A;e>=t&&p.css({display:"block"}).find("h2").html(y(this).find(".title-bar").text())})}function u(){y.ajax({type:"GET",url:"/brands/delBrandHistory",data:"",success:function(e){},error:function(){}})}var h,p,f,m,g,v,w,y=e("jquery"),b=e("hammer"),C=e("swiper"),j=e("js/plugin/loading"),x=e("lazyload"),k=" ??++ ",T=" ???--- ",q=y(".brand-list"),E=y(".search-icon"),I=y(".genderNav li"),S=y(".brandNav li"),L=y(".new-brand-wall"),D=y(".recommand-brand-wall"),z=y(".search-action"),_=y(".homebuttom"),P=y(".genderNav"),M=y(".newbrand-search"),F=y(".net-history"),O=y(".nav-home"),N=y(".newbrand-search").outerHeight(),B=y(".yoho-header").outerHeight(),A=parseInt(N)+parseInt(B)-1,H=y("#keyword"),R=y(".local-history"),U=y(".search-brand-page"),W=y(".history-search"),V=y(".hot-search"),G=y("#clear-history");o(),j.showLoadingMask(),x(y("img.lazy")),y(".yoho-header").css({"z-index":2,position:"fixed",top:0}),_.css("top","47px"),_.css("position","fixed"),O.on("touchstart",function(){_.hasClass("hide")?(P.css("top","47px"),M.css("margin-top","0px"),U.css("margin-top","0px"),y(".banner-top").css("margin-top","0px")):(P.css("top","97px"),M.css("margin-top","47px"),U.css("margin-top","47px"),y(".banner-top").css("margin-top","47px"))}),function(){y(".banner-top").length>0&&y(".hot-brands").css("padding-top","0"),y(".hide-when-loading").show(),j.hideLoadingMask(),h=new C(".swiper-container",{lazyLoading:!0,loop:!0,autoplay:3e3,pagination:".swiper-pagination .pagination-inner"}),f=new C(".brands-swiper",{grabCursor:!0,slidesPerView:"auto",wrapperClass:"brands-list",slideElement:"li"})}(),p=y('<div class="title-bar fixed-title-bar"><h2></h2></div>'),p.css({position:"fixed",top:A}).hide(),m=A+y(".hot-brands").outerHeight()+y(".banner-top").outerHeight(),q.last().append(p),y(".brand-index-page").length>0&&y(window).scroll(function(){window.requestAnimationFrame(c)}),y(".history-search").length>0&&l(y(".history-search"),!1),y(".hot-search").length>0&&l(y(".hot-search"),!1),y(".brand-search-page").length>0&&(g=y.parseJSON(y("#brands-data").html()),H.on("input",function(){s()}),E.css("color","#444"),H.closest(".search-box").css("width","11.25rem"),z.show().find(".clear-text").hide(),v=new b(y(".clear-text")[0]),v.on("tap",function(e){y(".search-result").html(""),y("#keyword").val("").trigger("input"),e.preventDefault(),e.srcEvent.stopPropagation()}),y("form.search-box").on("submit",function(){return!1})),I.length>0&&I.on("touchstart",function(){function e(){window.location.search="channel="+t}var t=y(this).data("id")+1;y(".genderNav ul .active").removeClass("active"),y(this).addClass("active"),y(".hide-when-loading").hide(),j.showLoadingMask(),setTimeout(e.bind(this),100)}),S.length>0&&S.on("click",function(){var e=y(this).data("id");y(".brandNav ul .active").removeClass("active"),y(this).addClass("active"),0===e?(D.not(".hide").addClass("hide"),L.not(".hide").addClass("hide"),q.removeClass("hide")):1===e?(L.removeClass("hide"),q.not(".hide").addClass("hide"),D.not(".hide").addClass("hide")):(D.removeClass("hide"),q.not(".hide").addClass("hide"),L.not(".hide").addClass("hide"))}),y(".brand-search-page").length>0&&(w=new b(G[0]),w.on("tap",function(){r()&&localStorage.removeItem("historys-brand"),R.html(""),W.hide(),G.hide(),y(".net-search").length>0&&u(),window.rePosFooter()}),function(){var e,t,n,o,a,s,l,d,c,u,h,p,f,m,g,v="";if(h=[],p=[],d=[],F.find("li").each(function(){a=y(this).find("a").attr("brandName"),l=y(this).find("a").attr("collectTime"),c={brand:a,time:l},d.push(c)}),localStorage&&(r()&&(t=localStorage.getItem("historys-brand")),t&&t.length>0))for(t=t.split(k),n=t.length;n>0;n--)e=t[n-1],""!==e&&(o=e.split(T),a=o[0],l=o[1],c={brand:a,time:l},h.push(c));if(0===h.length&&0===d.length)return void W.addClass("hide");if(m={},g={},h.length>0)for(u in h)h.hasOwnProperty(u)&&(g=h[u],(!m[g.brand]||m[g.brand]<g.time)&&(m[g.brand]=g.time));if(d.length>0)for(c in d)d.hasOwnProperty(c)&&(g=d[c],(!m[g.brand]||m[g.brand]<g.time)&&(m[g.brand]=g.time));s={};for(f in m)m.hasOwnProperty(f)&&(s={brand:f,time:m[f]},p.push(s));if(p.sort(i),p.length>0)for(n=p.length-1;n>=(p.length>10?p.length-10:0);n--)a=p[n].brand,l=p[n].time,v+='<li><a brandName = "'+a+'">'+a+"</li>",R.removeClass("hide"),R.html(v),G.removeClass("hide"),V.removeClass("hide"),window.rePosFooter();else R.addClass("hide")}())}),define("js/plugin/loading",["jquery"],function(e,t,n){function o(e){var t='<div class="loading-mask hide"><div class="loading"><div></div><div></div><div></div></div></div>';d=!0,void 0===e&&(e=l),e.append(t),s=e.children(".loading-mask")}function a(){d||(o(),d=!0),s.removeClass("hide")}function i(){s.addClass("hide")}var s,r=e("jquery"),l=r(".yoho-page"),d=!1;t.init=o,t.showLoadingMask=a,t.hideLoadingMask=i}),define("js/guang/entry",["jquery","lazyload","swiper","hammer","mlellipsis","iscroll-probe","index"],function(e,t,n){e("js/guang/plus-star/list"),e("js/guang/plus-star/detail"),e("js/guang/home"),e("js/guang/list"),e("js/guang/detail"),e("js/guang/star-classroom"),e("js/guang/calendar"),e("js/guang/collocation-list"),e("js/guang/check-top")}),define("js/guang/plus-star/list",["jquery","lazyload","swiper","index"],function(e,t,n){var o,a=e("jquery"),i=e("lazyload"),s=e("swiper"),r=a("#nav-tab > li"),l=a("#ps-content > .content");i(a("img.lazy")),a(".star-content li").each(function(e,t){a(t).find(".swiper-container").addClass("swiper-"+e),o=new s(".swiper-"+e,{lazyLoading:!0,pagination:".swiper-"+e+" .pagination-inner"})}),a("#nav-tab").bind("contextmenu",function(e){return!1}),a("#nav-tab").on("touchend touchcancel",function(e){var t=a(e.target).closest("li");t.hasClass("focus")||(r.toggleClass("focus"),l.toggleClass("hide"),a(document).trigger("scroll"))}),a("#nav-tab").on("touchstart",function(e){var t=e.target||e.srcElement;t.className="bytouch "+t.className}).on("touchend touchcancel",function(){r.removeClass("bytouch")})}),define("js/guang/plus-star/detail",["jquery","hammer","mlellipsis","lazyload","swiper","index"],function(e,t,n){var o,a,i,s,r,l,d=e("jquery"),c=e("hammer"),u=e("mlellipsis"),h=e("lazyload"),p=d("#intro"),f=d("#intro-more-txt"),m=d("#related-infos-container"),g=e("js/guang/info"),v=e("js/plugin/tip"),w=d("#brand-info").data("id"),y=d("#jump-to-app").val();e("js/plugin/wx-share"),u.init(),h(d("img.lazy")),d(".good-detail-text .name").length>0&&d(".good-detail-text .name").each(function(){r=d(this),l=r.find("a"),l[0].mlellipsis(2)}),p[0].mlellipsis(3),setTimeout(function(){o=p.text(),a=p.attr("title")}),g.initInfosEvt(m),i=new c(document.getElementById("more-intro-click-range")),i.on("tap",function(e){var t=f.parent();t.toggleClass("spread"),t.hasClass("spread")?(p.text(a),f.text("收起")):(p.text(o),f.text("more"),d(window).scrollTop(0,400)),e.preventDefault()}),s=new c(document.getElementById("brand-like")),s.on("tap",function(e){var t="ok",n=d(e.target);"1"!==y&&(e.preventDefault(),n.hasClass("like")&&(t="cancel"),d.ajax({type:"POST",url:"/guang/opt/favoriteBrand",data:{id:w,opt:t},success:function(e){200===e.code?(n.toggleClass("like"),v.show(e.message)):400===e.code||412===e.code?location.href=e.data:v.show(e.message)},error:function(){v.show("网络断开连接了~")}}))})}),define("js/guang/info",["jquery","hammer","mlellipsis","lazyload","swiper","index"],function(e,t,n){function o(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?n[2]:null}function a(e){void 0!==typeof e&&(b[e]=new h(".swiper-cont-"+e,{lazyLoading:!0,wrapperClass:"swiper-wrap-"+e,pagination:".swiper-pagi-"+e,autoplay:3e3}))}function i(e){u(e.find("img.lazy")),e.each(function(){var e=l(this),t=e.find(".info-title"),n=e.find(".info-text");t[0].mlellipsis(2),n[0].mlellipsis(2)})}function s(e){var t;"undefined"!=typeof e&&"undefined"!=typeof e[0]&&(t=new d(e[0]),t.on("tap",function(e){var t,n,a,i=l(e.target),s="ok";return t=i.closest(".like-btn"),t.length>0&&!C?(e.preventDefault(),t.hasClass("like")&&(s="cancel"),n=i.closest(".guang-info"),C=!0,void l.ajax({type:"POST",url:"/guang/opt/praiseArticle",data:{id:n.data("id"),opt:s},success:function(e){var n=e.code;200===n&&(t.next(".like-count").text(e.data),t.toggleClass("like"))},error:function(){p.show("网络断开连接了~")},complete:function(){C=!1}})):(t=i.closest(".collect-btn"),void(t.length>0&&(e.preventDefault(),t.hasClass("collected")&&(s="cancel"),n=i.closest(".guang-info"),o("yh_channel")&&(a=o("yh_channel")),l.ajax({type:"POST",url:"/guang/opt/collectArticle",data:{id:o("id"),opt:s,yh_channel:a,uid:o("uid")},success:function(e){e.code&&200===e.code&&(e.data.jump?(l("#intimacy-link").length<=0&&l("body").append("<a href='"+e.data.jumpUrl+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),l(".intimacy-link").click()):t.toggleClass("collected"))},error:function(){p.show("网络断开连接了~")}}))))}),i(e.find(".guang-info")))}function r(e,t,n){var o;y||t.end||(1===t.page&&f.showLoadingMask(),o=e.find(".guang-info").length,y=!0,l.ajax({type:"GET",url:n?n:"/guang/index/page",data:t,success:function(n){var s;return" "===n?(t.end=!0,y=!1,g.addClass("hide"),void v.removeClass("hide")):(e.append(n),w=e.find(".swiper-container"),w.length&&(w.addClass("swiper-cont-"+t.type),w.children(".swiper-wrapper").addClass("swiper-wrap-"+t.type),w.children(".swiper-pagination").addClass("swiper-pagi-"+t.type),a(t.type)),s=o>0?e.find(".guang-info:gt("+(o-1)+")"):e.find(".guang-info"),i(s),1===t.page&&(f.hideLoadingMask(),g.removeClass("hide"),window.rePosFooter()),t.page++,y=!1,void delete t.isTab)},error:function(){p.show("网络断开连接了~"),y=!1,delete t.isTab}}))}var l=e("jquery"),d=e("hammer"),c=e("mlellipsis"),u=e("lazyload"),h=e("swiper"),p=e("js/plugin/tip"),f=e("js/plugin/loading"),m=l("#load-more-info"),g=l(""),v=l(""),w=l(""),y=!1,b={},C=!1;c.init(),m.length>0&&(g=m.children(".loading"),v=m.children(".no-more")),t.mySwiper=b,t.initSwiper=a,t.initInfosEvt=s,t.setLazyLoadAndMellipsis=i,t.loadMore=r}),define("js/plugin/tip",["jquery"],function(e,t,n){function o(e,t){var n,o;"undefined"!=typeof e&&(n=e.toString(),o=t&&t>0?t:2e3,a.text(n).show(),i=setTimeout(function(){"block"===a.css("display")&&a.hide()},o))}var a,i,s=e("jquery");!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),a=s("#yoho-tip"),a.on("touchend",function(){a.hide(),clearTimeout(i)})}(),t.show=o}),define("js/plugin/wx-share",["jquery"],function(e,t,n){var o=e("jquery");n.exports=function(){var e="/life/getSignPackage";o.getJSON(e+"?pageurl="+encodeURIComponent(location.href.split("#")[0])+"&callback=?",function(e){var t,n,o,a;wx&&void 0!==e&&""!==e&&(t=e.appId.toString(),n=e.timestamp,o=e.nonceStr.toString(),a=e.signature.toString(),wx.config({debug:!1,appId:t,timestamp:n,nonceStr:o,signature:a,jsApiList:["checkJsApi","onMenuShareTimeline","onMenuShareAppMessage","onMenuShareQQ","onMenuShareWeibo","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","translateVoice","startRecord","stopRecord","onRecordEnd","playVoice","pauseVoice","stopVoice","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","closeWindow","scanQRCode","chooseWXPay","openProductSpecificView","addCard","chooseCard","openCard"]}))}),wx.ready(function(){var e=o("#shareTitle").val(),t=o("#shareImg").val(),n=o("#shareDesc").val(),a=o("#shareLink").val(),i={title:e,desc:n,imgUrl:t,link:a};wx.onMenuShareAppMessage(i),wx.onMenuShareTimeline(i),wx.onMenuShareQQ(i),wx.onMenuShareWeibo(i)})}}),define("js/guang/home",["jquery","hammer","mlellipsis","lazyload","swiper","index"],function(e,t,n){function o(){var e=h.not(".hide");a(window).scrollTop()+c>=a(document).height()-.25*e.height()&&s(e,g[m])}var a=e("jquery"),i=e("js/guang/info"),s=i.loadMore,r=a("#load-more-info"),l=a(""),d=a(""),c=a(window).height(),u=a("#info-list"),h=u.children(".info-list"),p=a("#guang-nav"),f=p.children(".focus"),m=f.data("type"),g={};r.length>0&&(l=r.children(".loading"),d=r.children(".no-more")),i.initSwiper(m),i.initInfosEvt(u),function(){var e=a("#gender").val();p.children(".guang-nav-item").each(function(){var t=a(this).data("type"),n=a(this).hasClass("focus");g[t]={page:n?2:1,gender:e,type:t,end:!1}})}(),p.bind("contextmenu",function(e){return!1}),p.on("touchend touchcancel",function(e){var t,n,o=a(e.target).closest(".guang-nav-item");o.hasClass("focus")||(n=o.index(),o.addClass("focus"),f.removeClass("focus"),t=h.eq(n),f=o,m=o.data("type"),1===g[m].page?(l.addClass("hide"),d.addClass("hide"),g[m].isTab=!0,s(t,g[m])):g[m].end?(l.addClass("hide"),d.removeClass("hide")):(l.removeClass("hide"),d.addClass("hide")),h.not(".hide").addClass("hide"),t.removeClass("hide"),1===g[m].page&&window.rePosFooter())}),a(document).scroll(function(){window.requestAnimationFrame(o)}),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,n){function o(){a(window).scrollTop()+r>=a(document).height()-.25*p.height()&&s(p,h)}var a=e("jquery"),i=e("js/guang/info"),s=i.loadMore,r=a(window).height(),l=a("#author-infos"),d=a("#tag"),c=a("#gender"),u=a("#isApp"),h={page:2,end:!1},p=a("#info-list");i.initInfosEvt(p),l.length>0&&a.extend(h,{authorId:l.data("id"),isApp:u.val()}),d.length>0&&a.extend(h,{tag:d.val(),gender:c.val(),isApp:u.val()}),a(window).scroll(function(){window.requestAnimationFrame(o)})}),define("js/guang/detail",["jquery","mlellipsis","lazyload","iscroll-probe"],function(e,t,n){function o(e){var t=e.offset().left,n=-C+t+y/2+"px";r.css({backgroundPosition:n+" bottom"}),v&&b.css({backgroundPosition:n+" bottom"})}function a(e){var t,n,a,i=h(e.currentTarget),p=i.index();i.hasClass("focus")||(l.filter(".focus").removeClass("focus"),v&&(t=i.closest(".fixed-thumb-container").length>0?r:b,n=t.find(".thumb").eq(p),b.find(".thumb.focus").removeClass("focus"),n.addClass("focus")),i.addClass("focus"),o(i),d.not(".hide").addClass("hide"),a=d.eq(p),a.removeClass("hide"),f(a.find(".lazy")),v?u&&u.scrollToElement(c,400):h("body").animate({scrollTop:s.offset().top},400),u&&u.refresh())}function i(){var e,t,n,o,a,i=h("#scroller"),l=h(".yoho-header"),d=0;return l.length>0&&(d=l.outerHeight()),u=new m("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),w?(e=h(window).height()-d,a=b[0],t=r.outerHeight(),n=s.outerHeight(),o=s.offset().top-d,void u.on("scroll",function(){var s=-this.y,r=a.className;o-e+t>=s?-1===r.indexOf("fixed-bottom")&&b.addClass("fixed-bottom").removeClass("hide"):o>=s?-1===r.indexOf("hide")&&b.addClass("hide").removeClass("fixed-bottom fixed-top"):o+n-t>=s?-1===r.indexOf("fixed-top")&&b.addClass("fixed-top").removeClass("hide absolute").css("top",""):o+n>=s?(-1===r.indexOf("absolute")&&b.addClass("absolute").removeClass("fixed-top hide"),a.style.top=o+d+n-t-s+"px"):s>o+n&&-1===r.indexOf("hide")&&b.addClass("hide").removeClass("absolute"),i.trigger("scroll")})):void u.on("scroll",function(){i.trigger("scroll")})}var s,r,l,d,c,u,h=e("jquery"),p=e("mlellipsis"),f=e("lazyload"),m=e("iscroll-probe"),g=h(".author .intro"),v=!1,w=h(".collocation-block").length>0,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()},h("img").on("load",function(){u&&u.refresh()}),t.i=function(e){var t,n,c=navigator.userAgent.indexOf("iPhone")>0;v=c&&e,p.init(),h(".good-detail-text .name").length>0&&h(".good-detail-text .name").each(function(){t=h(this),n=t.find("a"),n[0].mlellipsis(2)}),f(h(".lazy")),h(".info-list .title, .one-good .reco-name").each(function(){this.mlellipsis(2)}),g.offset()&&parseInt(g.offset().left,10)===parseInt(g.css("margin-left"),10)&&g.css("padding-top",0),v&&(h(".yoho-header").length>0?h("#wrapper").addClass("ios has-head"):h("#wrapper").addClass("ios")),w&&(s=h(".collocation-block"),r=s.children(".thumb-container"),l=r.find("li"),d=s.find(".prod"),y=l.width(),v&&(b=h("#wrapper").after(r.clone().addClass("fixed-thumb-container fixed-bottom")).next(".thumb-container"),f(b.find(".lazy"),{event:"sporty"})),o(l.filter(".focus")),r.delegate(".thumb","touchend",a),v&&b.delegate(".thumb","touchend",a)),v&&i()}}),define("js/guang/star-classroom",["jquery","swiper","lazyload","index"],function(e,t,n){function o(e){var t,n=new Image;t=e.data("avatar"),n.src=t,n.onload=function(){e.css("background-image","url("+t+")")}}function a(e){var t,n,a=d(".fan-charts-cont"),i=d(".my-intimacy"),s=d(".increased"),r=e.signDay.split(","),l="",c="",h=new Date,p=h.getFullYear(),f=h.getMonth(),m=u.calculateMonthDays(f,p);if(r.length>0)for(t=0;m>t;t++)for(n=0;n<r.length;n++)t===parseInt(r[n])&&d(".now-days").eq(t-1).addClass("sign-item");for(t=0;t<e.fanCharts.length;t++)c=0===t?"font-bold":"",l+='<li><i class="rank-ico">'+e.fanCharts[t].num+'</i><span data-avatar="'+e.fanCharts[t].img+'" class="rank-avatar"></span><span class="fans-name">'+e.fanCharts[t].name+'</span><div class="fans-intimacy">亲密度<span class="'+c+'">'+e.fanCharts[t].intimacyNum+"</span></div></li>";a.html(l),d(".fan-charts-cont .rank-avatar").each(function(e,t){""!==d(t).attr("data-avatar")&&o(d(t))}),i.find("span").html(e.todayIntimacy),s.find("span").html(e.todayIntimacy),0===e.intimacyNum?(d(".my-intimacy").hide(),d(".increased").show()):(d(".my-intimacy").show(),d(".increased").hide()),d(".pop-intimacy").css({zIndex:"10"}).show(),d(".classroom-mask").css({zIndex:"9"}).show(),d("body").css({overflow:"hidden"})}function i(e,t){return t+=/^[\u0000-\u00ff]$/.test(e)?1:2}function s(){var e,t,n=d(".home-floor-sign").find(".user-name"),o=n.html(),a=o.length,s=0,r="";for(e=0;a>e;e++)t=o.charAt(e),s=i(t,s),5>s&&(r+=t);s>8?r+=".."+o.charAt(a-1):r=o,n.html(r)}var r,l,d=e("jquery"),c=e("swiper"),u=e("js/guang/calendar"),h=e("lazyload"),p=e("js/plugin/tip");h(d("img.lazy")),d("body").addClass("star-class-body"),d(".banner-swiper").find("li").length>1&&(r=new c(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),d(".collocation-swiper").find("li").length>1&&(l=new c(".collocation-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,lazyLoadingOnTransitionStart:!0,grabCursor:!0,slidesPerView:"auto",slideElement:"li",watchSlidesVisibility:!0})),d(".artice-zan").find("li").length>0&&d(".zan-more").show(),d(".home-floor-sign").length>0&&s(),d(document).on("touchstart",".like-ico",function(e){var t=d(this),n="";e.stopPropagation(),d.ajax({type:"POST",url:"/guang/starclass/setPraise",data:{articleId:t.parents("li").attr("articleId")},success:function(e){var o=e.code;200===o&&(t.hasClass("like")?t.removeClass("like"):t.addClass("like"),n=e.num>99?"+":"",t.parent().find(".zan-more").html(e.num+n))},error:function(){p.show("网络断开连接了~")}})}),d(".add-intimacy").on("touchstart",function(e){e.stopPropagation(),e.preventDefault(),d.ajax({type:"GET",url:"/guang/starclass/sign",success:function(e){var t=e.code;200===t&&a(e.data),201===t&&(d("#intimacy-link").length<=0&&d("body").append("<a href='"+e.data+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),d(".intimacy-link").click())},error:function(){p.show("网络断开连接了~")}})}),d(".pop-intimacy .pop-close, .classroom-mask").on("click",function(){history.go(0)}),""!==d(".user-head").attr("data-avatar")&&o(d(".user-head"))}),define("js/guang/calendar",["jquery"],function(e,t,n){var o=e("jquery"),a={currentYear:0,currentMonth:0,initialize:function(){var e;e=this.createCalendar(0,0),o("#Container").append(e)},isRuiYear:function(e){return 0===e%4&&(e%100!==0||e%400===0)},calculateWeek:function(e,t,n){var o,a,i;return o="7123456".split(""),a=parseInt(n,10),i=o[new Date(e,t-1,a).getDay()]},calculateMonthDays:function(e,t){var n,o=0;return 0===e||1===e||3===e||5===e||7===e||8===e||10===e||12===e?o=31:2===e?(n=this.isRuiYear(t),o=n===!0?29:28):o=30,o},createCalendar:function(e,t){var n,a,i,s,r,l,d,c,u,h=["January","February","March","April","May","June","July","August","September","October","November","December"];if(n=o('<div class="day-item"></div>'),a=new Date,i=0===e?a.getFullYear():e,this.currentYear=i,s=0===t?a.getMonth()+1:t,this.currentMonth=s,r=this.calculateMonthDays(s,i),window.nowDaysNub=r,o(".cur-year").html(i),o(".cur-month").html(h[s-1]),l=parseInt(this.calculateWeek(i,s,1)),d=this.calculateMonthDays(s-1,i),0!==l)for(c=d-l;d>c;c++)n.append('<div class="item last-item">'+(c+1)+"</div>");for(c=1;r>=c;c++)n.append('<div class="item now-days">'+c+"</div>");if(u=l+r,41>u)for(c=0;41-u>=c;c++)n.append('<div class="item last-item">'+(c+1)+"</div>");return n}};o(document).ready(function(){a.initialize()}),t.calculateMonthDays=a.calculateMonthDays}),define("js/guang/collocation-list",["jquery","lazyload","mlellipsis"],function(e,t,n){function o(e){var t,n,o;r.showLoadingMask(),i.ajax({type:"GET",url:"/guang/starclass/ajaxCollocation",data:{page:e},dataType:"html",success:function(e){c=!1," "===e&&(c=!0,s.show("没有更多内容了")),i(".collocation-list").append(e),i(".cont-area").each(function(){t=i(this),n=t.find(".title"),o=t.find(".cont-txt"),n[0].mlellipsis(2),o[0].mlellipsis(2)}),r.hideLoadingMask(),l(i("img.lazy"))},error:function(){s.show("网络断开连接了~")}})}function a(){!c&&i(window).scrollTop()+i(window).height()>i("body").height()-100&&(c=!0,u++,o(u))}var i=e("jquery"),s=e("js/plugin/tip"),r=e("js/plugin/loading"),l=e("lazyload"),d=e("mlellipsis"),c=!1,u=1;d.init(),i("body").addClass("star-class-body"),window.successShare=function(){i.ajax({type:"POST",url:"/guang/starclass/forward",success:function(e){var t=e.code;200===t&&e.data>0&&s.show("分享成功,亲密度+10")},error:function(){s.show("网络断开连接了~")}})},i(window).scroll(function(){a()}),0===i(".collocation-list").find("li").length&&o(1),i(document).on("touchstart",".collection",function(e){var t,n=i(this),o=n.find(".collected-ico");e.stopPropagation(),t=o.hasClass("collected")?"del":"fav",i.ajax({type:"POST",url:"/guang/starclass/setFavorite",data:{articleId:n.parents("li").attr("articleId"),type:t},success:function(e){var t=e.code;200===t&&(o.hasClass("collected")?o.removeClass("collected"):o.addClass("collected")),201===t&&(i("#collocation-link").length<=0&&i("body").append("<a href='"+e.data+'\' style="display:none;" id="collocation-link"><span class="collocation-link"></span></a>'),i(".collocation-link").click())},error:function(){s.show("网络断开连接了~")}})})}),define("js/guang/check-top",["jquery"],function(e,t,n){function o(e){var t,n=new Image;t=e.data("avatar"),n.src=t,n.onload=function(){e.css("background-image","url("+t+")")}}var a=e("jquery");a("body").addClass("star-class-body"),
a(".ranking-area li").length>0&&a.each(a(".ranking-area li"),function(e,t){o(a(t).find(".rank-avatar"))}),""!==a(".user-avatar").attr("data-avatar")&&o(a(".user-avatar"))}),define("js/home/entry",["jquery","swiper","lazyload","hammer","mlellipsis","index"],function(e,t,n){e("js/home/home"),e("js/home/maybe-like")}),define("js/home/home",["jquery","swiper","lazyload","hammer","mlellipsis","index"],function(e,t,n){function o(){x=!1,v.hasClass("menu-open")&&(v.removeClass("menu-open"),w.hide(),p(".sub-nav").removeClass("show"),y.removeClass("on"))}function a(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 i(){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(i,3e3):C%360===0?window.setTimeout(i,6e4):window.requestAnimationFrame(i)}var s,r,l,d,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 o(),!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?(o(),!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")}),a(y),a(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"})),l=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&&(d=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(i,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,n){function o(e,t){var n=a(e),o=n.find(".notice-item"),i=o.length,s=1;e=e||".notice",t=t||3e3,i>1&&setInterval(function(){s>=i&&(s=0),o.fadeOut(),n.find(".item-"+s).fadeIn(),s++},t)}var a=e("jquery");n.exports=o}),define("js/home/fastclick",[],function(e,t,n){!function(){"use strict";function e(t,n){function a(e,t){return function(){return e.apply(t,arguments)}}var i;if(n=n||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=n.touchBoundary||10,this.layer=t,this.tapDelay=n.tapDelay||200,this.tapTimeout=n.tapTimeout||700,!e.notNeeded(t)){for(var s=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],r=this,l=0,d=s.length;d>l;l++)r[s[l]]=a(r[s[l]],r);o&&(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,n,o){var a=Node.prototype.removeEventListener;"click"===e?a.call(t,e,n.hijacked||n,o):a.call(t,e,n,o)},t.addEventListener=function(e,n,o){var a=Node.prototype.addEventListener;"click"===e?a.call(t,e,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),o):a.call(t,e,n,o)}),"function"==typeof t.onclick&&(i=t.onclick,t.addEventListener("click",function(e){i(e)},!1),t.onclick=null)}}var t=navigator.userAgent.indexOf("Windows Phone")>=0,o=navigator.userAgent.indexOf("Android")>0&&!t,a=/iP(ad|hone|od)/.test(navigator.userAgent)&&!t,i=a&&/OS 4_\d(_\d)?/.test(navigator.userAgent),s=a&&/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(a&&"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!o;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 n,o;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),o=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},e.prototype.determineEventType=function(e){return o&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;a&&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,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}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,n,o;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],a){if(o=window.getSelection(),o.rangeCount&&!o.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},e.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n},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,n,r,l,d,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,n=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,s&&(d=e.changedTouches[0],c=document.elementFromPoint(d.pageX-window.pageXOffset,d.pageY-window.pageYOffset)||c,c.fastClickScrollParent=this.targetElement.fastClickScrollParent),r=c.tagName.toLowerCase(),"label"===r){if(t=this.findControl(c)){if(this.focus(c),o)return!1;c=t}}else if(this.needsFocus(c))return e.timeStamp-n>100||a&&window.top!==window&&"input"===r?(this.targetElement=null,!1):(this.focus(c),this.sendClick(c,e),a&&"select"===r||(this.targetElement=null,e.preventDefault()),!1);return a&&!i&&(l=c.fastClickScrollParent,l&&l.fastClickLastScrollTop!==l.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;o&&(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,n,a,i;if("undefined"==typeof window.ontouchstart)return!0;if(n=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!o)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(n>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(r&&(a=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),a[1]>=10&&a[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:(i=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],i>=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)},e.attach=function(t,n){return new e(t,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof n&&n.exports?(n.exports=e.attach,n.exports.FastClick=e):window.FastClick=e}()}),define("js/home/maybe-like",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){n.exports=function(t){function n(){w||(w=!0,p.showLoadingMask(),c.ajax({type:"GET",url:s,data:{page:y+1},success:function(e){return" "===e?(w=!1,p.hideLoadingMask(),void(b&&!t&&(s="1,3"===b?"/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&&(d?null:d=c("#yoho-footer"),d.hasClass("bottom")?d.removeClass("bottom"):null),i=v.find(".good-info").length,v.append(e),m(0===i?v.find(".good-info").find("img.lazy"):v.find(".good-info:gt("+(i-1)+")").find("img.lazy")),w=!1,p.hideLoadingMask(),y++,void c(".good-detail-text .name").each(function(){var e=c(this),t=e.find("a");t[0].mlellipsis(2)}))},error:function(){h.show("网络断开连接了~"),w=!1,p.hideLoadingMask()}}))}function o(){c(window).scrollTop()+g>=c(document).height()-200&&n()}var a,i,s,r,l,d,c=e("jquery"),u=e("hammer"),h=e("js/plugin/tip"),p=e("js/plugin/loading"),f=e("mlellipsis"),m=e("lazyload"),g=c(window).height(),v=c("#goods-list"),w=!1,y=0,b=null,C=!("kids"!==t&&!c(".mobile-wrap").hasClass("kids-wrap")),j=!("lifestyle"!==t&&!c(".mobile-wrap").hasClass("lifestyle-wrap")),x=c("#maybe-like-nav");f.init(),C?s="/product/recom/maylikekids":j?s="lifestyle"===t?"/product/recom/maylike?gender=1,3":"/product/recom/maylikelife":(b="boys"===t||c(".mobile-wrap").hasClass("boys-wrap")?"1,3":"2,3",s="/product/recom/maylike?gender="+b),c(".mobile-wrap").hasClass("yoho-channel-page")&&(s="/product/recom/newPreference?template_id="+c.queryString().template_id),r=x.children(".focus"),j&&(a=x[0]?new u(x[0]):void 0,a&&a.on("tap",function(e){var t,n=c(e.target).closest("li"),o=c(".goods-list");e.preventDefault(),n.hasClass("focus")||(l=n.index(),n.addClass("focus"),r.removeClass("focus"),o.not(".hide").addClass("hide"),t=o.eq(l),t.removeClass("hide"),r=n,c(document).trigger("scroll"),e.srcEvent.stopPropagation())})),p.init(c(".maybe-like")),c(".maybe-like p").on("touchstart",function(e){n()}),t&&n(),c(window).scroll(function(){window.requestAnimationFrame(o)})}}),define("js/index/entry",["jquery","hammer","handlebars","source-map","swiper","index"],function(e,t,n){e("js/index/search"),e("js/index/footer"),e("js/index/channel"),e("js/index/coupon")}),define("js/index/search",["jquery","hammer","handlebars","source-map"],function(e,t,n){function o(){var e="test",t=Window.prototype.localStorage;try{return t.setItem(e,"testValue"),t.removeItem(e),!0}catch(n){return!1}}function a(){var e=r(".search-associate"),t=r(".search-icon"),n=r(".search-items");h.on("input",function(){""===h.val()?(t.css("color","#b2b2b2"),p.addClass("hide"),e.html(""),n.show(),e.hide()):(t.css("color","#666"),p.removeClass("hide"),e.show()),r.ajax({url:"/index/search/fuzzyDatas",data:{keyword:h.val()},dataType:"json",success:function(t){var o,a="";if(t.length>0){for(o=0;o<t.length;o++)a+='<li><span class="keyword">'+t[o].keyword+'</span><span class="count">'+t[o].count+' items<i class="iconfont">&#xe614;</i></span></li>';e.html(a),n.hide()}else e.html("");e.find("li").on("touchend",function(){w.val(r(this).find(".keyword").html()),y.closest("form").submit()})},error:function(){d.show("网络断开连接了~")}})})}var i,s,r=e("jquery"),l=e("js/plugin/security"),d=e("js/plugin/tip"),c=e("hammer"),u=e("js/me/dialog"),h=r("#search-input input"),p=r("#search-input .clear-input"),f=r("#search-form"),m=r(".history"),g=r(".history-search"),v=r("#clear-history"),w=r(".buriedpoint"),y=r("#search"),b=e("js/index/write-search"),C=b.getRanToken();i=new c(v[0]),i.on("tap",function(){u.showDialog({dialogText:"您确定要删除您的最近搜索吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){o()&&localStorage.removeItem("historys"),m.html(""),g.hide(),v.hide(),window.rePosFooter(),u.showDialog({dialogText:"删除成功",autoHide:!0,fast:!0})})}),a(),s=new c(p[0]),s.on("tap",function(){h.val("").trigger("input")}),y.on("touchend",function(){return""===w.val()&&""!==r("#default-terms").val()&&w.val(r("#default-terms").val()),l.hasDangerInput()?!1:(r(this).closest("form").submit(),!1)}),function(){var e,t,n,a="",i=1,s="";if(localStorage&&(o()&&(t=localStorage.getItem("historys")),s=f.attr("action"),t&&t.length>0)){for(t=t.split(C),n=t.length;n>0;n--)if(e=t[n-1],""!==e){if(i++>10)break;a+='<li><a href="'+s+"/?query="+e+'">'+e+"</li>"}m.html(a),""!==a&&(v.removeClass("hide"),g.removeClass("hide")),window.rePosFooter()}}(),o()&&b.bindWirteLocal(f)}),define("js/plugin/security",["jquery"],function(e,t,n){function o(e){var t,n,o,s=a("input[type!=hidden], textarea"),r=/['"<>&\|]|--/g,l=s.length,d=void 0===e||"boolean"!=typeof e?!0:e;for(n=0;l>n;n++)if(t=s.eq(n).val(),r.test(t))return d?s.eq(n).val(t.replace(r," ")):(o=t.match(r).join(" "),i.show("不可以输入 "+o+" 哦!")),!d&&!0;return!1}var a=e("jquery"),i=e("js/plugin/tip");t.hasDangerInput=o}),define("js/me/dialog",["jquery","handlebars","source-map","hammer"],function(e,t,n){function o(){return void 0===i&&(i='<div id="dialog-wrapper" class="dialog-wrapper"><div class="dialog-box">{{# hasHeader}}{{/ hasHeader}}<div class="dialog-content">{{dialogText}}</div>{{# hasFooter}}<div class="dialog-footer">{{# leftBtnText}}<span class="dialog-left-btn tap-hightlight">{{.}}</span>{{/ leftBtnText}}{{# rightBtnText}}<span class="dialog-right-btn tap-hightlight">{{.}}</span>{{/ rightBtnText}}</div>{{/ hasFooter}}</div></div>',s=l.compile(i)),s}var a,i,s,r=e("jquery"),l=e("handlebars"),d=e("hammer");t.showDialog=function(e,t,n,i){var s,l,c,u=o(),h=u(e);r(".dialog-wrapper").remove(),r("body").append(r(h)),s=r(".dialog-box"),a=r(".dialog-wrapper"),c=new d(document.getElementById("dialog-wrapper")),e.fast?a.css({display:"block"}):a.fadeIn(),i&&(r(".dialog-wrapper .dialog-footer > span").css("width","100%"),r(".dialog-wrapper .dialog-content").css({"padding-left":"1.85rem","padding-right":"1.85rem"}),a.css("z-index","10")),s.css({top:"50%",marginTop:-(s.height()/2)}),e.autoHide&&(l=1e3,e.autoHide>1&&(l=e.autoHide),setTimeout(function(){a.fadeOut()},l)),a.on("touchmove",function(){return!1}),c.on("tap",function(e){r(e.target).hasClass("dialog-left-btn")?("function"==typeof n&&n(),a.fadeOut()):r(e.target).hasClass("dialog-right-btn")&&t(),e.preventDefault(),e.srcEvent.stopPropagation()})},t.hideDialog=function(){r(".dialog-wrapper").remove()}}),define("js/index/write-search",[],function(e,t,n){function o(){var e="test",t=Window.prototype.localStorage;try{return t.setItem(e,"testValue"),t.removeItem(e),!0}catch(n){return!1}}function a(){return s}function i(e){e.on("submit",function(){var e,t=this.query.value;if(localStorage){if(o()&&(e=localStorage.getItem("historys")),e=e?e:"",e.indexOf(s+t+s)>-1)return;""===e&&(t=s+t),e+=t+s,o()&&localStorage.setItem("historys",e)}})}var s=" ??++ ";t.getRanToken=a,t.bindWirteLocal=i}),define("js/index/footer",["jquery","hammer"],function(e,t,n){function o(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?window.unescape(n[2]):null}function a(){var e="http://union.yoho.cn/union/downapp.html",t=new Date;setTimeout(function(){var n=o("mkt_code");new Date-t<2e3&&(n&&(e+="?union_type="+n),window.location=e)},500)}var i,s=e("jquery"),r=e("hammer");e("js/common"),s("#float-layer-close").on("touchend",function(e){return s("#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}),s("#float-layer-btn")&&s("#float-layer-btn")[0]&&(i=new r(s("#float-layer-btn")[0]),i.on("tap",function(e){a("bottom"),e.srcEvent.stopPropagation()}),"function"!=typeof window.cookie||window.cookie("_float-layer-app")?s("#float-layer-app").hide():s("#float-layer-app").show())}),define("js/index/channel",["jquery","hammer"],function(e,t,n){var o=e("jquery"),a=e("js/plugin/security"),i=o(".search-box"),s=o(".box"),r=o(".index-search"),l=o(".index-logo"),d=o(".index-channel a:not(#yohood)"),c=i.children('input[type="text"]'),u=s.children(".no-search"),h=i.children(".search-icon");e("js/common"),c.on("focus",function(){s.addClass("action"),l.addClass("action")}).on("input",function(){""===c.val()?h.addClass("empty"):h.removeClass("empty")}),u.on("touchend",function(){return s.removeClass("action"),l.removeClass("action"),c.blur(),!1}),i.children(".clear-text").on("touchstart",function(){c.val("").focus().trigger("input")}),i.children(".search-icon").on("touchstart",function(){return a.hasDangerInput()?!1:void r.submit()}),i.keyup(function(e){if(13===e.keyCode){if(a.hasDangerInput())return!1;r.submit()}}),o(".index-channel img").on("load error",function(){window.rePosFooter&&window.rePosFooter()}),d.on("touchstart",function(){d.css({background:"#000",color:"#fff",borderColor:"#fff"}),o(this).css({background:"rgba(255, 255, 255, 0.5)",color:"#000",borderColor:"#000"})}).on("touchend touchcancel",function(){o(this).css({background:"#000",color:"#fff",borderColor:"#fff"})})}),define("js/index/coupon",["jquery","swiper","index"],function(e,t,n){function o(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!=n?n[2]:null}var a,i=e("jquery"),s=e("swiper"),r=i(".main-right-receive"),l=i(".floor-mask"),d=i(".floor-message"),c=i(".floor-tooltip"),u=e("js/plugin/tip");r.on("click",function(){var e=i(this),t="";o("app_version")&&(t+="&app_version="+o("app_version")),o("uid")&&(t+="&uid="+o("uid")),i.ajax({url:"/coupon/receiveCoupon?code="+o("code")+t,data:{couponID:e.parents(".coupon-floor").attr("coupon-id")},dataType:"json",success:function(t){var n=t.msg,a=t.status,s=t.url+"?code="+o("code");t.isApp===!0&&(s=t.url),t.noLogin===!0?(i("#intimacy-link").length<=0&&i("body").append("<a href='"+s+'\' style="display:none;" id="intimacy-link"><span class="intimacy-link"></span></a>'),i(".intimacy-link").click()):a?(e.hide(),e.next().show(),c.show(),setTimeout(function(){c.hide()},3e3)):(d.find(".coupon-message-content").text(n),l.show(),d.show())},error:function(){u.show("网络异常!")}})}),i(".coupon-floor a, .banner-top a").on("click",function(){return i(this).attr("href").length<=0||"#"===i(this).attr("href")?!1:void 0}),i(".banner-swiper").find("li").length>1&&(a=new s(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),i(".coupon-message-op-rel").on("click",function(){location.reload()}),i("#noData").length>0&&location.href.indexOf("?openby:yohobuy=")<=0&&u.show("网络异常!"),l.on("click",function(){l.hide(),d.hide()})}),define("js/passport/entry",["jquery","handlebars","source-map","hammer"],function(e,t,n){e("js/passport/register/register"),e("js/passport/register/code"),e("js/passport/register/password"),e("js/passport/login/login"),e("js/passport/login/international"),e("js/passport/back/mobile"),e("js/passport/back/code"),e("js/passport/back/email"),e("js/passport/back/email-success"),e("js/passport/back/new-password"),e("js/passport/bind/bind"),e("js/passport/bind/code"),e("js/passport/bind/password"),e("js/passport/bind/relate")}),define("js/passport/register/register",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#phone-num"),i=o("#country-select"),s=o("#area-code"),r=o("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=o.trim,u=d.show,h=!1;l.selectCssHack(o("#country-select")),l.bindClearEvt(),a.bind("input",function(){""===c(a.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){s.text(i.val())}),r.on("touchstart",function(){var e=c(a.val()),t=i.val();if(!r.hasClass("disable"))return h?!1:void(l.phoneRegx[t].test(e)?(h=!0,o.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:t.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:(u(e.message),h=!1)},error:function(e){u("出错了,请重试"),h=!1}})):u("手机号格式不正确,请重新输入"))})}),define("js/passport/api",["jquery"],function(e,t,n){function o(e){var t,n=r(".has-eye");e&&"open"===e.status?n.append('<div class="eye"></div>'):n.append('<div class="eye close"></div>'),t=n.children(".eye"),t.on("touchstart",function(e){var t=r(this),n=t.siblings(".pwd");e.preventDefault(),t.toggleClass("close"),t.hasClass("close")?n.attr("type","password"):n.attr("type","text"),n.focus()})}function a(){var e,t=r(".has-clear");t.append('<div class="clear-input"></div>'),e=t.children(".clear-input"),e.on("touchstart",function(t){var n=e.siblings(".input");n.val("").trigger("input").focus(),t.preventDefault()}),t.children(".input").bind("input",function(){var e=r(this),t=e.siblings(".clear-input"),n=l(e.val());""===n?t.hide():t.show()})}function i(e){return e.length>=6&&e.length<=20}function s(e){function t(){var t=e.find("option:selected").text().length;switch(t){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var n=navigator.userAgent;n.match(/uc/i)&&n.match(/android/i)?e.change(function(){t()}):e.removeClass("in-android-uc")}var r=e("jquery"),l=r.trim,d=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,c={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};n.exports={emailRegx:d,phoneRegx:c,bindEyesEvt:o,bindClearEvt:a,pwdValidate:i,selectCssHack:s}}),define("js/passport/register/code",["jquery"],function(e,t,n){e("js/passport/code")(!0)}),define("js/passport/code",["jquery"],function(e,t,n){var o=e("jquery");n.exports=function(t,n,a){function i(){o.ajax({url:n?"/passport/bind/bindMobile":"/passport/bind/relateMobile",type:"post",data:{areaCode:m.replace("+",""),phoneNum:f,openId:p,sourceType:h,nickname:u,password:"",code:w(l.val())},success:function(e){200===e.code?(v.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):v.show(e.message)},error:function(e){v.show("登录失败,请重试!")}})}function s(){o.ajax({type:"POST",url:"/passport/"+b+"/verifycode",data:{phoneNum:f,areaCode:m,code:w(l.val()),token:o("#token").val()},success:function(e){200===e.code?location.href=e.data:y(e.message)}})}function r(){var e,t=59;e=setInterval(function(){0===t?(c.text("重新发送").removeClass("disable"),clearInterval(e)):c.text("重新发送 ("+t--+"秒)")},1e3)}var l=o("#captcha"),d=o("#btn-next"),c=o("#captcha-tip"),u=o("#nickname").val(),h=o("#sourceType").val(),p=o("#openId").val(),f=o("#phone-num").val(),m=o("#area-code").val().replace("+",""),g=e("js/passport/api"),v=e("js/plugin/tip"),w=o.trim,y=v.show,b=t?"reg":"back",C=parseInt(o("#isReg").val());g.bindClearEvt(),l.bind("input",function(){""!==w(l.val())?d.removeClass("disable"):d.addClass("disable")}),c.on("touchstart",function(){c.hasClass("disable")||o.ajax({type:"POST",url:n||a?"/passport/bind/sendBindMsg":"/passport/"+b+"/sendcode",data:{phoneNum:f,areaCode:m},success:function(e){200===e.code?(c.text("重发验证码 (60秒)").addClass("disable"),r()):y(e.message)}})}),d.on("touchstart",function(){d.hasClass("disable")||(n||a?C?i():location.href="/passport/bind/password?phoneNum="+f+"&areaCode="+m+"&openId="+p+"&sourceType="+h+"&nickname="+u+"&code="+w(l.val()):s())}),r()}}),define("js/passport/register/password",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#pwd"),i=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindEyesEvt({status:"open"}),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(a.val());i.hasClass("disable")||(s.pwdValidate(e)===!1?d("密码6-20位,请重新输入"):o.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:e,phoneNum:o("#phone-num").val(),areaCode:o("#area-code").val(),token:o("#token").val()},success:function(e){var t;200===e.code?(t=e.data,d("注册成功"),o.ajax({url:t.session,dataType:"jsonp"}),setTimeout(function(){location.href=t.href},1e3)):d(e.message)}}))})}),define("js/passport/login/login",["jquery"],function(e,t,n){function o(){h&&p?d.removeClass("disable"):d.addClass("disable")}function a(){c.show(),u.show()}function i(){c.hide(),u.hide()}var s=e("jquery"),r=s("#account"),l=s("#pwd"),d=s("#btn-login"),c=s("#retrive-pwd-mask"),u=s("#retrive-pwd-ways"),h=!1,p=!1,f=e("js/passport/api"),m=e("js/plugin/tip"),g=s.trim,v=m.show;f.bindEyesEvt(),f.bindClearEvt(),r.bind("input",function(){h=""!==g(r.val()),o()}),l.bind("input",function(){p=""!==g(l.val()),o()}),d.on("touchstart",function(){var e=g(r.val()),t=g(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),(/^[0-9]+$/.test(e)||f.emailRegx.test(e))&&f.pwdValidate(t)?s.ajax({type:"POST",url:"/passport/login/auth",data:{account:e,password:t},success:function(e){var t;200===e.code?(t=e.data,v("登录成功"),location.href=t.href):v(e.message)},error:function(){v("网络断开连接啦~")},complete:function(){d.text("登录").removeClass("disable")}}):(v("账号或密码有错误,请重新输入"),d.text("登录").removeClass("disable")))}),s("#forget-pwd").on("touchstart",function(){a()}),c.on("touchstart",function(){i()}),s("#cancel-retrive").on("touchstart",function(e){e.preventDefault(),i()}),r.trigger("input"),l.trigger("input")}),define("js/passport/login/international",["jquery"],function(e,t,n){function o(){c&&u?d.removeClass("disable"):d.addClass("disable")}var a=e("jquery"),i=a("#phone-num"),s=a("#country-select"),r=a("#area-code"),l=a("#pwd"),d=a("#btn-login"),c=!1,u=!1,h=e("js/passport/api"),p=e("js/plugin/tip"),f=a.trim,m=p.show;h.selectCssHack(s),h.bindEyesEvt(),h.bindClearEvt(),i.bind("input",function(){c=""!==f(i.val()),o()}),l.bind("input",function(){var e=f(l.val());u=""!==e,o()}),s.change(function(){r.text(s.val())}),d.on("touchstart",function(){var e=f(i.val()),t=s.val(),n=f(l.val());d.hasClass("disable")||(d.text("正在登录...").addClass("disable"),h.phoneRegx[t].test(e)&&h.pwdValidate(n)?a.ajax({type:"POST",url:"/passport/login/auth",data:{areaCode:t.replace("+",""),account:e,password:n},success:function(e){var t,n;200===e.code?(t=e.data,m("登录成功"),a.ajax({url:t.session,dataType:"jsonp",success:function(){clearTimeout(n),setTimeout(function(){location.href=t.href},1e3)}}),n=setTimeout(function(){location.href=t.href},3e3),m("登录成功")):m(e.message)},error:function(){m("网络断开连接啦~")},complete:function(){d.text("登录").removeClass("disable")}}):(m("账号或密码有错误,请重新输入"),d.text("登录").removeClass("disable")))}),i.trigger("input"),l.trigger("input")}),define("js/passport/back/mobile",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#phone-num"),i=o("#country-select"),s=o("#area-code"),r=o("#btn-next"),l=e("js/passport/api"),d=e("js/plugin/tip"),c=o.trim,u=d.show;l.selectCssHack(o("#country-select")),l.bindClearEvt(),a.bind("input",function(){""===c(a.val())?r.addClass("disable"):r.removeClass("disable")}),i.change(function(){s.text(i.val())}),r.on("touchstart",function(){var e=c(a.val()),t=i.val();r.hasClass("disable")||(l.phoneRegx[t].test(e)?o.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:t.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:u(e.message)}}):u("手机号格式不正确,请重新输入"))})}),define("js/passport/back/code",["jquery"],function(e,t,n){e("js/passport/code")(!1)}),define("js/passport/back/email",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#email"),i=o("#btn-sure"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show;s.bindClearEvt(),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e=l(a.val());i.hasClass("disable")||(s.emailRegx.test(e)?o.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:e},success:function(e){200===e.code?location.href=e.data:d(e.message)}}):d("邮箱格式不正确,请重新输入"))})}),define("js/passport/back/email-success",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#resend"),i=e("js/plugin/tip"),s=i.show;a.on("touchstart",function(e){e.preventDefault(),o.ajax({url:a.data("url"),type:"GET",success:function(e){s(e.message)}})})}),define("js/passport/back/new-password",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#pwd"),i=o("#btn-ok"),s=e("js/passport/api"),r=e("js/plugin/tip"),l=o.trim,d=r.show,c=o("#phone-num");
s.bindEyesEvt({status:"open"}),a.bind("input",function(){""===l(a.val())?i.addClass("disable"):i.removeClass("disable")}),i.on("touchstart",function(){var e,t,n=l(a.val()),r=!0;i.hasClass("disable")||(e={password:n},0===c.length&&(r=!1),r?(o.extend(e,{phoneNum:c.val(),areaCode:o("#areaCode").val(),token:o("#token").val()}),t="/passport/back/passwordByMobile"):(o.extend(e,{code:o("#email-code").val()}),t="/passport/back/passwordByEmail"),s.pwdValidate(n)?o.ajax({type:"POST",url:t,data:e,success:function(e){200===e.code?(d("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):d(e.message)}}):d("密码6-20位,请重新输入"))})}),define("js/passport/bind/bind",["jquery","handlebars","source-map","hammer"],function(e,t,n){function o(e,t,n){return v?!1:(v=!0,u.addClass("disable").html("绑定中..."),void a.ajax({type:"POST",url:"/passport/bind/sendBindMsg",data:{phoneNum:t,areaCode:n.replace("+","")},success:function(t){200===t.code?(window._yas&&window._yas.sendCustomInfo&&window._yas.sendCustomInfo({loginRefer:c.val()},!1),location.href=e):p.show(t.message)},error:function(){p.show("出错了,请重试!"),u.removeClass("disable").html("下一步"),v=!1}}))}var a=e("jquery"),i=a("#phone-num"),s=a("#country-select"),r=a("#area-code"),l=a("#openId"),d=a("#nickname"),c=a("#sourceType"),u=a("#btn-next"),h=e("js/passport/api"),p=e("js/plugin/tip"),f=e("js/me/dialog"),m=a.trim,g=p.show,v=!1;e("js/common"),h.selectCssHack(a("#country-select")),h.bindClearEvt(),i.bind("input",function(){""===m(i.val())?u.addClass("disable"):u.removeClass("disable")}),s.change(function(){r.text(s.val())}),u.on("touchstart",function(){var e=m(i.val()),t=m(l.val()),n=m(d.val()),r=m(c.val()),p=s.val();u.hasClass("disable")||(h.phoneRegx[p].test(e)?a.ajax({url:"/passport/bind/bindCheck",type:"POST",data:{areaCode:p.replace("+",""),phoneNum:e,openId:t,sourceType:r,nickname:n},success:function(t){200===t.code?1===t.data.isReg?f.showDialog({dialogText:"该手机号已注册过有货\n"+e+",确定绑定吗?",hasFooter:{leftBtnText:"更换号码",rightBtnText:"继续绑定"}},function(){o(t.data.next,e,p)}):3===t.data.isReg?f.showDialog({dialogText:"该手机号已注册过有货\n"+e+",是否进行关联?",hasFooter:{leftBtnText:"更换号码",rightBtnText:"确定"}},function(){o(t.data.next,e,p)}):o(t.data.next,e,p):g(t.message)}}):g("手机号格式不正确,请重新输入"))}),/MicroMessenger/i.test(navigator.userAgent)&&a.queryString().refer&&a(".go-back").attr("href",decodeURIComponent(a.queryString().refer))}),define("js/passport/bind/code",["jquery"],function(e,t,n){e("js/passport/code")(!0,!0)}),define("js/passport/bind/password",["jquery"],function(e,t,n){function o(e){a.ajax({url:"/passport/bind/bindMobile",type:"post",data:{areaCode:m.replace("+",""),phoneNum:f,openId:p,sourceType:h,nickname:u,password:e,code:g},success:function(e){200===e.code?(l.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):l.show(e.message)},error:function(e){l.show("登录失败,请重试!")}})}var a=e("jquery"),i=a("#pwd"),s=a("#btn-sure"),r=e("js/passport/api"),l=e("js/plugin/tip"),d=a.trim,c=l.show,u=a("#nickname").val(),h=a("#sourceType").val(),p=a("#openId").val(),f=a("#phone-num").val(),m=a("#area-code").val().replace("+",""),g=a("#code").val();r.bindEyesEvt({status:"open"}),i.bind("input",function(){""===d(i.val())?s.addClass("disable"):s.removeClass("disable")}),s.on("touchstart",function(){var e=d(i.val());s.hasClass("disable")||(r.pwdValidate(e)===!1?c("密码6-20位,请重新输入"):o(e))})}),define("js/passport/bind/relate",["jquery"],function(e,t,n){e("js/passport/code")(!0,!1,!0)}),define("js/product/entry",["jquery","swiper","mlellipsis","lazyload","hammer","handlebars","source-map","iscroll-probe","index"],function(e,t,n){e("js/product/newsale/newarrival"),e("js/product/newsale/discount"),e("js/product/list"),e("js/product/detail/detail"),e("js/product/detail/consultform"),e("js/product/newsale/hot-rank"),e("js/product/product-category"),e("js/product/shop")}),define("js/product/newsale/newarrival",["jquery","swiper","mlellipsis","lazyload","hammer","index"],function(e,t,n){function o(e){var t,n,o,a,i,u,h={};if(!d){if(e){for(n in E)E.hasOwnProperty(n)&&(E[n].reload=!0);switch(q.children(".active").removeClass("active"),I.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(C,t)}if(I.hasClass("today")?(a="today",i=1):I.hasClass("week")?(a="week",i=2):I.hasClass("sale")&&(a="sale",i=3),o=E[a],u=o.page+1,o.reload)u=1;else if(o.end)return;c.extend(h,C,{dayLimit:i,page:u}),d=!0,g.showLoadingMask(),c.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:h,success:function(e){var t,n;switch(a){case"today":t=s;break;case"week":t=r;break;case"sale":t=l}" "===e?(o.end=!0,o.reload&&t.html(b)):o.reload?(t.html(e),p(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),p(t.find(".good-info:gt("+(n-1)+") .lazy"))),o.reload=!1,o.page=u,d=!1,g.hideLoadingMask(),window.rePosFooter(),c(".good-detail-text .name").each(function(){var e=c(this),t=e.find("a");t[0].mlellipsis(2)})},error:function(){f.show("网络断开连接了~"),d=!1,g.hideLoadingMask()}})}}function a(){c(window).scrollTop()+y>c(document).height()-.25*v.height()-50&&void 0!==I&&o()}var i,s,r,l,d,c=e("jquery"),u=e("swiper"),h=e("mlellipsis"),p=e("lazyload"),f=e("js/plugin/tip"),m=e("js/plugin/filter"),g=e("js/plugin/loading"),v=c("#goods-container"),w=v.children(),s=c(w.get(0)),r=c(w.get(1)).addClass("hide"),l=c(w.get(2)).addClass("hide"),y=c(window).height(),b='<p class="no-result">未找到相关搜索结果</p>',C=e("js/product/query-param"),j=c.extend({},C),x=new Date,k=x.getMonth()+1,T=x.getDate(),q=c("#list-nav"),E={today:{reload:!0,page:0,end:!1},week:{reload:!0,page:0,end:!1},sale:{reload:!0,page:0,end:!1}},I=q.find(".active");e("js/product/suspend-cart"),h.init(),c("#today a").text(k+"月"+T+"号"),c(".swiper-container .swiper-slide").length>1&&(i=new u(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner"})),c.ajax({type:"GET",url:"/product/newsale/filter",data:C,success:function(e){v.append(e),m.initFilter({fCbFn:o,hCbFn:function(){I.addClass("active"),I.siblings(".filter").removeClass("active")}})}}),p(c(".lazy")),q.bind("contextmenu",function(e){return!1}),q.on("touchend touchcancel",function(e){var t,n,a,i=c(e.target).closest("li");if(e.preventDefault(),i.hasClass("filter"))i.hasClass("active")?(m.hideFilter(),I.addClass("active"),i.removeClass("active")):(I=i.siblings(".active"),I.removeClass("active"),i.addClass("active"),m.showFilter());else{if(i.hasClass("today")?n="today":i.hasClass("week")?n="week":i.hasClass("sale")&&(n="sale"),t=E[n],!i.hasClass("active")){if(a=i.siblings(".active"),I=i,a.hasClass("filter"))m.hideFilter();else{switch(v.children(".container:not(.hide)").addClass("hide"),n){case"today":s.removeClass("hide");break;case"week":r.removeClass("hide");break;case"sale":l.removeClass("hide")}m.resetFilter(),C=c.extend({},j)}a.removeClass("active"),i.addClass("active")}t.reload&&o()}e.stopPropagation()}),c(window).scroll(function(){window.requestAnimationFrame(a)}),o(),q.on("touchstart","li",function(e){c(this).addClass("bytouch")}).on("touchend touchcancel",function(){q.find("li").removeClass("bytouch")})}),define("js/plugin/filter",["jquery","hammer"],function(e,t,n){function o(){h.addClass("hide")}function a(){h.removeClass("hide")}function i(){var e=g(".filter-body .classify");e.on("touchstart",".shower",function(){var t=g(this).attr("data-bp-id")||"";e.removeClass("highlight"),g(this).addClass("highlight"),g(document).trigger("shouldSendBpData",[t])}).on("touchend touchcancel",".shower",function(){g(this).removeClass("highlight")})}function s(){var e=g(".filter-body .sub-item");e.on("touchstart",function(){e.removeClass("highlight"),g(this).addClass("highlight")}).on("touchend touchcancel",function(){g(this).removeClass("highlight")})}function r(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function l(e){var t,n,o=e.closest(".sub-classify"),a=o.siblings(".shower");return e.hasClass("chosed")?o:(o.children(".chosed").removeClass("chosed"),e.addClass("chosed"),t=g.trim(e.html()),n=g.trim(a.html()),a.html(n.substring(0,n.indexOf("</span>")+7)+t.substring(0,t.indexOf("<i"))),0===e.index()?a.addClass("default"):a.removeClass("default"),o)}function d(e){var t,n=e.data("id");t=l(e),p&&p({type:t.data("type"),id:n}),o()}function c(e){var t;p=e.fCbFn,f=e.hCbFn,m=e.missStatus,i(),s(),h=g(".filter-mask"),t=new v(h[0]),t.on("tap",function(e){var t,n=g(e.target);e.preventDefault(),n.closest(".filter-body").length>0?(t=n.closest(".sub-item"),t.length>0?(t=n.closest("li"),d(t)):(t=n.closest(".classify-item"),e.srcEvent.stopPropagation(),r(t))):(o(),f&&f())})}function u(){"undefined"!=typeof h&&(g(".sub-classify").each(function(){l(g(this).children(":first-child"))}),r(g(".classify > :first-child")))}var h,p,f,m,g=e("jquery"),v=e("hammer");t.initFilter=c,t.showFilter=a,t.hideFilter=o,t.resetFilter=u}),define("js/product/query-param",["jquery"],function(e,t,n){var o=e("jquery"),a={};o(".query-param").each(function(){var e=o(this);a[e.data("attr")]=e.val()}),n.exports=a}),define("js/product/suspend-cart",["jquery"],function(e,t,n){var o=e("jquery"),a=o("#suspend-cart");o.ajax({type:"GET",url:"/cart/index/count",success:function(e){var t;200===e.code&&(t=e.data.cart_goods_count,t>99&&(t="99+"),0===t&&o(".cart-count").remove(),a.find(".cart-count").html(t).removeClass("hide"))}})}),define("js/product/newsale/discount",["jquery","swiper","mlellipsis","lazyload","hammer","index"],function(e,t,n){function o(e){var t,n,o,a,i,l={};if(!s){if(e){for(n in x)x.hasOwnProperty(n)&&(x[n].reload=!0);switch(j.children(".active").removeClass("active"),k.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(C,t)}if(k.hasClass("new")?a="newest":k.hasClass("price")?a="price":k.hasClass("discount")&&(a="discount"),o=x[a],i=o.page+1,o.reload)i=1;else if(o.end)return;r.extend(l,C,{type:a,order:o.order,page:i}),s=!0,p.showLoadingMask(),r.ajax({type:"GET",url:"/product/newsale/selectNewSale",data:l,success:function(e){var t,n;switch(a){case"newest":t=g;break;case"price":t=v;break;case"discount":t=w}" "===e?(o.end=!0,o.reload&&t.html(b)):o.reload?(t.html(e),c(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),c(t.find(".good-info:gt("+(n-1)+") .lazy"))),o.reload=!1,o.page=i,s=!1,p.hideLoadingMask(),window.rePosFooter(),r(".good-detail-text .name").each(function(){var e=r(this),t=e.find("a");t[0].mlellipsis(2)})},error:function(){u.show("网络断开连接了~"),s=!1,p.hideLoadingMask()}})}}function a(){r(window).scrollTop()+y>r(document).height()-.25*f.height()-50&&void 0!==k&&o()}var i,s,r=e("jquery"),l=e("swiper"),d=e("mlellipsis"),c=e("lazyload"),u=e("js/plugin/tip"),h=e("js/plugin/filter"),p=e("js/plugin/loading"),f=r("#goods-container"),m=f.children(),g=r(m.get(0)),v=r(m.get(1)),w=r(m.get(2)),y=r(window).height(),b='<p class="no-result">未找到相关搜索结果</p>',C=e("js/product/query-param"),j=r("#list-nav"),x={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}},k=j.find(".active");e("js/product/suspend-cart"),d.init(),r(".swiper-container .swiper-slide").length>1&&(i=new l(".swiper-container",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner"})),r.ajax({type:"GET",url:"/product/newsale/filter",data:C,success:function(e){f.append(e),h.initFilter({fCbFn:o,hCbFn:function(){k.addClass("active"),k.siblings(".filter").removeClass("active")},missStatus:!0})}}),c(r(".lazy")),j.bind("contextmenu",function(e){return!1}),j.on("touchend touchcancel",function(e){var t,n,a,i=r(e.target).closest("li");if(e.preventDefault(),"undefined"!=typeof i&&0!==i.length){if(i.hasClass("filter"))i.hasClass("active")?(h.hideFilter(),k.addClass("active"),i.removeClass("active")):(k=i.siblings(".active"),k.removeClass("active"),i.addClass("active"),h.showFilter());else{if(i.hasClass("new")?n="newest":i.hasClass("price")?n="price":i.hasClass("discount")&&(n="discount"),t=x[n],i.hasClass("active")){if(i.hasClass("new"))return;(i.hasClass("price")||i.hasClass("discount"))&&(i.find(".icon > .iconfont").toggleClass("cur"),k=i,t.reload=!0,t.order=0===t.order?1:0)}else{if(a=i.siblings(".active"),k=i,a.hasClass("filter"))h.hideFilter();else switch(f.children(".container:not(.hide)").addClass("hide"),n){case"newest":g.removeClass("hide");break;case"price":v.removeClass("hide");break;case"discount":w.removeClass("hide")}a.removeClass("active"),i.addClass("active")}t.reload&&o()}e.stopPropagation()}}),r(window).scroll(function(){window.requestAnimationFrame(a)}),o(),j.on("touchstart","li",function(e){r(this).addClass("bytouch")}).on("touchend touchcancel",function(){j.find("li").removeClass("bytouch")})}),define("js/product/list",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){function o(){var e=m(".search-associate"),t=m(".search-icon"),n=m(".search-items");L.on("input",function(){""===L.val()?(t.css("color","#b2b2b2"),D.addClass("hide"),e.html(""),n.show(),e.hide()):(t.css("color","#666"),D.removeClass("hide"),e.show()),m.ajax({url:"/index/search/fuzzyDatas",data:{keyword:L.val()},dataType:"json",success:function(t){var o,a="";if(t.length>0){for(o=0;o<t.length;o++)a+='<li><span class="keyword">'+t[o].keyword+'</span><span class="count">'+t[o].count+' items<i class="iconfont">&#xe614;</i></span></li>';e.html(a),n.hide()}else e.html("");e.find("li").on("touchend",function(){z.val(m(this).find(".keyword").html()),_.closest("form").submit()})},error:function(){x.show("网络断开连接了~")}})})}function a(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?window.unescape(n[2]):null}function i(e){var t,n,o,a,i,s,h,p,f={};if(!u){if(e){for(n in F)F.hasOwnProperty(n)&&(F[n].reload=!0);switch(M.children(".active").removeClass("active"),O.addClass("active"),e.type){case"shop_id":t={shop_id:e.id};break;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"outlets":t={outlets:e.id}}m.extend(P,t)}if(O.hasClass("new")?a="newest":O.hasClass("price")?a="price":O.hasClass("discount")&&(a="discount"),o=F[a],i=o.page+1,o.reload)i=1;else if(o.end)return;p={type:a,order:o.order,page:i},r&&(p.shop_id=r),l&&(p.sort=l),d&&(p.brand=d),c&&(p.outlets=c),m.extend(f,P,p),u=!0,k.showLoadingMask(),m.ajax({type:"GET",url:"/index/search/search",data:f,success:function(e){var t,n,r='<p class="no-result">未找到相关搜索结果</p>';switch(a){case"newest":n=q;break;case"price":n=E;break;case"discount":n=I}if(" "===e?(o.end=!0,o.reload&&n.html(r)):o.reload?(n.html(e),w(n.find(".lazy"))):(t=n.find(".good-info").length,n.append(e),w(n.find(".good-info:gt("+(t-1)+") .lazy"))),o.reload=!1,o.page=i,u=!1,k.hideLoadingMask(),window.rePosFooter(),m(".good-detail-text .name").each(function(){s=m(this),h=s.find("a"),h[0].mlellipsis(2)}),window._yas)switch(a){case"newest":window._yas(1*new Date,"1.0.16","yohobuy_m",window._ozuid,"",m(".new-goods .good-info .good-detail-img .good-thumb"));break;case"price":window._yas(1*new Date,"1.0.16","yohobuy_m",window._ozuid,"",m(".price-goods .good-info .good-detail-img .good-thumb"));break;case"discount":window._yas(1*new Date,"1.0.16","yohobuy_m",window._ozuid,"",m(".discount-goods .good-info .good-detail-img .good-thumb"))}}})}}function s(){m(window).scrollTop()+S>m(document).height()-.25*T.height()&&i()}var r,l,d,c,u,h,p,f,m=e("jquery"),g=e("hammer"),v=e("mlellipsis"),w=e("lazyload"),y=m("#brand-header"),b=m("#intro-box"),C=e("js/plugin/filter"),j=e("js/index/write-search"),x=e("js/plugin/tip"),k=e("js/plugin/loading"),T=m("#goods-container"),q=T.children(".new-goods"),E=T.children(".price-goods"),I=T.children(".discount-goods"),S=m(window).height(),L=m("#search-input input"),D=m("#search-input .clear-input"),z=m(".buriedpoint"),_=m("#search"),P=e("js/product/query-param"),M=m("#list-nav"),F={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}},O=M.find(".active");v.init(),o(),D.on("touchend",function(){L.val("").trigger("input")}),_.on("touchend",function(){return m(this).closest("form").submit(),!1}),r=a("shop_id"),l=a("sort"),c=a("outlets"),e("js/product/suspend-cart"),m.ajax({type:"GET",url:"/search/filter",data:P,success:function(e){T.append(e),C.initFilter({fCbFn:i,hCbFn:function(){O.addClass("active"),O.siblings(".filter").removeClass("active")}})}}),w(m(".lazy")),j.bindWirteLocal(m("#search-form")),M.bind("contextmenu",function(e){return!1}),M.on("touchend touchcancel",function(e){var t,n,o,a=m(e.target).closest("li"),s=m(this).find(".buriedpoint").attr("data-bp-id")||"";if(a.hasClass("filter"))a.hasClass("active")?(C.hideFilter(),O.addClass("active"),a.removeClass("active")):(O=a.siblings(".active"),O.removeClass("active"),a.addClass("active"),C.showFilter());else{if(a.hasClass("new")?n="newest":a.hasClass("price")?n="price":a.hasClass("discount")&&(n="discount"),t=F[n],a.hasClass("active")){if(a.hasClass("new"))return;(a.hasClass("price")||a.hasClass("discount"))&&(a.find(".icon > .iconfont").toggleClass("cur"),O=a,t.reload=!0,t.order=0===t.order?1:0)}else{if(o=a.siblings(".active"),O=a,o.hasClass("filter"))C.hideFilter();else switch(T.children(".container:not(.hide)").addClass("hide"),n){case"newest":q.removeClass("hide");break;case"price":E.removeClass("hide");break;case"discount":I.removeClass("hide")}o.removeClass("active"),a.addClass("active")}t.reload&&(m(document).trigger("shouldSendBpData",[s]),i())}}),m(window).scroll(function(){window.requestAnimationFrame(s)}),y.length>0&&(h=new g(y.children(".btn-intro")[0]),h.on("tap",function(){b.removeClass("hide"),m("body").addClass("overflow-hidden")}),p=new g(document.getElementById("intro-box")),p.on("tap",function(e){var t=m(e.target);e.srcEvent.preventDefault(),(0===t.closest("#brand-intro").length||t.hasClass("close-intro"))&&(b.addClass("hide"),m("body").removeClass("overflow-hidden"))}),f=new g(y.children(".btn-col")[0]),f.on("tap",function(e){var t,n=m(e.target).closest(".btn-col"),o=y.data("id");t=n.hasClass("coled")?"cancel":"ok",m.ajax({type:"POST",url:"/product/opt/favoriteBrand",data:{id:o,opt:t},success:function(e){200===e.code?(n.toggleClass("coled"),"ok"===t?x.show("添加收藏成功"):x.show("取消收藏成功")):400===e.code?location.href=e.data:x.show(e.message)},error:function(){x.show("网络断开连接了~")}})})),i(),M.on("touchstart","li",function(){M.find("li").removeClass("bytouch"),m(this).addClass("bytouch")}).on("touchend touchcancel","li",function(){M.find("li").removeClass("bytouch")})}),define("js/product/detail/detail",["jquery","swiper","hammer","lazyload","handlebars","source-map","index"],function(e,t,n){function o(){var e=i(".cart-bar"),t=setInterval(function(){e?(window.reMarginFooter(".cart-bar"),clearInterval(t)):e=i(".cart-bar")},200)}var a,i=e("jquery"),s=e("swiper"),r=e("hammer"),l=e("lazyload"),d=i(".goodsDiscount .discount-folder"),c=i(".goodsDiscount .first-item span"),u=document.getElementById("goodsDiscount"),h=u&&new r(u),p=i(u).find(".first-item"),f=i(".cart-bar"),m=i('input[name="limitCodeUrl"]').val(),g=e("js/me/dialog");o(),e("js/product/detail/like"),l(i("img.lazy")),i("#goodsDiscount h1").length<1&&i(".dropdown").remove(),a=new s(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,paginationClickable:!0,pagination:".banner-top .pagination-inner",nextButton:".my-swiper-button-next",prevButton:".my-swiper-button-prev",spaceBetween:3}),0===d.children().length&&(d.css("display","none"),c.html("")),h&&d.children().length>0&&h.on("tap",function(e){d.is(":hidden")?(p.removeClass("short-text"),c.removeClass("icon-down").addClass("icon-up").html("&#xe608;"),d.slideDown()):(p.addClass("short-text"),c.removeClass("icon-up").addClass("icon-down").html("&#xe609;"),d.slideUp())}),i("#limit-sale").on("touchend",function(e){var t,n,o=i("#loginUrl").val();e.stopPropagation(),o?window.location=o:(g.showDialog({dialogText:"进入有货APP,获取限购码",hasFooter:{rightBtnText:"打开Yoho!Buy有货APP"}},function(){n=document.createElement("iframe"),n.src=m,n.style.display="none",document.body.appendChild(n),window.location.href=m,t=Date.now(),window.setTimeout(function(){document.body.removeChild(n),Date.now()-t<3200&&(window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho")},3e3)},void 0,!0),i(".dialog-wrapper").off("touchstart").on("touchstart",function(e){e.stopPropagation(),i(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"),i.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")}}}),i(".good-detail-page").length>0&&i("#yoho-footer").css("border-top","1px solid #e0e0e0")}),define("js/product/detail/like",["jquery"],function(e,t,n){var o=e("jquery"),a=e("js/plugin/tip"),i=e("js/cart/chose-panel"),s=o("#productId").val(),r=o("#productSkn").val(),l=o("#limitProductCode").val();o("#likeBtn").on("touchstart",function(){var e,t,n=o(this);return n.hasClass("liked")?(e="cancel",t=0):(e="ok",t=1),o.ajax({type:"POST",url:"/product/opt/favoriteProduct",data:{id:s,opt:e},success:function(t){200===t.code?(n.toggleClass("liked"),"cancel"===e?a.show("取消收藏成功"):"ok"===e&&a.show("收藏成功")):400===t.code?location.href=t.data:a.show(t.message)},error:function(){a.show("网络断开连接了~")}}),window._yas&&window._yas.sendCustomInfo({pd:s,fa:t},!0),!1}),o("#addtoCart").on("touchstart",function(){return o(".cart-bar").hide(),l&&i.setLimitGoodModeWithSknId(l,r),i.show(),window._yas&&window._yas.sendCustomInfo({pd:s,by:1},!0),!1}),o("#buyLimit").on("touchstart",function(){return a.show("打开APP可抢购该商品哦~"),!1})}),define("js/cart/chose-panel",["jquery"],function(e,t,n){function o(){var e=B(".chose-panel").find(".num .btn>.iconfont");e.hasClass("disabled")?null:e.addClass("disabled"),V.off("touchstart",".btn-minus"),V.off("touchstart",".btn-plus")}function a(){x=!1,k=!1,T=null,D=B.queryString(),v=B(".chose-panel").find(".thumb"),z=B(".chose-panel .main .chose-items"),L=B(".chose-items"),q=B(".size-list ul"),I=B(".color-list ul"),w=B("#left-num"),_=B(".cart-bar"),C=0,j=0,P=0}function i(e,t){B("#chose-btn-sure").html("确认"),P=1,F=e,M=t}function s(e,t){o(),B("#chose-btn-sure").html("立即购买"),O=e,N=t}function r(){var e=B(".chose-panel"),t=B("#promotionId");e&&e.remove(),t&&t.remove()}function l(){return x||k?x?k?!0:(A.show("请选择尺码~"),!1):(A.show("请选择颜色~"),!1):(A.show("请选择颜色和尺码~"),!1)}function d(e,t){e&&(U.html(e),""!==B("#promotionId").val()&&o(),a()),B(".chose-panel").show(),m=B("#good-num"),S=t,R.disableScroll(z)}function c(){B(".chose-panel").hide(),R.enableScroll(z),_.length>0&&_.show()}function u(){g=L.find(".chosed"),2===g.closest(".zero-stock").length?B("#chose-btn-sure").css("background-color","#c0c0c0").html("已售罄"):O?B("#chose-btn-sure").css("background-color","#eb0313").html("立即购买"):B("#chose-btn-sure").css("background-color","#eb0313").html(P?"确认":"加入购物车")}function h(e){e>0?(W.length>0?L.find(".num .left-num").html("即将售罄"):L.find(".num .left-num").html("剩余"+e+"件"),w.val(e)):(L.find(".num .left-num").html(""),w.val(0))}function p(e){var t,n,o;if(C&&T&&T.length>0){for(T.removeClass("chosed"),t=q.eq(e).children(),o=0;o<t.length;o++)if(B(t[o]).data("id")===T.data("id"))return T=B(t[o]),n="#"+T.data("id"),C=B(n).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=B(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,S,L,D,z,_,P,M,F,O,N,B=e("jquery"),A=e("js/plugin/tip"),H=e("js/plugin/loading"),R=e("js/plugin/inner-scroll"),U=B("#chose-panel"),W=B(".soonSoldOut-tag"),V=B(".yoho-page");a(),V.on("touchstart",".chose-panel",function(e){var t=B(e.target);if(!(t.closest(".main").length>0))return c(),!1}),V.on("touchstart",".color-list .block",function(){var e,t=B(this),n=t.index();t.hasClass("chosed")?(L.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(n+1),h(e),q.eq(n+1).removeClass("hide"),j=n+1,E=t,v.addClass("hide").eq(n).removeClass("hide")),t.siblings(".chosed").removeClass("chosed"),-1===e?(E=B(I.eq(0).children().get(n)),E.addClass("chosed")):t.toggleClass("chosed"),B("#good-num").val(1),u()}).on("touchstart",".size-list .block",function(){var e,t,n=B(this);n.hasClass("chosed")?(L.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=B("#"+n.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=n),n.siblings(".chosed").removeClass("chosed"),n.toggleClass("chosed"),B("#good-num").val(1),u()}),V.on("touchstart",".btn-minus",function(){var e=parseInt(m.val(),10);return y=B("#left-num").val(),l()?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=B("#left-num").val(),l()&&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,n,o,a=B("#good-num").val()-0,i=parseInt(m.val(),10);if(l()&&"已售罄"!==B("#chose-btn-sure").html()){if(y=B("#left-num").val()-0,i>y)return void A.show("您选择的数量超过了最大库存量~");if(0>i)return void A.show("您选择的数量小于一件~");if(g=B(".block-list>ul>li.chosed"),2===g.length&&0===g.closest(".zero-stock").length){if(e=T.data("skuid"),t=B("#promotionId").val(),b)return!1;if(b=!0,H.showLoadingMask(),P)n={new_product_sku:e,old_product_sku:F,buy_number:a,selected:M},o="/cart/index/modify";else{if(O)return B(this).css("background-color","#ccc").removeAttr("id"),o=B("#limitProductPay").val()+"?limitproductcode="+O+"&sku="+e+"&skn="+N+"&buy_number="+a,r(),H.showLoadingMask(),B.ajax({url:o}).then(function(e){e.error?(A.show(e.message),setTimeout(function(){location.reload()},2e3)):location.href=o}).fail(function(){A.show("网络异常!"),setTimeout(function(){location.reload()},2e3)}),!1;n={productSku:e,buyNumber:a,promotionId:t,isEdit:P,cartType:D.cartType},o="/cart/index/add"}B.ajax({method:"POST",url:o,data:n}).done(function(e){var t;H.hideLoadingMask(),200!==e.code||P||(t=e.data.goods_count,t>99&&(t="99+"),B(".num-tag").html(t).removeClass("hide"),b=!1,S&&S()),e.message&&!P&&A.show(e.message),c(),P&&(H.showLoadingMask(),setTimeout(function(){window.location.href="/cart/index/index?cartType="+B("#cartType").val()},1))}).fail(function(){A.show("网络出了点问题~")}).always(function(){b=!1})}}}),t.init=a,t.show=d,t.remove=r,t.setEditModeWithSknId=i,t.disableNumEdit=o,t.setLimitGoodModeWithSknId=s}),define("js/plugin/inner-scroll",["jquery"],function(e,t,n){function o(e){e=e||window.event,e.preventDefault&&e.preventDefault(),e.returnValue=!1}function a(e){e=e||window.event,e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!1}function i(e){var t=e.wheelDelta||e.originalEvent.wheelDelta||e.detail||0,n=l(this).get(0);return a(e),l(n).height()+n.scrollTop>=n.scrollHeight&&0>t?(o(e),!1):0===n.scrollTop&&t>0?(o(e),!1):void 0}function s(e){var t,n;e.on("mousewheel",i),e.on("touchstart",function(e){t=e.originalEvent.changedTouches[0].pageX,n=e.originalEvent.changedTouches[0].pageY}),e.on("touchmove",function(e){var o=e.originalEvent.changedTouches[0].pageX-t,a=e.originalEvent.changedTouches[0].pageY-n,i=l(this).get(0);return e.stopPropagation(),Math.abs(a)<Math.abs(o)?(e.preventDefault(),!1):l(i).height()+i.scrollTop>=i.scrollHeight&&0>a?(e.preventDefault(),!1):0===i.scrollTop&&a>0?(e.preventDefault(),!1):void 0}),l(document).on("mousewheel",o),l(document).on("touchmove",o)}function r(e){e.off("touchstart"),e.off("touchmove"),e.off("mousewheel"),l(document).off("mousewheel",o),l(document).off("touchmove",o)}var l=e("jquery");t.enableScroll=r,t.disableScroll=s}),define("js/product/detail/desc",["jquery","lazyload","swiper","index"],function(e,t,n){function o(e){var t,n;e.length>0&&(t=e[0].getBoundingClientRect().right,n=e.find(".swiper-slide:last-child")[0].getBoundingClientRect().right,0>n-t?e.next(".tips").css("display","none"):e.next(".tips").css("display","block"))}function a(e,t){var n=null;c(e).each(function(o,a){n=c(e).slice(o,o+t),n.length===t&&o%t===0&&c(n).wrapAll(c('<div class="js-wraper"></div>'))})}function i(){v||w||(v=!0,p.showLoadingMask(),c.ajax({type:"GET",url:m,success:function(e){r=c("#productDesc"),r.append(e),window.rePosFooter(),u(r.find("img.lazy")),l=new h("#size-swiper-container",{slidesPerView:"auto"}),d=new h("#reference-swiper-container",{slidesPerView:"auto"}),o(c("#size-swiper-container")),o(c("#reference-swiper-container")),a(".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)&&i()}var r,l,d,c=e("jquery"),u=e("lazyload"),h=e("swiper"),p=e("js/plugin/loading"),f=e("js/plugin/tip"),m=c("#introUrl").val(),g=c(window).height(),v=!1,w=!1;c(window).scroll(function(){window.requestAnimationFrame(s)})}),define("js/product/detail/comments-consults",["jquery","hammer"],function(e,t,n){var o,a,i=e("jquery"),s=e("js/plugin/tip"),r=e("hammer"),l=document.getElementById("nav-tab"),d=l&&new r(l),c=document.getElementById("goto-consult"),u=c&&new r(c),h=document.getElementById("readmore"),p=h&&new r(h);!function(){a=i("#nav-tab .consults-num").html()-0,o=i("#nav-tab .comments-num").html()-0,i("#nav-tab li").each(function(){i(this).removeClass("focus")}),i("#feedback-content .content").each(function(){i(this).addClass("hide")}),0!==o?(i("#nav-tab .comment-nav").addClass("focus"),i("#feedback-content .comment-content").removeClass("hide")):0!==a&&(i("#nav-tab .consult-nav").addClass("focus"),i("#feedback-content .consult-content").removeClass("hide")),i(".goods-consults .consult-item:lt(2)").removeClass("hide")}(),d&&d.on("tap",function(e){var t=i(e.target).closest("li"),n=t.index();t.hasClass("comment-nav")&&0===o?s.show("暂无商品评价"):t.hasClass("focus")||(i("#nav-tab li").each(function(){i(this).removeClass("focus")}),i("#feedback-content .content").each(function(){i(this).addClass("hide")}),t.addClass("focus"),i("#feedback-content .content:eq("+n+")").removeClass("hide"))}),u&&u.on("tap",function(){location.href=i(c).find("a").attr("href")}),i(".goods-consults-page").length>0&&i("#yoho-header").css("position","fixed").css("top","0"),i(".goods-consults-page").length>0&&i("#yoho-footer").css("border-top","1px solid #e0e0e0"),p&&p.on("tap",function(){return i(".readmore").hide(),i(".goods-consults").find(".consult-item").removeClass("hide"),!1}),e("js/product/detail/fav")}),define("js/product/detail/fav",["jquery","hammer"],function(e,t,n){function o(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 a,i,s=e("jquery"),r=e("hammer"),l=e("js/plugin/tip"),d=s("#goods-consults")[0],c=d&&new r(d);!function(){var e=window.location.search.substring(1);a=e.split("&")[0].split("=")[1],i=e.split("&")[1]?e.split("&")[1].split("=")[1]:void 0}(),c&&c.on("tap",function(e){var t,n=s(e.target).closest("li"),r=n.closest(".consult-item").data("id"),d=n.find(".count").html()-0;
n.hasClass("highlight")||(n.hasClass("fav")?t="/product/detail/consultupvote":n.hasClass("useful")&&(t="/product/detail/consultuseful"),s.ajax({method:"post",url:t,data:{id:r,productId:a,total:i}}).done(function(e){200===e.code?(o(n),n.addClass("highlight"),n.find(".count").html(d+1)):401===e.code&&(location.href=e.data)}).fail(function(e){l.show("网络断开连接了~")}))})}),define("js/product/recommend-for-you-product-desc",["swiper","jquery","index"],function(e,t,n){function o(){h||u||(h=!0,d&&r.get(d).then(function(e){e.length<5?l.css("display","none"):(l.html(e).show(),r("#swiper-recommend").length&&(i=new s("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0}))),h=!1,u=!0,window.rePosFooter()}).fail(function(){l.hide()}))}function a(){(!u||r(window).scrollTop()+c>=r(document).height()-200)&&o()}var i,s=e("swiper"),r=e("jquery"),l=r(".recommend-for-you"),d=r("#preferenceUrl").val(),c=r(window).height(),u=!1,h=!1;r(window).scroll(function(){window.requestAnimationFrame(a)})}),define("js/product/detail/consultform",["jquery"],function(e,t,n){var o,a=e("jquery"),i=e("js/plugin/tip"),s=e("js/plugin/loading"),r=a(".consult-form"),l=a("#submit"),d=a("#content"),c=a("#product_id").val();l.on("touchend",function(){return d.blur(),r.submit(),!1}).on("touchstart",function(){a(this).addClass("highlight")}).on("touchend touchcancel",function(){a(this).removeClass("highlight")}),d.on("focus",function(){"请输入咨询内容"===d.val()&&d.val("")}).on("blur",function(){""===d.val()&&d.val("请输入咨询内容")}),r.on("submit",function(){var e;return o?!1:(e=d.val(),e&&"请输入咨询内容"!==e?(o=!0,s.showLoadingMask(),a.ajax({method:"POST",url:"/product/detail/consultsubmit",data:{product_id:c,content:e}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(i.show(e.message||"网络出了点问题~"),o=!1,s.hideLoadingMask()):(i.show("提交成功~"),setTimeout(function(){window.history.go(-1)},3e3))}).fail(function(){i.show("网络出了点问题~"),o=!1}),!1):(i.show("咨询内容不能为空"),!1))})}),define("js/product/newsale/hot-rank",["jquery","swiper","lazyload","index"],function(e,t,n){function o(e,t,n,o){h.showLoadingMask(),d.ajax({type:"GET",url:"/product/newsale/selectHotrank?"+t,dataType:"html",data:{page:e,tab_id:n,notab:o},success:function(t){" "===t?d(".rank-main").length<1&&d(".goods-nav").length<1?d("#hotRank").html(v):1===e&&(l=d(".goods-nav").prop("outerHTML"),d("#hotRank").html(l+v)):(d(".no-result").remove(),1===e&&d(".rank-main").remove(),d("#hotRank").append(t)),u(d("img.lazy")),d(".rank-main ul li:gt(9)").find(".item-content i").removeClass("top"),i=d(window).height(),0!==d(".rank-main").length?(d("#yoho-footer").css("position","static"),s=d(".rank-main").find("ul").offset().top):d("#yoho-footer").css({position:"fixed",width:"100%"}),r=new c(".s-goods-nav",{grabCursor:!0,slidesPerView:"auto",slideElement:"li"}),h.hideLoadingMask()}})}function a(){2!==p&&(d(window).scrollTop()+i<s+d("#hotRank").height()-100||(p=2,f=1,o(p,m,g,f)))}var i,s,r,l,d=e("jquery"),c=e("swiper"),u=e("lazyload"),h=e("js/plugin/loading"),p=1,f=0,m="",g="",v='<p class="no-result">未找到相关搜索结果</p>';e("js/product/suspend-cart"),d(window).scroll(function(){window.requestAnimationFrame(a)}),o(p,m,g,f),d("#hotRank").on("touchend touchcancel",function(e){var t=t||window.event,n=t.target||t.srcElement;"span"===n.nodeName.toLowerCase()&&(d(".s-goods-nav .nav-item").removeClass("active"),n.parentNode.className="active "+n.parentNode.className,g=n.getAttribute("data-id")?n.getAttribute("data-id"):"",m=n.getAttribute("data-sort")?n.getAttribute("data-sort"):"",p=1,f=1,o(p,m,g,f))}),d("#hotRank").bind("contextmenu",function(e){return!1}),d("#hotRank").on("touchstart",function(e){var t=t||window.event,n=t.target||t.srcElement;"span"===n.nodeName.toLowerCase()&&(n.parentNode.className="bgActive "+n.parentNode.className)}).on("touchend touchcancel",function(){d(".s-goods-nav .nav-item").removeClass("bgActive")})}),define("js/product/product-category",["jquery"],function(e,t,n){var o=e("jquery"),a=o(".allproduct"),i=o(".category-container"),s=i.children(".content"),r=i.find(".sub-level li"),l=i.find(".primary-level-trilangle");!function(){var e=o(".yoho-header"),t=o(window).height()-e.outerHeight()-a.outerHeight(),n=.55*o(window).width();i.css("min-height",t),l.css("margin-right",n),s.height(t)}(),i.on("touchend",function(e){var t,n,a,i,s,r=o(e.target);if(n=r.closest(".p-level-item"),i=r.closest(".content").find(".sub-level-container"),i.removeClass("hide"),n.length>0){if(a=n.index(),t=r.closest(".content").find(".sub-level"),s=r.closest(".content").find(".primary-level-trilangle"),r.hasClass("focus"))return;t.not(".hide").addClass("hide"),t.eq(a).removeClass("hide"),s.not(".hide").addClass("hide"),s.eq(a).removeClass("hide")}}),i.find(".sub-level").on("touchstart","li",function(){r.removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel","li",function(){o(this).removeClass("highlight")}),a.on("touchstart",function(){o(this).addClass("highlight")}).on("touchend touchcancel",function(){o(this).removeClass("highlight")})}),define("js/product/shop",["jquery","iscroll-probe","lazyload","swiper","hammer","index"],function(e,t,n){function o(e){var t,n;I||(n=e.data.type,t=ee[n],t.end||(I=!0,L.ajax({type:"GET",url:e.url,data:e.data,success:function(n){" "===n&&(t.end=!0),e.callBack(n)},error:function(){alert("网络断开连接了~"),I=!1}})))}function a(e){X&&(e.data.brand=X),V&&(e.data.shop_id=V)}function i(e){var t={};t.url="/index/search/search",t.data={type:"newest",order:"1",page:ee["new"].page,tagNew:"1"},a(t),t.callBack=function(t){L("#new-arrival").append(t),ee["new"].page++,y.refresh(),z(L("#new-arrival .lazy")),q=L("#scroller").outerHeight(),I=!1,e&&L.isFunction(e)&&e()},o(t)}function s(e){var t={};t.url="/index/search/search",t.data={type:"hot",order:"1",page:ee.hot.page,showTag:"1"},a(t),t.callBack=function(t){L("#popularity").append(t),ee.hot.page++,y.refresh(),z(L("#popularity .lazy")),q=L("#scroller").outerHeight(),I=!1,e&&L.isFunction(e)&&e()},o(t)}function r(e,t){var n=e.eq(t);e.removeClass("active"),n.addClass("active"),e.removeClass("color"),n.addClass("color")}function l(){L(document).trigger("rebindBpEvent")}function d(e){var t,n,o,a,i,s={};if(!I){if(e.url||(e.url="/index/search/search"),!e.nextPage){for(n in ee)ee.hasOwnProperty(n)&&(ee[n].reload=!0);if(e.id){switch(e.type){case"shop_id":t={shop_id:e.id};break;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(Y,t)}}if(te.hasClass("new")?a="newest":te.hasClass("price")?a="price":te.hasClass("discount")&&(a="discount"),o=ee[a],i=o.page+1,o.reload)i=1;else if(o.end)return;L.extend(s,Y,{type:a,order:o.order,page:i}),X&&(s.brand=X),V&&(s.shop_id=V),I=!0,N.showLoadingMask(),L.ajax({type:"GET",url:e.url?e.url:"",data:s,success:function(e){var t,n;switch(a){case"newest":t=R;break;case"price":t=U;break;case"discount":t=W}" "===e?(o.end=!0,o.reload&&t.html(Q)):o.reload?(t.html(e),z(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),z(t.find(".good-info:gt("+(n-1)+") .lazy"))),o.reload=!1,o.page=i,I=!1,N.hideLoadingMask(),window.rePosFooter(),setTimeout(function(){y.refresh(),q=L("#scroller").outerHeight()},1e3),l()},error:function(){F.show("网络断开连接了~"),I=!1,N.hideLoadingMask()}})}}function c(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i"),n=window.location.search.substr(1).match(t);return null!=n?window.unescape(n[2]):null}function u(){E=-y.y,y&&y.refresh(),E+$>L("#scroller").height()-.25*A.height()-50&&void 0!==te&&d({type:"shop_id",id:V,brand:X,url:"/index/search/search",nextPage:!0})}function h(e){L(e+" li").on("touchstart",function(){L(".sub-group").addClass("hide"),L(this).find(".sub-group").length>0&&L(this).find(".sub-group").removeClass("hide")})}function p(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function f(e){var t="";I||(I=!0,L.ajax({method:"post",url:e.url,data:e.data,success:function(e){200===e.code&&(L("#collect").hasClass("alreadyCollect")?L("#collect").attr("class","notCollect"):L("#collect").attr("class","alreadyCollect")),401===e.code&&(t=e.url,L("body").append("<a href='"+t+'\'><span class="jump-login"><span></a>'),L(".jump-login").click()),setTimeout(function(){y.refresh(),q=L("#scroller").outerHeight()},1e3),I=!1},error:function(){alert("网络断开连接了~"),I=!1}}))}function m(){var e={};e.url="/product/index/shopFav",e.data={shop_id:J?J:V,app_version:G},f(e)}function g(){var e={};e.url="/product/index/cancelShopFav",e.data={shop_id:J?J:V,app_version:G},f(e)}var v,w,y,b,C,j,x,k,T,q,E,I,S,L=e("jquery"),D=e("iscroll-probe"),z=e("lazyload"),_=e("swiper"),P=L("#pos-nav"),M=L("#pos-list"),F=e("js/plugin/tip"),O=e("js/plugin/filter"),N=e("js/plugin/loading"),B=L(".home-sub-nav"),A=L("#goods-container"),H=A.children(),R=L(H.get(0)),U=L(H.get(1)),W=L(H.get(2)),V=L('input[name="shop_id"]').val(),G=L('input[name="app_version"]').val(),X=L('input[name="brand"]').val(),J=L('input[name="favId"]').val(),$=L(window).height(),Q='<p class="no-result">未找到相关搜索结果</p>',Y=e("js/product/query-param"),Z=L("#list-nav"),K=L("#pos-list"),ee={"new":{order:1,reload:!0,page:1,end:!1},hot:{order:1,reload:!0,page:1,end:!1},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}},te=Z.find(".active"),ne=1,oe=L(".category-list li").length,ae=4-oe%4;if(z(L("img.lazy")),L(".banner-swiper").find("li").size()>1&&(v=new _(".banner-swiper",{lazyLoading:!0,lazyLoadingInPrevNext:!0,loop:!0,autoplay:3e3,autoplayDisableOnInteraction:!1,paginationClickable:!0,slideElement:"li",pagination:".banner-top .pagination-inner"})),L(".multi-browse").find("li").size()>1&&(w=new _(".multi-browse",{lazyLoading:!0,lazyLoadingInPrevNext:!0,lazyLoadingOnTransitionStart:!0,grabCursor:!0,slidesPerView:"auto",slideElement:"li",watchSlidesVisibility:!0})),L(".category-list li").length%4!==0&&L(".category-list li:last-child").addClass("category-list-last-li"),L(".category-list li").length<4&&(L(".category-list").addClass("category-list-top-board"),L(".category-list").find(".buriedpoint").addClass("category-list-only-one-row")),L(".category-list li").length>=5)for(S=ae;S>=0;S--)L(".category-list li").eq(oe-4+S-1).addClass("category-list-last-full-row");L.jqtab=function(e,t,n){L(e+" li, "+t+" li").not("li.all-goods").on("touchstart",function(){var o=L(this).index(),a=L(this).attr("tab");P.removeClass("fixed-top"),r(L(e+" li"),o),r(L(t+" li"),o),L(n).hide(),L("#"+a).fadeIn(),"new-arrival"===a?(i(),ne=2):"popularity"===a?(s(),ne=3):"home-page"===a&&(y&&y.refresh(),q=L("#scroller").outerHeight(),P.removeClass("fixed-top"),P.removeClass("absolute"),M.removeClass("fixed-top"),M.removeClass("absolute")),P.hasClass("hide")||y.scrollTo(0,0-b),P.addClass("hide")})},L.jqtab("#nav","#pos-nav",".main"),L("#wrapper").addClass("scroll-wrapper"),y=new D("#wrapper",{probeType:3,mouseWheel:!0,click:!0}),y.on("scroll",function(){var e,t=-this.y;if(t+2*$>q)switch(ne){case 2:e=function(){P.css({transform:"translate(0, "+-q+"px)"})},i(e);break;case 3:e=function(){P.css({transform:"translate(0, "+-q+"px)"})},s(e)}if(b>t)P.hasClass("hide")||P.addClass("hide"),M.hasClass("hide")||M.addClass("hide");else if(b+C+x>t){if(P.hasClass("hide")&&P.removeClass("hide"),M.hasClass("hide")||M.addClass("hide"),b+j>t)P.hasClass("fixed-top")||P.addClass("fixed-top").removeClass("absolute").css({transform:"translate(0, "+-q+"px)"});else if(b+C+j>t){if(L("#home-page").is(":hidden"))return!1;P.hasClass("absolute")||P.addClass("absolute").removeClass("fixed-top"),P.css({transform:"translate(0, "+(b+j-t-q)+"px)"})}}else{if(L("#home-page").is(":hidden"))return!1;P.hasClass("hide")||P.addClass("hide"),M.hasClass("hide")&&M.removeClass("hide"),q>t&&(M.hasClass("absolute")||M.addClass("absolute").removeClass("fixed-top"),M.css({transform:"translate(0, "+-q+"px)"}))}L("#scroller").trigger("scroll")}),document.addEventListener("touchmove",function(e){e.preventDefault()},!1),L(window).load(function(){y&&y.refresh(),b=L("#nav-top").outerHeight(),C=L("#nav").outerHeight(),j=L("#nav-main").height(),x=L("#nav-main").outerHeight(),k=L("#list-nav").outerHeight(),T=L("#goods-container").outerHeight(),setTimeout(function(){q=L("#scroller").outerHeight()},1e3)}),L.ajax({type:"GET",url:"/search/filter",data:{shop_id:X?"":V,brand:X,gender:c("gender"),channel:c("channel")},success:function(e){A.append(e),setTimeout(function(){y.refresh(),q=L("#scroller").outerHeight()},1e3),O.initFilter({fCbFn:d,hCbFn:function(){te.addClass("active"),te.siblings(".filter").removeClass("active")},missStatus:!0})}}),Z.bind("contextmenu",function(e){return!1}),K.bind("contextmenu",function(e){return!1}),B.on("touchend touchcancel",function(e){var t,n,o,a,i=L(e.target).closest("li"),s=i.attr("data-bp-id")||"";if(e.preventDefault(),L(document).trigger("shouldSendBpData",[s]),"undefined"!=typeof i&&0!==i.length){if(i.hasClass("filter"))i.hasClass("active")?(O.hideFilter(),te.addClass("active"),i.removeClass("active")):(te=i.siblings(".active"),te.removeClass("active"),i.addClass("active"),O.showFilter());else{if(i.hasClass("new")?(t=".new",o="newest"):i.hasClass("price")?(t=".price",o="price"):i.hasClass("discount")&&(t=".discount",o="discount"),n=ee[o],i.hasClass("active")){if(i.hasClass("new"))return;if(i.hasClass("price")||i.hasClass("discount"))switch(i=B.find(t),i.find(".icon > .iconfont").toggleClass("cur"),te=i,n.reload=!0,n.order=0===n.order?1:0,A.children(".container:not(.hide)").addClass("hide"),o){case"newest":R.removeClass("hide");break;case"price":U.removeClass("hide");break;case"discount":W.removeClass("hide")}}else{if(a=B.find(".active"),te=i,a.hasClass("filter"))O.hideFilter();else switch(A.children(".container:not(.hide)").addClass("hide"),o){case"newest":R.removeClass("hide");break;case"price":U.removeClass("hide");break;case"discount":W.removeClass("hide")}B.children().removeClass("active"),B.find(t).addClass("active")}n.reload&&d({type:"shop_id",id:V,brand:X,url:"/index/search/search",nextPage:!1})}e.stopPropagation()}}),L(window).scroll(function(){window.requestAnimationFrame(u)}),d({type:"shop_id",id:V,brand:X,url:"/index/search/search",nextPage:!1}),Z.on("touchstart","li",function(e){L(this).addClass("bytouch")}).on("touchend touchcancel",function(){Z.find("li").removeClass("bytouch"),y.refresh()}),K.on("touchstart","li",function(e){L(this).addClass("bytouch")}).on("touchend touchcancel",function(){K.find("li").removeClass("bytouch"),y.refresh(),y.scrollTo(0,-(b+C+x+5))}),h(".shop-foot-wrapper"),L(document).bind("touchstart",function(){L(".sub-group").addClass("hide")}),L(".shop-foot-wrapper").bind("touchstart",function(e){p(e)}),L("#collect").on("touchstart",function(e){L("#collect").hasClass("alreadyCollect")?g():m()})}),define("js/me/entry",["jquery","hammer","lazyload","swiper","handlebars","source-map","mlellipsis","index"],function(e,t,n){e("js/me/order"),e("js/me/order-detail"),e("js/me/fav"),e("js/me/suggest"),e("js/me/index"),e("js/me/coupons"),e("js/me/online-service"),e("js/me/address"),e("js/me/suggest"),e("js/me/browse-record"),e("js/me/address-act"),e("js/me/logistic"),e("js/me/pay"),e("js/me/personal-details"),e("js/me/currency"),e("js/me/currency-new"),e("js/me/message"),e("js/me/message-detail"),e("js/me/address-modify")}),define("js/me/order",["jquery","hammer","lazyload","swiper","handlebars","source-map","index"],function(e,t,n){function o(e){function t(){var t,i,s,r=1e3,l=60*r,d=60*l,c=24*d;return t=Math.floor(a%c/d),i=Math.floor(a%d/l),s=Math.floor(a%l/r),t=String(t).length>=2?t:"0"+t,i=String(i).length>=2?i:"0"+i,s=String(s).length>=2?s:"0"+s,e.removeClass("hide"),"00"===t?o.text("剩余"+i+":"+s):o.text("剩余"+t+":"+i+":"+s),a-=1e3,0>=a?void clearInterval(n):void 0}var n,o=e.find(".hours"),a=o.text();""!==a&&a>0&&(n=setInterval(t,1e3))}function a(){d(".order").each(function(){var e=d(this).find(".count-down");d(this).hasClass("hide")||o(e)})}function i(e){var t={type:w,page:y.page+1},n=e&&!e.noLoadingMask;b||(b=!0,n&&C.showLoadingMask(),d.ajax({type:"GET",url:"/home/getOrders",data:t,success:function(e){var o;" "!==e?(y.page=t.page,1===t.page?(g.html(e),u(g.find(".lazy"),{try_again_css:"order-failure"})):(o=g.children(".order").length,g.append(e),u(g.children(".order:gt("+(o-1)+")").find(".lazy"),{try_again_css:"order-failure"})),window.rePosFooter()):y.end=!0,b=!1,n&&C.hideLoadingMask(),a()}}))}function s(){y.end===!1&&d(window).scrollTop()+v>d(document).height()-.25*m.height()&&i({noLoadingMask:!0})}var r,l,d=e("jquery"),c=e("hammer"),u=e("lazyload"),h=e("js/plugin/tip"),p=e("swiper"),f=d("#order-nav > li"),m=d("#order-container"),g=m.children(".orders:not(.hide)"),v=d(window).height(),w=f.filter(".active").data("type"),y={page:0,end:!1},b=!1,C=e("js/plugin/loading"),j=e("js/me/dialog"),x=d(".reason-mask");u({try_again_css:"order-failure"}),function(){var e=f.length;4!==e&&f.width(100/e+"%")}(),C.init(d("body")),r=new c(document.getElementById("order-container")),r.on("tap",function(e){var t,n,o,a=d(e.target);a.closest(".locHref").length>0||(t=a.closest(".order"),n=t.data("id"),x.data("orderId",n),a.closest(".del").length>0?j.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){d.ajax({type:"GET",url:"/home/delOrder",data:{id:n},success:function(e){j.hideDialog(),e.message&&h.show(e.message),200===e.code&&window.location.reload()},error:function(){h.show("取消订单失败")}})}):a.closest(".cancel").length>0?x.css("visibility","visible"):a.closest(".order-goods").length>0?(o=t.data("href"),location.href=o):a.closest(".rebuy").length>0&&d.ajax({type:"GET",url:"/home/readd",data:{orderCode:n},success:function(e){h.show(e.message),location.href="/cart/index/index"},error:function(e){h.show(e.message)}}))}),d(window).scroll(function(){window.requestAnimationFrame(s)}),i(),d(function(){l=new p(".box-main",{direction:"vertical",slidesPerView:5,centeredSlides:!0,initialSlide:0,onSlideChangeStart:function(e){var t=e.activeIndex,n=e.slides,o=0;if(1!==n.length)if(0===t)for(o=1;o<n.length;o++)d(n[o]).css("transform","");else if(t===n.length-1)for(o=0;t>o;o++)d(n[o]).css("transform","rotateX("+(30+12*(t-o))+"deg)");else{for(o=0;t>o;o++)d(n[o]).css("transform","rotateX("+(30+12*(t-o))+"deg)");for(o=t+1;o<n.length;o++)d(n[o]).css("transform","")}d(n[t]).css("transform","")}})}),x.find(".box-cmp").on("touchend",function(e){var t=l.slides[l.activeIndex],n=d(t).text(),o=d(t).data("reasonId");d.ajax({type:"GET",url:"/home/cancelOrder",data:{id:x.data("orderId"),reason:n,reasonId:o}}).then(function(e){x.fadeOut(),"object"===d.type(e)&&(e.message&&h.show(e.message),setTimeout(function(){window.location.href="/home/orders"},2e3))}).fail(function(){h.show("网络错误")})}),x.on("touchend",function(e){return"reason-mask"!==e.target.className?!1:(x.css("visibility","hidden"),void e.stopPropagation())})}),define("js/me/order-detail",["jquery","lazyload","hammer","handlebars","source-map","swiper","index"],function(e,t,n){function o(e){function t(){var e,t,a,i=1e3,s=60*i,r=60*s,l=24*r;return e=Math.floor(o%l/r),t=Math.floor(o%r/s),a=Math.floor(o%s/i),e=String(e).length>=2?e:"0"+e,t=String(t).length>=2?t:"0"+t,a=String(a).length>=2?a:"0"+a,p.removeClass("hide"),"00"===e?h.text("剩余"+t+":"+a):h.text("剩余"+e+":"+t+":"+a),o-=1e3,0>o?void clearInterval(n):void 0}var n,o=e;""!==o&&o>0&&(n=setInterval(t,1e3))}var a,i,s=e("jquery"),r=e("lazyload"),l=e("hammer"),d=e("js/me/dialog"),c=e("js/plugin/tip"),u=s("#order-detail").data("id"),h=s(".hours"),p=s(".count-down"),f=e("swiper"),m=s(".owner-info"),g=s(".reason-mask");r({try_again_css:"order-failure"}),o(h.text()),i=new l(document.getElementsByClassName("opt")[0]),i.on("tap",function(e){var t=s(e.target);t.hasClass("btn-del")?d.showDialog({dialogText:"确定删除订单吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){s.ajax({type:"GET",url:"/home/delOrder",data:{id:u}}).then(function(e){s("#dialog-wrapper").hide(),"object"===s.type(e)&&(e.message&&c.show(e.message),setTimeout(function(){window.location.href="/home/orders"},2e3))}).fail(function(){c.show("网络错误")})}):t.hasClass("btn-cancel")?g.css("visibility","visible"):t.hasClass("btn-rebuy")&&s.ajax({type:"GET",url:"/home/readd",data:{orderCode:u},success:function(e){c.show(e.message),location.href="/cart/index/index"},error:function(e){c.show(e.message)}})}),m.data("changeable")===!0&&(m.find(".rest").show(),m.on("touchend",function(){location.href=m.data("url")})),s(function(){a=new f(".box-main",{initialSlide:0,centeredSlides:!0,slidesPerView:5,direction:"vertical",onSlideChangeStart:function(e){var t=e.activeIndex,n=e.slides,o=0;if(1!==n.length)if(0===t)for(o=1;o<n.length;o++)s(n[o]).css("transform","");else if(t===n.length-1)for(o=0;t>o;o++)s(n[o]).css("transform","rotateX("+(30+12*(t-o))+"deg)");else{for(o=0;t>o;o++)s(n[o]).css("transform","rotateX("+(30+12*(t-o))+"deg)");for(o=t+1;o<n.length;o++)s(n[o]).css("transform","")}s(n[t]).css("transform","")}})}),g.find(".box-cmp").on("touchend",function(e){var t=a.slides[a.activeIndex],n=s(t).text(),o=s(t).data("reasonId");s.ajax({type:"GET",url:"/home/cancelOrder",data:{id:u,reason:n,reasonId:o}}).then(function(e){g.fadeOut(),"object"===s.type(e)&&(e.message&&c.show(e.message),setTimeout(function(){window.location.href="/home/orders"},2e3))}).fail(function(){c.show("网络错误")})}),g.on("touchend",function(e){return"reason-mask"!==e.target.className?!1:(g.css("visibility","hidden"),void e.stopPropagation())})}),define("js/me/fav",["jquery","hammer","swiper","handlebars","source-map","index"],function(e,t,n){function o(e){f.filter(".active").removeClass("active"),f.eq(e).addClass("active"),m.filter(".show").removeClass("show"),m.eq(e).addClass("show")}function a(e){var t,n,o=/container-(\d+)['"]{1}/gi,a=/\d+/,i=e.match(o),s=i.length;for(t=0;s>t;t++)n=i[t].match(a)[0],g[n]=new u("#swiper-container-"+n,{slidesPerView:"auto",grabCursor:!0,slideElement:"li",wrapperClass:"swiper-wrapper-"+n,lazyLoading:!0,watchSlidesVisibility:!0})}function i(e,t,n){"favBrand"===t?q=!0:T=!0,d.ajax({method:"post",url:"/home/"+t,data:{page:n},success:function(n){var o=e.closest(".fav-type").find(".fav-content-loading");"favBrand"===t?w.addClass("hide"):v.addClass("hide")," "===n?(o.addClass("hide"),e.closest(".fav-type").find(".fav-null-box").removeClass("hide"),window.rePosFooter()):"end"===n?(o&&!o.hasClass("hide")&&o.addClass("hide"),e.closest(".fav-type").find(".fav-load-background").removeClass("fav-load-background").html("没有更多了"),q=!0,T=!0):n.length>10&&(e.append(n),o.remove(),"favBrand"===t?(a(n),q=!1):T=!1),window.rePosFooter()}})}function s(){d(window).scrollTop()+y>=d(document).height()-.25*j.height()-b&&(E?(w.filter(".hide").removeClass("hide"),q||(k++,i(j,"favBrand",k))):(v.filter(".hide").removeClass("hide"),T||(x++,i(C,"favProduct",x))))}var r,l,d=e("jquery"),c=e("hammer"),u=e("swiper"),h=e("js/me/dialog"),p=e("js/plugin/tip"),f=d("#fav-tab > li"),m=d(".fav-content > .fav-type"),g={},v=d(".fav-load-more"),w=d(".fav-brand-load-more"),y=d(window).height(),b=d("#yoho-footer").height(),C=d(".fav-product-list"),j=d(".fav-brand-swiper-wrapper"),x=1,k=1,T=!0,q=!0,E=!1;d("#fav-tab").hasClass("brand-tab")?(o(1),i(j,"favBrand",1),E=!0,window.rePosFooter()):(o(0),i(C,"favProduct",1),E=!1,window.rePosFooter()),r=new c(document.getElementById("fav-tab")),r.on("tap",function(e){var t,n=d(e.target).closest("li");0===n.length||n.hasClass("active")||(t=n.index(),0===t?(E=!1,0===C.find("li").length&&C.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&i(C,"favProduct",1)):(E=!0,0===j.find("div").length&&j.closest(".fav-type").find(".fav-null-box").hasClass("hide")&&i(j,"favBrand",1)),o(t),window.rePosFooter())}),l=new c(document.getElementById("fav-content")),l.on("tap",function(e){var t="";d(e.target).hasClass("del-fav")&&h.showDialog({dialogText:"您确定要取消收藏吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){t=d(e.target).closest("li").attr("data-id"),d.ajax({method:"post",url:"/home/favoriteDel",data:{id:t}}).then(function(t){200===t.code?(h.showDialog({autoHide:!0,fast:!0,dialogText:"已经取消收藏"}),d(e.target).closest("li").remove()):400===t.code?h.showDialog({autoHide:!0,fast:!0,dialogText:t.message}):h.showDialog({autoHide:!0,fast:!0,dialogText:"取消收藏失败"})}).fail(function(){h.showDialog({autoHide:!0,dialogText:"网络错误~"})})})}),d(window).scroll(s),d(document).on("touchend",".swiper-header",function(){var e=d(this).find(".fav-more").attr("href");e&&(window.location.href=e)}),d(".invalidGoods").on("touchstart touchend",function(e){var t=d(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,n){var o,a,i,s,r=e("jquery"),l=e("hammer"),d=e("lazyload"),c=e("handlebars"),u=e("js/me/dialog"),h=r(".upload-img-list"),p=r(".suggest-item .like-btn"),f=r(".suggest-item .dislike-btn"),m=r(".img-add"),g="",v=0;e("js/me/jquery.upload"),i='{{# imgList}}<li>{{# imgUrl}}<img src="{{.}}" /><span class="upload-img-remove"></span>{{/ imgUrl}}</li>{{/ imgList}}',s=c.compile(i),r("#upload-img").upload({auto:!0,fileType:"image/*",uploadScript:"/home/suggestimgUpload",fileObjName:"fileData",fileSizeLimit:300,height:"100%",width:"100%",multi:!1,onAddQueueItem:function(e){h.html(s({imgList:!0}))},onUploadComplete:function(e,t){h.html(""),g=JSON.parse(t).imgList[0].imgRelUrl,h.html(s(JSON.parse(t))),m.hide(),v++}}),d(),o=new l(document.getElementById("yoho-header")),o.on("tap",function(e){var t=r("#suggest-textarea").val(),n=/\S+/;if(r(e.target).hasClass("nav-btn")){if(!n.test(t))return void u.showDialog({autoHide:!0,dialogText:"意见不能为空"});r.ajax({method:"post",url:"/home/savesuggest",data:{content:t,image:g}}).then(function(e){200===e.code?(u.showDialog({autoHide:!0,dialogText:"提交成功"}),setTimeout(function(){location.pathname="home/suggest"},2e3)):u.showDialog({autoHide:!0,dialogText:"提交失败~"})}).fail(function(){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})}}),null!==document.getElementById("img-form")&&(a=new l(document.getElementById("img-form")),a.on("tap",function(e){r(e.target).hasClass("upload-img-remove")&&(h.html(""),g="",v--,setTimeout(function(){m.show()},50))})),p.bind("click",function(){var e=r(this).closest(".suggest-item").attr("data-id"),t=r(this);r.ajax({method:"post",url:"/home/upAndDown",data:{suggest_id:e,reliable:1}}).then(function(e){200===e.code&&(t.closest(".suggest-type").removeClass("show"),t.closest(".suggest-item").find(".suggest-good").addClass("show"))}).fail(function(e){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})}),f.bind("click",function(){var e=r(this).closest(".suggest-item").attr("data-id"),t=r(this);r.ajax({method:"post",url:"/home/upAndDown",data:{suggest_id:e,reliable:2}}).then(function(e){200===e.code&&(t.closest(".suggest-type").removeClass("show"),t.closest(".suggest-item").find(".suggest-bad").addClass("show"))}).fail(function(e){u.showDialog({autoHide:!0,dialogText:"网络错误~"})})})}),define("js/me/jquery.upload",["jquery"],function(e,t,n){var o=e("jquery");!function(e){var t={init:function(n){return this.each(function(){var o=e(this);o.data("uploadifive",{inputs:{},inputCount:0,fileID:0,queue:{count:0,selected:0,replaced:0,errors:0,queued:0,cancelled:0},uploads:{current:0,attempts:0,successful:0,errors:0,count:0}});var a=o.data("uploadifive"),s=a.settings=e.extend({auto:!0,buttonClass:!1,buttonText:"Select Files",checkScript:!1,dnd:!0,dropTarget:!1,fileObjName:"Filedata",fileSizeLimit:0,fileType:!1,formData:{},height:30,itemTemplate:!1,method:"post",multi:!0,overrideEvents:[],queueID:!1,queueSizeLimit:0,removeCompleted:!1,simUploadLimit:0,truncateLength:0,uploadLimit:0,uploadScript:"uploadifive.php",width:100},n);if(isNaN(s.fileSizeLimit)){var r=1.024*parseInt(s.fileSizeLimit);s.fileSizeLimit.indexOf("KB")>-1?s.fileSizeLimit=1e3*r:s.fileSizeLimit.indexOf("MB")>-1?s.fileSizeLimit=1e6*r:s.fileSizeLimit.indexOf("GB")>-1&&(s.fileSizeLimit=1e9*r)}else s.fileSizeLimit=1024*s.fileSizeLimit;if(a.inputTemplate=e('<input type="file">').css({"font-size":s.height+"px",opacity:0,position:"absolute",right:"-3px",top:"-3px","z-index":999}),a.createInput=function(){var n=a.inputTemplate.clone(),i=n.name="input"+a.inputCount++;s.multi&&n.attr("multiple",!0),s.fileType&&n.attr("accept",s.fileType),n.bind("change",function(){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var n=this.files.length;if(a.queue.selected=n,a.queue.count+n>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(o,"QUEUE_LIMIT_EXCEEDED");else{for(var r=0;n>r;r++)file=this.files[r],a.addQueueItem(file);a.inputs[i]=this,a.createInput()}s.auto&&t.upload.call(o),"function"==typeof s.onSelect&&s.onSelect.call(o,a.queue)}),a.currentInput&&a.currentInput.hide(),a.button.append(n),a.currentInput=n},a.destroyInput=function(t){e(a.inputs[t]).remove(),delete a.inputs[t],a.inputCount--},a.drop=function(n){a.queue.selected=0,a.queue.replaced=0,a.queue.errors=0,a.queue.queued=0;var i=n.dataTransfer,r=i.name="input"+a.inputCount++,l=i.files.length;if(a.queue.selected=l,a.queue.count+l>s.queueSizeLimit&&0!==s.queueSizeLimit)e.inArray("onError",s.overrideEvents)<0&&alert("The maximum number of queue items has been reached ("+s.queueSizeLimit+").  Please select fewer files."),"function"==typeof s.onError&&s.onError.call(o,"QUEUE_LIMIT_EXCEEDED");else{for(var d=0;l>d;d++)file=i.files[d],a.addQueueItem(file);a.inputs[r]=i}s.auto&&t.upload.call(o),"function"==typeof s.onDrop&&s.onDrop.call(o,i.files,i.files.length),n.preventDefault(),n.stopPropagation()},a.fileExistsInQueue=function(e){for(var t in a.inputs){input=a.inputs[t],limit=input.files.length;for(var n=0;n<limit;n++)if(existingFile=input.files[n],existingFile.name==e.name&&!existingFile.complete)return!0}return!1},a.removeExistingFile=function(e){for(var n in a.inputs){input=a.inputs[n],limit=input.files.length;for(var i=0;i<limit;i++)existingFile=input.files[i],existingFile.name!=e.name||existingFile.complete||(a.queue.replaced++,t.cancel.call(o,existingFile,!0))}},0==s.itemTemplate?a.queueItem=e('<div class="uploadifive-queue-item">                        <a class="close" href="#">X</a>                        <div><span class="filename"></span><span class="fileinfo"></span></div>                        <div class="progress">                            <div class="progress-bar"></div>                        </div>                    </div>'):a.queueItem=e(s.itemTemplate),a.addQueueItem=function(n){if(e.inArray("onAddQueueItem",s.overrideEvents)<0){a.removeExistingFile(n),n.queueItem=a.queueItem.clone(),n.queueItem.attr("id",s.id+"-file-"+a.fileID++),n.queueItem.find(".close").bind("click",function(){return t.cancel.call(o,n),!1});var i=n.name;i.length>s.truncateLength&&0!=s.truncateLength&&(i=i.substring(0,s.truncateLength)+"..."),n.queueItem.find(".filename").html(i),n.queueItem.data("file",n),a.queueEl.append(n.queueItem)}"function"==typeof s.onAddQueueItem&&s.onAddQueueItem.call(o,n),n.size>s.fileSizeLimit&&0!=s.fileSizeLimit?a.error("FILE_SIZE_LIMIT_EXCEEDED",n):(a.queue.queued++,a.queue.count++)},a.removeQueueItem=function(t,n,o){o||(o=0);var i=n?0:500;t.queueItem&&(" - Completed"!=t.queueItem.find(".fileinfo").html()&&t.queueItem.find(".fileinfo").html(" - Cancelled"),t.queueItem.find(".progress-bar").width(0),t.queueItem.delay(o).fadeOut(i,function(){e(this).remove()}),delete t.queueItem,a.queue.count--)},a.filesToUpload=function(){var e=0;for(var t in a.inputs){input=a.inputs[t],limit=input.files.length;for(var n=0;n<limit;n++)file=input.files[n],file.skip||file.complete||e++}return e},a.checkExists=function(n){if(e.inArray("onCheck",s.overrideEvents)<0){e.ajaxSetup({async:!1});var a=e.extend(s.formData,{filename:n.name});if(e.post(s.checkScript,a,function(e){
n.exists=parseInt(e)}),n.exists&&!confirm("A file named "+n.name+" already exists in the upload folder.\nWould you like to replace it?"))return t.cancel.call(o,n),!0}return"function"==typeof s.onCheck&&s.onCheck.call(o,n,n.exists),!1},a.uploadFile=function(t,n){if(!t.skip&&!t.complete&&!t.uploading)if(t.uploading=!0,a.uploads.current++,a.uploads.attempted++,xhr=t.xhr=new XMLHttpRequest,"function"==typeof FormData||"object"==typeof FormData){var r=new FormData;r.append(s.fileObjName,t);for(i in s.formData)r.append(i,s.formData[i]);xhr.open(s.method,s.uploadScript,!0),xhr.upload.addEventListener("progress",function(e){e.lengthComputable&&a.progress(e,t)},!1),xhr.addEventListener("load",function(e){4==this.readyState&&(t.uploading=!1,200==this.status?"Invalid file type."!==t.xhr.responseText?a.uploadComplete(e,t,n):a.error(t.xhr.responseText,t,n):404==this.status?a.error("404_FILE_NOT_FOUND",t,n):403==this.status?a.error("403_FORBIDDEN",t,n):a.error("Unknown Error",t,n))}),xhr.send(r)}else{var l=new FileReader;l.onload=function(i){var r="-------------------------"+(new Date).getTime(),l="--",d="\r\n",c="";c+=l+r+d,c+='Content-Disposition: form-data; name="'+s.fileObjName+'"',t.name&&(c+='; filename="'+t.name+'"'),c+=d,c+="Content-Type: application/octet-stream"+d+d,c+=i.target.result+d;for(key in s.formData)c+=l+r+d,c+='Content-Disposition: form-data; name="'+key+'"'+d+d,c+=s.formData[key]+d;c+=l+r+l+d,xhr.upload.addEventListener("progress",function(e){a.progress(e,t)},!1),xhr.addEventListener("load",function(e){t.uploading=!1;var o=this.status;404==o?a.error("404_FILE_NOT_FOUND",t,n):"Invalid file type."!=t.xhr.responseText?a.uploadComplete(e,t,n):a.error(t.xhr.responseText,t,n)},!1);var u=s.uploadScript;if("get"==s.method){var h=e(s.formData).param();u+=h}xhr.open(s.method,s.uploadScript,!0),xhr.setRequestHeader("Content-Type","multipart/form-data; boundary="+r),"function"==typeof s.onUploadFile&&s.onUploadFile.call(o,t),xhr.sendAsBinary(c)},l.readAsBinaryString(t)}},a.progress=function(t,n){if(e.inArray("onProgress",s.overrideEvents)<0){if(t.lengthComputable)var a=Math.round(t.loaded/t.total*100);n.queueItem.find(".fileinfo").html(" - "+a+"%"),n.queueItem.find(".progress-bar").css("width",a+"%")}"function"==typeof s.onProgress&&s.onProgress.call(o,n,t)},a.error=function(n,i,r){if(e.inArray("onError",s.overrideEvents)<0){switch(n){case"404_FILE_NOT_FOUND":errorMsg="404 Error";break;case"403_FORBIDDEN":errorMsg="403 Forbidden";break;case"FORBIDDEN_FILE_TYPE":errorMsg="Forbidden File Type";break;case"FILE_SIZE_LIMIT_EXCEEDED":errorMsg="File Too Large";break;default:errorMsg="Unknown Error"}i.queueItem.addClass("error").find(".fileinfo").html(" - "+errorMsg),i.queueItem.find(".progress").remove()}"function"==typeof s.onError&&s.onError.call(o,n,i),i.skip=!0,"404_FILE_NOT_FOUND"==n?a.uploads.errors++:a.queue.errors++,r&&t.upload.call(o,null,!0)},a.uploadComplete=function(n,i,r){e.inArray("onUploadComplete",s.overrideEvents)<0&&(i.queueItem.find(".progress-bar").css("width","100%"),i.queueItem.find(".fileinfo").html(" - Completed"),i.queueItem.find(".progress").slideUp(250),i.queueItem.addClass("complete")),"function"==typeof s.onUploadComplete&&s.onUploadComplete.call(o,i,i.xhr.responseText),s.removeCompleted&&setTimeout(function(){t.cancel.call(o,i)},3e3),i.complete=!0,a.uploads.successful++,a.uploads.count++,a.uploads.current--,delete i.xhr,r&&t.upload.call(o,null,!0)},a.queueComplete=function(){"function"==typeof s.onQueueComplete&&s.onQueueComplete.call(o,a.uploads)},!(window.File&&window.FileList&&window.Blob&&(window.FileReader||window.FormData)))return"function"==typeof s.onFallback&&s.onFallback.call(o),!1;if(s.id="uploadifive-"+o.attr("id"),a.button=e('<div id="'+s.id+'" class="uploadifive-button">'+s.buttonText+"</div>"),s.buttonClass&&a.button.addClass(s.buttonClass),a.button.css({height:s.height,"line-height":s.height+"px",overflow:"hidden",position:"relative","text-align":"center",width:s.width}),o.before(a.button).appendTo(a.button).hide(),a.createInput.call(o),s.queueID?a.queueEl=e("#"+s.queueID):(s.queueID=s.id+"-queue",a.queueEl=e('<div id="'+s.queueID+'" class="uploadifive-queue" />'),a.button.after(a.queueEl)),s.dnd){var l=s.dropTarget?e(s.dropTarget):a.queueEl.get(0);l.addEventListener("dragleave",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("dragenter",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation()},!1),l.addEventListener("drop",a.drop,!1)}XMLHttpRequest.prototype.sendAsBinary||(XMLHttpRequest.prototype.sendAsBinary=function(e){function t(e){return 255&e.charCodeAt(0)}var n=Array.prototype.map.call(e,t),o=new Uint8Array(n);this.send(o.buffer)}),"function"==typeof s.onInit&&s.onInit.call(o)})},debug:function(){return this.each(function(){console.log(e(this).data("uploadifive"))})},clearQueue:function(){this.each(function(){var n=e(this),o=n.data("uploadifive"),a=o.settings;for(var s in o.inputs)for(input=o.inputs[s],limit=input.files.length,i=0;i<limit;i++)file=input.files[i],t.cancel.call(n,file);"function"==typeof a.onClearQueue&&a.onClearQueue.call(n,e("#"+o.settings.queueID))})},cancel:function(n,o){this.each(function(){var a=e(this),i=a.data("uploadifive"),s=i.settings;"string"==typeof n&&(isNaN(n)||(fileID="uploadifive-"+e(this).attr("id")+"-file-"+n),n=e("#"+fileID).data("file")),n.skip=!0,i.filesCancelled++,n.uploading&&(i.uploads.current--,n.uploading=!1,n.xhr.abort(),delete n.xhr,t.upload.call(a)),e.inArray("onCancel",s.overrideEvents)<0&&i.removeQueueItem(n,o),"function"==typeof s.onCancel&&s.onCancel.call(a,n)})},upload:function(t,n){this.each(function(){var o=e(this),a=o.data("uploadifive"),i=a.settings;if(t)a.uploadFile.call(o,t);else if(a.uploads.count+a.uploads.current<i.uploadLimit||0==i.uploadLimit){if(!n){a.uploads.attempted=0,a.uploads.successsful=0,a.uploads.errors=0;var s=a.filesToUpload();"function"==typeof i.onUpload&&i.onUpload.call(o,s)}e("#"+i.queueID).find(".uploadifive-queue-item").not(".error, .complete").each(function(){return _file=e(this).data("file"),a.uploads.current>=i.simUploadLimit&&0!==i.simUploadLimit||a.uploads.current>=i.uploadLimit&&0!==i.uploadLimit||a.uploads.count>=i.uploadLimit&&0!==i.uploadLimit?!1:void(i.checkScript?(_file.checking=!0,skipFile=a.checkExists(_file),_file.checking=!1,skipFile||a.uploadFile(_file,!0)):a.uploadFile(_file,!0))}),0==e("#"+i.queueID).find(".uploadifive-queue-item").not(".error, .complete").size()&&a.queueComplete()}else 0==a.uploads.current&&(e.inArray("onError",i.overrideEvents)<0&&a.filesToUpload()>0&&0!=i.uploadLimit&&alert("The maximum upload limit has been reached."),"function"==typeof i.onError&&i.onError.call(o,"UPLOAD_LIMIT_EXCEEDED",a.filesToUpload()))})},destroy:function(){this.each(function(){var n=e(this),o=n.data("uploadifive"),a=o.settings;t.clearQueue.call(n),a.queueID||e("#"+a.queueID).remove(),n.siblings("input").remove(),n.show().insertBefore(o.button),o.button.remove(),"function"==typeof a.onDestroy&&a.onDestroy.call(n)})}};e.fn.upload=function(n){return t[n]?t[n].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof n&&n?void e.error("The method "+n+" does not exist in $.uploadify"):t.init.apply(this,arguments)}}(o)}),define("js/me/index",["jquery","swiper","index"],function(e,t,n){var o,a=e("jquery"),i=e("js/plugin/notice-scroll"),s=a(".user-avatar"),r=a(".list-item"),l=new Image;e("js/product/recommend-for-you"),e("js/product/suspend-cart"),o=s.data("avatar"),l.src=o,l.onload=function(){s.css("background-image","url("+o+")")},i(".notice",1e3*a(".notice").data("time")),a(".yoho-page").on("touchstart",".list-item, .type-item, .order-title",function(){r.removeClass("highlight"),a(this).addClass("highlight")}).on("touchend touchcancel",".list-item, .type-item, .order-title",function(){a(this).removeClass("highlight")})}),define("js/product/recommend-for-you",["swiper","jquery","index"],function(e,t,n){var o,a=e("swiper"),i=e("jquery"),s=i(".recommend-for-you");i.get("/home/preference").then(function(e){s.html(e).show(),i("#swiper-recommend").length&&(o=new a("#swiper-recommend",{slidesPerView:"auto",grabCursor:!0,slideElement:"a",lazyLoading:!0,watchSlidesVisibility:!0}))}).fail(function(){s.hide()})}),define("js/me/coupons",["jquery","hammer","mlellipsis"],function(e,t,n){function o(e,t){d.showLoadingMask(),s.ajax({type:"POST",url:"/home/couponData",dataType:"html",data:{status:e,page:t},success:function(e){s("#employ").append(e),window.rePosFooter(),d.hideLoadingMask()}})}function a(){return s(window).scrollTop()+s(window).height()>s("body").height()-100?(u++,void o(c,u)):void 0}var i,s=e("jquery"),r=e("hammer"),l=e("mlellipsis"),d=e("js/plugin/loading"),c=0,u=1;l.init(),s(".yoho-footer").css("border-top","1px solid #e0e0e0"),s(".employ span").each(function(e){i=new r(s(".employ span")[e]),i.on("tap",function(t){s(".employ span").removeClass("active").eq(e).addClass("active"),s("#employ").html(" "),c=e,u=1,o(c,u),window.rePosFooter()})}),s(window).scroll(function(){window.requestAnimationFrame(a)}),o(c,u)}),define("js/me/online-service",["jquery"],function(e,t,n){var o=e("jquery"),a=o(".question-tab .tab-item");a.on("touchend",function(){var e=o(this).data("tab");e='[data-tab-name="'+e+'"]',a.removeClass("current"),o(this).addClass("current"),o(".question-list").removeClass("current"),o(e).addClass("current")}),o(".yoho-page").on("touchstart",".connect-item, .question-item",function(){o(this).siblings().removeClass("highlight"),o(this).addClass("highlight")}).on("touchend touchcancel",".connect-item, .question-item",function(){o(this).removeClass("highlight")})}),define("js/me/address",["jquery","hammer"],function(e,t,n){var o,a=e("jquery"),i=e("js/plugin/tip"),s=e("js/plugin/loading"),r=a(".action"),l=a(".add-address"),d=a("#yoho-footer"),c=a(".confim-mask"),u=a(".page-wrap"),h=a(".address-item");e("js/common"),u.first().css("min-height",function(){return a(window).height()-a("#yoho-header").height()-d.height()}),window.rePosFooter(),c.on("touchend",".cancel",function(e){return o=null,c.fadeOut(),!1}).on("touchend",".confim",function(){return s.showLoadingMask(),c.fadeOut(),a.ajax({method:"POST",url:"/home/delAddress",data:{id:o}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(i.show(e.message||"网络出了点问题~"),s.hideLoadingMask()):window.location.reload()}).fail(function(){i.show("网络出了点问题~"),s.hideLoadingMask()}).always(function(){o=null}),!1}),h.length<5&&l.attr("href",l.data("href")),l.on("touchend",function(){return h.length>=5?(i.show("您最多添加5个收货地址"),!1):void 0}),r.on("touchend",".del",function(){return o=a(this).data("id"),c.fadeIn(),!1}),r.on("touchstart","a,span",function(){a(this).css("background","#eee")}).on("touchend touchcancel","a,span",function(){a(this).css("background","transparent")})}),define("js/me/browse-record",["jquery","lazyload","handlebars","source-map","hammer"],function(t,n,o){function a(e){var t=c.children(".browse-record-good").length;g||(1===f&&u.removeClass("hide"),g=!0,i.ajax({type:"GET",url:"/home/recordContent",data:{page:f+1},success:function(n){" "===n?(m=!0,h.addClass("hide"),p.removeClass("hide")):(0===t?(c.html(n),s()):(c.append(n),s(c.find(".browse-record-good:gt("+(t-1)+") .lazy"))),window.rePosFooter(),f++,e&&e())},complete:function(){g=!1}}))}var i=t("jquery"),s=t("lazyload"),r=t("js/plugin/loading"),l=t("js/plugin/tip"),d=t("js/me/dialog"),c=i(".records"),u=i(".load-more"),h=u.children(".more"),p=u.children(".no-more"),f=0,m=!1,g=!1,v=i(window).height();r.init(),r.showLoadingMask(),a(r.hideLoadingMask),i(window).scroll(function(){m||v+i(window).scrollTop()>i(document).height()-.25*c.height()&&a()}),c.on("touchstart",".del-icon",function(){var e=i(this).closest(".browse-record-good"),t=e.data("skn");d.showDialog({dialogText:"确定删除此条浏览记录吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){i.ajax({type:"GET",url:"/home/delRecord",data:{skn:t},success:function(e){200===e.code&&(d.showDialog({dialogText:"删除浏览记录成功",autoHide:2e3,fast:!0}),setTimeout(function(){window.history.go(0)},1200))}})})}),i(".deps").on("touchstart","span",function(){i(this).css("background","#eee")}).on("touchend touchcancel","span",function(){i(this).css("background","transparent")}),i(".invalidGoods").on("touchstart touchend",function(){var t=i(e.target).closest("span");if(!t.hasClass("del-icon"))return l.show("商品已下架"),!1})}),define("js/me/address-act",["jquery","hammer"],function(e,t,n){function o(e){f.html(e),y.on("touchend",function(){p.hide(),f.show(),b="list",g.html("地区选择")}),f.find(".address").each(function(e,t){var n=new r(t);n.on("tap",function(e){var t=s(e.target);"li"!==e.target.tagName.toLowerCase()&&(t=t.parent("li")),C.push(t.children(".caption").text().trim()),t.siblings().hide(),t.children("ul").show().children("li").show(),e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),f.find(".address-last").each(function(e,t){var n=new r(t);n.on("tap",function(e){var t=s(e.target);C.push(t.text().trim()),s('[name="area"]').val(C.join(" ")),s('[name="area_code"]').val(t.data("id")),p.show(),b="edit",g.html(w),f.hide(),f.find("ul").hide().find("li").removeClass("highlight"),f.children("ul").show().children("li").show(),C=[],e.srcEvent.preventDefault(),e.srcEvent.stopPropagation()})}),f.on("touchstart","li",function(){s(this).addClass("highlight")}).on("touchend touchcancel","li",function(){s(this).removeClass("highlight")})}var a,i,s=e("jquery"),r=e("hammer"),l=e("js/plugin/tip"),d=e("js/plugin/security"),c=e("js/plugin/loading"),u=s(".edit-address"),h=s(".submit"),p=s(".my-edit-address-page"),f=s(".my-address-list-page"),m=s(".nav-back"),g=s(".nav-title"),v=s("input, textarea"),w=g.html(),y=s(".area"),b="edit",C=[],j=s.queryString();s(p,f).css("min-height",function(){return s(window).height()-s("#yoho-header").height()}),m.attr("href","javascript:void(0);"),m.on("touchend",function(e){"list"===b?(f.hide(),p.show(),e.preventDefault(),b="edit",g.html(w),f.hide(),f.find("ul").hide().find("li").removeClass("highlight"),f.children("ul").show().children("li").show(),C=[]):window.history.go(-1)}),u.on("submit",function(){return a?!1:d.hasDangerInput(!1)?!1:s(this).find('[name="consignee"]').val()?s(this).find('[name="mobile"]').val()?s(this).find('[name="area_code"]').val()&&s(this).find('[name="area"]').val()?s(this).find('[name="address"]').val()?(a=!0,c.showLoadingMask(),h.css("background","#777"),s.ajax({method:"POST",url:"/home/saveAddress",data:s(this).serialize()}).then(function(e){"object"!==s.type(e)&&(e={}),200!==e.code?(l.show(e.message||"网络出了点问题~"),a=!1,c.hideLoadingMask()):"shopping"===j.refer?window.location.href="/cart/index/selectAddress":"modify"===j.refer?window.location.href="/home/addressModify":window.location.href="/home/address"}).fail(function(){l.show("网络出了点问题~"),a=!1,c.hideLoadingMask(),h.css("background","#444")}),!1):(l.show("地址不能为空"),!1):(l.show("省市区不能为空"),!1):(l.show("手机号不能为空"),!1):(l.show("收件人不能为空"),!1)}),h.on("touchend",function(){return d.hasDangerInput(!1)?!1:(v.blur(),u.submit(),!1)}).on("touchstart",function(){s(this).addClass("highlight")}).on("touchend touchcancel",function(){s(this).removeClass("highlight")}),window.localStorage&&window.localStorage.getItem&&(i=window.localStorage.getItem("chinaAddressList")),i?o(i):s.ajax({method:"GET",url:"/home/locationList",timeout:6e4}).then(function(e){o(e),window.localStorage&&window.localStorage.setItem&&window.localStorage.setItem("chinaAddressList",e)}).fail(function(){l.show("获取省市区列表失败")})}),define("js/me/logistic",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){function o(){d+l>r?window.rePosFooter():s.css("border-top","1px solid #f1f1f1")}function a(){return window.cookie("_Channel")||"boys"}var i=e("jquery"),s=i("#yoho-footer"),r=window.outerHeight,l=document.body.offsetHeight,d=s.height();i(document).ready(o),e("js/home/maybe-like")(a()),i(window).scrollTop(1).scrollTop(0)}),define("js/me/pay",["jquery","hammer"],function(e,t,n){function o(){document.addEventListener("WeixinJSBridgeReady",function(){window.WeixinJSBridge&&window.WeixinJSBridge.call("hideOptionMenu")})}function a(e,t){w.addClass("hide"),window.WeixinJSBridge&&window.WeixinJSBridge.invoke("getBrandWCPayRequest",t,function(t){f.ajax({type:"GET",url:"/shopping/pay/wechatPayConfirm?order_code="+e,dataType:"json",success:function(t){window.location.href="/home/orders/detail?order_code="+e}})})}function i(e){var t;w.removeClass("hide"),void 0===typeof WeixinJSBridge?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",a,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",a),document.attachEvent("onWeixinJSBridgeReady",a)):f.ajax({type:"GET",url:"/shopping/pay/wechatwapapi?order_code="+e,dataType:"json",success:function(n){200===n.code?(t=n.data.jsApiParameters,a(e,t)):g.show("微信支付调取失败")},error:function(){g.show("请刷新本页面,完成微信支付")},complete:function(){w.addClass("hide")}})}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 l(){s()||r()}function d(e,t){f(e).css("background-position-y",t)}function c(){var e=f(".box"),t=null,n=null;e.each(function(e,o){t=f(o).find(".icon").find("div"),t.length>0&&(n=f(o).attr("id"),"alipay"!==n&&d(t,j[n]))})}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(){l(),m.hideLoadingMask(),u(),c(),h()}var f=e("jquery"),m=e("js/plugin/loading"),g=e("js/plugin/tip"),v=e("hammer"),w=f(".loading-toast"),y=document.getElementById("ordercode").value,b=document.getElementById("weixin"),C=b&&new v(b),j={baidu:"-2.7rem",weixin:"-1.2rem",QQ:"-5.4rem",bank:"-4rem"};window.wx&&wx.hideOptionMenu(),void 0===typeof WeixinJSBridge?(document.addEventListener?document.addEventListener("WeixinJSBridgeReady",o,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",o),document.attachEvent("onWeixinJSBridgeReady",o)),o()):o(),C&&C.on("tap",function(){i(y)}),m.showLoadingMask(),f(document).ready(p)}),define("js/me/personal-details",["jquery"],function(e,t,n){var o,a=e("jquery"),i=a(".user-avatar"),s=new Image;o=i.data("avatar"),s.src=o,s.onload=function(){i.css("background-image","url("+o+")")}}),define("js/me/currency",["jquery"],function(e,t,n){function o(e){i.ajax({type:"POST",url:"/home/ajaxCurrencyDetail",dataType:"html",data:{page:e},success:function(e){i(".coin-detail").append(e),window.rePosFooter()}})}function a(){return i(window).scrollTop()+i(window).height()>i("body").height()-100?(r++,void o(r)):void 0}var i=e("jquery"),s=e("js/plugin/loading"),r=1;s.showLoadingMask(),i(window).scroll(function(){window.requestAnimationFrame(a)}),o(r),i(document).ready(s.hideLoadingMask)}),define("js/me/currency-new",["jquery","hammer","mlellipsis","lazyload"],function(e,t,n){function o(){return window.cookie("_Channel")||"boys"}e("js/home/maybe-like")(o())}),define("js/me/message",["jquery","handlebars","source-map","hammer"],function(e,t,n){function o(e){s.showLoadingMask(),i.ajax({type:"POST",url:"/home/ajaxMessage",dataType:"html",data:{page:e},success:function(t){" "===t&&(c=!0,1===e&&(t='<p style="text-align:center">您没有消息</p>')),i(".massage-page").append(t),window.rePosFooter(),s.hideLoadingMask()}})}function a(){!c&&i(window).scrollTop()+i(window).height()>i("body").height()-100&&(d++,o(d))}var i=e("jquery"),s=e("js/plugin/loading"),r=e("js/me/dialog"),l=i(".massage-page"),d=1,c=!1;i(window).scroll(function(){window.requestAnimationFrame(a)}),l.on("touchstart",".del",function(){var e=i(this).closest(".massage-list"),t=e.data("id");r.showDialog({dialogText:"确定删除这条消息吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){i.ajax({type:"POST",url:"/home/ajaxDelMes",data:{id:t},success:function(e){200===e.code?(r.showDialog({dialogText:"删除消息成功",autoHide:2e3,fast:!0}),setTimeout(function(){window.history.go(0)},1200)):r.showDialog({dialogText:e.message,autoHide:2e3,fast:!0})}})})}),o(d)}),define("js/me/message-detail",["jquery","handlebars","source-map","hammer"],function(e,t,n){var o=e("jquery"),a=e("js/me/dialog"),i=o(".massage-page"),s=!1;i.on("touchstart",".pick-coupon-btn",function(){if(!s){s=!0;var e=o(this).data("id");o.ajax({type:"POST",url:"/home/pickCoupon",data:{id:e},success:function(e){200===e.code&&(a.showDialog({dialogText:"领取成功",autoHide:2e3,fast:!0}),o(this).removeClass("pick-coupon-btn")),s=!1,a.showDialog({dialogText:e.message,autoHide:2e3,fast:!0})}})}})}),define("js/me/address-modify",["jquery","hammer"],function(e,t,n){var o,a=e("jquery"),i=e("js/plugin/tip"),s=a(".confim-modify-mask"),r=a(".modifyAdd"),l=r.data("orderCode");e("js/common"),a(".address-item").on("touchend",function(){o=a(this).data("addressId"),r.data("rel")===!0?(s.find(".content").text("关联订单的收货地址将会一起修改且不可修改第二次,请确认是否修改?"),s.fadeIn()):(s.find(".content").text("收货地址仅且只能修改一次,请确认是否修改?"),s.fadeIn())}),s.on("touchend",".cancel",function(e){return o=null,s.fadeOut(),!1}).on("touchend",".confim",function(){return a.ajax({method:"GET",url:"/home/chooseAddress",data:{addressId:o,orderCode:l}}).then(function(e){"object"!==a.type(e)&&(e={}),200!==e.code?(s.fadeOut(),i.show(e.message||"网络出了点问题~")):window.location.href="/home/orderdetail?order_code="+l}).fail(function(){i.show("网络出了点问题~")}).always(function(){o=null}),!1})}),define("js/cart/entry",["jquery","mlellipsis","hammer","handlebars","source-map","swiper","lazyload","index"],function(e,t,n){e("js/cart/cart"),e("js/cart/gift-advance"),e("js/cart/order-ensure"),e("js/cart/invoice-info"),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,n){function o(){return window.isCookiesEnabled()?p(".cart-goods").length<=0&&!q:p(".cart-goods").length<=0}function a(){return b.not(".hide")}function i(){a().find(".shopping-cart-good .name").each(function(){this.mlellipsis(2)}),T=!0}function s(){return a().find(".cart-goods .icon-cb-checked").length>0}function r(){var e=a().find(".freebie");return!(e.length<=0)}function l(){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,n){p(n).parent().parent().parent().siblings(".checkbox").hasClass("icon-cb-checked")&&(E+=1,t=!0)}),t)}function d(){v.showDialog({dialogText:"您还未选择赠品,是否去选择赠品",hasFooter:{leftBtnText:"我不要赠品",rightBtnText:"去选择"}},function(){window.location.href=a().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"),E=0;w.showLoadingMask(),o()?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"),i(),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&&i(),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})),/MicroMessenger/i.test(navigator.userAgent)&&p(".btn-login").attr("href","/passport/login/wechat?refer="+location.href),p(".btn-balance").on("touchend",function(){var e=window.cookie("order-info");return E=0,l()?(y.show("所选商品中有"+E+"种库存不足的商品"),!1):r()?(d(),!1):void(s()?(e&&window.setCookie("order-info",""),window.location.href="/cart/index/orderEnsure?cartType="+C):y.show("请先勾选商品"))}),p(".off-shell-goods").on("click",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),0===p(".invalid-goods").find(".shopping-cart-good").length&&p("#failure-goods").removeClass("invalid-goods")}),define("js/cart/good",["jquery","mlellipsis","lazyload","handlebars","source-map","hammer"],function(e,t,n){function o(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 a(e,t,n,o){return e.length<2?(m.show("出错啦!"),!1):(u.remove(),d(e).appendTo("#mainCart"),u.init(),u.setEditModeWithSknId(t,n),o||u.disableNumEdit(),void u.show())}function i(e,t){v||(v=!0,d.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=d(".shopping-cart-good .icon-cb-checked"),n=d(".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){d(t).removeClass("icon-cb-checked").addClass("icon-checkbox")}):n.each(function(e,t){d(t).removeClass("icon-checkbox").addClass("icon-cb-checked")}),window.location.href="/cart/index/index?cartType="+d("#cartType").val()}function r(e,t,n){var a={},s=d(".cart-content:not(.hide) .shopping-cart-good"),r=null,l=[];a.goods_type=t,a.selected=e?"N":"Y",s.each(function(e,t){r=d(t),a.product_sku=d(t).data("id"),a.hasPromotion=d(t).data("promotion"),a.buy_number=r.find(".count").eq(0).text().trim().replace("×",""),l.push(new o(a))}),i(l,n)}var l,d=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=d(".balance .checkbox"),v=!1;c.init(),p({try_again_css:"order-failure"}),setTimeout(function(){d(".shopping-cart-good .name").each(function(){this.mlellipsis(2)})},0),d(".cart-goods").on("touchstart",".checkbox",function(){var e=d(this),t=e.closest(".shopping-cart-good"),n=t.data("id"),a=t.data("promotion"),i=[],s={};return!e.hasClass("icon-cb-checked")&&e.siblings(".info").find(".low-stocks").length>0?(m.show("库存不足,无法购买"),!1):(s.goods_type=d("#cartType").val(),s.selected=e.hasClass("icon-cb-checked")?"N":"Y",s.product_sku=n,s.hasPromotion=a,s.buy_number=t.find(".count").eq(0).text().trim().replace("×",""),i.push(new o(s)),void d.ajax({type:"post",url:"select",data:{skuList:JSON.stringify(i)}}).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="+d("#cartType").val()):400===t.code&&m.show("网络异常")},function(){m.show("网络异常")}))}),d(".icon-edit").on("touchstart",function(e){var t,n,o,i,s,r=d(this),c=r.closest(".shopping-cart-good").data("skn");return r.parents(".off-shell-goods").length?(m.show("商品已下架"),!1):c===l?void u.show():(l=c,t=r.closest(".info").siblings(".checkbox"),n=r.closest(".deps").siblings(".few-tag"),o=r.closest(".shopping-cart-good").data("id"),i=r.data("count"),s=!n.hasClass("gift-tag")&&!n.hasClass("plus-tag"),e.stopPropagation(),h.showLoadingMask(),void d.ajax({url:"/cart/index/goodinfo",data:{skn:c,buy_num:i},success:function(e){a(e,o,t.hasClass("icon-cb-checked"),s)},error:function(){m.show("网络异常"),window.location.reload()},complete:function(){h.hideLoadingMask()}}))}),d(".icon-del").on("touchstart",function(e){var t=d(this);e.stopPropagation(),f.showDialog({dialogText:"您确定要从购物车中删除吗?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){var e=t.closest(".shopping-cart-good"),n=t.data("count");d.ajax({method:"post",url:"/cart/index/del",data:{sku:e.data("id"),count:n,promotionId:e.data("promotion")}}).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="+d("#cartType").val()):m.show(e.message)},function(){m.show("网络异常"),window.location.reload()})})}),g.on("touchend",function(){var e=d("#cartType").val(),t=d(this).hasClass("icon-cb-checked");if("ordinary"===e){if(!t&&d(".common .low-stocks").length>0)return m.show("所选商品中含有库存不足的商品"),!1}else if("advance"===e&&!t&&d(".presell .low-stocks").length>0)return m.show("所选商品中含有库存不足的商品"),!1;r(t,e,s)}),d(".down").on("touchend",function(){u.show()})}),define("js/cart/gift-advance",["jquery","mlellipsis","lazyload","hammer"],function(e,t,n){function o(e,t){d.showLoadingMask(),a.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 l.show("网络错误")},function(){l.show("网络错误")}).always(function(){d.hideLoadingMask()})}var a=e("jquery"),i=e("mlellipsis"),s=e("lazyload"),r=e("hammer"),l=e("js/plugin/tip"),d=e("js/plugin/loading"),c=e("js/cart/chose-panel"),u=a(".gift-advance-page"),h=a.queryString();e("js/common"),s(a(".lazy")),i.init(),u.find(".chose").each(function(e,t){var n=new r(t);n.on("tap",function(e){var t=a(e.target),n=t.closest(".gift-advance-good").data("id"),i=t.closest(".advance-block").data("promotion-id");o(n,i)})}),setTimeout(function(){a(".gift-advance-good .name").each(function(){this.mlellipsis(2)})},0)}),define("js/cart/order-ensure",["jquery","lazyload","hammer"],function(e,t,n){function o(){var e,t=location.search.substr(1).split("&"),n=[],o={};for(e=0;e<t.length;e++)n=t[e].split("="),o[n[0]]=n[1],n=[];return o}function a(){return o().limitproductcode}function i(e){var t,n=p(".more-jit a").get(0);n&&(t=n.href,t.indexOf("deliveryId")<0?n.href=t+"&deliveryId="+e:n.href=t.replace(/deliveryId=(\d)/,"deliveryId="+e))}function s(){var e=T("yohoCoin"),t=T("deliveryId");g.showLoadingMask(),p.ajax({method:"POST",url:"/cart/index/orderCompute",data:{cartType:T("cartType")||"ordinary",deliveryId:T("deliveryId"),paymentTypeId:T("paymentTypeId"),couponCode:T("couponCode"),yohoCoin:e,skuList:a()?T("skuList"):void 0}}).then(function(e){"object"!==p.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&&(C.find("em").html("- ¥ "+e.use_yoho_coin),j.html("已抵¥"+e.use_yoho_coin),C.find("em").show(),j.show()),h="",e.promotion_formula_list&&(p.each(e.promotion_formula_list,function(e,t){h+="<li><p>"+t.promotion+"</p><span>"+t.promotion_amount+"</span></li>"}),p(".price-cost span").html("¥"+e.last_order_amount),p(".bill span").html("¥"+e.last_order_amount),p(".total").html(h)),i(t))}).fail(function(){window.location.reload()}).always(function(){
g.hideLoadingMask()})}function r(){var e=w.find('[name="invoice-title"]').val()||T("invoiceText"),t=p("#msg").find("input").val()||T("msg");if(c)return!1;if(T("invoice")){if(!e)return void m.show("请输入发票抬头");if(e.length>30)return void m.show("发票抬头不得超过30个汉字")}return t&&t.length>40?void m.show("留言不得超过40个汉字"):(g.showLoadingMask(),c=!0,void p.ajax({method:"POST",url:"/cart/index/orderSub",data:{addressId:T("addressId"),cartType:T("cartType")||"ordinary",deliveryId:T("deliveryId"),deliveryTimeId:T("deliveryTimeId"),invoiceText:T("invoice")?e:null,invoiceType:T("invoice")?w.find(".invoice-type").val()||T("invoiceType"):null,msg:t,paymentTypeId:T("paymentTypeId"),paymentType:T("paymentType"),couponCode:T("couponCode"),yohoCoin:T("yohoCoin"),skuList:a()?T("skuList"):void 0}}).then(function(e){var t;return e?void(200===e.code?(t=2===d?"/home/orderDetail?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&&m.show(e.message)):void m.show("系统繁忙,请稍后再试!")}).fail(function(){m.show("系统繁忙,请稍后再试!")}).always(function(){c=!1,g.hideLoadingMask()}))}function l(e){return e=e||"",e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var d,c,u,h,p=e("jquery"),f=e("lazyload"),m=e("js/plugin/tip"),g=e("js/plugin/loading"),v=e("js/cart/order-info"),w=p(".invoice"),y=p(".coupon-use.used"),b=p(".address-wrap"),C=p(".coin-check"),j=p(".coin .used"),x=p(".sub-block"),k=p.queryString(),T=v.orderInfo;e("js/common"),f(),window.getUid()!==T("uid")&&(v.init(),window.location.reload()),y.data("name")!==T("couponName")&&(T("couponCode",null),T("couponName",null)),document.referrer&&-1!==document.referrer.indexOf("/cart/index/index")&&(T("couponCode",null),T("couponName",null)),a()&&function(){var e=[],t=o();t.type="limitcode",e.push(t),T("skuList",JSON.stringify(e)),T("limitUrlSufix",location.search)}(),(k.cartType||k.carttype||!T("cartType"))&&T("cartType",k.cartType||k.carttype||"ordinary"),p(".checkbox").on("touchstart",function(){var e=p(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"))}),w.on("touchend",".checkbox",function(){var e=p(this);e.hasClass("icon-cb-radio")&&w.addClass("focus"),e.hasClass("icon-radio")&&w.removeClass("focus")}),T("addressId")||T("addressId",b.data("id")),p(".delivery-id").on("touchend","li",function(){T("deliveryId",p(this).data("id")),s()}),p(".payment-type").on("touchend","li",function(){T("paymentType",p(".icon-cb-radio",this).data("id"))}),p(".dispatch-time").on("touchend","li",function(){T("deliveryTimeId",p(this).data("id"))}),p(".coin").on("touchend",function(){var e=p(this);e.find(".checkbox").hasClass("icon-cb-radio")?(T("yohoCoin",e.data("yoho-coin")),e.find(".can-use").hide()):(T("yohoCoin",0),e.find(".coin-check em").hide(),e.find(".can-use").show(),e.find(".used").hide()),s()}),w.on("touchend",".checkbox",function(e){var t=p(this);T("invoice",t.hasClass("icon-cb-radio")),e.preventDefault(),e.stopPropagation()}),w.find('[name="invoice-title"]').on("blur",function(){T("invoiceText",p(this).val())}).end().find(".invoice-type").on("change",function(){T("invoiceType",p(this).val())}),p("#msg").find("textarea").on("blur",function(){T("msg",p(this).val())}),p(".pay-mode").on("click","li",function(){var e=p(this);T("paymentTypeId",e.data("pay-id")),T("paymentType",e.data("pay-type")),d=e.data("pay-type")}),p("form").on("submit",function(){return!1}),p(".dispatch").on("touchend","h3",function(){p(this).siblings("ul").is(":hidden")?(p(".dispatch h3").removeClass("border-none"),p(this).addClass("border-none"),p(".down").removeClass("hide"),p(".up").addClass("hide"),p(".up",this).removeClass("hide"),p(".down",this).addClass("hide"),p(".dispatch ul").hide(),p(this).siblings("ul").show()):(p(this).removeClass("border-none"),p(".down",this).removeClass("hide"),p(".up",this).addClass("hide"),p(this).siblings("ul").hide())}),x.on("touchstart","li",function(){p.each(p(this).parents("ul").find("i"),function(){p(this).parents("ul").find("i").removeClass("icon-cb-radio").addClass("icon-radio")}),p(this).parents("ul").hide(),p(".down").removeClass("hide"),p(".up").addClass("hide"),p(".dispatch h3").removeClass("border-none"),u=p(this).find("span").html(),p(this).parents(".sub-block").find("h3 span").html(u),p(this).find("i").hasClass("icon-cb-radio")?p(this).find("i").addClass("icon-radio"):p(this).find("i").hasClass("icon-radio")&&p(this).find("i").addClass("icon-cb-radio")}),p(".bill a").on("touchstart",function(){T("paymentTypeId",p(".delivery-id .icon-cb-radio").data("id")),T("paymentType",p(".payment-type .icon-cb-radio").data("id")),d=p(".payment-type .icon-cb-radio").data("id"),r()}),p(".info-phone").html(l(p(".info-phone").html())),T("address")&&"N"===T("address").is_support&&(T("deliveryId",p(".delivery-id .icon-cb-radio").data("id")),s())}),define("js/cart/order-info",["jquery","hammer"],function(e,t,n){function o(){i={uid:window.getUid(),deliveryId:a(".dispatch-mode .chosed").data("id")||1,deliveryTimeId:1,paymentTypeId:1,yohoCoin:0,addressId:null,couponCode:null,couponName:null,invoice:null,invoiceText:null,invoiceType:null,invoiceTitle:null,receiverMobile:null,invoicesType:null,msg:null,cartType:"ordinary"},window.setCookie("order-info",JSON.stringify(i))}var a=e("jquery"),i=window.cookie("order-info");e("js/common");try{i=JSON.parse(i)}catch(s){o()}t.init=o,t.orderInfo=function(e,t){return void 0===t?i[e]:(i[e]=t,void window.setCookie("order-info",JSON.stringify(i)))}}),define("js/cart/invoice-info",["jquery","handlebars","source-map","hammer"],function(e,t,n){function o(e,t){t.hasClass("icon-cb-radio")||(e.find(".choose").removeClass("icon-cb-radio icon-radio").addClass("icon-radio"),t.removeClass("icon-radio").addClass("icon-cb-radio"),t.parent().addClass("on"),t.parent().siblings().removeClass("on"),u.val("true"))}function a(){var e=p.find(".on").data("id"),t=i(".invoice-top").find(".on").text(),n=f.attr("data-tel"),o=m.val(),a=h.data("id");if("true"===u.val()){if(!w.test(f.attr("data-tel")))return s.show("请输入正确手机号"),f.focus(),!1;if("单位"===t&&0===o.length)return s.show("请填写发票抬头"),m.focus(),!1;if("单位"===t&&o.length>30)return s.show("发票抬头不得超过30个汉字"),m.focus(),!1;r.showDialog({dialogText:"确认保存修改内容?",hasFooter:{leftBtnText:"取消",rightBtnText:"确定"}},function(){g("invoiceText","单位"===t?o:""),g("invoiceType",a),g("receiverMobile",n),g("invoicesType",e),g("invoiceTitle",t),r.showDialog({dialogText:"保存成功",autoHide:!0,fast:!0}),window.location.href=y},function(){window.location.href=y})}else window.location.href=y}var i=e("jquery"),s=e("js/plugin/tip"),r=e("js/me/dialog"),l=e("js/cart/order-info"),d=i(".invoice-notice"),c=i(".company-area"),u=i(".edit-flag"),h=i(".choose-cont"),p=i(".invoice-type"),f=i(".tel"),m=i(".company"),g=l.orderInfo,v=i(".invoice-cont").find(".icon-cb-radio").parent(),w=/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/,y="/cart/index/orderEnsure?cartType=ordinary";e("js/common"),window.getUid()!==g("uid")&&(l.init(),window.location.reload()),h.html(v.text()).attr("data-id",v.find("span").data("id")),i(".invoice-top span, .invoice-cont li").not(".invoice-cont .cont-title").on("touchstart",function(e){o(i(this).parent(),i(this).find(".choose")),i(this).parent().hasClass("invoice-cont")&&h.html(i(this).text()).attr("data-id",i(this).find("span").data("id")),"单位"===i(this).text()&&c.slideDown(),"个人"===i(this).text()&&c.slideUp()}),i(".invoice-type span").on("touchstart",function(){i(this).hasClass("on")||(i(this).addClass("on").siblings().removeClass("on"),u.val("true"))}),i(".invoice-btn").on("touchstart",function(){return d.fadeIn(),!1}),i(".think-ok, .mask-bg").on("touchstart",function(){d.fadeOut()}),i(".istel").one("input",function(){i(this).val("").removeClass("istel")}),f.on("input",function(){i(this).attr("data-tel",i(this).val()),u.val("true")}),m.on("input",function(){u.val("true")}),i(".confirm-btn, .nav-back").on("touchstart",function(e){e.preventDefault(),a()})}),define("js/cart/select-coupon",["jquery","handlebars","source-map","hammer","mlellipsis"],function(e,t,n){function o(){var e=r(".null"),t=r(".nav-title").height(),n=e.height();return 0===e.length?!1:void e.css({top:w/2-n/2+t})}function a(e){var t,n;return r.isArray(e)?(r(".coupon-wrap").html(r("#tmpl-no-coupon").html()),void o()):(t=e.notAvailableCoupons,n=e.coupons,r.each(n,function(e,t){t.couponValue=Math.floor(t.couponValue)}),r.each(t,function(e,t){t.couponValue=Math.floor(t.couponValue)}),v.append(f({coupons:n})).find(".employ-main").each(function(e,t){var n=new d(t);n.on("tap",function(e){var t=r(e.srcEvent.currentTarget),n=t.data("coupon-code");r.ajax({method:"POST",url:"/cart/index/couponSearch",data:{couponCode:n}}).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(m({notAvailableCoupons:t})),void window.rePosFooter())}function i(){s||(u.showLoadingMask(),s=!0,r.ajax({type:"GET",url:"/cart/index/couponList",dataType:"json"}).then(a).fail(function(){}).always(function(){s=!1,u.hideLoadingMask()}))}var s,r=e("jquery"),l=e("handlebars"),d=e("hammer"),c=e("mlellipsis"),u=e("js/plugin/loading"),h=e("js/plugin/tip"),p=e("js/cart/order-info").orderInfo,f=l.compile(r("#tmpl-coupon").html()),m=l.compile(r("#tmpl-coupon-not-avaliable").html()),g=r("#new-coupon"),v=r("#coupon-list"),w=r(window).height();e("js/common"),c.init(),g.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)}),v.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),location.href="/cart/index/orderEnsure"}),g.find("input").on("input",function(){""!==r(this).val()?g.find(".submit").css("background","#444"):g.find(".submit").css("background","#b0b0b0")}),i()}),define("js/cart/select-address",["jquery","hammer"],function(e,t,n){var o,a=e("jquery"),i=e("js/cart/order-info").orderInfo,s=a(".confim-mask");e("js/common"),a(".address-item").on("touchend",function(){var e=a(this),t=e.data("address-id"),n={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")};i("addressId",t),i("address",n),console.log(e.data("href")+(i("limitUrlSufix")||"")),window.location.href=e.data("href")+(i("limitUrlSufix")||"")}).on("touchend",".edit",function(){return window.location.href=a(this).data("href"),!1}).on("touchstart",".del",function(){o=a(this).data("id")}),s.on("touchend",".confim",function(){i("addressId")===o&&(i("addressId",null),i("address",null))})}),define("js/life/entry",["jquery","hammer"],function(e,t,n){e("js/life/login"),e("js/life/coupon")}),define("js/life/login",["jquery","hammer"],function(e,t,n){function o(){a.ajax({type:"get",url:"/index/life/sendCoupon",dataType:"json",success:function(e){a(".statu").html(e.message),a(".statu-mark").show(),a(".statu-box").show(),200===e.code?(window.setCookie("lifeCoupon",e.data),location.href="/life/coupon"):401===e.code?(a(".successed").css("display","block"),a(".sure").click(function(){location.href="/life/coupon"})):403===e.code?a(".late").css("display","block"):a(".faill").css("display","block")}})}var a=e("jquery");e("js/common"),e("js/plugin/wx-share")(),a(".notice").click(function(){a(".code").show(),a(".mark").show()}),a(".close").click(function(){a(".code").hide(),a(".mark").hide()}),a(".coupon-btn").click(function(){o(),a(".mark").show()})}),define("js/life/coupon",["jquery","hammer"],function(e,t,n){var o=e("jquery");e("js/common"),o(".coupon-input").val(window.cookie("lifeCoupon")||""),e("js/plugin/wx-share")()});