<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">const baseUrl = 'https://api.aruisi.net/ares'
// 页面适配
const baseSize = 32;
function setRem () {
  const scale = document.documentElement.clientWidth / 7867
  document.documentElement.style.fontSize = (baseSize * Math.min(scale, 2)) + 'px'
}
setRem()
window.onresize = function () {
  setRem()
}

/**
 * 
 * @param {String} d 元素标签名
 * @param {String} v 要添加的特效名
 * @param {String} t 默认add 添加还是删除 add添加 del删除 
 */
function docc (d, v, t='add') {
  switch (t) {
    case 'add':
      if (!$(d).hasClass(v))
      $(d).addClass(v)
      break;
    case 'del':
      if ($(d).hasClass(v)) {
        $(d).removeClass(v)
      }
  }
}

/**
 * 搜索下拉查询
&nbsp;* @param {object} list: 传入城市数据
&nbsp;* @param {string} keyWord: 传入查询的关键字
  * @param {string} attribute: 数据中要检索的字段名
  */
function selectSearch (list, keyWord, attribute = 'name') {
  const reg = new RegExp(keyWord) // 创建正则表达式
  const arr = []
  for (let i = 0; i &lt; list.length; i++) {
    if (reg.test(list[i][attribute])) {
      arr.push(list[i])
    }
  }
  return arr
}

// 监听页面滚动
window.onscroll = function () {
  let currentTop = Math.ceil($(window).scrollTop())
  // 固定导航 返回顶部
  let topNavHeight = Math.ceil($('.top').height() + $('.nav').height())
  if (currentTop &gt; topNavHeight) {
    $('.nav-fixed').addClass('on')
  } else {
    $('.nav-fixed').removeClass('on')
  }
}

