channel.index.js
5.62 KB
webpackJsonp([19],{0:function(n,e,o){var t=o(1),i=o(36),r=t(".search-box"),a=t(".box"),c=t(".index-search"),s=t(".index-logo"),u=t(".index-channel a:not(#yohood)"),h=r.children('input[type="text"]'),d=a.children(".no-search"),l=r.children(".search-icon");o(3),h.on("focus",function(){a.addClass("action"),s.addClass("action")}).on("input",function(){""===h.val()?l.addClass("empty"):l.removeClass("empty")}),d.on("touchend",function(){return a.removeClass("action"),s.removeClass("action"),h.blur(),!1}),r.children(".clear-text").on("touchstart",function(){h.val("").focus().trigger("input")}),r.children(".search-icon").on("touchstart",function(){return i.hasDangerInput()?!1:void c.submit()}),r.keyup(function(n){if(13===n.keyCode){if(i.hasDangerInput())return!1;c.submit()}}),t(".index-channel img").on("load error",function(){window.rePosFooter&&window.rePosFooter()}),u.on("touchstart",function(){u.css({background:"#000",color:"#fff",borderColor:"#fff"}),t(this).css({background:"rgba(255, 255, 255, 0.5)",color:"#000",borderColor:"#000"})}).on("touchend touchcancel",function(){t(this).css({background:"#000",color:"#fff",borderColor:"#fff"})})},2:function(n,e,o){function t(n,e){var o,t;"undefined"!=typeof n&&(o=n.toString(),t=e&&e>0?e:2e3,i.text(o).show(),r=setTimeout(function(){"block"===i.css("display")&&i.hide()},t))}var i,r,a=o(1);!function(){var n='<div id="yoho-tip" class="yoho-tip"></div>';a(".yoho-page").append(n),i=a("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(r)})}(),e.show=t},3:function(n,e,o){function t(n){var e,o,t=document.cookie;return document.cookie&&""!==document.cookie&&(o=t.indexOf(n+"="),o>-1&&(o+=n.length+1,e=decodeURIComponent(f.trim(t.substring(o,t.indexOf(";",o)))))),e}function i(n,e,o){var t,i,r,a,c="";"undefined"!=typeof e&&(o=o||{},null===e&&(e="",o.expires=-1),o.expires&&("number"==typeof o.expires||o.expires.toUTCString)&&("number"==typeof o.expires?(a=new Date,a.setTime(a.getTime()+24*o.expires*60*60*1e3)):a=o.expires,c="; expires="+a.toUTCString()),t=o.path?"; path="+o.path:"",i=o.domain?"; domain="+o.domain:"",r=o.secure?"; secure":"",document.cookie=[n,"=",encodeURIComponent(e),c,t,i,r].join(""))}function r(){var n=!!navigator.cookieEnabled;return"undefined"!=typeof navigator.cookieEnabled||n||(document.cookie="testcookie",n=-1!==document.cookie.indexOf("testcookie")),n}function a(){var n,e=t("_UID");return"undefined"==typeof e?0:(n=e.split("::"),"undefined"==typeof n||n.length<4?0:n)}function c(){var n=a();return 0===n?0:n[1]}function s(){var n=t("_g");return"undefined"==typeof n?"":JSON.parse(n).k}function u(){var n;0!==m.length&&(n=Math.min(f(window).height(),window.screen.availHeight),f("body").height()<=n-parseInt(m.css("height"),0)?m.addClass("bottom"):m.removeClass("bottom"))}function h(n){var e=f(n).outerHeight();n&&m.css("margin-bottom",e+"px")}function d(){var n,e,o=[],t=window.location.search.slice(1).split("&");for(e=0;e<t.length;e++)n=t[e].split("="),o.push(n[0]),o[n[0]]=n[1];return o}function l(n){return n.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2")}var f=o(1),p=o(4),m=f("#yoho-footer"),g=f(".yoho-page"),w=f(".yoho-header");!function(){var n,e=m.children(".op-row"),o=f(".back-to-top"),t=a();u(),0===t?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()+'">'+t[0]+'</a><a href="http://m.yohobuy.com/passport/signout/index">退出</a>'),o.length>0&&(n=new p(o[0]),n.on("tap",function(n){return f(window).scrollTop(0),n.srcEvent.preventDefault(),!1})),m.removeClass("hide")}(),function(n,e,o,t,i){var r=e.createElement(o),a=e.getElementsByTagName(o)[0];n.YohoAcquisitionObject=i,n[i]=function(){n[i].p=arguments},r.async=1,r.src=t,a.parentNode.insertBefore(r,a)}(window,document,"script","http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js","_yas"),function(){var n=c();n=0===n?"":n,window._ozuid=n,window._yas&&window._yas(1*new Date,"1.0.14","yohobuy_m",n,"","")}(),w.on("touchstart","a",function(){w.find("a").removeClass("highlight"),f(this).addClass("highlight")}).on("touchend touchcancel","a",function(){f(this).removeClass("highlight")}),g.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 n,e,o=0,t="webkit moz ms o".split(" "),i=window.requestAnimationFrame,r=window.cancelAnimationFrame;for(e=0;e<t.length&&(!i||!r);e++)n=t[e],i=i||window[n+"RequestAnimationFrame"],r=r||window[n+"CancelAnimationFrame"]||window[n+"CancelRequestAnimationFrame"];i&&r||(i=function(n){var e=(new Date).getTime(),t=Math.max(0,16-(e-o)),i=window.setTimeout(function(){n(e+t)},t);return o=e+t,i},r=function(n){window.clearTimeout(n)}),window.requestAnimationFrame=i,window.cancelAnimationFrame=r}(),f.extend({queryString:d}),11===m.find(".user-name").text().length&&m.find(".user-name").html(l(m.find(".user-name").text())),window.cookie=t,window.setCookie=i,window.isCookiesEnabled=r,window.getUser=a,window.getUid=c,window.getShoppingKey=s,window.rePosFooter=u,window.reMarginFooter=h,window.queryString=d()},36:function(n,e,o){function t(n){var e,o,t,a=i("input[type!=hidden], textarea"),c=/['"<>&\|]|--/g,s=a.length,u="undefined"==typeof n||"boolean"!=typeof n?!0:n;for(o=0;s>o;o++)if(e=a.eq(o).val(),c.test(e))return u?a.eq(o).val(e.replace(c," ")):(t=e.match(c).join(" "),r.show("不可以输入 "+t+" 哦!")),!u&&!0;return!1}var i=o(1),r=o(2);e.hasDangerInput=t}});