text: "use strict";!function(r){function t(){this.$usernamebox=r(".sn-login"),this.$hidebox=r(".sn-register"),this.$brand=r(".brand-box"),this.$brandBtn=r(".brand-item-btn"),this.init()}t.prototype.init=function(){var t=this;this.getcookie("username")&&(this.$usernamebox.html(this.getcookie("username").split("; ")[0]),this.$usernamebox.attr("href","#"),this.$hidebox.html("退出"),this.$hidebox.attr("href","#"),this.$hidebox.on("click",function(){return t.$usernamebox.html("请登录"),t.$usernamebox.attr("href","http://10.31.158.21:8088/tianmao/object/src/login.html"),t.$hidebox.html("免费注册"),t.$hidebox.attr("href","http://10.31.158.21:8088/tianmao/object/src/registor.html"),t.removecookie("username"),!1})),this.ajax()},t.prototype.ajax=function(){var a=this;r.ajax({url:"http://10.31.158.21:8088/tianmao/object/php/index-data.php",dataType:"json"}).done(function(o){a.setdata(o,"tmallgj","tmall-hk"),a.setdata(o,"fashion","fashion"),a.setdata(o,"play","play"),a.setdata(o,"family","family"),a.setdata(o,"love","home-decoration"),a.setdata(o,"outdoors","outdoors"),a.setdata(o,"guesslist","guess-like","product-show",'<li class="guess-item">',"</li>"),a.setdata(o,"supermarket",!1,"product-box");var s="";a.$brand.find(".brand-item").each(function(t,n){var i=a.sj(0,20);s+='\n\t\t\t\t\t<li class="brand-item">\n\t\t\t\t\t\t<div class="brand-img">\n\t\t\t\t\t\t\t<img src="'+o.brand[i].url+'"\n\t\t\t\t\t\t\talt="">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<a class="brand-mask" href="javascript:;">\n\t\t\t\t\t\t\t<div class="coupon">\n\t\t\t\t\t\t\t\t<span>'+o.brand[i].title+'</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="enter">\n\t\t\t\t\t\t\t\t<span>点击进入</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t'}),a.$brand.html(s),new Brand(o);var i="",t=r(".banner-center");r.each(o.banner,function(t,n){n.imgurls?i+='\n\t\t\t<div class="banner-pic" style="display:none" bcolor="'+n.color+'">\n\t\t\t\t<a class="big-banner-link" href="javascript:;">\n\t\t\t\t\t<b class="big-banner" style="background:url('+n.url+') no-repeat center center;"></b>\n\t\t\t\t</a>\n\t\t\t\t<a class="sm-banner sm1" href="javascript:;">\n\t\t\t\t\t<img src="'+n.imgurls.split(",")[0]+'"\n\t\t\t\t\talt="">\n\t\t\t\t</a>\n\t\t\t\t<a class="sm-banner sm2" href="javascript:;">\n\t\t\t\t\t<img src="'+n.imgurls.split(",")[1]+'"\n\t\t\t\t\talt="">\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t':i+='\n\t\t\t<div class="banner-pic" style="display:none" bcolor="'+n.color+'">\n\t\t\t\t<a class="big-banner-link" href="javascript:;">\n\t\t\t\t\t<div class="tanx-banner-con">\n\t\t\t\t\t\t<img class="tanx-banner"\n\t\t\t\t\t\t\tsrc="'+n.url+'" alt="">\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t\t'}),t.html(i),new Lb})},t.prototype.setdata=function(t,i,n){var o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"product-item-box",s=4<arguments.length&&void 0!==arguments[4]?arguments[4]:"",a=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"",e=this;this.$productbox=r("string"==typeof n?"#"+n+" ."+o:"."+o),this.str="",r.each(t[i],function(t,n){e.str+="\n\t\t\t\t"+s+'\n\t\t\t\t<div class="product-item">\n\t\t\t\t\t<a class="product-item-link" href="http://10.31.158.21:8088/tianmao/object/src/details.html?table='+i+"&id="+t+'">\n\t\t\t\t\t\t<div class="floor-item-tag" style="visibility:hidden"></div>\n\t\t\t\t\t\t<img src="'+n.url+'"\n\t\t\t\t\t\t\talt="">\n\t\t\t\t\t\t<div class="floor-item-title">'+n.title+'</div>\n\t\t\t\t\t\t<div class="floor-price">￥'+n.price+"</div>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t\t"+a+"\n\t\t\t\t",e.$productbox.html(e.str)})},t.prototype.setcookie=function(t,n,i){var o=new Date;o.setDate(o.getDate()+i),document.cookie=t+"="+n+";expires="+o},t.prototype.getcookie=function(t){for(var n=document.cookie.split("; "),i=0;i<n.length;i++){var o=n[i].split("=");if(o[0]===t)return o[1]}},t.prototype.removecookie=function(t){this.setcookie(t,"",-1)},t.prototype.sj=function(t,n){return parseInt(Math.random()*(n-t+t))},new t}(jQuery),function(a){function t(t){this.init(t)}t.prototype.init=function(t){this.brandhover(),this.brandswitch(t.brand)},t.prototype.brandhover=function(){this.$brandItem=a(".brand-item"),this.$brandItem.hover(function(){a(this).find(".brand-img").css("opacity","0").siblings(".brand-mask").css("opacity","1")},function(){a(this).find(".brand-img").css("opacity","1").siblings(".brand-mask").css("opacity","0")})},t.prototype.brandswitch=function(o){var s=this;this.$switchbtn=a(".brand-item-btn"),this.$brandImg=a(".brand-img"),this.$bg=a(".brand-mask"),this.$switchbtn.on("click",function(){for(var n=this,t=function(t){n.timer=setTimeout(function(){s.brandhide(t,o)},s.sj(0,500))},i=0;i<30;i++)t(i);clearTimeout(this.timer)})},t.prototype.brandhide=function(n,i){var o=this;a(this.$brandImg[n]).stop().animate({width:0,left:a(this.$brandItem[n]).offset().left+61},200,function(){a(o.$brandImg[n]).stop().animate({width:122,left:a(o.$brandItem[n]).offset().left-61},200);var t=o.sj(0,i.length);a(o.$brandImg[n]).find("img").attr("src",i[t].url),a(o.$bg[n]).find(".coupon").find("span").html(i[t].title)})},t.prototype.sj=function(t,n){return parseInt(Math.random()*(n-t+t))},window.Brand=t}(jQuery),function(n){function t(){this.$bannerbox=n(".banner-pic"),this.$bannerbtn=n(".banner-btn a"),this.$bgcolorbox=n(".banner-bgcolor"),this.timer=null,this.index=0,this.init()}t.prototype.init=function(){var t=this;this.$bannerbox.eq(0).css({display:"block",opacity:1}),this.$bgcolorbox.css("background",this.$bannerbox.eq(0).attr("bcolor")),this.$bannerbtn.on("mouseover",function(){t.btnswitch(n(this).index()),t.switch(n(this).index()),t.index=n(this).index()}),t.autoswitch(),this.$bannerbox.hover(function(){clearInterval(t.timer)},function(){t.autoswitch()})},t.prototype.btnswitch=function(t){this.$bannerbtn.eq(t).addClass("selected").siblings().removeClass("selected")},t.prototype.switch=function(t){var n=this;this.$bannerbox.eq(t).animate({opacity:1},200).siblings(".banner-pic").animate({opacity:0},200,function(){n.$bgcolorbox.css("background",n.$bannerbox.eq(t).attr("bcolor")),n.$bannerbox.eq(t).css("display","block"),n.$bannerbox.eq(t).siblings().css("display","none")})},t.prototype.autoswitch=function(){var t=this;this.timer=setInterval(function(){t.index++,t.index>=t.$bannerbtn.length&&(t.index=0),t.switch(t.index),t.btnswitch(t.index)},4e3)},window.Lb=t}(jQuery),function(){function t(){this.$floorbox=$(".mui-lift"),this.navsign=$(".nav-name"),this.floor=$(".fplist a"),this.sqall=$(".js-use").find("div[id]").not("div[id=product-content]"),this.init()}t.prototype.init=function(){var t=this,n=null;$(window).on("scroll",function(){n=setTimeout(function(){t.floorshow(),t.floorswitch(),clearTimeout(n)},800)}),this.floor.hover(function(){t.mouseover($(this).index(),1)},function(){t.mouseout($(this))}),this.floor.on("click",function(){t.click($(this).index())})},t.prototype.floorshow=function(){680<$(window).scrollTop()?this.$floorbox.stop(!0).animate({width:35,height:370,opacity:1,display:"block"},200):this.$floorbox.stop(!0).animate({width:0,height:0,opacity:0,display:"none"},150)},t.prototype.mouseover=function(t){var n=$(this.navsign[t]).parent();switch(t){case 0:case 4:n.css("background","#64C333").siblings("a").css("background","rgba(0, 0, 0, 0.6)");break;case 1:case 7:n.css("background","#000").siblings("a").css("background","rgba(0, 0, 0, 0.6)");break;case 2:n.css("background","#EA5F8D").siblings("a").css("background","rgba(0, 0, 0, 0.6)");break;case 5:n.css("background","#F15453").siblings("a").css("background","rgba(0, 0, 0, 0.6)");break;case 3:n.css("background","#0AA6E8").siblings("a").css("background","rgba(0, 0, 0, 0.6)");break;case 6:n.css("background","#19C8A9").siblings("a").css("background","rgba(0, 0, 0, 0.6)")}},t.prototype.mouseout=function(t){this.floor.not(t).css({background:"rgba(0, 0, 0, 0.6)"})},t.prototype.floorswitch=function(){var i=this;$.each(this.sqall,function(t,n){$(window).scrollTop()+300>$(n).offset().top&&i.mouseover(t)})},t.prototype.click=function(t){t<8?$("html,body").animate({scrollTop:this.sqall.eq(t).offset().top-50}):$("html,body").animate({scrollTop:0})},new t}(jQuery),function(){function t(){this.$topNav=$("#top-nav"),this.navshow()}t.prototype.navshow=function(){var t=this;$(window).on("scroll",function(){730<$(window).scrollTop()?t.$topNav.css({display:"block"}):t.$topNav.css("display","none")})},new t}(jQuery),function(){function t(){this.$subNav=$(".nav-box .content-con"),this.$navli=$(".nav-item"),this.init()}t.prototype.init=function(){var t=this;this.$navli.hover(function(){t.$subNav.eq($(this).index()).addClass("show").siblings().removeClass("hide")},function(){t.$subNav.hover(function(){},function(){t.$subNav.removeClass("show").addClass("hide")})})},new t}(jQuery),function(){function t(){this.$tabli=$(".floor-tab-title li"),this.$tabcon=$(".floor-tab-content"),this.timer=null,this.num=0,this.init()}t.prototype.init=function(){var t=this;this.$tabli.on("mouseover",function(){t.switch($(this).index())}),this.autoswitch(),this.hover()},t.prototype.switch=function(t){this.$tabli.eq(t).addClass("floor-current-tab").siblings("li").removeClass("floor-current-tab"),this.$tabcon.eq(t).addClass("hide").siblings(".floor-tab-content").removeClass("hide")},t.prototype.autoswitch=function(){var t=this;this.timer=setInterval(function(){t.num++,t.num>=t.$tabli.length&&(t.num=0),t.switch(t.num)},3e3)},t.prototype.hover=function(){var t=this;this.$tabcon.hover(function(){clearInterval(t.timer)},function(){t.autoswitch()})},new t}(jQuery);