function loadother(){ if(typeof(campusid) != "undefined" && !isNaN(campusid)) { var data_info = [{"id":"320327","map_x":"121.514015","map_y":"31.258247","pointname":"北外滩来福士校区","pointaddress":"东大名路999号北外滩来福士广场","areaname":"虹口区","areacode":"100031001009"},{"id":"320326","map_x":"121.452601","map_y":"31.373456","pointname":"宝山花园城校区","pointaddress":"杨行镇水产路杨泰路路口2199弄招商花园城","areaname":"宝山区","areacode":"100031001013"},{"id":"320325","map_x":"121.496485","map_y":"31.169289","pointname":"杨新路校区","pointaddress":"杨新路","areaname":"浦东新区","areacode":"100031001015"},{"id":"320324","map_x":"121.516212","map_y":"31.335735","pointname":"杨浦校区","pointaddress":"殷行路1388号悠方广场","areaname":"杨浦区","areacode":"100031001010"},{"id":"320323","map_x":"121.457485","map_y":"31.29203","pointname":"大宁校区","pointaddress":"彭江路602号德必易园","areaname":"静安区","areacode":"100031001006"},{"id":"320322","map_x":"121.426955","map_y":"31.244682","pointname":"曹杨路校区","pointaddress":"曹杨路","areaname":"普陀区","areacode":"100031001007"},{"id":"320321","map_x":"121.418057","map_y":"31.236764","pointname":"环球港校区","pointaddress":"宁夏路","areaname":"普陀区","areacode":"100031001007"},]; //补充其他行政区分组 if(data_info.length>10){ var areaGroupArr=new Array(); var defaultCode=''; for(var i=0;i< data_info.length;i++){ if(data_info[i].id==campusid){ defaultCode=data_info[i].areacode; } var _item=areaGroupArr.find(it=>it.areacode==data_info[i].areacode); if(_item){ _item.count++; }else{ areaGroupArr.push({areacode:data_info[i].areacode,areaname:data_info[i].areaname,count:1,fid:data_info[i].id}); } } $('#areaul li:gt(0)').remove(); for(var i=0;i< areaGroupArr.length;i++){ $('#areaul').append(`
  • ${areaGroupArr[i].areaname}(${areaGroupArr[i].count})
  • `); } } //2023-6-7 简化之前逻辑,对网点列表重新构建数据 var _uls=$('.school-list-container ul'); for(var i=0;i< _uls.length;i++){ var _ul=$(_uls[i]); var _id=_ul.attr('id'); var _code=''; if(/\d+/.test(_id)){ _code=/\d+/.exec(_id)[0]; } _ul.empty(); var _index=0; var visible=_ul.is(':visible'); for(var j=0;j< data_info.length;j++){ if(_code&&data_info[j].areacode!=_code){ continue; } _index++; var _li=`
  • ${_index}${data_info[j].id==campusid?'':''}
    ${data_info[j].pointname} ${data_info[j].pointaddress}
  • `; _ul.append(_li); if(visible){ if(locationPoint && data_info[j].id==campusid){ var overlay = new ComplexCustomOverlay(new BMap.Point(locationPoint.lng, locationPoint.lat), _index, data_info[j].pointname, data_info[j].pointaddress, data_info[j].id); map.addOverlay(overlay); map.centerAndZoom(new BMap.Point(locationPoint.lng, locationPoint.lat), 15); }else{ var overlay = new ComplexCustomOverlay(new BMap.Point(data_info[j].map_x, data_info[j].map_y), _index, data_info[j].pointname, data_info[j].pointaddress, data_info[j].id); map.addOverlay(overlay); } } } if(visible){ var _activeTop=_ul.find('li.active').offset().top; var _parentTop=_ul.offset().top; _ul.scrollTop(_activeTop-_parentTop-_ul.find('li.active').outerHeight()); } } resetJybTabLine(); } }