"use strict"; /// /// var GLOBLE = { apiUrl: "http://47.98.134.161:8080/nbWave" }; //鏅€ ajax鏀归€ function ajax(option) { if (Object.prototype.toString.call(option) != "[object Object]") { console.warn(" ajax 鍙傛暟搴旇涓簕}"); return 0; } var url = ""; option.url = option.url || ''; url = option.fixUrl ? option.fixUrl : option.wxUrl ? GLOBLE.wxUrl + option.wxUrl : GLOBLE.apiUrl + option.url; if (option.type == "post" || option.type == "POST") { option.params = JSON.stringify(option.params); } $.ajax({ async: true, timeout: 5000, //瓒呮椂鏃堕棿璁剧疆锛屽崟浣嶆绉 type: option.type || "get", headers: { //璇锋眰澶 Accept: "application/json, text/plain, */*" }, url: url, contentType: option.contentType || "application/json", dataType: "json", //杩斿洖鏁版嵁鏍煎紡涓簀son data: option.params || {}, //浼犲叆宸插皝瑁呯殑鍙傛暟 complete: option.complete }); } //鑾峰彇瀵艰埅鏍忎俊鎭 function getNavInfo(name) { if (name == undefined || name == 'html') { var res = window.location.pathname.match(/(\w+).html/); if (res && res.length == 2) { return res[1]; } else { return null; } } else { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]);return null; } } //鍩虹鍐呭鍔犺浇 (function () { var _id = "__commonlistBL_"; /*澶村熬閮ㄥ姞杞?/ function beforeCreate() { var pageTop = "
\n
\n
\n
\n \n \n \n
\n
    \n \n
\n
\n

\u5168\u56FD\u670D\u52A1\u70ED\u7EBF

\n

400-688-2878

\n

\u5168\u56FD\u670D\u52A1\u70ED\u7EBF

\n

0574-27812345

\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
"; var pageBottom = "
\n
\n
    \n \n
\n
    \n \n\n
\n
    \n \n \n
\n
    \n \n \n
\n
    \n \n \n
\n
\n
\n\n
\u5168\u56FD\u670D\u52A1\u70ED\u7EBF
\n\n

400-688-2878

\n
\u5168\u56FD\u552E\u540E\u7535\u8BDD
\n

400-672-2220

\n

\n \n \n\n \n \n

\n
\n
\n
\n \n
\n

\u5B98\u7F51\u5546\u57CE

\n
\n
\n
\n \n
\n

\u5FAE\u4FE1\u5E73\u53F0

\n
\n
\n\n
\n
\n
\n
\n

\u53CB\u60C5\u94FE\u63A5

