details.js 32.9 KB
/*! dili 2016-01-06 */
define("base",function(require,exports){exports.now=function(){return(new Date).getTime()},exports.uid=function(start,len){for(var str="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"+(new Date).getTime(),len=len||12,temp=[],i=0;len>i;i++)temp.push(str.charAt(Math.floor(Math.random()*str.length)));return(void 0!==start?start+"-":"")+temp.join("")},exports.listen={_t:null,resize:function(callback){clearTimeout(this._t),this._t=setTimeout(function(){$(window).resize(function(){callback()})},79)}},exports.page={screen:{width:function(){return $(window).width()+$(window).scrollLeft()},height:function(){return $(window).height()+$(window).scrollTop()}}},exports.chars={toJson:function(str){str=str.replace(/^[\s\xA0{]+/,"").replace(/[\s\xA0}]+/,"");for(var json={},arr=str.split(/[,;]/),i=0;i<arr.length;i++){var item=arr[i].split(":");json[item[0]]=item[1].replace(/^[\s\xA0\'\"]+/,"").replace(/[\s\xA0\'\"}]+/,"")}return json},toStr:function(json,s1,s2){var arr=[];for(var key in json)arr.push(key+(s1||":")+json[key]);return arr.join(s2||";")},strcut:function(str,num,dir){if(str.length<=num)return[str];for(var temp=[],arr=[],index=0,i=0;i<str.length;i++)temp.push(str.charAt(i));-1===dir&&temp.reverse();for(var i=0;i<temp.length;i++){if(0!==i&&i%num==0&&(-1===dir&&arr[index].reverse(),arr[index]=arr[index].join(""),index++),arr[index]||(arr[index]=[]),i===temp.length-1){arr[index].push(temp[i]),-1===dir&&arr[index].reverse(),arr[index]=arr[index].join("");break}arr[index].push(temp[i])}return-1===dir?arr.reverse():arr}},exports.math={rand:function(end,start){var num=Math.floor(Math.random()*end);return(start||0)+num},"float":function(num,pos){var mynum="number"==typeof num?num:parseFloat(num),mypos=pos||2;return isNaN(mynum)?null:Math.round(mynum*Math.pow(10,mypos))/Math.pow(10,mypos)}},exports.browser={ishtml5:function(){return void 0!==typeof Worker?!0:!1}},exports.imgLoader=function(param,callback){var data={};$.isPlainObject(param)?data=param:$.isArray(param)||"object"===$.type(param)&&!$.isPlainObject(param)?$.each(param,function(){data[$(this).attr("src")]=this}):"string"==typeof param&&(data[param]=[]);for(var key in data){var url=key,img=new Image;if(img.src=url,img._callback=callback,img._orgi=data[key],img.complete)return void img._callback.call(img._orgi.length?img._orgi:img,!0);$(img).load(function(){this._callback.call(this._orgi.length?this._orgi:this,!1)})}},exports.handLazy=function(list){$(list).find("img").each(function(){var _image=$(this),o=_image.attr("src1")||_image.attr("original")||_image.attr("data-original"),s=_image.attr("src");o&&""!=o&&!_image.hasClass("load-img")&&(_image.attr("src",o).removeAttr("src1").removeAttr("original").removeAttr("data-original"),_image.bind("error",function(){$(this).attr("src",s).removeAttr("original").removeAttr("data-original").addClass("load-img")}))})},exports.lazyload=function(target,beginDis){function pageTop(){return(document.body.clientHeight<document.documentElement.clientHeight?document.body.clientHeight:document.documentElement.clientHeight)+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}function imgLoad(){lazyArray.each(function(){var oft=$(this).offset();if(oft&&void 0!==this.nodeType&&oft.top<=pageTop()+(beginDis||0)){var original=$(this).attr("original")||$(this).attr("data-original"),_src=$(this).attr("src");original&&!$(this).hasClass("load-img")&&(murl=$(this).attr("src"),$(this).attr("src",original).removeAttr("original").removeAttr("data-original"),$(this).attr("isOriginal",!0),$(this).bind("error",function(){$(this).attr("src",_src).removeAttr("original").removeAttr("data-original").addClass("load-img")}))}})}var lazyArray=$(target),murl=null;imgLoad(),$(window).bind("scroll",function(){imgLoad()})},exports["goto"]=function(options){var timerId=null;clearTimeout(timerId);var opt={elem:null,duration:400,yOffset:0};$.extend(opt,options),opt.elem=$.isPlainObject(options)?$(opt.elem):$(options);var endpos=0,st=$(window).scrollTop(),start=(new Date).getTime(),toElem=null!==opt.elem&&opt.elem.length,easeout=function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b};return opt.elem&&opt.elem.length?(toElem&&(endpos=Math.round(opt.elem.offset().top)),endpos+opt.yOffset==st?!1:(endpos=Math.floor(endpos+opt.yOffset),void(timerId=setInterval(function(){var t=(new Date).getTime()-start,state=t/opt.duration,ratio=easeout(state,t,0,1,opt.duration);if((new Date).getTime()>start+opt.duration)clearInterval(timerId),timerId=null,$(window).scrollTop(endpos);else{var step=(toElem?ratio:1-ratio)*(endpos-st);$(window).scrollTop(st+step)}},17)))):!1}}),define("tools",function(require,exports){var Tools;return Tools=function(){var self=this;return this.setSelected=function(obj){var Selected=function(data){var $container,$tags,config={type:"click",container:"",tags:"",selected:"act",disabledClass:"disabled",cllback:function(){}},methods={setIndex:function(is){return is.hasClass(config.disabledClass)||is.hasClass(config.selected)?!1:($container.find(config.tags).removeClass(config.selected),is.addClass(config.selected),void("undefined"!=typeof is.index()&&config.cllback(is.index(),is)))}};return $.extend(config,data),$container=$(config.container),$tags=$container.find(config.tags),$tags.on(config.type,function(event){$tags.is("a")&&event&&event.preventDefault&&event.preventDefault(),$(this).hasClass(config.disabledClass)||methods.setIndex($(this))}),this.setIndex=function(index){$tags.eq(index)&&methods.setIndex($tags.eq(index))},this};return new Selected(obj)},this.numberChange=function(){var list=[],subscript=0,NumberChange=function(v,index){var config={view:$(v),addView:$(v).find(".up")?$(v).find(".up"):null,reduceView:$(v).find(".down")?$(v).find(".down"):null,changeView:$(v).find("input")?$(v).find("input"):null,index:index,maxnum:$(v).find("input").attr("maxmun")?parseInt($(v).find("input").attr("maxmun")):9999,minmun:$(v).find("input").attr("minmun")?parseInt($(v).find("input").attr("minmun")):1,value:1},methods={update:function(){config.changeView.val(config.value),self.radio.numCallback(config.value,config.view)},tip:function(key){if(self.radio&&self.radio.num){var text="";text+=key?"该商品最大购买数为"+config.maxnum:"该商品最小购买数为"+config.minmun,self.radio.num(text,config.view)}},interval:function(){config.maxnum=$(v).find("input").attr("maxmun"),config.minmun=$(v).find("input").attr("minmun")}};return config.view.hasClass("disabled")?(config.changeView.attr("disabled",!0),!1):(config.addView&&config.addView.click(function(){methods.interval(),config.value<config.maxnum?(config.value+=1,methods.update()):methods.tip(1)}),config.changeView&&(config.value=parseInt(config.changeView.val()),config.changeView.change(function(){methods.interval();var value=parseInt($(this).val())>=0?parseInt($(this).val()):config.value;value<config.minmun?methods.tip(0):value>config.maxnum?methods.tip(1):config.value=value,methods.update()})),config.reduceView&&config.reduceView.click(function(){methods.interval(),config.value>config.minmun?(config.value-=1,methods.update()):methods.tip(0)}),config.view.parent().bind("selectstart",function(){return!1}),this)};return $(".counter").each(function(){var nc=new NumberChange(this,subscript);subscript+=1,list.push(nc)}),list},this.sollView=function(obj){function SollView(){var config={leftBtn:null,rightBtn:null,sollView:null,view:null,index:0,width:0,maxPage:0,sollWidth:0,leftWidth:28,hoverView:null,isasingle:!1,callBack:function(){}},methods={animation:function(){config.sollView.stop().animate({left:config.index*config.width+"px"}),config.callBack(config.index,config.maxPage)},upadte:function(){if(config.isasingle)maxPage=config.sollView.find("li").length;else{var maxPage=parseInt(config.sollView.find("li").length/4);config.sollView.find("li").length%4&&(maxPage+=1)}try{config.leftWidth=config.sollView.find("li").eq(0).css("marginRight").replace("px",""),config.leftWidth=parseInt(config.leftWidth)}catch(error){}config.maxPage=maxPage,config.isasingle?config.width=config.sollView.find("li").width():config.width=4*config.sollView.find("li").width()+4*config.leftWidth+8,config.sollView.width(config.view.width()*maxPage)}};return config=$.extend(config,obj),methods.upadte(),config.leftBtn&&config.rightBtn?(config.leftBtn.click(function(){config.index<0&&(config.index+=1,methods.animation(config.index))}),config.rightBtn.click(function(){-config.index<config.maxPage-1&&(config.index-=1,methods.animation(config.index))})):config.hoverView&&config.hoverView.find("li").bind("mouseover",function(){config.index=0-$(this).index(),methods.animation(config.index)}),$(window).resize(function(){config.index=0,methods.upadte(),config.sollView.css({left:0}),config.callBack(config.index,config.maxPage)}),config.callBack(config.index,config.maxPage),this.updateInfo=function(data){config=$.extend(config,data),methods.upadte(),config.sollView.css({left:0}),config.callBack(config.index,config.maxPage)},this}return new SollView},this.request=function(paras,_url){var url="";url=_url?_url:location.href;for(var paraString=url.substring(url.indexOf("?")+1,url.length).split("&"),paraObj={},i=0;j=paraString[i];i++)paraObj[j.substring(0,j.indexOf("=")).toLowerCase()]=j.substring(j.indexOf("=")+1,j.length);var returnValue=paraObj[paras.toLowerCase()];return"undefined"==typeof returnValue?"":returnValue},this.cookie=function(){function getsec(str){var str1=1*str.substring(1,str.length),str2=str.substring(0,1);return"s"==str2?1e3*str1:"h"==str2?60*str1*60*1e3:"d"==str2?24*str1*60*60*1e3:void 0}function getcookie(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?arr[2]:null}return{set:function(name,value,time){var strsec=getsec(time),exp=new Date;exp.setTime(exp.getTime()+1*strsec),document.cookie=name+"="+escape(value)+";expires="+exp.toGMTString()},get:function(name){return getcookie(name)},remove:function(name){var exp=new Date;exp.setTime(exp.getTime()-1);var cval=getcookie(name);null!=cval&&(document.cookie=name+"="+cval+";expires="+exp.toGMTString())}}}(),this.addValue=function(_view){function AddValue(){var _p_view=$(_view);return this.setData=function(data){_p_view.html("");for(var _show_view="",_aData=[],i=0;i<data.length;i++)_show_view+='<div class="a-v-view"><p>'+data[i].txt+'</p><span class="a-v-view-d" inx="'+i+'">×</span></div>',_aData.push(data[i].val);_show_view+='<input type="hidden" class="a-v-hidden" value="'+_aData+'" name="'+_p_view.attr("data-name")+'" />',_p_view.html(_show_view),$(".a-v-view-d").click(function(){var _index=$(this).attr("inx");_index=parseInt(_index),_aData.splice(_index,1),$(this).parent().remove(),_p_view.find(".a-v-hidden").remove();var _h_view='<input type="hidden" class="a-v-hidden" value="'+_aData+'" name="'+_p_view.attr("data-name")+'" />';_p_view.append(_h_view)})},this}return new AddValue},this.shoppingMsg=function(_v){var _view=$(".q-message"),_top=0,_time=null;return _v&&(_view=$("."+_v)),$(".q-close").click(function(){_view.hide(),_time&&(clearTimeout(_time),_time=null)}),{load:function(_this){_time&&(clearTimeout(_time),_time=null),_view.find(".load").show(),_view.find(".text").hide();var top=$(_this).parent().offset().top,left=$(_this).parent().offset().left;_top=top-55,_view.css({top:_top,left:left-40}).css({height:"50px"}),_view.show(),self.amAdd("q-message","fadeInDown")},show:function(text){_time=setTimeout(function(){_view.hide(),_time&&(clearTimeout(_time),_time=null)},3e3),_view.animate({height:"75px",top:_top-30},function(){_view.find(".load").hide(),_view.find(".text").show(),_view.find(".text").find("p").css("line-height","30px"),"string"==typeof text?(_view.find(".text").find("p").eq(0).show(),_view.find(".text").find("p").eq(1).html('小计金额:<b class="q-total">'+text+"</b>")):(_view.find(".text").find("p").eq(0).hide(),_view.find(".text").find("p").eq(1).html(text.msg).css("line-height","80px"))})}}},this.randomize=function(b,e){return!b&&0!=b||!e?"?":Math.floor(Math.random()*e+b)},this.DiliRaty=function(_view,_xv){var _xing=8;_xv&&(_xing=_xv),$("."+_view).find("span").width(10*_xing),$("."+_view).next().html(_xing/2),$("."+_view).mousemove(function(e){var xx=e.originalEvent.layerX||e.originalEvent.x||0;if(xx&&(xx=e.clientX-$(this).offset().left),1>xx)return!1;xx+="";var pageX=0;pageX=parseInt(xx.substring(1,0)),pageX%2!=0&&(pageX+=1),$(this).find("span").width(10*pageX),$(this).next().html(+pageX/2)})},this.getPageCoord=function(_view){function getOffset(e){var target=e.target;void 0==target.offsetLeft&&(target=target.parentNode);var pageCoord=getPageCoord(target),eventCoord={x:window.pageXOffset+e.clientX,y:window.pageYOffset+e.clientY},offset={offsetX:eventCoord.x-pageCoord.x,offsetY:eventCoord.y-pageCoord.y};return offset}function getPageCoord(element){for(var coord={x:0,y:0};element;)coord.x+=element.offsetLeft,coord.y+=element.offsetTop,element=element.offsetParent;return coord}$(_view).hover(function(e){var _this=$(this),_desc=_this.find(".end").stop(!0,!0),width=103,height=103,left=void 0==e.offsetX?getOffset(e).offsetX:e.offsetX,top=void 0==e.offsetY?getOffset(e).offsetY:e.offsetY,right=width-left,bottom=height-top,rect={},_min=Math.min(left,top,right,bottom),_out="mouseleave"==e.type,spos={};rect[left]=function(epos){spos={left:-width,top:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[top]=function(epos){spos={top:-height,left:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[right]=function(epos){spos={left:left,top:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[bottom]=function(epos){spos={top:height,left:0},_out?_desc.stop().animate(spos,"fast"):_desc.css(spos).stop().animate(epos,"fast")},rect[_min]({left:0,top:0})})},this.tabRolling=function(_obj){var config={rollview:"u-buoy",view:"u-list li",offset:20,istxtwidth:!1,bias:2};config=$.extend(config,_obj);var width=0,left=0;$("."+config.view).hover(function(e){left=$(this).position().left,width=$(this).width()+config.offset,config.istxtwidth&&(width=$(this).find("a").width(),left=left+($(this).width()-$(this).find("a").width())/2+config.offset/2+config.bias),$("."+config.rollview).stop().animate({left:left,width:width},300)})},this.securitycode=function(view){var time=60,btn=$(view);btn.addClass("gray-btn");var date=setInterval(function(){return 0>=time?(clearInterval(date),btn.html("获取验证码"),time=60,btn.removeClass("gray-btn"),!1):(btn.html(time+"s重新获取"),void time--)},1e3)},this.radio={num:function(){},numCallback:function(){}},this}(),function($){$.fn.dilislider=function(options){function slide(){switch(index>=$contents.length&&(index=0),$stag.removeClass(settings.current).eq(index).addClass(settings.current),settings.affect){case"scrollx":$conbox.width($contents.length*$contents.width()),$conbox.stop().animate({left:-$contents.width()*index},settings.speed);break;case"scrolly":$contents.css({display:"block"}),$conbox.stop().animate({top:-$contents.height()*index+"px"},settings.speed);break;case"fade":$contents.eq(last_index).stop().animate({opacity:0},settings.speed/2).css("z-index",1).end().eq(index).css("z-index",9).stop().animate({opacity:1},settings.speed/2);break;case"none":$contents.hide().eq(index).show()}last_index=index,index++}function _pause(){clearInterval(Timer)}function _continue(){settings.auto&&(Timer=setInterval(slide,settings.space))}var settings={affect:"scrollx",speed:500,space:6e3,auto:!0,trigger:"mouseover",conbox:"ul",ctag:"li",switcher:".tab-a",stag:"a",current:"on",rand:!1};options.point&&(options.switcher=options.point.split(" ")[0],options.stag=options.point.split(" ")[1]),settings=$.extend({},settings,options);var index=1,last_index=0,$conbox=$(this).find(settings.conbox),$contents=$conbox.find(settings.ctag),$switcher=$(settings.switcher),$stag=$switcher.find(settings.stag);if(settings.rand&&(index=Math.floor(Math.random()*$contents.length),slide()),"fade"==settings.affect&&$.each($contents,function(k,v){0===k?$(this).css({position:"absolute","z-index":9}):$(this).css({position:"absolute","z-index":1,opacity:0})}),settings.auto)var Timer=setInterval(slide,settings.space);$stag.bind(settings.trigger,function(){_pause(),index=$(this).index(),slide(),_continue()}),$conbox.hover(_pause,_continue)},$.fn.dhover=function(_fun,_sfun){var trigger=null;$($(this).selector).hover(function(e){var thishover=this;this.ufun=_fun,trigger=setTimeout(function(){thishover.ufun(e)},200)},function(e){this.sfun=_sfun,clearTimeout(trigger),this.sfun(e)})}}(jQuery),function($){$.fn.dhover=function(_fun,_sfun){var trigger=null;$($(this).selector).hover(function(e){var thishover=this;this.ufun=_fun,trigger=setTimeout(function(){thishover.ufun(e)},200)},function(e){this.sfun=_sfun,clearTimeout(trigger),this.sfun(e)})}}(jQuery),Tools}),define("droll",function(require,exports,module){var droll=function(target,options){this.autoTimer=null,this.target=target,this.opt={step:null,moveNum:null,Media:!1,eventType:"click",isHori:!0,index:0,auto:!1,effect:"1",autoDelay:5e3,speed:500,fadeSpeed:400,dirButton:!0,indexButton:!1,showNum:!0,isCycle:!0,relaBtns:null,listCurClass:"pdo-droll_list_current",ibtnCurClass:"pdo-droll_btn_current",lockedClass:"pdo-droll_btn_locked",prevHtml:"&lt;",nextHtml:"&gt;",loop:!0,outerSelector:"ul",itemsSelector:"li",btnHoverActive:!1,onFinished:function(target,inview_elems){},onBeforeInView:function(target,inview_elems){},layoutWidth:null,layoutHeight:null},$.extend(this.opt,options),this.LENGTH=0,this.LOCKED=!1,this.I=this.opt.index,this.PREVI=this.opt.index,this.init()};return droll.prototype={init:function(){var _this=this;if(this.LENGTH=$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector).length,this.LENGTH<=this.opt.moveNum&&(this.opt.loop=!1),this.printWrapper(),this.setParams(),this.bindEvents(),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(this.opt.index),this.LENGTH<=this.opt.moveNum&&!this.opt.Media)return void this.opt.onBeforeInView.call(this.target,$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector));if(0!==this.opt.index?this.move():this.opt.onBeforeInView.call(this.target,this.getInViewList()),2==this.opt.effect&&($(this.target).find(this.opt.itemsSelector).each(function(){$(this).css({left:0,top:0,position:"absolute"}).hide()}),this.move()),this.opt.auto&&(this.auto(),$(this.target).hover(function(){clearTimeout(_this.autoTimer)},function(){_this.auto()})),this.opt.Media){var _itemsSelector=$(_this.target).find(_this.opt.outerSelector).find(_this.opt.itemsSelector),_ml=parseFloat($(_itemsSelector).css("marginLeft")),_mr=parseFloat($(_itemsSelector).css("marginRight"));$(window).resize(function(){_this.opt.step=parseFloat($(_itemsSelector).outerWidth())+_ml+_mr,$(_this.target).find(".pdo-droll_layout , .pdo-droll").css({width:_this.opt.step*_this.opt.moveNum}),_this.setParams(),_this.move(1*_this.opt.moveNum)})}},printWrapper:function(){var numlists="",elem=$(this.target),style=this.opt.isHori?"width: "+(this.opt.layoutWidth||this.opt.step*this.opt.moveNum)+"px; height: "+(this.opt.layoutHeight||$(this.target).outerHeight())+"px;":"height: "+(this.opt.layoutHeight||this.opt.step*this.opt.moveNum)+"px; width: "+(this.opt.layoutWidth||$(this.target).outerWidth())+"px;";2==this.opt.effect&&(style="width:100%;height:100%;");for(var i=0;i<this.LENGTH/this.opt.moveNum;i++){var _i=this.opt.showNum?i+1:"&nbsp;";numlists+='<a href="javascript:void(0);">'+_i+"</a>"}elem.find(this.opt.outerSelector).wrap('<div style="'+style+'z-index:1;" class="pdo-droll"></div>'),elem.find(".pdo-droll").wrap('<div style="'+style+'" class="pdo-droll_layout"></div>'),this.LENGTH>this.opt.moveNum&&elem.find(".pdo-droll_layout").append('                        <div class="pdo-droll_dirbutton" style="display:none;">                            <a class="pdo-droll_prev" href="javascript:void(0);"><span><span></a>                            <a class="pdo-droll_next" href="javascript:void(0);"><span><span></a>                        </div>                        <div class="pdo-droll_numbutton" style="display:none;">'+numlists+"</div>                    ")},setParams:function(){var elem=$(this.target);this.ELEM={outer:elem.find("pdo-droll"),cont:elem.find(this.opt.outerSelector),dirbtn:elem.find("div.pdo-droll_dirbutton"),numbtn:elem.find("div.pdo-droll_numbutton"),prev:elem.find("a.pdo-droll_prev"),next:elem.find("a.pdo-droll_next")},this.opt.dirButton&&!this.opt.btnHoverActive&&this.ELEM.dirbtn.fadeIn(200),this.opt.indexButton&&this.LENGTH>this.opt.moveNum&&this.ELEM.numbtn.fadeIn(200);var size=this.opt.step*this.ELEM.cont.find(this.opt.itemsSelector).length;2==this.opt.effect&&(size="100%"),this.ELEM.cont[this.opt.isHori?"width":"height"](size).css("position","absolute")},bindEvents:function(){var _this=this;this.ELEM.prev.click(function(){_this.move(-1*_this.opt.moveNum)}),this.ELEM.next.click(function(){_this.move(1*_this.opt.moveNum)}),this.opt.btnHoverActive&&(this.target.ha_stimer=null,this.target.ha_htimer=null,$(this.target).hover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_stimer=setTimeout(function(){_this.ELEM.dirbtn.fadeIn(120)},100)},function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_htimer=setTimeout(function(){_this.ELEM.dirbtn.fadeOut(120)},100)}),this.ELEM.dirbtn.mouseover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer)})),this.ELEM.numbtn.find("a")[this.opt.eventType](function(){_this.move($(this).index()*_this.opt.moveNum-_this.I)}),this.opt.relaBtns&&this.opt.relaBtns[this.opt.eventType](function(){var orgBtns=_this.ELEM.numbtn.find("a").eq($(this).index());orgBtns.triggerHandler(_this.opt.eventType)})},move:function(move_num,cur_ibtn_index){if(!(this.LENGTH<=this.opt.moveNum||1==this.opt.effect&&this.LOCKED)){this.LOCKED=!0;var _this=this,gs=this.getStep(move_num,cur_ibtn_index),step=1==this.opt.effect?gs.step:gs.toindex;if(1==this.opt.effect&&null===gs.step)return void(this.LOCKED=!1);if(this.opt.onBeforeInView.call(this.target,this.getInViewList()),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(Math.abs(gs.toindex)),1==this.opt.effect){var move_config={};move_config[this.opt.isHori?"left":"top"]=step,this.ELEM.cont.animate(move_config,this.opt.speed,function(){_this.LOCKED=!1,_this.opt.onFinished.call(_this.target,_this.getInViewList())})}if(2==this.opt.effect){var items=$(this.target).find(this.opt.itemsSelector);items.eq(gs.toindex).siblings().fadeOut(100),items.eq(gs.toindex).fadeIn(this.opt.fadeSpeed,function(){_this.opt.onFinished.call(_this.target,_this.getInViewList())})}}},getStep:function(move_num){var cycle=this.opt.isCycle;if(void 0==move_num)return this.I=0,{toindex:0,step:null};var range=[0,this.LENGTH-this.opt.moveNum],to_index=move_num+this.I;return to_index>range[1]&&(to_index=this.opt.loop?to_index<this.LENGTH?range[1]:cycle?0:range[1]:range[1]),to_index<range[0]&&(this.opt.loop?to_index+this.LENGTH>range[1]?to_index=0:cycle?to_index+=this.LENGTH:to_index=0:to_index=0),this.I=to_index,{toindex:to_index,step:to_index*this.opt.step*-1}},auto:function(){clearTimeout(this.autoTimer);var _this=this;this.autoTimer=setTimeout(function(){_this.move(1*_this.opt.moveNum),_this.auto()},this.opt.autoDelay)},getInViewList:function(){for(var arr=[],i=this.I;i<this.I+this.opt.moveNum;i++)arr.push(this.ELEM.cont.find(this.opt.itemsSelector).eq(i)[0]);return arr},setListState:function(){},setDirBtnState:function(){this.opt.loop||(this.ELEM.prev.removeClass(this.opt.lockedClass),this.ELEM.next.removeClass(this.opt.lockedClass),this.I<=0&&this.ELEM.prev.addClass(this.opt.lockedClass),this.I>=this.LENGTH-this.opt.moveNum&&this.ELEM.next.addClass(this.opt.lockedClass))},setIndexBtnState:function(index){this.opt.loop;var realIndex=Math.round(index/this.opt.moveNum),orgBtns=this.ELEM.numbtn.find("a");orgBtns.removeClass(this.opt.ibtnCurClass),orgBtns.eq(realIndex).addClass(this.opt.ibtnCurClass),this.opt.relaBtns&&(this.opt.relaBtns.removeClass(this.opt.ibtnCurClass),this.opt.relaBtns.eq(realIndex).addClass(this.opt.ibtnCurClass))}},droll}),define("ntab",function(require,exports,module){var ntab=function(a,b){this.target=a,this.opt={handler:null,eventType:"hover",hoverActive:!0,currentClass:"pdo-ntab_current",hideDelay:120,index:0,isAnimate:!0,onShow:function(){},onHide:function(){}},$.extend(this.opt,b),this.init()};return ntab.prototype={init:function(){var b=this;this.H=$(this.target).find(this.opt.handler),this.H.each(function(i){var a=$(this).attr("data-href")?$(this).attr("data-href"):$(this).attr("href"),cont=$(a);this.C=a&&cont.length?cont:$(this).next(),this.C&&this.C.length&&(this.C[0].H=this,b.opt.index!==i?$(this.C).hide():b.show(this))}),this.bind()},bind:function(){function delayShow(a){clearTimeout(stimer),clearTimeout(htimer),stimer=setTimeout(function(){b.show(a)},b.opt.hideDelay)}var b=this,stimer=htimer=null;/click/.test(this.opt.eventType)?this.H[this.opt.eventType](function(a){delayShow(this),a.preventDefault()}):(this.H[this.opt.eventType](function(){delayShow(this)},function(){}),$(this.target)[this.opt.eventType](function(){clearTimeout(htimer)},function(){})),/hover/.test(this.opt.eventType)&&this.opt.hoverActive&&this.H.each(function(){this.C&&$(this.C)[b.opt.eventType](function(){clearTimeout(htimer)},function(){})}),$(".ntab-handler").each(function(){this._bind||($(this).click(function(){var a=this,relato=$(this).attr("relato"),rela_elems=$(relato),orgi_target=null;return rela_elems.each(function(){$(this).attr("href")==$(a).attr("href")&&(orgi_target=this)}),$(orgi_target).click(),!1}),this._bind=!0)})},show:function(a){var b=this;this.H.each(function(){$(this)[this===a&&a.C&&a.C.length?"addClass":"removeClass"](b.opt.currentClass),this===a?(this.C&&$(this.C)[b.opt.isAnimate?"fadeIn":"show"](b.opt.isAnimate?200:0),b.opt.onShow.call(this,this.C)):/click/.test(b.opt.eventType)?$(this.C).hide():$(this.C)[b.opt.isAnimate?"fadeOut":"hide"](b.opt.isAnimate?200:0)})},hide:function(a){$(a).removeClass(this.opt.currentClass),/click/.test(this.opt.eventType)?$(a.C).hide():$(a.C).fadeOut(200),a||_this.show()}},ntab}),define("miniclock",function(require,exports,module){function isin(arr,data){for(var each in arr)if(arr[each]===data)return!0;return!1}function timeFormat(number){var day,hour,minute,second;for(day=parseInt(number/86400),hour=parseInt(number/3600);hour>=24;)hour-=24;for(minute=parseInt(number/60);minute>=60;)minute-=60;return second=parseInt(number%60),day+"<span>天</span>"+(10>hour?"0"+hour:hour)+":"+(10>minute?"0"+minute:minute)+":"+(10>second?"0"+second:second)}return miniclock=function(target,options){this.target=target,this.o={interval:1e3,time:60,minTime:0,type:["plus","minus"],yourType:"minus",SD:"发送验证码",WT:"秒后可重新发送",mark:"s-waiting",ban:"bangrey",waitByDay:!1,callback:function(){},isAuto:!0},this.o=$.extend(this.o,options),this.o.isAuto?this.init():0},miniclock.prototype={init:function(){if(this.o.waitByDay&&this.counterDay(this.o.waitByDay),$(this.target).hasClass(this.o.mark))return!1;this.o.mark+" "+this.o.ban;this.clock=this.recycle(this.router())},start:function(){this.init()},router:function(){var format,number,_this=this,classname=this.o.mark+" "+this.o.ban,type=_this.o.type,yourType=_this.o.yourType;return format=_this.o.waitByDay?timeFormat:function(e){return e},this.action(this.o.yourType,function(cache){_this.o.minTime<cache&&cache<_this.o.time?(number=format(cache),$(_this.target).addClass(classname).html(number+_this.o.WT)):($(_this.target).html(_this.o.SD).removeClass(classname),isin(type,yourType)&&(cache="minus"==yourType?_this.o.time:_this.o.minTime),clearInterval(_this.clock),_this.o.callback())})},action:function(exp,callback){var mincache=this.o.minTime+1,maxcache=this.o.time-1;switch(exp){case"plus":return function(){return callback(mincache),++mincache};case"minus":return function(){return callback(maxcache),--maxcache}}},recycle:function(callback){var _this=this;return setInterval(callback,_this.o.interval)},counterDay:function(day){var _this=this;if(!day)throw Error(day+" is not a number or positive number.");_this.o.SD="0<span>天</span> 00:00:00",_this.o.WT=""},reset:function(number,fn){var _this=this,classname=this.o.mark+" "+this.o.ban;setTimeout(function(){$(_this.target).html(_this.o.SD).removeClass(classname),clearInterval(_this.clock),"function"==typeof fn?fn():0},1e3*number)}},miniclock}),define(function(require,exports,module){var _Droll=require("droll"),_Tools=require("tools"),_Ntab=require("ntab"),_Base=require("base"),_Pophint=require("pophint");require("miniclock"),require("Parabola");require("hoverex"),require("charts"),require("fancybox"),require("timeDown"),$(function(){function standardShow(index){var _elem=$(".standard-box").find(".standard-group").eq(index);_elem.find("tr").length>2?(_elem.height("111px"),$(".need-more").show()):($(".need-more").hide(),$(".need-more span").removeClass("up")),$(_elem).css({display:"block"}).animate({left:0},300).siblings(".standard-group").css({display:"none",left:"-100%"})}function isContain(elem,cur){var _in=!1;return $(elem).each(function(){(this==$(cur)[0]||$(this).find(cur).length)&&(_in=!0)}),_in}var numberItem=0;Parabola.start({addview:".flyItem",setview:".receipt",images:"../images/add-loading.gif",btnview:".joincart",speed:700,curvature:.001,complete:function(){$(".receipt i").html(++numberItem),$("#popup-start").length>0&&$("#popup-start").trigger("click")}}),$(".thumb-list img").click(function(){var src=$(this).attr("src"),large=$(this).data("large");$("#zoomblock>img").attr("src",src),$("#zoomblock .he-zoom > img").attr("src",large),$(this).parent().addClass("current").siblings().removeClass("current")});var _index=0;$("#standard-list1").length>0&&(_Tools.setSelected({container:"#standard-list1",tags:"li",selected:"current",disabledClass:"disabled",cllback:function(index){_index=index,standardShow(index)}}),$("#standard-list1 li").eq(0).trigger("click")),$(".need-more span").click(function(){var _elem=$(".standard-box").find(".standard-group").eq(_index);if($(this).hasClass("up"))$(this).removeClass("up"),_elem.animate({height:"111px"},300);else{$(this).addClass("up");var _height=_elem.find("tr").height()*_elem.find("tr").length+5;_elem.animate({height:_height},300)}}),$("#standard-list2").length>0&&_Tools.setSelected({container:"#standard-list2",tags:"li",selected:"current",disabledClass:"disabled",cllback:function(index){}}),$("#standard-list3  li").click(function(){$(this).hasClass("current")?$(this).removeClass("current"):$(this).addClass("current")}),$(".door").click(function(){$(this).hasClass("selected")?($(this).removeClass("selected"),$(".room").hide()):($(this).addClass("selected"),$(".room").show())}),$(".account-house").length>0&&$(document).on("click",function(event){var click_target=event.target;isContain($(".account-house"),click_target)||($(".door").removeClass("selected"),$(".room").hide())}),new _Droll($("#goods-recommend2 .recommend-list")[0],{step:$("#goods-recommend2 li").width()+20,moveNum:5,dirButton:!0,Media:!0,onBeforeInView:function(list){_Base.handLazy(list)}}),$(".n-tab").length>0&&$(".n-tab").each(function(){new _Ntab(this,{handler:"a",eventType:"click",currentClass:"current",onShow:function(target){var _id=$(target).attr("id");$(".n-tab li").each(function(){var _href=$(this).find("a").attr("href");_href=="#"+_id?$(this).find("a").addClass("current"):$(this).find("a").removeClass("current")})}})});var _fixedTop=$(".content").offset().top;$(window).scroll(function(){$(window).scrollTop()>_fixedTop?$(".tab-fixed").show():$(".tab-fixed").hide()}),$(".tab-fixed li").click(function(){_Base["goto"]({elem:$(".content")})});var myChart=echarts.init(document.getElementById("graphic")),option={title:{text:"",subtext:""},tooltip:{trigger:"axis"},legend:{data:["寿光地利","哈尔滨哈达"]},toolbox:{show:!1,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{
show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",boundaryGap:!1,data:["周一","周二","周三","周四","周五","周六","周日"]}],yAxis:[{type:"value",axisLabel:{formatter:"{value}"}}],series:[{name:"寿光地利",type:"line",data:[11,11,15,13,12,13,10],markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}},{name:"哈尔滨哈达",type:"line",data:[1,-2,2,5,3,2,0],markPoint:{data:[{name:"周最低",value:-2,xAxis:1,yAxis:-1.5}]},markLine:{data:[{type:"average",name:"平均值"}]}}]};myChart.setOption(option),$(window).resize(function(){myChart.resize()}),$("#inquiryBtn").fancybox({padding:0}),$("#inquiry-send").click(function(){$.fancybox.close(),setTimeout(function(){new _Pophint(this,{operation:function(target){},content:"您的询价单已成功提交,我们已通知供应商为您报价,并通过短信通知您报价结果,请随时关注您的询价单。",showButton:!1})},500)}),$("#common-words").change(function(){$("#words-area").val($(this).val())}),$("#popup-start").fancybox({padding:0}),!login_flag&&$("#s-login-pop").length&&($(".nowbuy").click(function(){$("#s-login-pop").click()}),$("#s-login-pop").fancybox({width:"380px",height:"310px",type:"iframe",fitToView:!1,iframe:{preload:!1,scrolling:"no"},scrolling:"visible"})),$(".j-time").length>0&&$(".j-time").each(function(){var _runtime=parseFloat($(this).attr("runtime"));$(this).timeDown({runTime:_runtime,daysText:"天",sign:["小时","分","秒"]})})})});