• 车林通购车之家--购车计算器模块js实现


    //jsq-nav.twig

    <ul class="switch-nav db-tags bgfff clearfix"> <li id="qk" class="{{ app.request.getUrl() starts with path(['qk'])?'active':'' }}"><a href="{{ path('qk',{'brand_id':brand_id,'series_id':series_id,'model_id':model_id}) }}"><span>全款计算<i class="line"></i></span></a></li> <li id="dk" class="{{ app.request.getUrl() starts with path(['dk'])?'active':'' }}"><a href="{{ path('dk',{'brand_id':brand_id,'series_id':series_id,'model_id':model_id}) }}"><span>贷款计算<i class="line"></i></span></a></li> <li id="bx" class="{{ app.request.getUrl() starts with path(['bx'])?'active':'' }}"><a href="{{ path('bx',{'brand_id':brand_id,'series_id':series_id,'model_id':model_id}) }}"><span>保险计算<i class="line"></i></span></a></li> </ul> {{ use('common\widgets\JsBlock') }} {{ js_block_begin() }} <script> //获取url中的参数 function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).match(reg); //匹配目标参数 if (r != null) return unescape(r[2]); return null; //返回参数值 } var brand_id = getUrlParam('brand_id'); $.cookie("brand_id",brand_id); var series_id = getUrlParam('series_id'); $.cookie("series_id",series_id); var model_id = getUrlParam('model_id'); $.cookie("model_id",model_id); if(brand_id && series_id && model_id){ //品牌 var url1 = 'http://cardb.test.chelintong.com/rest-api/v1/brands/'+ brand_id; $.getJSON(url1, function (data1) { console.log(data1); bname=data1.name; $.cookie("bname",bname); //车系 var url2 = 'http://cardb.test.chelintong.com/rest-api/v1/series/'+ series_id; $.getJSON(url2, function (data2) { console.log(data2); sname=data2.name; $.cookie("sname",sname); //车型 var url3 = 'http://cardb.test.chelintong.com/rest-api/v1/models/'+ model_id; $.getJSON(url3, function (data3) { console.log(data3); mname=data3.name; $.cookie("mname",mname); hidCarPrice=data3.guided_price_yuan; $.cookie('hidCarPrice',hidCarPrice); year=data3.year; //bname=$.cookie("bname"); //sname=$.cookie("sname"); var htmg=year+''+bname+sname+mname; var ktmg=bname+sname; $.cookie("htmg",htmg); $("#select_carname").html(htmg); $("#tit").html(ktmg); GetCarInfo(model_id); InitTagStatus(); calcAutoAll(); }); }); }); } </script> <script> $(".m-jsq-btn-box .btn-orange").click(function(){ //根据索引值设置选中状态 aa=$.cookie("aa"); //根据索引值设置选中状态 bb=$.cookie("bb"); model_id=$.cookie("model_id"); brand_id=$.cookie("brand_id"); series_id=$.cookie("series_id") var url=window.location.href; if(url.indexOf("dk")>0){ location.href='{{path(['dk'])}}?model_id='+model_id+'&brand_id='+brand_id+'&series_id='+series_id+'&aa='+aa+'&bb='+bb; }else if(url.indexOf("qk")>0){ location.href='{{path(['qk'])}}?model_id='+model_id+'&brand_id='+brand_id+'&series_id='+series_id+'&aa='+aa+'&bb='+bb; }else{ location.href='{{path(['bx'])}}?model_id='+model_id+'&brand_id='+brand_id+'&series_id='+series_id+'&aa='+aa+'&bb='+bb; } }); </script> <script> //选择车款弹出窗 $(".select-mode-car1").click(function(){ $.cookie("k",0); $(".select-models").show(); $("body").css("overflow","hidden"); brand_name=$.cookie("bname"); series_name=$.cookie("sname"); series_id=$.cookie("series_id"); //奥迪A4L $.ajax({ url:"models", type:"POST", dateType:"json", data:{"series_id":series_id}, success:function(datas){ /*********奥迪A4L************/ console.log(datas); //标题更换 var htmn='<span>'+brand_name+''+series_name+'<i class="line"></i></span>'; $("#cc").html(htmn); var keys = []; for(var key in datas){ keys.push(key); } keys = keys.sort(); var htmo=""; for(var i=keys.length-1; i>=0;i--){ //内容更换 var dlength=datas[keys[i]].length; var f=0; for(var j=0;j<dlength;j++){ if(datas[keys[i]][j].status ==3){ f=f+1; } } if(f==dlength){ htmo +='<div class="year-tt font20 color-gray">'+keys[i]+'款【停售】</div>'; htmo +='<ul id="ts" class="pic-txt-j dfk">'; }else{ htmo +='<div class="year-tt font20 color-gray">'+keys[i]+'款</div>'; htmo +='<ul id="zs" class="pic-txt-j dfk">'; } for(k in datas[keys[i]]){ if (datas[keys[i]][k].guided_price_yuan == null) { ele = '暂无报价'; }else{ ele=datas[keys[i]][k].guidedPriceWanYuan+""; } if(datas[keys[i]][k].year=keys[i]){ //alert(datas[i][k].name); htmo +=' <li modelid="'+datas[keys[i]][k].id+'" year="'+keys[i]+'" price="'+datas[keys[i]][k].guided_price_yuan+'" id="'+(ele)+'" class="'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】">'; htmo +=' <a href="javascript:void(0);" style="color:#3B5998">'; htmo +=' <h4 class="font28" style="color:#666666">'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】</h4>'; htmo +=' <p class="font24" style="color:#999999">'+(ele)+'</p>'; htmo +=' </a>'; htmo +=' </li> '; } } htmo +=' </ul>'; } $("#kk").html(htmo); //停售折叠显示 $("ul#ts").hide(); $(".year-tt").click(function(){ $(this).next('ul').toggle(); }); /**********************************/ $(".dfk li").click(function(){ //奥迪A4L选择 bd=$.cookie("brand_id"); sd=$.cookie("series_id"); /****根据车型id获取排量、座位数****/ //获取车型id model_id=$(this).attr("modelid"); $.cookie("model_id",model_id); md=$.cookie("model_id"); /***********裸车价格**************/ //获取车型价格 hidCarPrice=$(this).attr("price"); $.cookie('hidCarPrice',hidCarPrice); //设置单机后颜色 $(".pic-txt-j li").find("h4").attr("style","color:#666666"); $(".pic-txt-j li").find("p").attr("style","color:#999999"); $(this).find("h4").removeAttr("style"); $(this).find("p").removeAttr("style"); $(this).find("a").css("color","#3B5998"); var url=window.location.href; if(url.indexOf("dk")>0){ location.href='{{path(['dk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else if(url.indexOf("qk")>0){ location.href='{{path(['qk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else{ location.href='{{path(['bx'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; } }); } }); }); //重置选择车款弹出窗 $(".select-mode-car2").click(function(){ $.cookie("k",1); $(".select-models").show(); $("body").css("overflow","auto"); $(".select-models").css("overflow","auto"); brand_name=$.cookie("bname"); series_name=$.cookie("sname"); series_id=$.cookie("series_id"); //奥迪A4L $.ajax({ url:"models", type:"POST", dateType:"json", data:{"series_id":series_id}, success:function(datas){ /*********奥迪A4L************/ console.log(datas); //标题更换 var htmn='<span>'+brand_name+''+series_name+'<i class="line"></i></span>'; $("#cc").html(htmn); var keys = []; for(var key in datas){ keys.push(key); } keys = keys.sort(); var htmo=""; for(var i=keys.length-1; i>=0;i--){ //内容更换 var dlength=datas[keys[i]].length; var f=0; for(var j=0;j<dlength;j++){ if(datas[keys[i]][j].status ==3){ f=f+1; } } if(f==dlength){ htmo +='<div class="year-tt font24 color-gray">'+keys[i]+'款【停售】</div>'; htmo +='<ul id="ts" class="pic-txt-j dfh">'; }else{ htmo +='<div class="year-tt font24 color-gray">'+keys[i]+'款</div>'; htmo +='<ul id="zs" class="pic-txt-j dfh">'; } for(k in datas[keys[i]]){ if (datas[keys[i]][k].guided_price_yuan == null) { ele = '暂无报价'; }else{ ele=datas[keys[i]][k].guidedPriceWanYuan+""; } if(datas[keys[i]][k].year=keys[i]){ //alert(datas[i][k].name); htmo +=' <li modelid="'+datas[keys[i]][k].id+'" year="'+keys[i]+'" price="'+datas[keys[i]][k].guided_price_yuan+'" id="'+(ele)+'" class="'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】">'; htmo +=' <a href="javascript:void(0);">'; htmo +=' <h4 class="font28" style="color:#666666">'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】</h4>'; htmo +=' <p class="font24" style="color:#999999">'+(ele)+'</p>'; htmo +=' </a>'; htmo +=' </li> '; } } htmo +=' </ul>'; } $("#kk").html(htmo); //停售折叠显示 $("ul#ts").hide(); $(".year-tt").click(function(){ $(this).next('ul').toggle(); }); /**********************************/ $(".dfh li").click(function(){ //奥迪A4L选择 bd=$.cookie("brand_id"); sd=$.cookie("series_id"); /****根据车型id获取排量、座位数****/ //获取车型id model_id=$(this).attr("modelid"); $.cookie("model_id",model_id); md=$.cookie("model_id"); /***********裸车价格**************/ //获取车型价格 hidCarPrice=$(this).attr("price"); $.cookie('hidCarPrice',hidCarPrice); bname=$.cookie("bname"); sname=$.cookie("sname"); mname=$(this).attr("class"); year=$(this).attr("year"); var htmg=year+''+bname+sname+mname; $("#select_carname2").html(htmg); $("#luochePrice3").attr("value",hidCarPrice); //设置单机后颜色 $(".pic-txt-j li").find("h4").attr("style","color:#666666"); $(".pic-txt-j li").find("p").attr("style","color:#999999"); $(this).find("h4").removeAttr("style"); $(this).find("p").removeAttr("style"); $(this).find("a").css("color","#3B5998"); $(".select-models").hide(); }); } }); }); </script> <script> $(document).ready(function(){ //品牌选择弹窗 $("#bybrand-list ul li a").click(function(){ $(".left-mask1").show(); $(".rand-list").animate({ right:'0' }); $(".rand-list").find("a").on("click",$(this),function(){ $(this).parents(".rand-list").animate({ right:'-3.5rem' }); $(".rand-model-list").animate({ right:'0' }); }); $("#go-rand").click(function(){ $(this).parents(".rand-model-list").animate({ right:'-3.5rem' }); $(".rand-list").animate({ right:'0' }); }); $(".select-models").css("overflow","hidden"); //获取品牌id brand_id=$(this).attr("id"); $.cookie("brand_id",brand_id); //获取品牌名称 brand_name=$(this).attr("class"); $.cookie("bname",brand_name); //获取品牌logo brand_logo=$(this).find("img").attr("src"); var h ='<i class="brand-logo"><img src="'+brand_logo+'" /></i>'; h +='<span class="brand-name">'+brand_name+'</span>'; //$(h).appendTo(".choose-car-name-close"); $(".choose-car-name-close").html(h); var html=""; $.ajax({ url:"series", type:"POST", dateType:"json", data:{"brand_id":brand_id}, success:function(data){ console.log(data); /*********车系弹出层************/ for(i in data){ //alert(i); html +='<div class="tt-small font22 color-gray">'+i+'</div>'; html +='<div class="pic-txt-h">'; html +=' <ul>'; for(k in data[i]){ //alert(k); if ((data[i][k].priceWanYuanMin == null && data[i][k].priceWanYuanMax == null) || (data[i][k].priceWanYuanMin == 0 && data[i][k].priceWanYuanMax == 0) ||(data[i][k].priceWanYuanMin == null && data[i][k].priceWanYuanMax == 0 )||(data[i][k].priceWanYuanMin == 0 && data[i][k].priceWanYuanMax == null )) { ele = '--'; } else if (data[i][k].priceWanYuanMin == null || data[i][k].priceWanYuanMin == 0 || data[i][k].priceWanYuanMin == data[i][k].priceWanYuanMax) { ele = data[i][k].priceWanYuanMax + ''; } else { ele = data[i][k].priceWanYuanMin + '-' + data[i][k].priceWanYuanMax + ''; } html +=' <li id="'+(data[i][k].id)+'" class="'+(data[i][k].name)+'">'; html +=' <a href="javascript:void(0);" class="clearfix">'; html +=' <div class="img-div fl"><img src="' + (data[i][k].logo ? '{{ app.params.uploadFileHost }}' + data[i][k].logo : '{{ path('@web/images/series_none.png') }}') + '"></div>'; html +=' <div class="c-box fl font24">'; html +=' <h4 class="font15 color-black">'+(k)+'</h4>'; html +=' <p class="font14 color-red">'+(ele)+'</p>' html +=' </div>'; html +=' </a>'; html +=' </li>'; } html +=' </ul>'; html +=' </div>'; } //alert(html); //$(html).appendTo("#tt"); //追加方式会有重复出现,使用下面的方式可解决此问题 $("#tt").html(html); $(".pic-txt-h ul li").click(function(){ //获取车系id series_id=$(this).attr("id"); $.cookie("series_id",series_id); //获取车系名称 series_name=$(this).attr("class"); $.cookie("sname",series_name); var ht ='<a class="color-light-gray" id="go-rand"><i class="arrow-icon left-w"></i>'+brand_name+''+series_name+'</a>'; $(".dealer-type").html(ht); var htm=""; $.ajax({ url:"models", type:"POST", dateType:"json", data:{"series_id":series_id}, success:function(datas){ /*********车型弹出层************/ console.log(datas); var keys = []; for(var key in datas){ keys.push(key); } keys = keys.sort(); for(var i=keys.length-1; i>=0;i--){ var dlength=datas[keys[i]].length; var f=0; for(var j=0;j<dlength;j++){ if(datas[keys[i]][j].status ==3){ f=f+1; } } if(f==dlength){ htm +='<div class="year-tt font20 color-gray">'+keys[i]+'款【停售】</div>'; htm +='<ul class="pic-txt-j dfb" id="ts">'; }else{ htm +='<div class="year-tt font20 color-gray">'+keys[i]+'款</div>'; htm +='<ul class="pic-txt-j dfb" id="zs">'; } for(k in datas[keys[i]]){ if (datas[keys[i]][k].guided_price_yuan == null) { ele = '暂无报价'; }else{ ele=datas[keys[i]][k].guidedPriceWanYuan+""; } if(datas[keys[i]][k].year==keys[i]){ //alert(datas[i][k].name); htm +=' <li status="'+datas[keys[i]][k].status+'" modelid="'+datas[keys[i]][k].id+'" year="'+keys[i]+'" price="'+datas[keys[i]][k].guided_price_yuan+'" id="'+datas[keys[i]][k].guidedPriceWanYuan+'万" class="'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】">'; htm +=' <a href="javascript:voil(0);" style="">'; htm +=' <h4 class="font14" style="color:#666666">'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】</h4>'; htm +=' <p class="font14" style="color:#999999">'+(ele)+'</p>'; htm +=' </a>'; htm +=' </li> '; } } htm +=' </ul>'; } $("#aa").html(htm); //折叠显示 $("ul#ts").hide(); $(".year-tt").click(function(){ $(this).next('ul').toggle(); }); /*****************************************/ $(this).parents(".rand-list").animate({ right:'-3.5rem' }); $(".rand-model-list").animate({ right:'0' }); $("#go-rand").click(function(){ $(this).parents(".rand-model-list").animate({ right:'-3.5rem' }); $(".rand-list").animate({ right:'0' }); }); $(".select-models").css("overflow","hidden"); /*****************************************/ //$.cookie("models_id",""); //$.cookie('hidCarPrice',""); $(".dfb li").on('click','',function(){ model_id=$(this).attr("modelid"); $.cookie("model_id",model_id); bd=$.cookie("brand_id"); sd=$.cookie("series_id"); md=$.cookie("model_id"); bname=$.cookie("bname"); sname=$.cookie("sname"); mname=$(this).attr("class"); htmg=year+''+bname+sname+mname; $.cookie("htmg",htmg); $.cookie("view_time",getnowtime()); hidCarPrice=$(this).attr("price"); $.cookie('hidCarPrice',hidCarPrice); //设置单机后颜色 $(".pic-txt-j li").find("h4").attr("style","color:#666666"); $(".pic-txt-j li").find("p").attr("style","color:#999999"); $(this).find("a").css("color","#3B5998"); $(this).find("h4").removeAttr("style"); $(this).find("p").removeAttr("style"); if($.cookie("k")==0){ var url=window.location.href; if(url.indexOf("dk")>0){ location.href='{{path(['dk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else if(url.indexOf("qk")>0){ location.href='{{path(['qk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else{ location.href='{{path(['bx'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; } } $("#select_carname2").html(htmg); $("#luochePrice3").attr("value",hidCarPrice); //选择品牌隐藏弹出窗 $(".select-models").hide(); $(".left-mask1").hide(); $(".rand-list").animate({ right:'-3.5rem' }); $(".rand-model-list").animate({ right:'-3.5rem' }); calcAutoAll(); InitTagStatus(); }); } }); }); } }); }); //热门品牌选择弹窗 $("#brand-hot ul li a").click(function(){ //获取品牌id brand_id=$(this).attr("id"); $.cookie("brand_id",brand_id); //获取品牌名称 brand_name=$(this).attr("class"); $.cookie("bname",brand_name); //获取品牌logo brand_logo=$(this).find("img").attr("src"); var h ='<i class="brand-logo"><img src="'+brand_logo+'" /></i>'; h +='<span class="brand-name">'+brand_name+'</span>'; //$(h).appendTo(".choose-car-name-close"); $(".choose-car-name-close").html(h); var html=""; $.ajax({ url:"series", type:"POST", dateType:"json", data:{"brand_id":brand_id}, success:function(data){ console.log(data); /*********车系弹出层************/ for(i in data){ //alert(i); html +='<div class="tt-small font22 color-gray">'+i+'</div>'; html +='<div class="pic-txt-h">'; html +=' <ul>'; for(k in data[i]){ //alert(k); if ((data[i][k].priceWanYuanMin == null && data[i][k].priceWanYuanMax == null) || (data[i][k].priceWanYuanMin == 0 && data[i][k].priceWanYuanMax == 0) ||(data[i][k].priceWanYuanMin == null && data[i][k].priceWanYuanMax == 0 )||(data[i][k].priceWanYuanMin == 0 && data[i][k].priceWanYuanMax == null )) { ele = '--'; } else if (data[i][k].priceWanYuanMin == null || data[i][k].priceWanYuanMin == 0 || data[i][k].priceWanYuanMin == data[i][k].priceWanYuanMax) { ele = data[i][k].priceWanYuanMax + ''; } else { ele = data[i][k].priceWanYuanMin + '-' + data[i][k].priceWanYuanMax + ''; } html +=' <li id="'+(data[i][k].id)+'" class="'+(data[i][k].name)+'">'; html +=' <a href="javascript:void(0);" class="clearfix">'; html +=' <div class="img-div fl"><img src="' + (data[i][k].logo ? '{{ app.params.uploadFileHost }}' + data[i][k].logo : '{{ path('@web/images/series_none.png') }}') + '"></div>'; html +=' <div class="c-box fl">'; html +=' <h4 class="font15 color-black">'+(k)+'</h4>'; html +=' <p class="font14 color-red">'+(ele)+'</p>'; html +=' </div>'; html +=' </a>'; html +=' </li>'; } html +=' </ul>'; html +=' </div>'; } //alert(html); //$(html).appendTo("#tt"); //追加方式会有重复出现,使用下面的方式可解决此问题 $("#tt").html(html); $(".pic-txt-h ul li").click(function(){ //获取车系id series_id=$(this).attr("id"); $.cookie("series_id",series_id); //获取车系名称 series_name=$(this).attr("class"); $.cookie("sname",series_name); var ht ='<a class="color-light-gray" id="go-rand"><i class="arrow-icon left-w"></i>'+brand_name+''+series_name+'</a>'; $(".dealer-type").html(ht); var htm=""; $.ajax({ url:"models", type:"POST", dateType:"json", data:{"series_id":series_id}, success:function(datas){ /*********车型弹出层************/ console.log(datas); var keys = []; for(var key in datas){ keys.push(key); } keys = keys.sort(); for(var i=keys.length-1; i>=0;i--){ var dlength=datas[keys[i]].length; var f=0; for(var j=0;j<dlength;j++){ if(datas[keys[i]][j].status ==3){ f=f+1; } } if(f==dlength){ htm +='<div class="year-tt font20 color-gray">'+keys[i]+'款【停售】</div>'; htm +='<ul class="pic-txt-j dfr" id="ts">'; }else{ htm +='<div class="year-tt font20 color-gray">'+keys[i]+'款</div>'; htm +='<ul class="pic-txt-j dfr" id="zs">'; } for(k in datas[keys[i]]){ if(datas[keys[i]][k].year=keys[i]){ if (datas[keys[i]][k].guided_price_yuan == null) { ele = '暂无报价'; }else{ ele=datas[keys[i]][k].guidedPriceWanYuan+""; } //alert(datas[i][k].name); htm +=' <li modelid="'+datas[keys[i]][k].id+'" year="'+keys[i]+'" price="'+datas[keys[i]][k].guided_price_yuan+'" id="'+datas[keys[i]][k].guidedPriceWanYuan+'万" class="'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】">'; htm +=' <a href="javascript:voil(0);" style="">'; htm +=' <h4 class="font14" style="color:#666666">'+datas[keys[i]][k].name+''+datas[keys[i]][k].statusTxt+'】</h4>'; htm +=' <p class="font14" style="color:#999999">'+(ele)+'</p>'; htm +=' </a>'; htm +=' </li> '; } } htm +=' </ul>'; } //alert(htm); $("#aa").html(htm); //折叠显示 $("ul#ts").hide(); $(".year-tt").click(function(){ $(this).next('ul').toggle(); }); /*****************************************/ $(this).parents(".rand-list").animate({ right:'-3.5rem' }); $(".rand-model-list").animate({ right:'0' }); $("#go-rand").click(function(){ $(this).parents(".rand-model-list").animate({ right:'-3.5rem' }); $(".rand-list").animate({ right:'0' }); }); $(".select-models").css("overflow","hidden"); /*****************************************/ //$.cookie("models_id",""); //$.cookie('hidCarPrice',""); $(".dfr li").on('click','',function(){ model_id=$(this).attr("modelid"); $.cookie("model_id",model_id); bd=$.cookie("brand_id"); sd=$.cookie("series_id"); md=$.cookie("model_id"); bname=$.cookie("bname"); sname=$.cookie("sname"); mname=$(this).attr("class"); htmg=year+''+bname+sname+mname; $.cookie("htmg",htmg); $.cookie("view_time",getnowtime()); hidCarPrice=$(this).attr("price"); $.cookie('hidCarPrice',hidCarPrice); //设置单机后颜色 $(".pic-txt-j li").find("h4").attr("style","color:#666666"); $(".pic-txt-j li").find("p").attr("style","color:#999999"); $(this).find("a").css("color","#3B5998"); $(this).find("h4").removeAttr("style"); $(this).find("p").removeAttr("style"); if($.cookie("k")==0){ var url=window.location.href; if(url.indexOf("dk")>0){ location.href='{{path(['dk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else if(url.indexOf("qk")>0){ location.href='{{path(['qk'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; }else{ location.href='{{path(['bx'])}}?model_id='+md+'&brand_id='+bd+'&series_id='+sd; } } $("#select_carname2").html(htmg); $("#luochePrice3").attr("value",hidCarPrice); //选择热门品牌隐藏弹出窗 $(".select-models").hide(); $(".left-mask1").hide(); $(".rand-list").animate({ right:'-3.5rem' }); $(".rand-model-list").animate({ right:'-3.5rem' }); calcAutoAll(); InitTagStatus(); }); } }); }); } }); }); }); //获取当前日期时间并格式化 function getnowtime() { var nowtime = new Date(); var year = nowtime.getFullYear(); var month = padleft0(nowtime.getMonth() + 1); var day = padleft0(nowtime.getDate()); var hour = padleft0(nowtime.getHours()); var minute = padleft0(nowtime.getMinutes()); var second = padleft0(nowtime.getSeconds()); var millisecond = nowtime.getMilliseconds(); millisecond = millisecond.toString().length == 1 ? "00" + millisecond : millisecond.toString().length == 2 ? "0" + millisecond : millisecond; return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second; } //补齐两位数 function padleft0(obj) { return obj.toString().replace(/^[0-9]{1}$/, "0" + obj); } </script> {{ js_block_end() }}
  • 相关阅读:
    CentOS7 安装 Mysql5.6.40
    CentOS7 安装 Python3.6.5
    CentOS7 添加新用户并授权 root 权限
    02 常用数据结构
    01 常见算法
    初识 Docker
    glob & fnmatch -- 使用Unix style通配符
    Pillow6 起步
    leetcode70. 爬楼梯 🌟
    leetcode69. x 的平方根 🌟
  • 原文地址:https://www.cnblogs.com/zouke1220/p/8176191.html
Copyright © 2020-2023  润新知