product.outlet-detail.js
13.8 KB
webpackJsonp([3],[function(e,t,n){var i=n(1),o=n(13),a=n(12),s=i(".cd-lite");a.start(),new o.Countdown({el:s}),i(".back-ground-white").css("padding","0")},,function(e,t,n){function i(e,t){var n,i;"undefined"!=typeof e&&(n=e.toString(),i=t&&t>0?t:2e3,o.text(n).show(),a=setTimeout(function(){"block"===o.css("display")&&o.hide()},i))}var o,a,s=n(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),o=s("#yoho-tip"),o.on("touchend",function(){o.hide(),clearTimeout(a)})}(),t.show=i},function(e,t,n){function i(e){var t,n,i=document.cookie;return document.cookie&&""!==document.cookie&&(n=i.indexOf(e+"="),n>-1&&(n+=e.length+1,t=decodeURIComponent(f.trim(i.substring(n,i.indexOf(";",n)))))),t}function o(e,t,n){var i,o,a,s,r="";"undefined"!=typeof t&&(n=n||{},null===t&&(t="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(s=new Date,s.setTime(s.getTime()+24*n.expires*60*60*1e3)):s=n.expires,r="; expires="+s.toUTCString()),i=n.path?"; path="+n.path:"",o=n.domain?"; domain="+n.domain:"",a=n.secure?"; secure":"",document.cookie=[e,"=",encodeURIComponent(t),r,i,o,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,t=i("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function r(){var e=s();return 0===e?0:e[1]}function l(){var e=i("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function c(){var e;0!==p.length&&(e=Math.min(f(window).height(),window.screen.availHeight),f("body").height()<=e-parseInt(p.css("height"),0)?p.addClass("bottom"):p.removeClass("bottom"))}function d(e){var t=f(e).outerHeight();e&&p.css("margin-bottom",t+"px")}function h(){var e,t,n=[],i=window.location.search.slice(1).split("&");for(t=0;t<i.length;t++)e=i[t].split("="),n.push(e[0]),n[e[0]]=e[1];return n}function u(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var f=n(1),g=n(4),p=f("#yoho-footer"),m=f(".yoho-page"),v=f(".yoho-header");!function(){var e,t=p.children(".op-row"),n=f(".back-to-top"),i=s();c(),0===i?t.prepend('<a href="http://m.yohobuy.com/signin.html?refer='+location.href+'">登录</a><span class="sep-line">|</span><a href="http://m.yohobuy.com/reg.html">注册</a>'):t.prepend('<span>Hi,</span><a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+i[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index">退出</a>'),n.length>0&&(e=new g(n[0]),e.on("tap",function(e){return f(window).scrollTop(0),e.srcEvent.preventDefault(),!1})),p.removeClass("hide")}(),function(e,t,n,i,o){var a=t.createElement(n),s=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=o,e[o]=function(){e[o].p=arguments},a.async=1,a.src=i,s.parentNode.insertBefore(a,s)}(window,document,"script",("https:"===document.location.protocol?"https":"http")+"://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js","_yas"),function(){var e=r();e=0===e?"":e,window._ozuid=e,window._yas&&window._yas(1*new Date,"1.0.17","yohobuy_m",e,"","")}(),v.on("touchstart","a",function(){v.find("a").removeClass("highlight"),f(this).addClass("highlight")}).on("touchend touchcancel","a",function(){f(this).removeClass("highlight")}),m.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,t,n=0,i="webkit moz ms o".split(" "),o=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(t=0;t<i.length&&(!o||!a);t++)e=i[t],o=o||window[e+"RequestAnimationFrame"],a=a||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];o&&a||(o=function(e){var t=(new Date).getTime(),i=Math.max(0,16-(t-n)),o=window.setTimeout(function(){e(t+i)},i);return n=t+i,o},a=function(e){window.clearTimeout(e)}),window.requestAnimationFrame=o,window.cancelAnimationFrame=a}(),f.extend({queryString:h}),11===p.find(".user-name").text().length&&p.find(".user-name").html(u(p.find(".user-name").text())),window.cookie=i,window.setCookie=o,window.isCookiesEnabled=a,window.getUser=s,window.getUid=r,window.getShoppingKey=l,window.rePosFooter=c,window.reMarginFooter=d,window.queryString=h()},,function(e,t,n){function i(e){var t='<div class="loading-mask hide"><div class="loading"><div></div><div></div><div></div></div></div>';c=!0,e||(e=l),e.append(t),s=e.children(".loading-mask"),r("body").on("touchstart touchmove touchend",".loading-mask",function(){return!1})}function o(){c||(i(),c=!0),s.removeClass("hide")}function a(){s.addClass("hide")}var s,r=n(1),l=r(".yoho-page"),c=!1;t.init=i,t.showLoadingMask=o,t.hideLoadingMask=a,t.show=o,t.hide=a},,,,function(e,t,n){var i=n(1),o={};i(".query-param").each(function(){var e=i(this);o[e.data("attr")]=e.val()}),e.exports=o},function(e,t,n){function i(){u.addClass("hide")}function o(){u.removeClass("hide")}function a(){var e=p(".filter-body .classify");e.on("touchstart",".shower",function(){e.removeClass("highlight"),p(this).addClass("highlight")}).on("touchend touchcancel",".shower",function(){p(this).removeClass("highlight")})}function s(){var e=p(".filter-body .sub-item");e.on("touchstart",function(){e.removeClass("highlight"),p(this).addClass("highlight")}).on("touchend touchcancel",function(){p(this).removeClass("highlight")})}function r(e){e.hasClass("active")||(e.siblings(".active").removeClass("active"),e.addClass("active"))}function l(e){var t,n,i=e.closest(".sub-classify"),o=i.siblings(".shower");return e.hasClass("chosed")?i:(i.children(".chosed").removeClass("chosed"),e.addClass("chosed"),t=p.trim(e.html()),n=p.trim(o.html()),o.html(n.substring(0,n.indexOf("</span>")+7)+t.substring(0,t.indexOf("<i"))),0===e.index()?o.addClass("default"):o.removeClass("default"),i)}function c(e){var t,n=e.data("id");t=l(e),f&&f({type:t.data("type"),id:n}),g&&g(),i()}function d(e){var t;f=e.fCbFn,g=e.hCbFn,window.missStatus=e.missStatus,a(),s(),u=p(".filter-mask"),u[0]&&(t=new m(u[0]),t.on("tap",function(e){var t,n=p(e.target);e.preventDefault(),n.closest(".filter-body").length>0?(t=n.closest(".sub-item"),t.length>0?(t=n.closest("li"),c(t)):(t=n.closest(".classify-item"),e.srcEvent.stopPropagation(),r(t))):(i(),g&&g())}))}function h(){"undefined"!=typeof u&&(p(".sub-classify").each(function(){l(p(this).children(":first-child"))}),r(p(".classify > :first-child")))}var u,f,g,p=n(1),m=n(4);t.initFilter=d,t.showFilter=o,t.hideFilter=i,t.resetFilter=h},,function(e,t,n){function i(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);return null!==n?n[2]:null}function o(e){var t="category";return e.hasClass("new")?t="newest":e.hasClass("price")?t="price":e.hasClass("discount")?t="discount":e.hasClass("sale")?t="sale":e.hasClass("all")?t="all":e.hasClass("category")&&(t="category"),t}function a(e,t,n){var i,a,s,r,h,g={};if(!c){if(e&&!n){for(a in M)M.hasOwnProperty(a)&&(M[a].reload=!0);switch(q.children(".active").removeClass("active"),D.addClass("active"),e.type){case"gender":i={gender:e.id};break;case"ageLevel":i={age_level:e.id};break;case"brand":i={brand:e.id};break;case"sort":i={sort:e.id};break;case"color":i={color:e.id};break;case"size":i={size:e.id};break;case"price":i={price:e.id};break;case"discount":i={discount:e.id};break;case"p_d":i={p_d:e.id}}d.extend(T,i)}if(d.extend(t||{},T),r=o(D),s=M[r||"all"],h=s.page+1,s.reload)h=1;else if(s.end)return;t?(l=t,d.extend(g,t,{type:r,order:s.order,page:h})):(l=null,d.extend(g,T,{type:r,order:s.order,page:h})),c=!0,p.showLoadingMask(),d.ajax({type:"GET",url:"/product/sale/search",data:g,success:function(e){var t,n;switch(r){case"newest":t=v;break;case"price":t=y;break;case"discount":t=w;break;case"sale":t=k;break;case"all":t=C;break;case"categroy":t=b;break;default:t=C}t.hasClass("hide")&&(t.siblings().addClass("hide"),t.removeClass("hide")),""===e?(s.end=!0,s.reload&&t.html(_)):("category"===r&&(s.page=1),s.reload?(t.html(e),u(t.find(".lazy"))):(n=t.find(".good-info").length,t.append(e),u(t.find(".good-info:gt("+(n-1)+") .lazy")))),s.reload=!1,s.page=h,c=!1,p.hideLoadingMask(),window.rePosFooter(),d(".good-detail-text .name").each(function(){var e=d(this),t=e.find("a");t[0].mlellipsis(2)})},error:function(){f.show("网络断开连接了~"),c=!1,p.hideLoadingMask()}})}}function s(){d.ajax({type:"GET",url:"/product/sale/filter",data:T,success:function(e){m.append(e),g.initFilter({fCbFn:a,hCbFn:function(){D.addClass("active"),D.siblings(".filter").removeClass("active")},missStatus:!0})}})}function r(){var e=d(window).scrollTop();e>F&&e+x>d(document).height()-.25*m.height()-50&&"undefined"!=typeof D&&(l?a({type:"category"},l,!0):a()),F=e}var l,c,d=n(1),h=n(8),u=n(6),f=n(2),g=n(10),p=n(5),m=d("#goods-container"),v=m.find(".new-goods"),w=m.find(".discount-goods"),y=m.find(".price-goods"),C=m.find(".all-goods"),b=m.find(".category-goods"),k=m.find(".sale-goods"),x=d(window).height(),_='<p class="no-result">未找到相关搜索结果</p>',F=0,T=n(9),q=d("#list-nav"),M={all:{order:0,reload:!0,page:0,end:!1},newest:{order:0,reload:!0,page:0,end:!1},price:{order:1,reload:!0,page:0,end:!1},discount:{order:1,reload:!0,page:0,end:!1},sale:{order:0,reload:!0,page:0,end:!1},category:{order:0,reload:!0,page:0,end:!1}},D=q.find(".active");n(3),h.init(),u(d("img.lazy")),d(".sale-vip-page").length>0?T.saleType=2:d(".discount-detail-page").length>0&&(T.saleType=3,T.productPool=d(".discount-detail-page").data("product-pool")||""),d.extend(T,{yh_channel:i("channel")||"all"}),0===d(".outlet-index-page").length&&s(),u(d(".lazy")),q.bind("contextmenu",function(){return!1}),q.on("touchend touchcancel",function(e){var t,n,i,s=d(e.target).closest("li");if(e.preventDefault(),"undefined"!=typeof s&&0!==s.length){if(s.hasClass("filter"))s.hasClass("active")?(g.hideFilter(),D.addClass("active"),s.removeClass("active")):(D=s.siblings(".active"),D.removeClass("active"),s.addClass("active"),g.showFilter());else{if(n=o(s),t=M[n],s.hasClass("active")){if(s.hasClass("new")||s.hasClass("sale")||s.hasClass("all"))return;(s.hasClass("price")||s.hasClass("discount"))&&(s.find(".icon > .iconfont").toggleClass("cur"),D=s,t.reload=!0,t.order=0===t.order?1:0)}else{if(i=s.siblings(".active"),D=s,i.hasClass("filter"))g.hideFilter();else switch(m.children(".container:not(.hide)").addClass("hide"),n){case"newest":v.removeClass("hide");break;case"price":y.removeClass("hide");break;case"discount":w.removeClass("hide");break;case"sale":k.removeClass("hide");break;case"all":C.removeClass("hide")}i.removeClass("active"),s.addClass("active")}t.reload&&a()}e.stopPropagation()}}),d(window).scroll(function(){0===d(".outlet-index-page").length&&window.requestAnimationFrame(r)}),q.on("touchstart","li",function(){d(this).addClass("bytouch")}).on("touchend touchcancel",function(){q.find("li").removeClass("bytouch")}),e.exports={start:a}},function(e,t,n){"use strict";function i(e){var t;return this instanceof i?(e.el=o(e.el),void(e.el&&(t=e.el.attr("data-config"),t&&(t=JSON.parse(t.replace(/'/g,'"')),e=o.extend(!0,{},r,t,e)),this.config=e,this._init()))):new i(e)}var o=n(1),a=n(2),s="afterPaint",r={el:{},stopPoint:0,leftTime:0,template:"",varRegular:/\$\{([\-\w]+)\}/g,clock:["d",100,2,"h",24,2,"m",60,2,"s",60,2,"u",10,1],effect:"normal"},l={normal:{paint:function(){var e,t=this;o.each(t.hands,function(n,i){i.lastValue!==i.value&&(e="",o.each(t._toDigitals(i.value,i.bits),function(n,i){e+=t._html(i,"","digital")}),i.node.html(e))})}}},c=function(){function e(){for(var t,o,a,s,r=+new Date-e.nextTime,l=1+Math.floor(r/100);i.length;)i.shift()();for(r=100-r%100,e.nextTime+=100*l,a=0,s=n.length;a<s;a+=2)t=n[a+1],0===t?n[a](l):(t+=2*l-1,o=Math.floor(t/20),o>0&&n[a](o),n[a+1]=t%20+1);setTimeout(e,r)}function t(e,t){var n,i;for(n=0,i=t.length;n<i;++n)if(t[n]===e)return n;return-1}var n=[],i=[];return e.nextTime=+new Date,e(),{add:function(e,t){i.push(function(){n.push(e),n.push(1e3===t?1:0)})},remove:function(e){var o;i.push(function(){o=t(e,n),o!==-1&&n.splice(t(e,n),2)})}}}();o.extend(i.prototype,{_init:function(){var e,t,n=this,i=n.config.el,a=[],s=i.html(),r=n.config.varRegular;n.hands=a,n.frequency=1e3,n._notify=[],r.lastIndex=0,i.html(s.replace(r,function(e,t){var i="";return"u"!==t&&"s-ext"!==t||(n.frequency=100),"s-ext"===t?(a.push({type:"s"}),a.push({type:"u"}),i=n._html("","s","handlet")+n._html(".","","digital")+n._html("","u","handlet")):a.push({type:t}),n._html(i,t,"hand")})),e=n.config.clock,o.each(a,function(t,n){var o,a=n.type,s=100;for(n.node=i.find(".hand-"+a),o=e.length-3;o>-1&&a!==e[o];o-=3)s*=e[o+1];n.base=s,n.radix=e[o+1],n.bits=e[o+2]}),n._getLeft(),n._reflow(),t=n._reflow,n._reflow=function(){return t.apply(n,arguments)},c.add(n._reflow,n.frequency),i.show()},_getLeft:function(){var e=1e3*this.config.leftTime,t=this.config.stopPoint;!e&&t&&(e=t-+new Date),this.left=e-e%this.frequency},_reflow:function(e){var t=this,n=t.config.el;return e=e||0,t.left=t.left-t.frequency*e,o.each(t.hands,function(e,n){n.lastValue=n.value,n.value=Math.floor(t.left/n.base)%n.radix}),t._repaint(),t._notify[t.left]&&o.each(t._notify[t.left],function(e,n){n.call(t)}),t.left<1&&(n.text("— 活动已结束 —"),n.parents(".back-ground-white").on("click",function(){return a.show("活动即将开始,敬请期待!"),!1}),c.remove(t._reflow)),t.left<864e5&&n.find(".left-day").hide(),t},_repaint:function(){l[this.config.effect].paint.apply(this),this.config.el.trigger(s)},_toDigitals:function(e,t){var n=[];for(e=e<0?0:e,t=e.toString().length>1?2:1;t--;)n[t]=e%10,e=Math.floor(e/10);return n},_html:function(e,t,n){switch(o.isArray(e)&&(e=e.join("")),n){case"hand":t=n+" hand-"+t;break;case"handlet":t=n+" hand-"+t;break;case"digital":t="."===e?n+" "+n+"-point "+t:n+" "+n+"-"+e+" "+t}return'<i class="'+t+'">'+e+"</i>"},notify:function(e,t){var n;return e=1e3*e,e-=e%this.frequency,n=this._notify[e]||[],n.push(t),this._notify[e]=n,this}}),t.Countdown=i}]);