锘縱ar mainUrl = "http://121.199.3.154:8877/xiaoniaoResultData"; var uploadUrl = 'http://121.199.3.154:8877/update'; //<-- Matomo --> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//www.digibird.com.cn/dbstat/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '1']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })(); function getImageUrl(id) { return `${uploadUrl}/files/image/${id}` } function getVideoUrl(id) { return `${uploadUrl}/files/media/${id}` } function getUrlQuery() { var strHref = window.location.href; var urlSplit = strHref.split('?'); var urlQuery = {}; if( urlSplit.length >=2 ){ var strRight = urlSplit[1]; var arrTmp = strRight.split('&') for (var i = 0; i < arrTmp.length; i++) { var arrTemp = arrTmp[i].split('=') urlQuery[arrTemp[0]] = arrTemp[1] } } return urlQuery; } function yearMonthDay(date) { var nowdate = new Date(date).toLocaleDateString().replace(/\//g, '/') return nowdate } function footerHeight(){ if( $(window).height > $("body").height() ){ $(".footer").css({ "marginTop" : $(window).height - $("body").height() }) }else{ $(".footer").css({ "marginTop": 0 }) } } function re(){ if( $(window).height() > $("body").height() ){ $(".footer").css({ paddingTop : $(window).height() - $("body").height() }) }else{ $(".footer").css({ paddingTop : 0 }) } } $(function(){ setInterval(function(){ $(".us-8-m-t .bg").eq(2).addClass("active"); setTimeout(function(){ $(".us-8-m-t .bg").eq(3).addClass("active").siblings(".bg").removeClass("active"); $(".us-8-m-1 div").eq(1).addClass("active").siblings("div").removeClass("active") setTimeout(function(){ $(".us-8-m-t .bg").removeClass("active"); setTimeout(function(){ $(".us-8-m-t .bg").eq(3).addClass("active").siblings(".bg").removeClass("active"); setTimeout(function(){ $(".us-8-m-t .bg").eq(2).addClass("active").siblings(".bg").removeClass("active"); $(".us-8-m-1 div").eq(0).addClass("active").siblings("div").removeClass("active") setTimeout(function(){ $(".us-8-m-t .bg").removeClass("active"); },300) },300) },1000) },300) },500) },4000) $(window).resize(function(){ footerHeight(); }) footerHeight(); //瀵艰埅 var mLi = $(".menu li"); var mBg = $(".m-bg"); var olActive = $(".menu li.active"); var olLeft = olActive.position().left; var sVal = $(".menu li.active").position().left; var mVal = true; $(".m-bg").css({ "left" : olLeft+10, "width": olActive.width() }).show(); mLi.each(function(i) { var This = $(this); $(this).mouseenter(function() { mVal = false; mAnim(This, $(this).position().left); }) $(this).mouseleave(function() { if( !$(this).hasClass("m-t") ){ mAnim(olActive, olLeft); }else{ setTimeout(function(){ if( mVal ){ mAnim(olActive, olLeft); } },50) } }) }) function mAnim(obj, eVal) { //缁撴潫澧炲姞Class鐨勫厓绱?缁撴潫鐨勫€?鍔ㄧ敾閫熷害 mBg.css({ "left": eVal+10, "width": obj.width() }) } (function($, window, document, undefined) {//banner杞挱鍥 "use strict"; var init = function(ele, opt) { this.$element = ele, this.eleUl = this.$element.find("ul"), this.eleLi = this.eleUl.find("li"), this.eleLiW = this.$element.width(), this.eleLiN = this.eleLi.length, this.eleLeft = this.$element.find(".btn-fl"), this.eleRight = this.$element.find(".btn-fr"), this.eleBtn = this.$element.find(".btn-a"), this.eleBtnA = null, this.eleTimer = null, this.eleInow = 0; this.defaults = { "mode": "move", //閫夋嫨鍒囨崲妯″紡move鏄粴鍔╫pacity閫忔槑搴 "tabMode": "hover", //搴曢儴绉诲叆鍒囨崲hover鐐瑰嚮鍒囨崲click "autoPlay": false, //鑷姩婊氬姩 "timerSpeed": 2000, //瀹氭椂鍣ㄩ€熷害閫熷害 "speed": 300, //婊氬姩閫熷害 "width": 0 //榛樿瀹藉害涓?鑷€傚簲瀹藉害 }, this.options = $.extend({}, this.defaults, opt); } init.prototype = { beautify: function() { var This = this; if (This.options.width != 0) { This.eleLiW = This.options.width; } this.eleUl.css({ width: This.eleLiW * This.eleLiN * 2, }) $(window).resize(function() { This.eleLiW = This.$element.width(); This.eleUl.css({ width: This.eleLiW * This.eleLiN * 2, "left": -This.eleLiW * This.eleInow }) This.eleLi.css({ width: This.eleLiW }) }) if (this.eleBtn.length > 0) { //鏄惁澧炲姞涓嬭竟鍒囨崲 if (this.eleBtn.find("a").length == 0) { //鏄惁鏈夐鍏堥鐣欑殑鍒囨崲鎸夐挳 this.eleLi.each(function(i) { if (i == 0) { This.eleBtn.append(''); } else { This.eleBtn.append(''); } }) } this.eleBtnA = this.eleBtn.find("a"); if (this.options.tabMode == "hover") { //搴曢儴鍒囨崲绉诲姩 this.eleBtnA.mouseover(function() { This.eleInow = $(this).index(); This.animate(); }) } else if (this.options.tabMode == "click") { this.eleBtnA.click(function() { This.eleInow = $(this).index(); This.animate(); }) } } if (This.options.mode == "opacity") { This.eleLi.siblings("li").css({ "opacity": "0", "zIndex": "1", "position": "absolute", "top": "0", "left": "0" }).eq("0").css({ "opacity": "1", "zIndex": "2" }); } if (this.options.mode == "move") { //鏄惁鏃犵紳婊氬姩 this.eleUl.append(this.eleUl.html()); this.eleLi = this.eleUl.find("li"); this.eleLi.css({ width: this.eleLiW }) } if (this.eleLeft.length > 0) { //宸﹁竟鍒囨崲鎸夐挳 this.eleLeft.click(function() { This.eleInow--; This.animate(); }) } if (this.eleRight.length > 0) { //鍙宠竟鍒囨崲鎸夐挳 this.eleRight.click(function() { This.eleInow++; This.animate(); }) } if (this.options.autoPlay) { //鏄惁鑷姩婊氬姩 This.autoPlay(); //寮€鍚嚜鍔ㄦ粴鍔 this.$element.mouseover(function() { clearInterval(This.eleTimer); }) this.$element.mouseout(function() { This.autoPlay(); }) } } } init.prototype.autoPlay = function() { var This = this; This.eleTimer = setInterval(function() { This.eleInow++; This.animate(); }, This.options.timerSpeed) } init.prototype.animate = function() { var This = this; if (This.options.mode == "move") { if (This.eleInow > This.eleLiN) { This.eleInow = "1"; This.eleUl.css({ "left": "0" }); } else if (This.eleInow < 0) { This.eleInow = This.eleLiN - 1; This.eleUl.css({ "left": -This.eleLiW * This.eleLiN + 1 }); } if (This.eleInow > This.eleLiN) { This.eleInow = "1"; This.eleUl.css({ "left": "0" }); } else if (This.eleInow < 0) { This.eleInow = This.eleLiN - 1; This.eleUl.css({ "left": -This.eleLiW * This.eleLiN + 1 }); } This.eleUl.stop(false, false).animate({ "left": -This.eleLiW * This.eleInow }, This.options.speed) } else if (This.options.mode == "opacity") { if (This.eleInow > This.eleLiN - 1) { This.eleInow = "0"; } else if (This.eleInow < 0) { This.eleInow = This.eleLiN - 1; } This.eleLi.siblings("li").css({ "opacity": "0", "zIndex": "1" }).eq(This.eleInow).css({ "z-index": "2" }).stop(false, false).animate({ "opacity": "1" }, This.options.speed) } if (this.options.tabMode == "hover" || this.options.tabMode == "click") { if (This.eleInow == This.eleLiN) { This.eleBtnA.removeClass("active").eq(0).addClass("active"); } else { This.eleBtnA.removeClass("active").eq(This.eleInow).addClass("active"); } } } $.fn.myBanner = function(options) { var Init = new init(this, options); return Init.beautify(); } })(jQuery, window, document); // 鍑哄満鍔ㄧ敾 var anim = $(".anim"); setTimeout(function(){//瑙勯伩椤甸潰鍔犺浇涓嶅畬鏁撮珮搴﹁幏鍙栧紓甯 $(window).scroll(function() { roll(); }) $(window).resize(function() { roll(); }) roll(); },6) function roll() { //婊氬姩鎵ц鍔ㄧ敾 var oHeight = $(window).height(); var ScrVal = $(window).scrollTop(); anim.each(function(i) { if (ScrVal + oHeight > anim.eq(i).offset().top + 100 ){ anim.eq(i).addClass("anim-show"); } }) } //鍒嗕韩 $("body").on("click", ".bds_qzone", function() { //鍒嗕韩鍒癚Q绌洪棿 window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" + window.location.href + "&title=" + document.title + "&desc=&summary=&site="); }) $("body").on("click", ".bds_tsina", function() { //鍒嗕韩鍒版柊娴井鍗 window.open("http://service.weibo.com/share/share.php?title=" + document.title + "&url=" + window.location.href); }) $("body").on("click", ".bds_sqq", function() { //鍒嗕韩鍒癚Q window.open("http://connect.qq.com/widget/shareqq/index.html?url=" + window.location.href + "&title=" + document.title); }) $("body").on("click", ".bds_weixin", function() { //鍒嗕韩鍒板井淇 if( $(".pages-val").val() != undefined ){ $("#dui-share").remove(); $("body").append('
鍒嗕韩鍒板井淇℃湅鍙嬪湀

