$(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' + '

    鐢佃瘽锛欬a href="tel:400-818-5228">'+_data[i].mobile+'

    \n' + '

    鍥鸿瘽锛欬a href="tel:'+_data[i].tel+'">'+_data[i].tel+'

    \n' + '

    閭锛欬a href="mailto:ava@ava.com.cn">'+_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' + '

    鐢佃瘽锛欬a href="tel:400-818-5228">'+_data[i].mobile+'

    \n' + '

    鍥鸿瘽锛欬a href="tel:'+_data[i].tel+'">'+_data[i].tel+'

    \n' + '

    閭锛欬a href="mailto:ava@ava.com.cn">'+_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' + '

    鐢佃瘽锛欬a href="tel:400-818-5228">'+_data[i].mobile+'

    \n' + '

    鍥鸿瘽锛欬a href="tel:'+_data[i].tel+'">'+_data[i].tel+'

    \n' + '

    閭锛欬a href="mailto:ava@ava.com.cn">'+_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' + '

    鐢佃瘽锛欬a href="tel:400-818-5228">'+_data[i].mobile+'

    \n' + '

    鍥鸿瘽锛欬a href="tel:'+_data[i].tel+'">'+_data[i].tel+'

    \n' + '

    閭锛欬a href="mailto:ava@ava.com.cn">'+_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(); } }); /*鍏充簬濂ュ▉浜欭============================================>*/ // 鑾峰彇 鍙戝睍鍘嗙▼ 鏁版嵁 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 (); /*瑙e喅鏂规鍒楄〃===========================================>*/ // 鑾峰彇 妗堜緥鍦板浘 鍏ㄩ儴鍖哄煙 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 (); });