\n
    \n
    \n
    \n

    \n

    \n
    \n
    "; $('.document-page').prepend(pageTop); $('.document-page').append(pageBottom); } function created() { //鑾峰彇 棣栭〉瀵艰埅,鍙嬫儏閾炬帴,搴曢儴淇℃伅 var allList = JSON.parse(localStorage.getItem(_id)); console.log("allList", allList); list1(allList[0]); list2(allList[1]); list3(allList[2]); // 瀵艰埅鏍廰ctive var navActive = getNavInfo(); switch (navActive) { case 'index': $('.headerNav li').eq(0).addClass('active'); break; case 'Product': $('.headerNav li').eq(1).addClass('active'); break; case 'ProductDetail': $('.headerNav li').eq(1).addClass('active'); break; case 'Technical': $('.headerNav li').eq(2).addClass('active'); break; case 'TechnicalDetail': $('.headerNav li').eq(2).addClass('active'); break; case 'ClassicCase': $('.headerNav li').eq(3).addClass('active'); break; case 'ClassicCaseDetail': $('.headerNav li').eq(3).addClass('active'); break; case 'UserEvaluation': $('.headerNav li').eq(4).addClass('active'); break; case 'News': $('.headerNav li').eq(5).addClass('active'); break; case 'NewsDetail': $('.headerNav li').eq(5).addClass('active'); break; case 'AboutUs': $('.headerNav li').eq(6).addClass('active'); break; case 'Video': $('.headerNav li').eq(6).addClass('active'); break; case 'JoinUs': $('.headerNav li').eq(7).addClass('active'); break; default: $('.headerNav li').eq(0).addClass('active'); break; } /*澶撮儴瀵艰埅鍔ㄧ敾*/ $(".pageHeader .headerNav").find("li").mouseenter(function () { $(".dropDownList").stop().animate({ opacity: 1, height: "80px" }, 400); var index = $(this).index(); $(".dropDownList").find("dl").eq(index).show().siblings().hide(); if ($(".dropDownList").find("dl").eq(index).find("dd").length === 0) { $(".dropDownList").stop().animate({ opacity: 0, height: "0px" }, 300); } }); $(".pageHeader").mouseleave(function () { $(".dropDownList").stop().animate({ opacity: 0, height: "0px" }, 400); }); //鍦ㄧ嚎鍜ㄨ $('body>div').click(function () { $('.bl-consult-close').click(); }); $('body').append("
    \n
    \n
    X
    \n
    \n
    \n \u5C5E\u4E8E\u4F60\u7684\u4E13\u4E1A\u54A8\u8BE2\n
    \n
    \n only belong to you\n
    \n
    \n \n \n \n
    \n
    \u4E13\u5C5E\u54A8\u8BE2
    \n
    \n
    \n
    \n \n
    \n
    "); var blSumbitFlag = false; $('.bl-consult-sumbit').click(function () { var params = {}; params.userName = $('#blName').val(); params.tel = $('#blPhone').val(); params.msg = $('#blInfo').val().replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi, ''); params.type = '1040'; params.typeName = '鍦ㄧ嚎鍜ㄨ'; if (blSumbitFlag) { alert("涓婁紶涓?); return false; } if (!params.userName) { alert("璇疯緭鍏ユ偍鐨勫鍚?);return false; } if (!/^1[3578][0-9]{9}$/.test(params.tel)) { alert("鐢佃瘽鍙风爜閿欒");return false; } if (!params.msg) { alert("璇疯緭鍏ョ暀瑷€");return false; } blSumbitFlag = true; ajax({ type: 'post', url: '/customer/join-us/save', params: params, complete: function complete(xhr) { var data = xhr.responseJSON || JSON.parse(xhr.responseText); blSumbitFlag = false; console.log(data); alert(data.msg); $('.bl-consult-close').click(); } }); }); $('.bl-consult-btn').click(function () { $('.bl-consult-info').show(); }); $('.bl-consult-close').click(function () { $('#blName').val(''); $('#blPhone').val(''); $('#blInfo').val(''); $('.bl-consult-sumbit').html('涓撳睘鍜ㄨ'); $('.bl-consult-info').hide(); }); ////绂佹鍥剧墖涓嬭浇 //if (window.Event) // document.captureEvents(Event.MOUSEUP); //function nocontextmenu() { // event.cancelBubble = true // event.returnValue = false; // return false; //} //function norightclick(e) { // if (window.Event) { // if (e.which == 2 || e.which == 3) // return false; // } // else // if (event.button == 2 || event.button == 3) { // event.cancelBubble = true // event.returnValue = false; // return false; // } //} //document.oncontextmenu = nocontextmenu; // for IE5+ //document.onmousedown = norightclick; // for all others } // ajax 寮傛鑾峰彇 棣栭〉瀵艰埅,鍙嬫儏閾炬帴,搴曢儴淇℃伅 function get1() { return new Promise(function (resolve, reject) { //鑾峰彇棣栭〉瀵艰埅 ajax({ url: '/customer/index/homeNavigation', complete: function complete(xhr) { // console.log(xhr); var data = xhr.responseJSON || JSON.parse(xhr.responseText); var _list = data.data; // console.log('棣栭〉瀵艰埅', _list); resolve(_list); } }); }); } function list1(_list) { _list.map(function (item) { if (item.name == "棣栭〉") { item.href = 'Index'; } if (item.name == "浜у搧绯诲垪") { item.href = 'Product'; item.subNavigationDto.map(function (e) { e.url = 'ProductDetail'; }); } if (item.name == "鏍稿績鎶€鏈?) { item.href = 'TechnicalDetail'; item.subNavigationDto.map(function (e) { e.url = 'TechnicalDetail'; }); } if (item.name == "缁忓吀妗堜緥") { item.href = 'ClassicCase'; item.subNavigationDto.map(function (e) { e.url = 'ClassicCase'; }); } if (item.name == "瀹㈡埛鍙嶉") { item.href = 'UserEvaluation'; item.subNavigationDto.map(function (e) { e.url = 'UserEvaluation'; }); } if (item.name == "鏂伴椈涓績") { item.href = 'News', item.subNavigationDto.map(function (e) { e.url = 'News'; }); } if (item.name == "鍏充簬鍗氭氮") { item.href = 'AboutUs'; item.subNavigationDto.map(function (e) { if (e.id == '-1') { e.url = 'Video'; } else { e.url = 'AboutUs'; } }); } if (item.name == "鍔犲叆鎴戜滑") { item.href = 'JoinUs'; } }); console.log('淇敼鍚庡鑸爮锛?, _list); var _headerNavStr = ''; var navActive = getNavInfo(); for (var i in _list) { _headerNavStr += "
  • " + _list[i].name + "
  • "; if (_list[i].href == 'Product') { var _subStr = ''; var _btmStr = '
  • 浜у搧绯诲垪
  • '; for (var j in _list[i].subNavigationDto) { var _subList = _list[i].subNavigationDto[j]; _subStr += "
    " + _subList.name + "
    "; _btmStr += "
  • " + _subList.name + "
  • "; } $('.prodectSeriesSubitem').html(_subStr); $('.prodectSeriesBtm').html(_btmStr); } else if (_list[i].href == 'TechnicalDetail') { var _subList2 = _list[i].subNavigationDto[0]; var _subStr2 = "
    " + _subList2.name + "
    "; var _btmStr2 = "
  • \u6838\u5FC3\u6280\u672F
  • " + _subList2.name + "
  • "; $('.coreTechnologySubitem').html(_subStr2); $('.coreTechnologyBtm').html(_btmStr2); } else if (_list[i].href == 'ClassicCase') { var _subStr3 = ''; var _btmStr3 = '
  • 缁忓吀妗堜緥
  • '; for (var _j in _list[i].subNavigationDto) { var _subList3 = _list[i].subNavigationDto[_j]; _subStr3 += "
    " + _subList3.name + "
    "; _btmStr3 += "
  • " + _subList3.name + "
  • "; } $('.classicCaseSubitem').html(_subStr3); $('.classicCaseBtm').html(_btmStr3); } else if (_list[i].href == 'UserEvaluation') { var _subStr4 = ''; for (var _j2 in _list[i].subNavigationDto) { var _subList4 = _list[i].subNavigationDto[_j2]; _subStr4 += "
    " + _subList4.name + "
    "; } $('.userEvaluationSubitem').html(_subStr4); } else if (_list[i].href == 'News') { var _subStr5 = ''; var _btmStr4 = '
  • 鏂伴椈涓績
  • '; for (var _j3 in _list[i].subNavigationDto) { var _subList5 = _list[i].subNavigationDto[_j3]; _subStr5 += "
    " + _subList5.name + "
    "; _btmStr4 += "
  • " + _subList5.name + "
  • "; } $('.newsCenterSubitem').html(_subStr5); $('.newsCenterBtm').html(_btmStr4); } else if (_list[i].href == "AboutUs") { var _subStr6 = ''; var _btmStr5 = '
  • 鍏充簬鍗氭氮
  • '; for (var _j4 in _list[i].subNavigationDto) { var _subList6 = _list[i].subNavigationDto[_j4]; if (_subList6.id == "-1") { _subStr6 += "
    " + _subList6.name + "
    "; _btmStr5 += "
  • " + _subList6.name + "
  • "; } else { _subStr6 += "
    " + _subList6.name + "
    "; _btmStr5 += "
  • " + _subList6.name + "
  • "; } } $('.aboutBolangSubitem').html(_subStr6); $('.aboutBolangBtm').html(_btmStr5); } } $('.headerNav').html(_headerNavStr); } function get2() { return new Promise(function (resolve, reject) { //鑾峰彇鍙嬫儏閾炬帴 ajax({ url: '/customer/index/friednLink', complete: function complete(xhr) { // console.log(xhr); var data = xhr.responseJSON || JSON.parse(xhr.responseText); var _list = data.data.list; // console.log('鍙嬫儏閾炬帴', _list); resolve(_list); } }); }); } function list2(_list) { // 2 鍙嬫儏閾炬帴 var _listStr = ''; if (_list.length > 0) { for (var i in _list) { _listStr += "
  • " + _list[i].name + "
  • "; } $('.Blogroll ul').html(_listStr); } else { $(".Blogroll").hide(); } } function get3() { return new Promise(function (resolve, reject) { //搴曢儴淇℃伅 ajax({ url: '/customer/index/bottomInfo', complete: function complete(xhr) { // console.log(xhr); var data = xhr.responseJSON || JSON.parse(xhr.responseText); var _list = data.data; resolve(_list); } }); }); } function list3(_list) { var _listStr = _list.downInfo + ("" + _list.recordNo + ""); // console.log('搴曢儴淇℃伅:', _list); $('.copyRight .company').html(_list.upInfo); $('.copyRight .recording').html(_listStr); } beforeCreate(); //10s鍐呭叡鐢ㄦ帴鍙d笉鍒锋柊 var _time = dateOver(); if (_time.isOver() || localStorage.getItem(_id) == null || localStorage.getItem(_id) == '') { Promise.all([get1(), get2(), get3()]).then(function (result) { // console.log('棣栭〉瀵艰埅,鍙嬫儏閾炬帴,搴曢儴淇℃伅鍔犺浇瀹屾瘯'); // console.log(result); localStorage.setItem(_id, JSON.stringify(result)); created(); _time.reset(); }); } else { created(); } })(); //璁剧疆鍒嗛〉 function setPageNav(res, limit) { //鑾峰彇Type var Type = getNavInfo('Type') || ''; var ID = getNavInfo('ID') || ''; var _str = ''; var _li = ''; // 鎬婚〉鏁 var _pages = res.pages; // 褰撳墠椤 var _current = Math.floor(res.current / limit) + 1; // 鏈€澶ч〉鐮 var _maxPage = 6; // console.log('鍒嗛〉锛?, res); // console.log('褰撳墠椤?, _current); if (_pages <= _maxPage) { for (var i = 1; i <= _pages; i++) { _li += "
  • " + i + "
  • "; } } else { var _begin = 1; if (_current - Math.ceil(0.5 * _maxPage) > 0) { _begin = _current - Math.ceil(0.5 * _maxPage); } var _end = _begin + _maxPage > _pages ? _pages : _begin + _maxPage; // console.log(_begin,_end); for (var _i = _begin; _i <= _end; _i++) { _li += "
  • " + _i + "
  • "; } } _str = ""; $('.panel-footer').html(_str); } //瀛愰〉杞挱 function setMainBanner() { //瀛愰〉杞挱 ajax({ url: '/customer/news/rotationChart', complete: function complete(xhr) { // console.log(xhr); var data = xhr.responseJSON || JSON.parse(xhr.responseText); var _list = data.data.list; var _listStr1 = '
    '; var _listStr2 = '
    '; // console.log('瀛愰〉杞挱:', _list); for (var i in _list) { if (_list[i].linkUrl.trim().length > 0) { _listStr1 += "\n
    \n
    \n \n \""\n \n
    \n
    "; } else { _listStr1 += "\n
    \n
    \n \""\n
    \n
    "; } _listStr2 += '
    '; } $('.mainBanner').html(_listStr1 + _listStr2 + '
    '); $('.mainBanner .dots dd').eq(0).addClass('active'); banner(); } }); } // 鏃堕棿杩囨湡 function dateOver() { var _id = '__dateOver__'; var _bT = localStorage.getItem(_id) * 1; if (_bT == null || _bT == '') { localStorage.setItem(_id, new Date().getTime()); _bT = localStorage.getItem(_id) * 1; } var step = 10 * 1000; // console.log("BT:", _bT); return { isOver: function isOver() { // console.log('nT:', new Date().getTime()); // console.log('oT:', _bT + step); return _bT + step - new Date().getTime() < 0; }, reset: function reset() { localStorage.setItem(_id, new Date().getTime()); // console.log("BT:", _bT); }, setStep: function setStep(n) { if (typeof n != "number") { console.warn('step涓哄簲璇ユ暟瀛?); } else { step = n; console.log("step:", step); this.reset(); } } }; } //楠岃瘉鐮佸姞杞 function yzm(option) { if (Object.prototype.toString.call(option) != "[object Object]") { console.warn(" ajax 鍙傛暟搴旇涓簕}"); return false; } var _dom; if (option.dom) { _dom = option.dom; } else { _dom = $(option.id); } if (_dom.length != 1) { console.warn('yzm鍑芥暟鍑洪敊'); return false; } var d = _dom.prop('id'); _dom.html("\n
    \n
    \n
    \n \u770B\u4E0D\u6E05\uFF0C\u6362\u4E00\u5F20\n \n \n
    "); var _checkCode = _dom.find("#yzm_checkCode_" + d); var _input = _dom.find("#yzm_input_" + d); var _yzm = { createCode: function createCode() { this.code = ""; //瀛樻斁楠岃瘉鐮 var codeLength = 6; //璁剧疆楠岃瘉鐮侀暱搴︿负6 var codeChars = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //楠岃瘉鐮佽闅忔満鎸戦€夌殑瀛楃 for (var i = 0; i < codeLength; i++) { var charIndex = Math.floor(Math.random() * 52); //闅忔満浜х敓0-52涔嬮棿鐨勬暣鏁 this.code += codeChars[charIndex]; //灏嗛殢鏈烘寚鍚戞垜浠瀹氱殑瀛楃娣诲姞鍒癱ode瀹瑰櫒閲 } _checkCode.html(this.code); }, isLegal: function isLegal() { // 涓嶅垎澶у皬鍐 if (_input.val().toLowerCase() == this.code.toLowerCase()) { // alert("楠岃瘉鐮佹纭?"); option.success && option.success(); } else { alert("楠岃瘉鐮佷笉姝g‘,璇烽噸璇?"); _input.val('').focus(); option.error && option.error(); } } }; _dom.on('click', '#yzm_change_' + d, function () { _yzm.createCode(); }); _dom.on('click', '#yzm_subBtn_' + d, function () { var _flag = true; if (option.beforeLegal) { _flag = option.beforeLegal() === false ? false : true; } console.log('flag', _flag); _flag ? _yzm.isLegal() : ''; }); //鍒濆鍖 _yzm.createCode(); //棰勫厛璁剧疆 option.beforeSet && option.beforeSet(); } // banner.js鍔犺浇 function banner() { var Page = { InitBanner: function InitBanner() { $(".dots").show(); $(".mainBanner .imgs dd").show(); if ($(".mainBanner .imgs dd").length <= 1) { $(".mainBanner .dots").remove(); return; } var imgWidth = $(".mainBanner .imgs dd").width(); var imgCount = $(".mainBanner .imgs dd").length + 2; var firstImg = $(".mainBanner .imgs dd").first().clone(); var lastImg = $(".mainBanner .imgs dd").last().clone(); $(".mainBanner .imgs").prepend(lastImg); $(".mainBanner .imgs").append(firstImg); $(".mainBanner .imgs").css("width", imgWidth * imgCount).css("transform", "translate3d(-" + imgWidth + "px,0,0)"); $(".mainBanner .imgs dd").css("width", imgWidth); //鎵ц鍔ㄧ敾index=绉诲姩鍒板摢涓狪ndex, auto鏄偣鍑昏Е鍙戣繕鏄嚜鍔ㄥ惊鐜噷 var moveLeft = function moveLeft(index, auto) { $(".mainBanner .dots dd").eq(index).addClass("active").siblings().removeClass("active"); if (auto == true && index == 0) { $(".mainBanner .imgs").css("transition-duration", "0s").css("transform", "translate3d(0,0,0)"); } setTimeout(function () { $(".mainBanner .imgs").css("transition-duration", "1s").css("transform", "translate3d(-" + (imgWidth * (index + 1) + "px") + ",0,0)"); }, 30); }; var moveRight = function moveRight(index, auto) { $(".mainBanner .dots dd").eq(index).addClass("active").siblings().removeClass("active"); if (auto == true && index == $(".mainBanner .dots dd").length - 1) { console.log(imgWidth * (imgCount - 1)); $(".mainBanner .imgs").css("transition-duration", "0s").css("transform", "translate3d(-" + imgWidth * (imgCount - 1) + "px,0,0)"); } setTimeout(function () { $(".mainBanner .imgs").css("transition-duration", "1s").css("transform", "translate3d(-" + (imgWidth * (index + 1) + "px") + ",0,0)"); }, 30); }; var Timer = { Obj: new Object(), Open: function Open() { clearInterval(Timer.Obj); Timer.Obj = setInterval(function () { //鑷姩宸︾Щ var currentIndex = $(".mainBanner .dots dd.active").index(); var nextIndex = currentIndex == $(".mainBanner .dots dd").length - 1 ? 0 : currentIndex + 1; moveLeft(nextIndex, true); //鑷姩鍙崇Щ //var currentIndex = $(".mainBanner .dots dd.active").index(); //var nextIndex = currentIndex == 0 ? ($(".mainBanner .dots dd").length - 1) : (currentIndex - 1); //moveRight(nextIndex, true); }, 5000); this.IsClose = false; }, IsClose: true, Close: function Close() { clearInterval(Timer.Obj); this.IsClose = true; } }; Timer.Open(); $("#pageContainer .mainBanner .dots dd").each(function (index, dot) { $(dot).click(function () { if ($(this).hasClass("active")) { return false; } //if ($(".mainBanner .imgs").hasClass("moveing")) { return false; } if (Timer.IsClose == false) { Timer.Close(); setTimeout(function () { Timer.Open(); }, 1000); } var currentIndex = $(".mainBanner .dots dd.active").index(); var nextIndex = index; //鍒ゆ柇鏄宸︾Щ杩樻槸鍙崇Щ if (currentIndex < index) { moveLeft(nextIndex, false); } if (currentIndex > index) { moveRight(nextIndex, false); } }); }); } }; Page.InitBanner(); }