product.outlet-will-end.js 8.7 KB
webpackJsonp([8],[function(e,t,n){var o=n(1),i=n(14),a=n(15),r=o(".cd-lite");n(3),n(17),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(e,t,n){function o(e,t){var n,o;"undefined"!=typeof e&&(n=e.toString(),o=t&&t>0?t:2e3,i.text(n).show(),a=setTimeout(function(){"block"===i.css("display")&&i.hide()},o))}var i,a,r=n(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';r(".yoho-page").append(e),i=r("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(a)})}(),t.show=o},function(e,t,n){function o(e){var t,n,o=document.cookie;return document.cookie&&""!==document.cookie&&(n=o.indexOf(e+"="),n>-1&&(n+=e.length+1,t=decodeURIComponent(d.trim(o.substring(n,o.indexOf(";",n)))))),t}function i(e,t,n){var o,i,a,r,s="";"undefined"!=typeof t&&(n=n||{},null===t&&(t="",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=[e,"=",encodeURIComponent(t),s,o,i,a].join(""))}function a(){var e=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!==document.cookie.indexOf("testcookie")),e}function r(){var e,t=o("_UID");return"undefined"==typeof t?0:(e=t.split("::"),"undefined"==typeof e||e.length<4?0:e)}function s(){var e=r();return 0===e?0:e[1]}function c(){var e=o("_g");return"undefined"==typeof e?"":JSON.parse(e).k}function h(){var e;0!==m.length&&(e=Math.min(d(window).height(),window.screen.availHeight),d("body").height()<=e-parseInt(m.css("height"),0)?m.addClass("bottom"):m.removeClass("bottom"))}function l(e){var t=d(e).outerHeight();e&&m.css("margin-bottom",t+"px")}function u(){var e,t,n=[],o=window.location.search.slice(1).split("&");for(t=0;t<o.length;t++)e=o[t].split("="),n.push(e[0]),n[e[0]]=e[1];return n}function f(e){return e.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var d=n(1),p=n(4),m=d("#yoho-footer"),g=d(".yoho-page"),v=d(".yoho-header");!function(){var e,t=m.children(".op-row"),n=d(".back-to-top"),o=r();h(),0===o?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()+'">'+o[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index">退出</a>'),n.length>0&&(e=new p(n[0]),e.on("tap",function(e){return d(window).scrollTop(0),e.srcEvent.preventDefault(),!1})),m.removeClass("hide")}(),function(e,t,n,o,i){var a=t.createElement(n),r=t.getElementsByTagName(n)[0];e.YohoAcquisitionObject=i,e[i]=function(){e[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 e=s();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"),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 e,t,n=0,o="webkit moz ms o".split(" "),i=window.requestAnimationFrame,a=window.cancelAnimationFrame;for(t=0;t<o.length&&(!i||!a);t++)e=o[t],i=i||window[e+"RequestAnimationFrame"],a=a||window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"];i&&a||(i=function(e){var t=(new Date).getTime(),o=Math.max(0,16-(t-n)),i=window.setTimeout(function(){e(t+o)},o);return n=t+o,i},a=function(e){window.clearTimeout(e)}),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(e,t,n){"use strict";function o(e){var t;return this instanceof o?(e.el=i(e.el),void(e.el&&(t=e.el.attr("data-config"),t&&(t=JSON.parse(t.replace(/'/g,'"')),e=i.extend(!0,{},s,t,e)),this.config=e,this._init()))):new o(e)}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 e,t=this;i.each(t.hands,function(n,o){o.lastValue!==o.value&&(e="",i.each(t._toDigitals(o.value,o.bits),function(n,o){e+=t._html(o,"","digital")}),o.node.html(e))})}}},h=function(){function e(){for(var t,i,a,r,s=+new Date-e.nextTime,c=1+Math.floor(s/100);o.length;)o.shift()();for(s=100-s%100,e.nextTime+=100*c,a=0,r=n.length;r>a;a+=2)t=n[a+1],0===t?n[a](c):(t+=2*c-1,i=Math.floor(t/20),i>0&&n[a](i),n[a+1]=t%20+1);setTimeout(e,s)}function t(e,t){var n,o;for(n=0,o=t.length;o>n;++n)if(t[n]===e)return n;return-1}var n=[],o=[];return e.nextTime=+new Date,e(),{add:function(e,t){o.push(function(){n.push(e),n.push(1e3===t?1:0)})},remove:function(e){var i;o.push(function(){i=t(e,n),-1!==i&&n.splice(t(e,n),2)})}}}();i.extend(o.prototype,{_init:function(){var e,t,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(e,t){var o="";return"u"!==t&&"s-ext"!==t||(n.frequency=100),"s-ext"===t?(a.push({type:"s"}),a.push({type:"u"}),o=n._html("","s","handlet")+n._html(".","","digital")+n._html("","u","handlet")):a.push({type:t}),n._html(o,t,"hand")})),e=n.config.clock,i.each(a,function(t,n){var i,a=n.type,r=100;for(n.node=o.find(".hand-"+a),i=e.length-3;i>-1&&a!==e[i];i-=3)r*=e[i+1];n.base=r,n.radix=e[i+1],n.bits=e[i+2]}),n._getLeft(),n._reflow(),t=n._reflow,n._reflow=function(){return t.apply(n,arguments)},h.add(n._reflow,n.frequency),o.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,i.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]&&i.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}),h.remove(t._reflow)),t.left<864e5&&n.find(".left-day").hide(),t},_repaint:function(){c[this.config.effect].paint.apply(this),this.config.el.trigger(r)},_toDigitals:function(e,t){var n=[];for(e=0>e?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(i.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=o},function(e,t,n){function o(e){function t(e){var t;t=n.find("li").eq(e),t.length>0&&setTimeout(function(){o.scrollToElement(t[0],400)},1)}var n,o,i,a={el:".outlet-nav"};return i=s.extend({},a,e),n=s(i.el),o=new c(n[0],{scrollX:!0,scrollY:!1,tap:!0,eventPassthrough:!0,preventDefault:!0}),{"goto":t}}function i(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=window.location.search.substr(1).match(t);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 e=s("#index_nav"),t=i("yh_channel");a(),null===t?(t=i("type"),null===t?e.find('li:not([data-nav="other"])').eq(0).addClass("active").siblings().removeClass("active"):e.find("li[data-type="+t+"]").addClass("active").siblings().removeClass("active")):e.find('li:not([data-nav="other"])').eq(t).addClass("active").siblings().removeClass("active")}var s=n(1),c=n(16),h="即将结束",l="上线预告";r(),e.exports=o},,function(e,t,n){var o=n(1);o(".nav-back").on("click",function(e){var t=window.cookie("_Channel")||"boys";e.preventDefault(),location.href="//m.yohobuy.com/"+t})}]);