$(function () {
  // 快速搜索城市显示隐藏
  $('#city-search input').click(function (event) {
    event.stopPropagation()
    $('#city-search .data-list').show()
    return false
  })
  $(document).click(function (event) {
    var _doc = $('#city-search .data-list')
    if (!_doc.is(event.target) &amp;&amp; _doc.has(event.target).length === 0) {
      $('#city-search .data-list').hide()
    }
  })
  // 产品中心切换
  $('#product .left .menu li a').hover(function () {
    let index = $(this).parent().index()
    $(this).parent().addClass('on').siblings().removeClass('on')
    $('#product .right .list:eq('+ index +')').addClass('on animated fadeIn').siblings().removeClass('on animated fadeIn')
  })
  $('.index-product .logo2').hover(function () {
    $('.index-product .inner-ring').addClass('innerringRotate')
    $('.index-product .outer-ring').addClass('outerringRotate')
    $('.index-product .inner-ring').removeClass('stop')
    $('.index-product .outer-ring').removeClass('stop')
  }, function () {
    $('.index-product .inner-ring').addClass('stop')
    $('.index-product .outer-ring').addClass('stop')
  })
  // 新闻中心切换
  $('#news .tab .box a').hover(function () {
    let index = $(this).index()
    $(this).addClass('on').siblings().removeClass('on')
    $('#news .list .ul:eq('+ index +')').addClass('on').siblings().removeClass('on')
  })
  // 返回顶部
  $('#back-top').click(function () {
    $('html').animate({
      scrollTop: 0
    })
  })
  // 搜索
  $('.search-btn').click(function () {
    window.open(`/cpzx/?keywords=${$('.search-input').val()}`)
    return false
  })
  // 表单提交
  $('.form-save').each(function () {
    let that = this
    $(that).find('.save-btn').click(function () {
      let tha = this
      let xm = $(tha).parents('.form-save').find('[name="xm"]').val()
      let dh = $(tha).parents('.form-save').find('[name="dh"]').val()
      let budget = $(tha).parents('.form-save').find('[name="ys"]').val()
      let content = $(tha).parents('.form-save').find('[name="xq"]').val()
      let cityCode = $(tha).parents('.form-save').find('[name="cityCode"]').val()
      let cityName = $(tha).parents('.form-save').find('[name="cityName"]').val()
      let path = $(tha).parents('.form-save').find('[name="path"]').val()
      if (xm == '') {
        layer.msg('请输入您的姓名', {icon: 7})
        return false
      }
      if (dh == '') {
        layer.msg('请输入您的电话', {icon: 7})
        return false
      }
      if (!/^1[3456789]\d{9}$/.test(dh)) {
        layer.msg('您的电话格式有误', {icon: 7})
        return false
      }
      $(tha).attr('disabled', true)
      $.ajax({
        url: `${baseUrl}/api/v1/api/messageBoard/addMessageBoard`,
        type: 'post',
        data: {
          fullName: xm,
          phone: dh,
          budget: budget,
          content: content,
          cityCode: cityCode,
          cityName: cityName,
          path: path
        },
        success(res) {
          if (res.code == 200) {
            layer.msg(res.msg, {icon: 6})
            $(tha).parents('.form-save').find('[name="xm"]').val('')
            $(tha).parents('.form-save').find('[name="dh"]').val('')
            $(tha).parents('.form-save').find('[name="ys"]').val('')
            $(tha).parents('.form-save').find('[name="xq"]').val('')
            $(tha).parents('.form-save').find('[name="cityCode"]').val('')
            $(tha).parents('.form-save').find('[name="cityName"]').val('')
            $(tha).parents('.form-save').find('[name="path"]').val('')
            $(tha).attr('disabled', false)
            return false
          }
          layer.msg(res.msg, {icon: 5})
          $(tha).attr('disabled', false)
        }
      })
    })
  })

  // 二级导航显示隐藏
  $('.nav .nav-center .list .list-a').hover(function (event) {
    event.stopPropagation()
    $('.nav .sub-nav .sub-nav-center .nav-item').removeClass('flex')
    switch ($(this).attr('data-route')) {
      case '/cpzx':
        $('.nav .sub-nav .sub-nav-center .cpzx').addClass('flex')
        $('.nav .sub-nav').show()
        break;
      case '/yssj':
        $('.nav .sub-nav .sub-nav-center .yssj').addClass('flex')
        $('.nav .sub-nav').show()
        break;
      case '/xwzx':
        $('.nav .sub-nav .sub-nav-center .xwzx').addClass('flex')
        $('.nav .sub-nav').show()
        break;
      case '/gcal':
        $('.nav .sub-nav .sub-nav-center .gcal').addClass('flex')
        $('.nav .sub-nav').show()
        break;
      default:
        $('.nav .sub-nav .sub-nav-center .nav-item').removeClass('flex')
        $('.nav .sub-nav').hide()
    }
  }, function () {})
  $('.nav-fixed .nav-fixed-center .list .list-a').hover(function () {
    $('.nav-fixed .sub-nav .sub-nav-center .nav-item').removeClass('flex')
    switch ($(this).attr('data-route')) {
      case '/cpzx':
        $('.nav-fixed .sub-nav .sub-nav-center .cpzx').addClass('flex')
        $('.nav-fixed .sub-nav').show()
        break;
      case '/yssj':
        $('.nav-fixed .sub-nav .sub-nav-center .yssj').addClass('flex')
        $('.nav-fixed .sub-nav').show()
        break;
      case '/xwzx':
        $('.nav-fixed .sub-nav .sub-nav-center .xwzx').addClass('flex')
        $('.nav-fixed .sub-nav').show()
        break;
      case '/gcal':
        $('.nav-fixed .sub-nav .sub-nav-center .gcal').addClass('flex')
        $('.nav-fixed .sub-nav').show()
        break;
      default:
        $('.nav-fixed .sub-nav .sub-nav-center .nav-item').removeClass('flex')
        $('.nav-fixed .sub-nav').hide()
    }
  }, function () {})
  $(window).hover(function (event) {
    var _doc = $('.nav')
    if (!_doc.is(event.target) &amp;&amp; _doc.has(event.target).length === 0) {
      $('.nav .sub-nav').hide()
    }
    var _doc2 = $('.nav-fixed')
    if (!_doc2.is(event.target) &amp;&amp; _doc2.has(event.target).length === 0) {
      $('.nav-fixed .sub-nav').hide()
    }
  }, function () {})
  /* 网站地图产品中心切换 */
  $('.sitemap-list .sl-center .slc-letter .slcl-list').hover(function() {
    $(this).addClass('on').siblings().removeClass('on')
    $('.sitemap-list .sl-center .slc-product .slc-ul').removeClass('on')
    $('.sitemap-list .sl-center .slc-product .slc-ul:eq('+$(this).index()+')').addClass('on')
  }, function() {})

  // 首页特效
  if (location.pathname == '/') {
    // 数据递增
    var arr = []
    $('#productNumber li').each(function (i, dom) {
      var iDom = $(dom).find('i'), decimals = 0, sum = iDom.data('sum')
      arr.push(new CountUp(iDom.attr('id'), 0, sum, decimals, 5, {
        useEasing: true,
        separator: ''
      }))
      arr[i].start()
    })
    // 滚动事件
    $(window).scroll(function () {
      let currentTop = Math.ceil($(window).scrollTop())
      let currentBottom = Math.ceil(currentTop + $(window).height())
      // 关于阿瑞斯
      let about1 = Math.ceil($('.index-about .about-center .title .en').offset().top)
      if (currentBottom &gt; about1) {
        docc('.index-about .about-center &gt;.title', 'animated fadeInDown')
      }
      let about2 = Math.ceil($('.index-about .about-center .content .cover').offset().top)
      if (currentBottom &gt; about2) {
        docc('.index-about .about-center .content .cover', 'animated fadeInDown')
        docc('.index-about .about-center .content .item .title', 'animated fadeInDown')
      }
      // 产品中心
      let product1 = Math.ceil($('.index-product .product-center').offset().top)
      if (currentBottom &gt; product1) {
        docc('.index-product .product-center .left', 'animated fadeInDown')
        docc('.index-product .product-center .right', 'animated fadeInUp')
        docc('.index-product .outer-ring', 'rotateBig')
        docc('.index-product .inner-ring', 'rotateBig')
      }
      // 我们的优势
      let advantage1 = Math.ceil($('.index-advantage .advantage-center &gt;.title').offset().top)
      if (currentBottom &gt; advantage1) {
        docc('.index-advantage .advantage-center &gt;.title', 'animated fadeInDown')
      }
      let advantage2 = Math.ceil($('.index-advantage .advantage-center .list .ul').offset().top)
      if (currentBottom &gt; advantage2) {
        setTimeout(function () {
          docc('.index-advantage .advantage-center .list .ul li:eq(0)', 'left-in')
        }, 0)
        setTimeout(function () {
          docc('.index-advantage .advantage-center .list .ul li:eq(1)', 'left-in')
        }, 50)
        setTimeout(function () {
          docc('.index-advantage .advantage-center .list .ul li:eq(2)', 'left-in')
        }, 100)
        setTimeout(function () {
          docc('.index-advantage .advantage-center .list .ul li:eq(3)', 'left-in')
        }, 150)
      }
      // 工程案例
      let case1 = Math.ceil($('.index-case .case-center .case-box &gt;.title').offset().top)
      if (currentBottom &gt; case1) {
        docc('.index-case .case-center .case-box &gt;.title', 'animated fadeInDown')
      }
      let case2 = Math.ceil($('.index-case .case-center .case-box .list').offset().top)
      if (currentBottom &gt; case2) {
        $('.index-case .case-center .case-box .list .ul .li').addClass('container')
      }
      // 业务范围
      let business1 = Math.ceil($('.index-business .business-center .title .en').offset().top)
      if (currentBottom &gt; business1) {
        docc('.index-business .business-center .title', 'animated fadeInDown')
      }
      let business2 = Math.ceil($('.index-business .business-center .text').offset().top)
      if (currentBottom &gt; business2) {
        docc('.index-business .business-center .text', 'animated fadeInUp')
      }
      // 新闻中心
      let news1 = Math.ceil($('.index-news .news-center .title .en').offset().top)
      if (currentBottom &gt; news1) {
        docc('.index-news .news-center &gt;.title', 'animated fadeInDown')
      }
      let news2 = Math.ceil($('.index-news .news-center .content .list').offset().top)
      if (currentBottom &gt; news2) {
        $('.index-news .news-center .content .list .ul').each(function () {
          $(this).find('li').show()
          // $(this).find('li').addClass('animated flipInY')
          $(this).find('li').addClass('container')
        })
      }
      // 合作伙伴
      let partner1 = Math.ceil($('.index-partner &gt;.title').offset().top)
      if (currentBottom &gt; partner1) {
        docc('.index-partner &gt;.title', 'animated fadeInDown')
      }
      let partner2 = Math.ceil($('.index-partner .partner-center').offset().top)
      if (currentBottom &gt; partner2) {
        docc('.index-partner .partner-center', 'animated fadeInDown')
      }
    })
  }
  // 领取优惠卷
  let downTime = 1000 * 15
  var setCoupon = setInterval(function () {
    if (!$('.coupon-popup').hasClass('on')) {
      $('.coupons').click()
    } else {
      clearInterval(setCoupon)
    }
  }, downTime)
  $('.coupons').click(function () {
    $('.coupon-popup').addClass('on')
  })
  $('.coupon-popup .mask').click(function () {
    $('.coupon-popup').removeClass('on')
    clearInterval(setCoupon)
    setCoupon = setInterval(function () {
      $('.coupons').click()
    }, downTime)
  })
  if ($('.coupon-popup').hasClass('on')) {
    clearInterval(setCoupon)
  }
  $('.spbi-form .button').click(function () {
    let _this = $(this)
    let _phone = $('.spbi-form [name="phone"]')
    if (_phone.val() == '') {
      layer.msg('请输入您的电话')
      return false
    }
    if (!/1[3456789]\d{9}/.test(_phone.val())) {
      layer.msg('您的电话有误')
      return false
    }
    let cityCode = $('.spbi-form [name="cityCode"]').val()
    let cityName = $('.spbi-form [name="cityName"]').val()
    let path = $('.spbi-form [name="path"]').val()
    _this.attr('disabled', true)
    $.ajax({
      url: `${baseUrl}/api/v1/api/messageBoard/addMessageBoard`,
      type: 'post',
      data: {
        phone: _phone.val(),
        discountContent: '10000起',
        cityCode: cityCode,
        cityName: cityName,
        path: path
      },
      success(res) {
        if (res.code == 200) {
          layer.msg(res.msg, {icon: 6})
          _phone.val('')
          _this.attr('disabled', false)
          $('.coupon-popup').removeClass('on')
          return false
        }
        layer.msg(res.msg, {icon: 5})
        _this.attr('disabled', false)
      }
    })
  })
})</pre></body></html>