123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- function IEVersion() {
- var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
- var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
- var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
- var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
- if(isIE) {
- var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
- reIE.test(userAgent);
- var fIEVersion = parseFloat(RegExp["$1"]);
- if(fIEVersion == 7) {
- return 7;
- } else if(fIEVersion == 8) {
- return 8;
- } else if(fIEVersion == 9) {
- return 9;
- } else if(fIEVersion == 10) {
- return 10;
- } else {
- return 6;//IE版本<=7
- }
- } else if(isEdge) {
- return 'edge';//edge
- } else if(isIE11) {
- return 11; //IE11
- }else{
- return -1;//不是ie浏览器
- }
- }
- // console.info(IEVersion());
- IEVersion();
- if (IEVersion() != '-1' && IEVersion() != 'edge') {
- var IEtips = document.getElementById('tips');
- // IEtips.classList.remove('tips_none');
- IEtips.style.display = "block";
- }
- function scrollSideIconHide(el) {
- var sNode = $('#sideIcon')
- var sTop = '50'
- var scrollBox = $(el)
- scrollBox.on('scroll', function () {
- var nTop = scrollBox.scrollTop()
- if (nTop > sTop) {
- sNode.addClass('fadeOutRight')
- } else {
- sNode.removeClass('fadeOutRight')
- }
- })
- }
- $(function () {
- scrollSideIconHide()
- localStorage.removeItem('kf-shunt-data')
- })
- /**
- * 全局客服事件拦截(用于旧客服业务 open-customer 改造)
- */
- $(window).on('click', function (e) {
- var openDom = $(e.target).hasClass('open-customer') || $(e.target).parents().hasClass('open-customer')
- if (openDom) {
- loginCom.checkCustomerService()
- $(".icon-badge-number").removeAttr('data-badge-number');
- var href = window.location.href;
- var sourceStr =""
- if (href.indexOf("/front/structed/pc_index.html?source=baidusem")>-1){//结构化数据
- sourceStr="结构化数据-pc-baidusem";
- }else if (href.indexOf("/bid/pc/page/bidfile_list?source=baidusem")>-1){//招标文件解读
- sourceStr="招标文件解读-pc-baidusem";
- }
- if(sourceStr!=""){ _hmt && _hmt.push(['_trackEvent',sourceStr, 'click', '咨询客服'])};
- try {
- if ($(e.target).attr('id') === 'go-customer-1' || $(e.target).attr('id') === 'go-customer-2') {
- } else {
- $.get('/front/pc/sobot?t='+new Date().getTime() + '&q=右侧客服')
- _hmt && _hmt.push(['_trackEvent','客服', 'click', '右侧客服']);
- }
- } catch (e) {
- $.get('/front/pc/sobot?t=' + new Date().getTime() + '&q=右侧客服问题测试')
- _hmt && _hmt.push(['_trackEvent','客服', 'click', '右侧客服问题测试']);
- console.log('未初始化百度统计')
- }
- }
- })
- $(function () {
- // 接收聊天子页面发来的消息
- window.addEventListener('message', function(event) {
- // 子页面发送来得消息是关闭或是全屏操作时 关闭当前侧边栏会话窗口
- if (event.data && event.data.action) {
- if (event.data.action === 'close') {
- $('#mini-custom').removeAttr('data-src').hide()
- $('#custom-iframe').remove()
- } else if (event.data.action ==='fullScreen') {
- var customerUrl = $('#mini-custom').attr('data-src')
- $('#mini-custom').hide(function(){
- $('#custom-iframe').remove()
- $('#mini-custom').removeAttr('data-src')
- window.open(customerUrl + '&mini=1')
- })
- }
- }
- }, false);
- function getDomScreenHeight () {
- var clientHeight = [document.documentElement.clientHeight, document.body.clientHeight, window.screen.availHeight, window.screen.height]
- var minH = Math.min.apply(null, clientHeight)
- return minH
- }
- $(window).scroll(function () {
- // 侧边栏显示控制
- if (typeof goBackTop_disBottom !== 'number') {
- var metaValue = document.getElementsByTagName('meta')['data-backside']
- if (metaValue) {
- goBackTop_disBottom = Number(metaValue.getAttribute('content'))
- } else {
- goBackTop_disBottom = 484
- }
- }
- var sideDom = $("div[data-backside]")
- if (sideDom.attr('data-backside').length < 1) {
- sideDom.attr('data-backside', sideDom.css('bottom'))
- }
- var hHeight = $("html").height()
- hHeight = hHeight < $(document).height() ? $(document).height() : hHeight
- var scrollDisBottom = hHeight - getDomScreenHeight() - $(window).scrollTop()
- if (scrollDisBottom <= goBackTop_disBottom) {
- sideDom.css({
- bottom: (goBackTop_disBottom - scrollDisBottom) + 'px'
- })
- } else {
- sideDom.css({
- bottom: sideDom.attr('data-backside')
- })
- }
- // 返回顶部显示控制
- if ($(window).scrollTop() > 150) {
- $("div[data-backtop]").show().prev().removeClass('fix-b-w')
- } else {
- $("div[data-backtop]").hide().prev().addClass('fix-b-w')
- }
- })
- /* 返回顶部 */
- function goBackTop(e) {
- var setting = {
- top: 0,
- height: $(window).scrollTop() / 300 * 10
- };
- var test = setInterval(function () {
- var height = $(window).scrollTop()
- if (height === setting.top) {
- document.querySelector('div[data-backtop]').style.display = 'none'
- return clearInterval(test);
- }
- $(window).scrollTop($(window).scrollTop() - setting.height);
- }, 10);
- }
- $("div[data-backtop]").off('click').on('click', goBackTop)
- // 显示帮助弹框
- $('#go-customer-4').click(function(){
- $('.right-side-box .help-slide').fadeIn()
- })
- // 关闭帮助弹框
- $('.right-side-box .help-close').off('click').on('click', function(e) {
- e.stopPropagation()
- $(this).parents('.help-slide').fadeOut()
- })
- // 客服
- $('.help-slide-kf').off('click').on('click', function(e) {
- e.stopPropagation()
- $('.right-side-box .kf-phone').removeClass('kf-phone-afternone')
- $('.right-side-box .kf-phone').toggle()
- })
- // 右侧图片客服
- $('.right-side-pop').hover(function(e) {
- $('.right-side-box .kf-phone').addClass('kf-phone-afternone')
- $('.right-side-box .kf-phone').show()
- },function() {
- $('.right-side-box .kf-phone').hide()
- })
- });
- ;(function(){
- // 动态设置copyright
- function setCopyRightForBottom (url) {
- var host = url || location.host
- var nowCopyRightInfo = {
- rule: '',
- icp: ''
- }
- var copyRightMap = [
- {
- rule: 'jianyu360.cn',
- icp: '京ICP备2021020018号-1'
- },
- {
- rule: 'jianyu360.com.cn',
- icp: '京ICP备2021020018号-2'
- },
- {
- rule: 'jianyubiaoxun.cn',
- icp: '京ICP备2021020018号-3'
- },
- {
- rule: 'jianyu360.com',
- icp: '京ICP备2021020018号-4'
- }
- ]
- for(let i=0;i<copyRightMap.length;i++){
- if (host.indexOf(copyRightMap[i].rule) !== -1) {
- nowCopyRightInfo = copyRightMap[i]
- break
- }
- }
- var copyright = '©2015-' + new Date().getFullYear() + ' ' +nowCopyRightInfo.rule+ ' 版权所有 | ' + '<a style="color: inherit; font-size: inherit;" href="https://beian.miit.gov.cn/" target="_blank">' + nowCopyRightInfo.icp + '</a>'
- $('.copyright').html(copyright)
- }
- setCopyRightForBottom()
- $(".j-bottom .jy_province font").click(function(){
- var scope = $(this).text();
- areasearch(scope);
- })
- $(".j-bottom .jy_classify font").click(function(){
- var stype = $(this).attr("data-value");
- stypesearch(stype);
- })
- })();
- function zbsqClose(){
- $("#bidcommunity").modal("hide");
- }
- //
- function areasearch(scope){
- $("#bottomform").remove();
- $(".j-bottom").append('<form id="bottomform" action="/jylab/supsearch/index.html" method="post" class="hide" ><input type="hidden" name="area" value="'+scope+'"></form>');
- $("#bottomform").submit();
- }
- //
- function stypesearch(stype){
- $("#bottomform").remove();
- $(".j-bottom").append('<form id="bottomform" action="/jylab/supsearch/index.html" method="post" class="hide" ><input type="hidden" name="subtype" value="'+stype+'"></form>');
- $("#bottomform").submit();
- }
- //
- function zbSeatch(id){
- var pathname = window.location.pathname;
- if (pathname.indexOf("supsearch/index.html")>0){
- $("#"+id).attr("action",pathname);
- }
- $("#"+id).submit();
- }
- $("#zbSeatchB [name='keywords']").on("input propertychange",function(){
- if($(this).val().length > 0){
- $("#b-clear").show();
- }else{
- $("#b-clear").hide();
- }
- });
- $("#b-clear").click(function(){
- $("#b-clear").hide();
- $("#zbSeatchB [name='keywords']").val("").focus();
- });
- var tjhost = location.host;
- var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1261815924'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D1261815924' type='text/javascript'%3E%3C/script%3E"));
- setTimeout(function(){
- $("#cnzz_stat_icon_1261815924 a").text("");
- },1000)
|