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