product.outlet-will-end.js 8.54 KB
webpackJsonp([10],[function(t,e,n){var o=n(1),i=n(13),a=n(14),r=o(".cd-lite");n(3),r.length>0&&r.each(function(){new i.Countdown({el:o(this)})}),o("#index_nav").length>0&&a({el:"#index_nav"})["goto"](o("#index_nav").find(".active").index()),o(".back-ground-white").length<1&&o(".empty").show()},,function(t,e,n){function o(t,e){var n,o;"undefined"!=typeof t&&(n=t.toString(),o=e&&e>0?e:2e3,i.text(n).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},o))}var i,a,r=n(1);!function(){var t='<div id="yoho-tip" class="yoho-tip"></div>';r(".yoho-page").append(t),i=r("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(a)})}(),e.show=o},function(t,e,n){function o(t){var e,n,o=document.cookie;return document.cookie&&""!==document.cookie&&(n=o.indexOf(t+"="),n>-1&&(n+=t.length+1,e=decodeURIComponent(d.trim(o.substring(n,o.indexOf(";",n)))))),e}function i(t,e,n){var o,i,a,r,s="";"undefined"!=typeof e&&(n=n||{},null===e&&(e="",n.expires=-1),n.expires&&("number"==typeof n.expires||n.expires.toUTCString)&&("number"==typeof n.expires?(r=new Date,r.setTime(r.getTime()+24*n.expires*60*60*1e3)):r=n.expires,s="; expires="+r.toUTCString()),o=n.path?"; path="+n.path:"",i=n.domain?"; domain="+n.domain:"",a=n.secure?"; secure":"",document.cookie=[t,"=",encodeURIComponent(e),s,o,i,a].join(""))}function a(){var t=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||t||(document.cookie="testcookie",t=-1!==document.cookie.indexOf("testcookie")),t}function r(){var t,e=o("_UID");return"undefined"==typeof e?0:(t=e.split("::"),"undefined"==typeof t||t.length<4?0:t)}function s(){var t=r();return 0===t?0:t[1]}function c(){var t=o("_g");return"undefined"==typeof t?"":JSON.parse(t).k}function h(){var t;0!==m.length&&(t=Math.min(d(window).height(),window.screen.availHeight),d("body").height()<=t-parseInt(m.css("height"),0)?m.addClass("bottom"):m.removeClass("bottom"))}function l(t){var e=d(t).outerHeight();t&&m.css("margin-bottom",e+"px")}function u(){var t,e,n=[],o=window.location.search.slice(1).split("&");for(e=0;e<o.length;e++)t=o[e].split("="),n.push(t[0]),n[t[0]]=t[1];return n}function f(t){return t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var d=n(1),p=n(4),m=d("#yoho-footer"),g=d(".yoho-page"),w=d(".yoho-header");!function(){var t,e=m.children(".op-row"),n=d(".back-to-top"),o=r();h(),0===o?e.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>'):e.prepend('<span>Hi,</span><a class="user-name" href="http://m.yohobuy.com/home?tmp='+Math.random()+'">'+o[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index">退出</a>'),n.length>0&&(t=new p(n[0]),t.on("tap",function(t){return d(window).scrollTop(0),t.srcEvent.preventDefault(),!1})),m.removeClass("hide")}(),function(t,e,n,o,i){var a=e.createElement(n),r=e.getElementsByTagName(n)[0];t.YohoAcquisitionObject=i,t[i]=function(){t[i].p=arguments},a.async=1,a.src=o,r.parentNode.insertBefore(a,r)}(window,document,"script",("https:"===document.location.protocol?"https":"http")+"://cdn.yoho.cn/yas-jssdk/1.0.17/yas.js","_yas"),function(){var t=s();t=0===t?"":t,window._ozuid=t,window._yas&&window._yas(1*new Date,"1.0.17","yohobuy_m",t,"","")}(),w.on("touchstart","a",function(){w.find("a").removeClass("highlight"),d(this).addClass("highlight")}).on("touchend touchcancel","a",function(){d(this).removeClass("highlight")}),g.on("touchstart",".tap-hightlight",function(){d(this).siblings(".tap-hightlight").removeClass("highlight"),d(this).addClass("highlight")}).on("touchend touchcancel",".tap-hightlight",function(){d(this).removeClass("highlight")}),d(".nav-home").on("touchstart",function(){d(".homebuttom").toggleClass("hide")}),function(){var t,e,n=0,o="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(e=0;e<o.length&&(!i||!a);e++)t=o[e],i=i||window[t+"RequestAnimationFrame"],a=a||window[t+"CancelAnimationFrame"]||window[t+"CancelRequestAnimationFrame"];i&&a||(i=function(t){var e=(new Date).getTime(),o=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+o)},o);return n=e+o,i},a=function(t){window.clearTimeout(t)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=a}(),d.extend({queryString:u}),11===m.find(".user-name").text().length&&m.find(".user-name").html(f(m.find(".user-name").text())),window.cookie=o,window.setCookie=i,window.isCookiesEnabled=a,window.getUser=r,window.getUid=s,window.getShoppingKey=c,window.rePosFooter=h,window.reMarginFooter=l,window.queryString=u()},,,,,,,,,,function(t,e,n){"use strict";function o(t){var e;return this instanceof o?(t.el=i(t.el),void(t.el&&(e=t.el.attr("data-config"),e&&(e=JSON.parse(e.replace(/'/g,'"')),t=i.extend(!0,{},s,e,t)),this.config=t,this._init()))):new o(t)}var i=n(1),a=n(2),r="afterPaint",s={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"},c={normal:{paint:function(){var t,e=this;i.each(e.hands,function(n,o){o.lastValue!==o.value&&(t="",i.each(e._toDigitals(o.value,o.bits),function(n,o){t+=e._html(o,"","digital")}),o.node.html(t))})}}},h=function(){function t(){for(var e,i,a,r,s=+new Date-t.nextTime,c=1+Math.floor(s/100);o.length;)o.shift()();for(s=100-s%100,t.nextTime+=100*c,a=0,r=n.length;r>a;a+=2)e=n[a+1],0===e?n[a](c):(e+=2*c-1,i=Math.floor(e/20),i>0&&n[a](i),n[a+1]=e%20+1);setTimeout(t,s)}function e(t,e){var n,o;for(n=0,o=e.length;o>n;++n)if(e[n]===t)return n;return-1}var n=[],o=[];return t.nextTime=+new Date,t(),{add:function(t,e){o.push(function(){n.push(t),n.push(1e3===e?1:0)})},remove:function(t){var i;o.push(function(){i=e(t,n),-1!==i&&n.splice(e(t,n),2)})}}}();i.extend(o.prototype,{_init:function(){var t,e,n=this,o=n.config.el,a=[],r=o.html(),s=n.config.varRegular;n.hands=a,n.frequency=1e3,n._notify=[],s.lastIndex=0,o.html(r.replace(s,function(t,e){var o="";return"u"!==e&&"s-ext"!==e||(n.frequency=100),"s-ext"===e?(a.push({type:"s"}),a.push({type:"u"}),o=n._html("","s","handlet")+n._html(".","","digital")+n._html("","u","handlet")):a.push({type:e}),n._html(o,e,"hand")})),t=n.config.clock,i.each(a,function(e,n){var i,a=n.type,r=100;for(n.node=o.find(".hand-"+a),i=t.length-3;i>-1&&a!==t[i];i-=3)r*=t[i+1];n.base=r,n.radix=t[i+1],n.bits=t[i+2]}),n._getLeft(),n._reflow(),e=n._reflow,n._reflow=function(){return e.apply(n,arguments)},h.add(n._reflow,n.frequency),o.show()},_getLeft:function(){var t=1e3*this.config.leftTime,e=this.config.stopPoint;!t&&e&&(t=e-+new Date),this.left=t-t%this.frequency},_reflow:function(t){var e=this,n=e.config.el;return t=t||0,e.left=e.left-e.frequency*t,i.each(e.hands,function(t,n){n.lastValue=n.value,n.value=Math.floor(e.left/n.base)%n.radix}),e._repaint(),e._notify[e.left]&&i.each(e._notify[e.left],function(t,n){n.call(e)}),e.left<1&&(n.text("— 活动已结束 —"),n.parents(".back-ground-white").on("click",function(){return a.show("活动即将开始,敬请期待!"),!1}),h.remove(e._reflow)),e.left<864e5&&n.find(".left-day").hide(),e},_repaint:function(){c[this.config.effect].paint.apply(this),this.config.el.trigger(r)},_toDigitals:function(t,e){var n=[];for(t=0>t?0:t,e=t.toString().length>1?2:1;e--;)n[e]=t%10,t=Math.floor(t/10);return n},_html:function(t,e,n){switch(i.isArray(t)&&(t=t.join("")),n){case"hand":e=n+" hand-"+e;break;case"handlet":e=n+" hand-"+e;break;case"digital":e="."===t?n+" "+n+"-point "+e:n+" "+n+"-"+t+" "+e}return'<i class="'+e+'">'+t+"</i>"},notify:function(t,e){var n;return t=1e3*t,t-=t%this.frequency,n=this._notify[t]||[],n.push(e),this._notify[t]=n,this}}),e.Countdown=o},function(t,e,n){function o(t){function e(t){var e;e=n.find("li").eq(t),e.length>0&&setTimeout(function(){o.scrollToElement(e[0],400)},1)}var n,o,i,a={el:".outlet-nav"};return i=s.extend({},a,t),n=s(i.el),o=new c(n[0],{scrollX:!0,scrollY:!1,tap:!0,eventPassthrough:!0,preventDefault:!0}),{"goto":e}}function i(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(e);return null!==n?decodeURIComponent(n[2]):null}function a(){s("#index_nav").find("li").each(function(){s(this).find("a").text()===l?s(this).attr({"data-nav":"other","data-type":3}):s(this).find("a").text()===h&&s(this).attr({"data-nav":"other","data-type":2})})}function r(){var t=s("#index_nav"),e=i("yh_channel");a(),null===e?(e=i("type"),null===e?t.find('li:not([data-nav="other"])').eq(0).addClass("active").siblings().removeClass("active"):t.find("li[data-type="+e+"]").addClass("active").siblings().removeClass("active")):t.find('li:not([data-nav="other"])').eq(e).addClass("active").siblings().removeClass("active")}var s=n(1),c=n(15),h="即将结束",l="上线预告";r(),t.exports=o}]);