|
@@ -734,146 +734,136 @@ $(function () {
|
|
|
})
|
|
|
|
|
|
// 渲染列表
|
|
|
- function xrList(arr){
|
|
|
+ async function xrList(arr){
|
|
|
+ map.clearOverlays();
|
|
|
var sContnet = '';
|
|
|
- getAllArr = arr;
|
|
|
- $.each(arr, function(index){
|
|
|
- var arrdep = arr[index].dep;
|
|
|
- arraddre = arr[index].address;
|
|
|
- var arrtype = arr[index].type;
|
|
|
- var arrspecial = arr[index].specialtype;
|
|
|
- var arrtag = arr[index].tag;
|
|
|
- var arrtag2 = arr[index].tag2;
|
|
|
- var arrtag3 = arr[index].tag3;
|
|
|
- var arrcontent = arr[index].content;
|
|
|
- var arrimg = arr[index].img;
|
|
|
- var arrtel = arr[index].tel;
|
|
|
- var arrtime = arr[index].time;
|
|
|
- var arrsptype = arr[index].sptype;
|
|
|
- sContnet += "<ul class='titleFirst'>"
|
|
|
- sContnet += "<div class='wrap_apply'>"
|
|
|
- sContnet += "<li class='title_flex'>"
|
|
|
- sContnet += "<p style='width:100%'>"
|
|
|
- sContnet += arrdep
|
|
|
- sContnet += "</p>"
|
|
|
- if ((arrtype == "" || arrtype == undefined)||arrtype==null) {
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- if (arrspecial == '中学') {
|
|
|
- if (arrtype == '中学') {
|
|
|
- sContnet += ''
|
|
|
+ var dataString,addFirst;
|
|
|
+ var mapList=[];
|
|
|
+ // getAllArr = arr;
|
|
|
+ if (!arr){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ for (var index=0;index<arr.length;index++){
|
|
|
+ var arrdep = arr[index].dep;
|
|
|
+ arraddre = arr[index].address;
|
|
|
+ const tempAdd = arraddre;
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ var address = new BMap.Point(point.lng,point.lat);
|
|
|
+ var obj = {
|
|
|
+ "id": arr[index].id,
|
|
|
+ "longitude": address.lng,
|
|
|
+ "latitude": address.lat
|
|
|
+ }
|
|
|
+ mapList.push(obj);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ var arrtype = arr[index].type;
|
|
|
+ var arrspecial = arr[index].specialtype;
|
|
|
+ var arrtag = arr[index].tag;
|
|
|
+ var arrtag2 = arr[index].tag2;
|
|
|
+ var arrtag3 = arr[index].tag3;
|
|
|
+ var arrcontent = arr[index].content;
|
|
|
+ var arrimg = arr[index].img;
|
|
|
+ var arrtel = arr[index].tel;
|
|
|
+ var arrtime = arr[index].time;
|
|
|
+ var arrsptype = arr[index].sptype;
|
|
|
+ sContnet += "<ul class='titleFirst'><div class='wrap_apply'><li class='title_flex'>"
|
|
|
+ sContnet += "<p style='width:100%'>"+arrdep+"</p>"
|
|
|
+ if ((arrtype == "" || arrtype == undefined)||arrtype==null) {
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ if (arrspecial == '中学') {
|
|
|
+ if (arrtype == '中学') {
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p class='flex_blue'>· "+arrtype+"</p>"
|
|
|
+ }
|
|
|
+ sContnet += "<p class='flex_blue'>· "+arrspecial+"</p>"
|
|
|
} else {
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrtype
|
|
|
- sContnet += "</p>"
|
|
|
+ sContnet += "<p class='flex_blue'>· "+arrtype+"</p>"
|
|
|
}
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrspecial
|
|
|
- sContnet += "</p>"
|
|
|
- } else {
|
|
|
- sContnet += "<p class='flex_blue'>· "
|
|
|
- sContnet += arrtype
|
|
|
- sContnet += "</p>"
|
|
|
}
|
|
|
- sContnet += "</li>"
|
|
|
- }
|
|
|
- if ((arrtag == "" || arrtag == undefined)||arrtag==null) {
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- sContnet += "<li class='flex_orange'>"
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag
|
|
|
- if ((arrtag2 == undefined||arrtag2=="")||arrtag2==null) {
|
|
|
- sContnet += "</div>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ if ((arrtag == "" || arrtag == undefined)||arrtag==null) {
|
|
|
+ sContnet += ''
|
|
|
} else {
|
|
|
- sContnet += "</div>"
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag2
|
|
|
- sContnet += "</div>"
|
|
|
+ sContnet += "<li class='flex_orange'><div class='three_tag'>"+arrtag
|
|
|
+ if ((arrtag2 == undefined||arrtag2=="")||arrtag2==null) {
|
|
|
+ sContnet += "</div>"
|
|
|
+ } else {
|
|
|
+ sContnet += "</div><div class='three_tag'>"+arrtag2+"</div>"
|
|
|
+ }
|
|
|
+ if ((arrtag3 == undefined||arrtag3=="")||arrtag3==null) {
|
|
|
+ sContnet += "</li>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<div class='three_tag'>"+arrtag3+"</div></li>"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ((arrcontent == undefined||arrcontent==null)||arrcontent == "") {
|
|
|
+ sContnet += ''
|
|
|
+ }else{
|
|
|
+ sContnet += "<li><a class='a_blue'><p class='content_p' style='overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;'>"
|
|
|
+ sContnet += arrcontent+"</p></a></li>"
|
|
|
+ }
|
|
|
+ if ((arrimg == undefined||arrimg==null)||arrimg == "") {
|
|
|
+ sContnet += ''
|
|
|
+ }else{
|
|
|
+ sContnet += "<li class='img_box'><img data-src='"+PATH+arrimg+"' class='two_img' src='" +PATH+arrimg + "'></li>"
|
|
|
}
|
|
|
- if ((arrtag3 == undefined||arrtag3=="")||arrtag3==null) {
|
|
|
- sContnet += "</li>"
|
|
|
+ sContnet += "<li class='address_box'><p><span class='flex_address'>地址:</span>"+arraddre+"</p>"
|
|
|
+ if ((arrtime == "" || arrtime == undefined)||arrtime==null) {
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrsptype == '查阅场所'){
|
|
|
+ sContnet += "<p><span class='flex_address'>查询时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrsptype == '受理场所'){
|
|
|
+ sContnet += "<p><span class='flex_address'>受理时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrsptype == '政务服务'){
|
|
|
+ sContnet += "<p><span class='flex_address'>办理时间:</span>"+arrtime+"</p>"
|
|
|
} else {
|
|
|
- sContnet += "<div class='three_tag'>"
|
|
|
- sContnet += arrtag3
|
|
|
- sContnet += "</div>"
|
|
|
- sContnet += "</li>"
|
|
|
+ sContnet += "<p><span class='flex_address'>办公时间:</span>"+arrtime+"</p>"
|
|
|
}
|
|
|
- sContnet += "<li>"
|
|
|
- }
|
|
|
- if ((arrcontent == undefined||arrcontent==null)||arrcontent == "") {
|
|
|
- sContnet += ''
|
|
|
- }else{
|
|
|
- sContnet += "<a class='a_blue'>"
|
|
|
- sContnet += "<p class='content_p' style='overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;'>"
|
|
|
- sContnet += arrcontent
|
|
|
- sContnet += "</p>"
|
|
|
- sContnet += "</a>"
|
|
|
- }
|
|
|
- sContnet += "</li>"
|
|
|
- if ((arrimg == undefined||arrimg==null)||arrimg == "") {
|
|
|
- sContnet += ''
|
|
|
- }else{
|
|
|
- sContnet += "<li class='img_box'>"
|
|
|
- sContnet += "<img data-src='"+PATH+arrimg+"' class='two_img' src='" +PATH+arrimg + "'>"
|
|
|
- sContnet += "</li>"
|
|
|
- }
|
|
|
- sContnet += "<li class='address_box'>"
|
|
|
- sContnet += "<p><span class='flex_address'>地址:</span>"
|
|
|
- sContnet += arraddre
|
|
|
- sContnet += "</p>"
|
|
|
- if ((arrtime == "" || arrtime == undefined)||arrtime==null) {
|
|
|
- sContnet += ''
|
|
|
- } else if(arrsptype == '查阅场所'){
|
|
|
- sContnet += "<p><span class='flex_address'>查询时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else if(arrsptype == '受理场所'){
|
|
|
- sContnet += "<p><span class='flex_address'>受理时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else if(arrsptype == '政务服务'){
|
|
|
- sContnet += "<p><span class='flex_address'>办理时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- } else {
|
|
|
- sContnet += "<p><span class='flex_address'>办公时间:</span>"
|
|
|
- sContnet += arrtime
|
|
|
- sContnet += "</p>"
|
|
|
- }
|
|
|
- if ((arrtel == "" || arrtel == undefined)||arrtel==null){
|
|
|
- sContnet += ''
|
|
|
- } else {
|
|
|
- sContnet += "<p><span class='flex_address'>办公电话:</span>"
|
|
|
- for (var i=0;i<arrtel.split(';').length;i++){
|
|
|
- if(arrtel.split(';').length-i != 1){
|
|
|
- sContnet += "<a href='tel:"+arrtel.split(';')[i]+"' style='text-decoration:underline'>"+arrtel.split(';')[i]+"</a>"
|
|
|
- sContnet += ";"
|
|
|
- }else{
|
|
|
- sContnet += "<a href='tel:"+arrtel.split(';')[i]+"' style='text-decoration:underline'>"+arrtel.split(';')[i]+"</a>"
|
|
|
+ if ((arrtel == "" || arrtel == undefined)||arrtel==null){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p><span class='flex_address'>办公电话:</span>"
|
|
|
+ for (var i=0;i<arrtel.split(';').length;i++){
|
|
|
+ if(arrtel.split(';').length-i != 1){
|
|
|
+ sContnet += "<a href='tel:"+arrtel.split(';')[i]+"' style='text-decoration:underline'>"+arrtel.split(';')[i]+"</a>;"
|
|
|
+ }else{
|
|
|
+ sContnet += "<a href='tel:"+arrtel.split(';')[i]+"' style='text-decoration:underline'>"+arrtel.split(';')[i]+"</a>"
|
|
|
+ }
|
|
|
}
|
|
|
+ sContnet += "</p>"
|
|
|
}
|
|
|
- sContnet += "</p>"
|
|
|
- }
|
|
|
- if (arr[index].sptype == '受理场所'){
|
|
|
- sContnet += " <div class='handle_business'>点击查看详情</div>"
|
|
|
- }else if(arrdep == '重庆市南岸区民政局婚姻登记处(茶园)' || arrdep == '重庆市南岸区民政局婚姻登记处(南坪)'){
|
|
|
- sContnet += " <div class='handle_business1'>点击查看详情</div>"
|
|
|
- }else if(arrdep == '重庆市南岸区社会保险事务中心'){
|
|
|
- sContnet += " <div class='handle_business2'>点击查看详情</div>"
|
|
|
- }else{
|
|
|
- sContnet += "<div class='detailCheck'>点击查看详情</div>"
|
|
|
+ if (arr[index].sptype == '受理场所'){
|
|
|
+ sContnet += " <div class='handle_business'>点击查看详情</div>"
|
|
|
+ }else if(arrdep == '重庆市南岸区民政局婚姻登记处(茶园)' || arrdep == '重庆市南岸区民政局婚姻登记处(南坪)'){
|
|
|
+ sContnet += " <div class='handle_business1'>点击查看详情</div>"
|
|
|
+ }else if(arrdep == '重庆市南岸区社会保险事务中心'){
|
|
|
+ sContnet += " <div class='handle_business2'>点击查看详情</div>"
|
|
|
+ }else{
|
|
|
+ sContnet += "<div class='detailCheck'>点击查看详情</div>"
|
|
|
+ }
|
|
|
+ sContnet += "</li></div><li class='btn_box'>"
|
|
|
+ sContnet += "<button class='one_bus'>公交</button><button class='two_car'>自驾</button>"
|
|
|
+ sContnet += "</li></ul>";
|
|
|
}
|
|
|
- sContnet += "</li>"
|
|
|
- sContnet += "</div>"
|
|
|
- sContnet += "<li class='btn_box'>"
|
|
|
- sContnet += "<button class='one_bus'>公交</button>"
|
|
|
- sContnet += "<button class='two_car'>自驾</button>"
|
|
|
- sContnet += "</li>"
|
|
|
- sContnet += "</ul>";
|
|
|
- })
|
|
|
- $('.show-fifth .pad_box').empty().append(sContnet);
|
|
|
- $('.show-fourth .pad_box').empty().append(sContnet);
|
|
|
+ $('.show-fifth .pad_box').empty().append(sContnet);
|
|
|
+ $('.show-fourth .pad_box').empty().append(sContnet);
|
|
|
+ }
|
|
|
+ dataString=JSON.stringify(mapList);
|
|
|
+ $.ajax({
|
|
|
+ type: 'POST',
|
|
|
+ url: PATH + '/mapdata/longitudeLatitude',
|
|
|
+ // url: "http://192.168.0.230:7777/mapdata/longitudeLatitude",
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ data: {"dataString":dataString}
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
$(document).on('click','.handle_business',async function(){
|