鎵撳紑寰俊锛岀偣鍑诲簳閮ㄧ殑鈥滃彂鐜扳€濓紝
浣跨敤鈥滄壂涓€鎵€濆嵆鍙皢缃戦〉鍒嗕韩鑷虫湅鍙嬪湀銆侟/p>

'); $("#phone-url").qrcode({ //浜岀淮鐮佺敓鎴 render: "image", text: window.location.href }); }else{ $("#dui-share").remove(); $("body").append('
灏忛笩鍏紬鍙饵/span>

鍏虫敞鑾峰彇鏇村璧勮銆侟/p>

'); } }) $("body").on("click", "#exit-dui", function() { //鍒嗕韩鍒板井淇″叧闂 $("#dui-share").remove(); }) // 搴曢儴鐐瑰嚮鍏虫敞寰俊鍏紬鍙 $(".f_bds_weixin").click(function(){ $("#dui-share").remove(); $("body").append('

鎵撳紑寰俊锛岀偣鍑诲簳閮ㄧ殑鈥滃彂鐜扳€濓紝
浣跨敤鈥滄壂涓€鎵€濆嵆鍙叧娉ㄥ皬楦熷叕浼楀彿銆侟/p>

'); }) $(".menu-2").click(function(){//瀵艰埅鐐瑰嚮鏇村 if( !$(this).hasClass("menu-2-show") ){ $(this).addClass("menu-2-show"); $(".menu-2-down").show(); }else{ $(this).removeClass("menu-2-show"); $(".menu-2-down").hide(); } }) var mT = $(".m-t"); var mL = $(".m-l"); var mLli = $(".m-l li"); mT.each(function(i){ $(this).mouseover(function(){ mL.addClass("m-l-show"); mLli.hide().eq(i).show(); }) $(this).mouseout(function(){ mL.removeClass("m-l-show"); }) mL.mouseenter(function(){ mVal=false; mT.addClass("active") mL.addClass("m-l-show"); }) mL.mouseleave(function(){ mVal=true; mAnim(olActive, olLeft); mL.removeClass("m-l-show"); }) }) $(".back-top").click(function(){//杩斿洖椤堕儴 $("body,html").stop(true,false).animate({ "scrollTop" : "0" },500) }) // 璧勮川涓撳埄 var pImg = $(".p-img"); pImg.click(function(){ $("body").addClass("body-photo-show"); $(".mark-photo img").attr({"src":$(this).find("img").attr("max-src")}); }) $(".mark-p-box").click(function(){ $("body").removeClass("body-photo-show"); }) $(window).resize(function(){ qua(); }) qua(); function qua(){ if( $(window).width() > 600 ){ $(".mark-photo img").css({ width : "auto", height : $(window).height()*.98 }); }else{ $(".mark-photo img").css({ width : "auto", height : $(window).height()*.98 }); } } // 鏈嶅姟涓嬭浇 $(".down-a").click(function(){ var DownLi = $(this).parent("li"); var DownContM = $(this).siblings(".down-cont").find(".down-cont-m"); if( DownLi.hasClass("active") ){ DownLi.removeClass("active"); $(this).siblings(".down-cont").css({ "height" : "0" }); }else{ $(".down-cont").css({ "height" : "0" }) $(this).siblings(".down-cont").css({ "height" : DownContM.height()+31 }); DownLi.addClass("active").siblings("li").removeClass("active"); } }) // H绯诲垪浜у搧椤 var psTop = $(".ps-3-2"); var psDragBox = $(".ps-3-drag-box"); var psDrag = $(".ps-3-drag"); if ($(".ps-3-drag").html() != undefined ) { psTop.css({ "width" : $(window).width() }) psDragBox.css({ "left" : $(window).width() }) psDragBox.mousedown(function(){ $(window).bind("mousemove",function(ev){ var evX = ev.clientX || event.clientX; if( evX < 0 ){ evX = 0; }else if ( evX > $(window).width() ){ evX = $(window).width(); } psTop.css({ "width" : evX }) psDragBox.css({ "left" : evX }) ev.stopPropagation(); return false; }) }) $(window).on("mouseup",function(){ $(window).unbind("mousemove"); }) } $(".ps-3-fl").click(function(){ psTop.stop(true,true).animate({ "width" : 0 },200) psDragBox.stop(true,true).animate({ "left" : 0 },200) }) $(".ps-3-fr").click(function(){ psTop.stop(true,true).animate({ "width" : $(window).width() },200) psDragBox.stop(true,true).animate({ "left" : $(window).width() },200) }) $(window).resize(function(){ psTop.css({ "width" : $(window).width() }) psDragBox.css({ "left" : $(window).width() }) }) // H绯诲垪浜у搧椤礒nd $(window).resize(function(){ if( $(window).width() > 982 ){ $(".menu-2-down").hide(); $(".menu-2").removeClass("menu-2-show"); } }) VisualTxt($(".dmis-1-4"), 50, 6); //瑙嗚宸 VisualTxt($(".dmis-1-5"), 200, 6); //瑙嗚宸 function VisualTxt(obj, speed, dir) { $(window).mousemove(function(e) { var x = e.clientX, y = e.clientY, clientWidth = $(window).width(), clientHeight = $(window).height(); if (dir == "5") { obj.css({ "transform": "translate3d(" + (-x - clientWidth / 2) / speed + "px," + -(y - clientHeight / 2) / 40 + "px, 0px)" }); } else if (dir == "1") { obj.css({ "transform": "translate3d(" + (x - clientWidth / 2) / speed + "px," + (y - clientHeight / 2) / 40 + "px, 0px)" }); } else if (dir == "6") { obj.css({ "transform": "translate3d(" + (x - clientWidth / 2) / speed + "px," + "0px, 0px)" }); } else { obj.css({ "transform": "translate3d(" + (x - clientWidth / 2) / speed + "px," + -(y - clientHeight / 2) / 40 + "px, 0px)" }); } }); } // 瀵艰埅鏄剧ず涓庨殣钘 var NavHeight = false; $(window).scroll(function(){ Nav(); }) Nav(); function Nav(){ if( $(window).scrollTop() > $(window).height() && NavHeight == false ){ $("body").addClass("nav-hide"); NavHeight = true; }else if($(window).scrollTop() <= $(window).height() && NavHeight == true ){ NavHeight = false; $("body").removeClass("nav-hide"); } } $(window).mousewheel(function(e, delta) { //婊氬姩鏉″悜涓婃粴鍔 p = $(window).scrollTop(); if( p > $(window).height() ){ if (delta < 0) { $("body").addClass("nav-hide"); } else { //涓婃粴 $("body").removeClass("nav-hide"); } } }) // 鏃犵紳鎷兼帴鍣⊿tart $(".se-3-1 li a").click(function(){ var index = $(this).parents("li").index(); $(".se-3-2 li").hide().eq(index).show(); $(".se-3-1 a").removeClass("active"); $(this).addClass("active"); }) // 鏃犵紳鎷兼帴鍣‥nd if( $(".opacity-bg").html() != undefined ){ var oInow1= 0; var oInow2 = 0; opacityAnimate1(); opacityAnimate2(); function opacityAnimate1(){ if( oInow1 > $(".op-1 li").length-1 ){ oInow1 = 0; } $(".op-1 li").eq(oInow1).animate({ "opacity" : 1 },500).siblings("li").animate({ "opacity" : 0 },500) } function opacityAnimate2(){ if( oInow2 > $(".op-2 li").length-1 ){ oInow2 = 0; } $(".op-2 li").eq(oInow2).animate({ "opacity" : 1 },1000).siblings("li").animate({ "opacity" : 0 },1000) } setInterval(function(){ oInow1++; oInow2++; opacityAnimate1(); opacityAnimate2(); },2000) } $(window).resize(function(){ re(); }) re(); $('.change-1 .btn-box a').click(function(){ $(this).siblings('a').removeClass('active'); $(this).addClass('active'); $(this).parents('.change-1').find('.one-box').removeClass('active').eq($(this).index()).addClass('active') }) var swiper = new Swiper('#swiper-compression', { pagination: '.swiper-icon', loop:true, autoplay: 5000, paginationClickable:true }); var swiperObj = new Swiper('.slide-avcent-box', { loop:true, nextButton: '.next-btn', prevButton: '.last-btn', onSlideChangeStart:(swiper)=>{ let index = swiper.activeIndex-1; console.log(index) let length = $('.avcnet-2-box .list-box .one-box').length; // if( index < 0 ){ // index = length; // } if( swiper.activeIndex < 0 ){ index = length; } if( swiper.activeIndex > length){ index = 0; } $('.avcnet-2-box .list-box .one-box').removeClass('active'); $('.avcnet-2-box .list-box .one-box').eq(index).addClass('active'); $('.avcnet-2-box .list-des-box .one-box').hide(); $('.avcnet-2-box .list-des-box .one-box').eq(index).show(); } }); $('.avcnet-2-box .list-box ').on("click",'.one-box',function(){ let index = $(this).index()+1; swiperObj.slideTo(index) }) $('.swiper-uni-box .uni-tag a').click(function(){ // var index = $(this).parents("li").index(); // $(".se-3-2 li").hide().eq(index).show(); // $(".se-3-1 a").removeClass("active"); // $(this).addClass("active"); console.log($(this).index()) var index = $(this).index(); $(this).addClass('active').siblings('a').removeClass('active'); // $(this).parents('.swiper-uni-box'). }) $('.swiper-uni-box').each(function(i){ var oneItem = $(this); $(this).find('.swiper-slide').eq(0).addClass('show'); $(this).find('.uni-tag a').eq(0).addClass('active'); var length = oneItem.find('.swiper-slide').size(); var index = 0; $(this).find('.uni-tag a').click((function(){ index = $(this).index(); $(this).addClass('active').siblings('a').removeClass('active'); oneItem.find('.swiper-slide').eq(index).addClass('show').siblings('.swiper-slide').removeClass('show') })) $(this).find('.swiper-prev').click(()=>{ console.log(index) index++; if( index >= length ){ index=0; } oneItem.find('.uni-tag a').eq(index).addClass('active').siblings('a').removeClass('active'); oneItem.find('.swiper-slide').eq(index).addClass('show').siblings('.swiper-slide').removeClass('show') }) $(this).find('.swiper-next').click(()=>{ index--; if( index < 0){ index=length-1; } oneItem.find('.uni-tag a').eq(index).addClass('active').siblings('a').removeClass('active'); oneItem.find('.swiper-slide').eq(index).addClass('show').siblings('.swiper-slide').removeClass('show') }) }) $('.swiper-uni-2-box').each(function(i){ var oneItem = $(this); $(this).find('.swiper-slide').eq(0).addClass('show'); $(this).find('.uni-tag a').eq(0).addClass('active'); $(this).find('.uni-tag a').click((function(){ var index = $(this).index(); $(this).addClass('active').siblings('a').removeClass('active'); oneItem.find('.swiper-slide').eq(index).addClass('show').siblings('.swiper-slide').removeClass('show') })) // $(this).find('.swiper-next') }) $('.swiper-uni-3-box').each(function(i){ var swiperObj3 = new Swiper($(this), { loop:true, nextButton:$(this).find('.swiper-prev') , prevButton: $(this).find('.swiper-next'), onSlideChangeStart:(swiper)=>{ $(this).find('.swiper-slide-duplicate .anim').addClass('anim-show') let length = $(this).find('.uni-tag a').length; let index = swiper.activeIndex-1; if( swiper.activeIndex < 0 ){ index = length-1; } if( swiper.activeIndex > length){ index = 0; } // let length = $('.avcnet-2-box .list-box .one-box').length; // // if( index < 0 ){ // // index = length; // // } // if( swiper.activeIndex < 0 ){ // index = length; // } // if( swiper.activeIndex > length){ // index = 0; // } // $('.avcnet-2-box .list-box .one-box').removeClass('active'); // $('.avcnet-2-box .list-box .one-box').eq(index).addClass('active'); // $('.avcnet-2-box .list-des-box .one-box').hide(); // $('.avcnet-2-box .list-des-box .one-box').eq(index).show(); $(swiper.wrapper['0']).siblings('.uni-tag').find('a').removeClass('active').eq(index).addClass('active'); } }); $(this).find('.uni-tag').on("click",'a',function(){ let index = $(this).index()+1; swiperObj3.slideTo(index) }) }) $(".m-menu-btn").click(function(){//瀵艰埅鐐瑰嚮鏇村 if( !$(this).hasClass("m-menu-btn-show") ){ $(this).addClass("m-menu-btn-show"); $(".m-menu-down-box").show(); }else{ $(this).removeClass("m-menu-btn-show"); $(".m-menu-down-box").hide(); } }) let designW = 750; let font_rate = 100; document.getElementsByTagName("html")[0].style.fontSize = document.body.offsetWidth / 750 * 100 + "px"; document.getElementsByTagName("body")[0].style.fontSize = document.body.offsetWidth / 750 * 100 + "px"; $(window).resize(()=>{ if( $(window).width() > 750 ){ $(".m-menu-down-box").hide(); $(".m-menu-btn").removeClass("m-menu-btn-show"); } document.getElementsByTagName("html")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px"; document.getElementsByTagName("body")[0].style.fontSize = document.body.offsetWidth / designW * font_rate + "px"; }) // $(".anim-fast").addClass('anim-show'); // $(".m-menu-btn") var animFast = $(".anim-fast"); setTimeout(function(){//瑙勯伩椤甸潰鍔犺浇涓嶅畬鏁撮珮搴﹁幏鍙栧紓甯 $(window).scroll(function() { rollFast(); }) $(window).resize(function() { rollFast(); }) rollFast(); },6) function rollFast() { //婊氬姩鎵ц鍔ㄧ敾 var oHeight = $(window).height(); var ScrVal = $(window).scrollTop(); animFast.each(function(i) { if (ScrVal + oHeight > animFast.eq(i).offset().top + 120 ){ animFast.eq(i).addClass("anim-show"); } }) } $("#el-form input[name='name']").val(localStorage.getItem('downloadName')); $("#el-form input[name='phone']").val(localStorage.getItem('downloadPhone')); $("#el-form input[name='companyName']").val(localStorage.getItem('downloadCompanyName')); $("#el-form input[name='city']").val(localStorage.getItem('downloadCity')); var fileUrl=""; var fileName=""; $(".down-file-box").click(function(){ var This = $(this); fileUrl = This.attr('file-url'); fileName = This.attr('download'); $(".dialog-box").show(); }) $(".dialog-close").click(function(){ $(".dialog-box").hide(); }) $("#download-submit-btn").click(function(){ let name = $("#el-form input[name='name']").val(); let phone = $("#el-form input[name='phone']").val(); let companyName = $("#el-form input[name='companyName']").val(); let city = $("#el-form input[name='city']").val(); if( name === "" ){ alert('璇峰~鍐欏悕绉?) return; } if( phone === "" ){ alert('璇峰~鍐欐墜鏈哄彿') return; } if (!/^1[3456789]\d{9}$/.test(phone)) { alert('鎵嬫満鍙烽敊璇?) return; } if( companyName === "" ){ alert('璇峰~鍐欏叕鍙稿悕') return; } if( city === "" ){ alert('璇峰~鍐欏煄甯傚悕') return; } console.log('dd') /* $.ajax({ dataType: "json", contentType : 'application/json',//娣诲姞杩欏彞璇 type:"post",url:"http://121.199.3.154:8877/xiaoniaoResultData/download/save",data:JSON.stringify({ name, phone, companyName, city, fileName }),success:function(result){ localStorage.setItem('downloadName',name); localStorage.setItem('downloadPhone',phone); localStorage.setItem('downloadCompanyName',companyName); localStorage.setItem('downloadCity',city); downFile(fileUrl,fileName); $(".dialog-box").hide(); }}); */ localStorage.setItem('downloadName',name); localStorage.setItem('downloadPhone',phone); localStorage.setItem('downloadCompanyName',companyName); localStorage.setItem('downloadCity',city); downFile(fileUrl,fileName); $(".dialog-box").hide(); }) function downFile(url,fileName){ var a = document.createElement('a'); a.href = url; a.target = '_blank'; a.download=fileName document.body.appendChild(a); a.click(); document.body.removeChild(a); } })