$(function(){ var _apiHead = '/api'; /*服务与支持============================================>*/ // 获取 服务网点 数据 function getAddressbook () { $.get(_apiHead + '/plugin/message_board/api_index/get_addressbook',function(data,status){ if (data.code) { var _data = data.data; var _html_1 = ''; var _html_2 = ''; var _html_3 = ''; var _city = ''; for (var i = 0; i < _data.length; i++) { if (i == 0) { _city = _data[i].company; } else { _city = _data[i].area; } if(_data[i].cid==999){ if(i==0){ _html_1 += '
  • ' + '

    '+_city+'

    \n' + '
    \n' + '

    '+_data[i].name+''+_data[i].mobile+'

    \n' + '

    '+_data[i].address+'

    \n' + '
    \n' + '

    电话:'+_data[i].mobile+'

    \n' + '

    固话:'+_data[i].tel+'

    \n' + '

    邮箱:'+_data[i].email+'

    \n' + '

    地址:'+_data[i].address+'

    \n' + '
    \n' + '
    \n' + '
    \n' + '
  • ' } if(i==1){ _html_1 += '
  • ' + '
    教育业务咨询
    司法业务咨询
    政企业务咨询
    \n' + '
  • ' break; } }else if(_data[i].cid==1000){ _html_2 += '
  • ' + '

    '+_city+'

    \n' + '
    \n' + '

    '+_data[i].name+''+_data[i].mobile+'

    \n' + '

    '+_data[i].address+'

    \n' + '
    \n' + '

    电话:'+_data[i].mobile+'

    \n' + '

    固话:'+_data[i].tel+'

    \n' + '

    邮箱:'+_data[i].email+'

    \n' + '

    地址:'+_data[i].address+'

    \n' + '
    \n' + '
    \n' + '
    \n' + '
  • ' }else if(_data[i].cid==1001){ _html_3 += '
  • ' + '

    '+_city+'

    \n' + '
    \n' + '

    '+_data[i].name+''+_data[i].mobile+'

    \n' + '

    '+_data[i].address+'

    \n' + '
    \n' + '

    电话:'+_data[i].mobile+'

    \n' + '

    固话:'+_data[i].tel+'

    \n' + '

    邮箱:'+_data[i].email+'

    \n' + '

    地址:'+_data[i].address+'

    \n' + '
    \n' + '
    \n' + '
    \n' + '
  • ' } } $('.addressbook-views-1').html(_html_1).find('li').eq(0).addClass('cur').find('.services-network-info').show().siblings('.d-address').hide(); $('.addressbook-views-2').html(_html_2).find('li').eq(0).addClass('cur').find('.services-network-info').show().siblings('.d-address').hide(); $('.addressbook-views-3').html(_html_3).find('li').eq(0).addClass('cur').find('.services-network-info').show().siblings('.d-address').hide(); } else { $('.services-network-views').html(' '); $('.services-network').hide(); } }); } getAddressbook(); // 搜索 服务网点 数据 $('.services-network .public-title-submit').off('click').on('click',function(){ var _keyword = $(this).siblings('.public-title-input').val(); if (_keyword) { $.post(_apiHead + '/plugin/message_board/api_index/search_addressbook',{keyword:_keyword},function(data,status){ if (data.code) { var _data = data.data; var _html = ''; for (var i = 0; i < _data.length; i++) { _html += '
  • ' + '

    '+_data[i].area+'

    \n' + '
    \n' + '

    '+_data[i].name+''+_data[i].mobile+'

    \n' + '

    '+_data[i].address+'

    \n' + '
    \n' + '

    电话:'+_data[i].mobile+'

    \n' + '

    固话:'+_data[i].tel+'

    \n' + '

    邮箱:'+_data[i].email+'

    \n' + '

    地址:'+_data[i].address+'

    \n' + '
    \n' + '
    \n' + '
    \n' + '
  • ' } $('.services-network-views').html(_html).find('li').eq(0).addClass('cur').find('.services-network-info').show().siblings('.d-address').hide(); } }) } else { getAddressbook(); } }); /*关于Ok138大阳城集团娱乐平台=============================================>*/ // 获取 发展历程 数据 function getHistory () { $.get(_apiHead + '/plugin/ava_history/api_index/get_ava_history',function(data,status){ if (data.code) { var _data = data.data; var _html = ''; var _chtml = ''; for (var i = 0; i < _data.length; i++) { var _cur = ''; if (i == 0) { _cur == 'cur'; } var _content = _data[i].content .replace(//g,">"); var _thumb = _data[i].thumbnail || '/themes/ava2020/public/assets/images/historyCitem01.jpg?t=2023'; // 年份 _chtml += '
  • '+_data[i].history_time+'
  • '; // 对应的年份内容 _html += "
  • \n" + "
    \n" + ""+_data[i].history_time+"\n" + "
    \n" + "
    \n" + "

    "+_data[i].history_time+"

    \n" + _content + "
    \n" + "
  • " } $('.historyC-cate-swiper .swiper-wrapper').html(_chtml).find('li').eq(0).addClass('cur'); $('.historyC-swiper .swiper-wrapper').html(_html); if (typeof Swiper != 'undefined') { var $historycCate = $('.historyC-cate-swiper'); var hisClen = $historycCate.find('li').length; var historycInit = $historycCate.find('.cur').index() > 0 ? $historycCate.find('.cur').index() : 0; var perview = {}; $('.historyC-cate-swiper li').eq(historycInit).addClass('cur'); function addSwiperCtrl(slideLen) { if (slideLen <= 4) { perview.normal = slideLen; perview.wap = slideLen; $historycCate.parent().removeClass('add-swiper-ctrl'); } else if (slideLen <= 6) { perview.normal = slideLen; perview.wap = 4; $(window).width() < 768 ? $historycCate.parent().addClass('add-swiper-ctrl') : $historycCate.parent().removeClass('add-swiper-ctrl'); } else { perview.normal = 6; perview.wap = 4; $historycCate.parent().addClass('add-swiper-ctrl'); } }; addSwiperCtrl(hisClen); $(window).resize(function () { addSwiperCtrl(hisClen); }); var historycCateSw = new Swiper('.historyC-cate-swiper', { init: historycInit, prevButton: '.hisCate-prev', nextButton: '.hisCate-next', slidesPerView: perview.normal, breakpoints: { 768: { slidesPerView: perview.wap } } }); $('.historyC-cate-swiper').off('click').on('click','li',function(){ historycSw.slideTo($(this).index()); }); function lockswipers() { if (hisClen <= 4) { historycCateSw.lockSwipes && historycCateSw.lockSwipes(); } else if (hisClen <= 6) { $(window).width() < 768 ? (historycCateSw.lockSwipes && historycCateSw.unlockSwipes()) : (historycCateSw.lockSwipes && historycCateSw.unlockSwipes()); } else { historycCateSw.lockSwipes && historycCateSw.unlockSwipes(); } }; lockswipers(); $(window).resize(lockswipers); var historycSw = new Swiper('.historyC-swiper', { pagination: '.historyC-pages', paginationClickable: true, prevButton: '.historyC-prev', nextButton: '.historyC-next', onSlideChangeStart: function(swiper){ historycCateSw.slideTo(swiper.activeIndex); $('.historyC-cate-swiper li').eq(swiper.activeIndex).addClass('cur').siblings().removeClass('cur'); } }); }; } else { $('.history-views').hide(); } }); } getHistory (); /*解决方案列表===========================================>*/ // 获取 案例地图 全部区域 function getAllcase () { $.get(_apiHead + '/plugin/ava_history/api_case/all_case',function(data,status){ if (data.code) { var _data = data.data; var _html = ''; for (var i = 0; i < _data.length; i++) { var _areaNum = _data[i].area_num || 0; var _schoolNum = _data[i].school_num || 0; _html += '
  • \n' + '
    '+_data[i].area+'
    \n' + '

    '+_areaNum+'  区域  '+_schoolNum+'所  学校

    \n' + '
  • ' } $('.solution-map-views .word-list ul').html(_html); } else { $('.solution-map').hide(); } }); } getAllcase (); });