Bladeren bron

整理代码

李雪梅 2 jaren geleden
bovenliggende
commit
cc4aec3a03

+ 110 - 208
nngkxxdp/src/main/resources/static/district/js/sy.js

@@ -45,7 +45,7 @@ $(function() {
 					xx.push(xxs[i])
 				}
 				if (xxs[i].type == "中学" || xxs[i].specialtype == "中学") {
-					zx.push(xxs[i])
+					zx.push(xxs[i]);
 				}
 				if (xxs[i].type == "特殊教育学校") {
 					tsjy.push(xxs[i])
@@ -565,9 +565,13 @@ $(function() {
 				getPointPostAjax(xx);
 				break;
 			case "中学":
-				xxGEO(zx);
-				xrxx(zx);
-				getPointPostAjax(zx);
+				let zxmark = []
+				zx.map(function(item) {
+					zxmark.push(Object.assign({},item,{markMiddleSchool: 1}))
+				});
+				xxGEO(zxmark);
+				xrxx(zxmark);
+				getPointPostAjax(zxmark);
 				break;
 			case "特殊教育学校":
 				xxGEO(tsjy);
@@ -836,7 +840,7 @@ $(function() {
 	// 点击列表中的一条,重置地图中心点
 	$(document).on('click', '.title-first li', function() {
 		var add_text = $(this).parents('.title-first').find('.jzdz').text();
-		var topTextNav = $('.top-title').children('.layui-this').text().trim();
+		var topTextNav = '受理场所';
 		let cilckList = [];
 		allArr.map(function(item, index) {
 			cilckList.push(Object.assign({},item,{clickIndex: 1}))
@@ -873,6 +877,7 @@ $(function() {
 
 	$(document).on('click', '.title-first1 ul li,.typeFirst', function() {
 		var add_text = $(this).parents('.title-first1').children('ul').find('.jzdz').text();
+		var dep_text = $(this).parents('.title-first1').children('ul').find('li:nth-child(1)').attr('title');
 		let cilckList = [];
 		var topTextNav = '受理场所'
 		allArr.map(function(item, index) {
@@ -881,6 +886,10 @@ $(function() {
 		let getClick1 = cilckList.filter(function(item) {
 			return item.address == add_text
 		});
+		let getClick2 = cilckList.filter(function(item) {
+			return item.dep == dep_text
+		});
+		console.log(getClick2)
 		for (let i = 0; i < getClick1.length; i++) {
 			for (let j = i + 1; j < getClick1.length; j++) {
 				if (getClick1[j].dep === getClick1[i].dep) {
@@ -1364,140 +1373,86 @@ $(function() {
 							var arrSptype = arr[index].sptype;
 							var arrgzh = arr[index].gzh
 							var sContnet = ''
-							sContnet += "<ul class='titleFirst'>"
-							sContnet += "<li class='title_flex' title='"+arrdep+"'>"
-							sContnet += arrdep
-							if ((arrtype == null || arrtype == undefined)||arrtype=='') {
+							sContnet += "<ul class='titleFirst'><li class='title_flex' title='"+arrdep+"'>"+arrdep
+							if ((arrtype==null||arrtype==undefined)||arrtype==''){
 								sContnet += ''
-							} else {
-								if (arrspecial == "中学") {
-									if (arrtype == "中学"){
+							}else{
+								if (arrspecial=="中学") {
+									if (arrtype=="中学"){
 										sContnet += ''
 									} 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>"
+									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 += "</li>"
 							}
-							if ((arrtag == null || arrtag == undefined)||arrtag=='') {
+							if ((arrtag==null||arrtag==undefined)||arrtag==''){
 								sContnet += ""
 							} else {
-								sContnet += "<li class='flex_orange'>"
-								sContnet += "<div class='three_tag'>"
-								sContnet += arrtag
-								if ((arrtag2 == undefined || arrtag2 == null)||arrtag2=='') {
-									sContnet += "</div>"
-								} else {
-									sContnet += "</div>"
-									sContnet += "<div class='three_tag'>"
-									sContnet += arrtag2
+								sContnet += "<li class='flex_orange'><div class='three_tag'>"+arrtag
+								if ((arrtag2==undefined||arrtag2==null)||arrtag2==''){
 									sContnet += "</div>"
+								}else{
+									sContnet += "</div><div class='three_tag'>"+arrtag2+"</div>"
 								}
-								if ((arrtag3 == undefined || arrtag3 == null)||arrtag3=='') {
+								if ((arrtag3==undefined||arrtag3==null)||arrtag3==''){
 									sContnet += "</li>"
 								} else {
-									sContnet += "<div class='three_tag'>"
-									sContnet += arrtag3
-									sContnet += "</div>"
-									sContnet += "</li>"
+									sContnet += "<div class='three_tag'>"+arrtag3+"</div></li>"
 								}
 							}
-							if (arrcontent == "") {
-								sContnet += ''
-							} else if (arrcontent == undefined || arrcontent == null) {
+							if (arrcontent==""||(arrcontent==undefined||arrcontent==null)){
 								sContnet += ''
-							} else {
-								sContnet += "<li>"
-								sContnet += "<a class='a_blue'>"
-								sContnet += "<p class='content_p'>"
-								sContnet += arrcontent
-								sContnet += "</p>"
-								sContnet += "</a>"
+							}else{
+								sContnet += "<li><a class='a_blue'><p class='content_p'>"+arrcontent+"</p></a>"
 							}
 							sContnet += "</li>"
-							if (arrimg == "") {
-								sContnet += ''
-							} else if (arrimg == undefined || arrimg == null) {
+							if (arrimg==""||(arrimg==undefined||arrimg==null)){
 								sContnet += ''
-							} else {
-								sContnet += "<li class='img_box'>"
-								sContnet += "<img class='two_img' src='" +PATH+arrimg + "'>"
-								sContnet += "</li>"
+							}else{
+								sContnet += "<li class='img_box'><img class='two_img' src='"+PATH+arrimg+"'></li>"
 							}
-							sContnet += "<li class='address_box'>"
-							sContnet += "<p><span class='flex_address'>地址:</span>"
-							sContnet += arraddre
-							sContnet += "</p>"
-							if ((arrtime == null || arrtime == undefined)||arrtime=='') {
+							sContnet += "<li class='address_box'><p><span class='flex_address'>地址:</span>"+arraddre+"</p>"
+							if ((arrtime==null||arrtime==undefined)||arrtime==''){
 								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 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 += "<p><span class='flex_address'>办公时间:</span>"
-								sContnet += arrtime
-								sContnet += "</p>"
+								sContnet += "<p><span class='flex_address'>办公时间:</span>"+arrtime+"</p>"
 							}
-							if ((arrtel == null || arrtel == undefined)||arrtel==''){
+							if ((arrtel==null||arrtel==undefined)||arrtel==''){
 								sContnet += ''
 							} else {
-								sContnet += "<p><span class='flex_address'>办公电话:</span>"
-								sContnet += arrtel
-								sContnet += "</p>"
+								sContnet += "<p><span class='flex_address'>办公电话:</span>"+arrtel+"</p>"
 							}
-							if ((arrUrl == undefined || arrUrl == null)||arrUrl=='') {
+							if ((arrUrl==undefined||arrUrl==null)||arrUrl==''){
 								sContnet += ''
-							} else if(arrSptype == "民政服务") {
+							} else if(arrSptype=="民政服务") {
 								sContnet += "<a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>预约祭扫</a>"
-							}else if(arrSptype == "住房保障"){
+							}else if(arrSptype=="住房保障"){
 								sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>公租房申请</a>"
 							} else {
 								sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='color: #2775CC;text-decoration:underline;'>在线预约</a>"
 							}
-							sContnet += "<br><a class='correct_html' style='color: #2775CC;text-decoration:underline;'>我要纠错</a>"
-							sContnet += "</li>"
-							if ((arrgzh == undefined || arrgzh == null)||arrgzh==''){
+							sContnet += "<br><a class='correct_html' style='color: #2775CC;text-decoration:underline;'>我要纠错</a></li>"
+							if ((arrgzh==undefined||arrgzh==null)||arrgzh==''){
 								sContnet += ''
 							}else if(arrSptype=="交通服务"){
-								sContnet += "<li class='gzh_img'>"
-								sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
-								sContnet += "<p>微信扫描公众号办理</p>"
-								sContnet += "</li>"
+								sContnet += "<li class='gzh_img'><img class='two_img' src='"+PATH+arrgzh+"'><p>微信扫描公众号办理</p></li>"
 							}else if(arrSptype=="文体旅游"||arrtype=="城市公园"){
-								sContnet += "<li class='gzh'>"
-								sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
-								sContnet += "<p>微信扫描公众号预约服务</p>"
-								sContnet += "</li>"
+								sContnet += "<li class='gzh'><img class='two_img' src='"+PATH+arrgzh+ "'><p>微信扫描公众号预约服务</p></li>"
 							}else{
-								sContnet += "<li class='gzh_img'>"
-								sContnet += "<img class='two_img' src='" +PATH+arrgzh + "'>"
-								sContnet += "<p>微信扫描公众号预约挂号</p>"
-								sContnet += "</li>"
+								sContnet += "<li class='gzh_img'><img class='two_img' src='"+PATH+arrgzh+ "'><p>微信扫描公众号预约挂号</p></li>"
 							}
-							sContnet += "<li class='btn_box'>"
-							sContnet += "<button class='one_bus'>公交</button>"
-							sContnet += "<button class='two_car'>自驾</button>"
-							sContnet += "</li>"
-							sContnet += "</ul>"
-							if (tempAdd == arraddre) {
+							sContnet += "<li class='btn_box'><button class='one_bus'>公交</button><button class='two_car'>自驾</button></li></ul>"
+							if (tempAdd==arraddre){
 								addMarker2(arrIndex, index, address, new BMap.InfoWindow(sContnet, arraddre), arrdep);
 							}
 							document.querySelectorAll(".two_img").onload = function() {
@@ -1562,43 +1517,6 @@ $(function() {
 		},100);
 	}
 
-	// 街镇列表的循环渲染
-	function xrjz(arrey) {
-		var html = '';
-		var sum = 0;
-		$.each(arrey, function(item){
-			var dep = arrey[item].dep;
-			var tel = arrey[item].tel;
-			var address = arrey[item].address;
-			sum += 1;
-			html += "<ul class='title-first'>"
-			html += "<li title='"+dep+"'>"
-			html += "<span>" + sum + "." + "</span>" + dep + "</li>"
-			html += "<li>"
-			if (tel == ''){
-				html += ''
-			} else {
-				html += "<p>" + "电话:" + tel + "</p>"
-			}
-			html += "<div class='differentdz'>" + "地址:" + "<p  class='jzdz' title='"+address+"'>" + address + "</p>" + "</div>"
-			html += "</li>"
-			html += "<a class='correct_text' style='color: #2775CC;text-decoration:underline;visibility:hidden;'>我要纠错</a>"
-			html += "</ul>"
-		});
-		$('.show-fifth .text-second').empty().append(html);
-		$('.text-third').empty().append(
-			"共" +
-			"<span>" + sum + "</span>" +
-			"条记录"
-		);
-		$('.districtLevel').empty().append(html);
-		$('.textThird').empty().append(
-			"共" +
-			"<span>" + sum + "</span>" +
-			"条记录"
-		);
-	}
-
 	$(document).on('click','.correct_text',function(){
 		var address_text = $(this).siblings('li').find(".jzdz").text();
 		// var discript_text = address_text.split(":")[1];
@@ -1616,42 +1534,40 @@ $(function() {
 		var html = ''
 		html += "<div class='hide_list'><h6>搜索结果</h6><button type='button' class='back_btn'>返回</button></div>"
 		for (var item = 0; item < arr.length; item++) {
-			var jzdep = arr[item].dep;
-			var jzdhs = arr[item].tel;
-			var jzdzs = arr[item].address;
+			var dep = arr[item].dep;
+			var tel = arr[item].tel;
+			var address = arr[item].address;
 			var type = arr[item].type;
 			var sptype  = arr[item].sptype;
+			var specialtype  = arr[item].specialtype
+			var markMiddleSchool = arr[item].markMiddleSchool
 			var sum = 1;
 			sum += item;
 			html += "<div class='title-first1'>"
-			if ((type == undefined || type == null)||type=='') {
+			if ((type==undefined||type==null)||type=='') {
 				html += ''
-			} else if (type == '路内停车场' || type == '室外停车场'){
+			} else if (markMiddleSchool != undefined){
+				html += "<p class='typeFirst othertypeFirst'>"+specialtype+"</p>"
+			}else if (type=='路内停车场'||type=='室外停车场'){
 				html += "<p class='typeFirst tcstyletypeFirst'>"+type+"</p>"
 			} else {
 				html += "<p class='typeFirst othertypeFirst'>"+type+"</p>"
 			}
-			if ((sptype == undefined || sptype == null)||sptype=='') {
+			if ((sptype==undefined||sptype==null)||sptype=='') {
 				html += ''
-			}else if((sptype == '不动产登记' || sptype == '党群服务中心') || sptype=='住房公积金'){
+			}else if((sptype=='不动产登记'||sptype=='党群服务中心')||sptype=='住房公积金'){
 				html += "<p class='typeFirst tcstyletypeFirst'>"+sptype+"</p>"
 			} else {
 				html += "<p class='typeFirst othertypeFirst'>"+sptype+"</p>"
 			}
-			html += "<ul>"
-			html += "<li title='"+jzdep+"'>"
-			html += "<span>" + sum + "." + "</span>" + jzdep + "</li>"
-			html += "<li>"
-			if ((jzdhs == null || jzdhs == undefined)||jzdhs==''){
+			html += "<ul><li title='"+dep+"'><span>"+sum+"."+"</span>"+dep+"</li><li>"
+			if ((tel==null||tel == undefined)||tel==''){
 				html += ''
 			} else {
-				html += "<p>" + "电话:" + jzdhs + "</p>"
+				html += "<p>"+"电话:"+jzdhs+"</p>"
 			}
-			html += "<div class='differentdz'>" + "地址:" + "<p  class='jzdz' title='"+jzdzs+"'>" + jzdzs + "</p>" + "</div>"
-			html += "</li>"
-			html += "<a class='correct_text' style='color: #2775CC;text-decoration:underline;visibility: hidden;'>我要纠错</a>"
-			html += "</ul>"
-			html += "</div>"
+			html += "<div class='differentdz'>"+"地址:"+"<p class='jzdz' title='"+address+"'>"+address+"</p>"+"</div></li>"
+			html += "<a class='correct_text' style='color: #2775CC;text-decoration:underline;visibility: hidden;'>我要纠错</a></ul></div>"
 		};
 		$('.show-first .text-second').empty().append(html);
 		$('.flex_box .flex_li').fadeOut(0);
@@ -1659,8 +1575,6 @@ $(function() {
 
 	// 实现列表的收起和展开
 	$(document).on("click", ".back_btn ", function() {
-		var TFdisplay = $(this).parents('.hide_list').siblings('.title-first1').css('display');
-		var fdisplay = $(this).parents('.text-second').siblings('.flex_box').children('.flex_li').css('display');
 		$(".title-first1").fadeIn(600);
 		$('.flex_box').removeAttr('style');
 		$(this).text('返回');
@@ -1670,6 +1584,43 @@ $(function() {
 		$('.flex_li').find('.flex_text').removeAttr('style').parent('.img_tab').siblings('.pop').find('.mapnav').removeClass('choice');
 		window.location.reload();
 	});
+
+	// 街镇列表的循环渲染
+	function xrjz(arrey) {
+		var html = '';
+		var sum = 0;
+		$.each(arrey, function(item){
+			var dep = arrey[item].dep;
+			var tel = arrey[item].tel;
+			var address = arrey[item].address;
+			sum += 1;
+			html += "<ul class='title-first'>"
+			html += "<li title='"+dep+"'>"
+			html += "<span>" + sum + "." + "</span>" + dep + "</li>"
+			html += "<li>"
+			if (tel == ''){
+				html += ''
+			} else {
+				html += "<p>" + "电话:" + tel + "</p>"
+			}
+			html += "<div class='differentdz'>" + "地址:" + "<p  class='jzdz' title='"+address+"'>" + address + "</p>" + "</div>"
+			html += "</li>"
+			html += "<a class='correct_text' style='color: #2775CC;text-decoration:underline;visibility:hidden;'>我要纠错</a>"
+			html += "</ul>"
+		});
+		$('.show-fifth .text-second').empty().append(html);
+		$('.text-third').empty().append(
+			"共" +
+			"<span>" + sum + "</span>" +
+			"条记录"
+		);
+		$('.districtLevel').empty().append(html);
+		$('.textThird').empty().append(
+			"共" +
+			"<span>" + sum + "</span>" +
+			"条记录"
+		);
+	}
 	
 	// 渲染查阅场所列表
 	function cycsone(cycsbms) {
@@ -1709,6 +1660,7 @@ $(function() {
 		});
 	};
 
+	// 渲染查阅场所的街镇
 	function slcsjzs(slcsjz) {
 		var html3 = ''
 		for (var index = 0; index < slcsjz.length; index++) {
@@ -1748,56 +1700,6 @@ $(function() {
 	};
 	
 
-	// 点击市级部门下公交出现输入框并点击中间的切换按钮能够切换起点和终点
-	$(document).on('click', '.change-buts', function() {
-		let inps = $('.inps').css('left');
-		if (inps == '0px') {
-			$('.inps').css('left', '90px');
-		}
-		if (inps == '90px') {
-			$('.inps').css('left', '0px');
-		}
-		let inpText = $('.inp-text').css('left');
-		if (inpText == '220px') {
-			$('.inp-text').css('left', '0px');
-		}
-		if (inpText == '0px') {
-			$('.inp-text').css('left', '220px');
-		}
-		let changeButs = $('.change-buts').css('left');
-		if (changeButs == '185px') {
-			$('.change-buts').css('left', '50px');
-		}
-		if (changeButs == '50px') {
-			$('.change-buts').css('left', '185px');
-		}
-	});
-
-	// 点击市级部门下自驾出现输入框并点击中间的切换按钮能够切换起点和终点
-	$(document).on('click', '.change-buts2', function() {
-		let inpst = $('.inpst').css('left');
-		if (inpst == '0px') {
-			$('.inpst').css('left', '90px');
-		}
-		if (inpst == '90px') {
-			$('.inpst').css('left', '0px');
-		}
-		let inpText2 = $('.inp-text2').css('left');
-		if (inpText2 == '220px') {
-			$('.inp-text2').css('left', '0px');
-		}
-		if (inpText2 == '0px') {
-			$('.inp-text2').css('left', '220px');
-		}
-		let changeButs2 = $('.change-buts2').css('left');
-		if (changeButs2 == '185px') {
-			$('.change-buts2').css('left', '50px');
-		}
-		if (changeButs2 == '50px') {
-			$('.change-buts2').css('left', '185px');
-		}
-	});
-
 	function addMarker(getIndex, index, point, infoWindow, dep) {
 		var myIcon = new BMap.Icon("./img/location.png", new BMap.Size(40, 40));
 		var marker = new BMap.Marker(point, {

+ 3 - 6
nngkxxdp/src/main/resources/static/district/js/sy_mobile.js

@@ -63,8 +63,8 @@ $(function () {
     var timeout = null;
     $.ajax({
         type: 'GET',
-        url: PATH + '/mapdata/getMapDataAll',
-		// url: "http://192.168.1.253:7777/mapdata/getMapDataAll",
+        // url: PATH + '/mapdata/getMapDataAll',
+		url: "http://192.168.1.253:7777/mapdata/getMapDataAll",
         async: false,
         success: function (res) {
             $.each(res.data.xxs, function(i){
@@ -397,7 +397,7 @@ $(function () {
 				contrastArrey.push(res.data.gwzxs[i]);
 			});
         },
-        error: function (err) { },
+        error: function (err) {},
     });
 
     // 渲染点击小学等的结果页面样式
@@ -424,15 +424,12 @@ $(function () {
             var wsHeight = window.outerHeight - $('.right-map').innerHeight() - $('.head').innerHeight() - 11;
             var windowHeight = $('.right-map').innerHeight() - $('.head').innerHeight() + 45;
             var spWidth = ($('.show-fifth').innerWidth() - $('.wrap_result').innerWidth())/2;
-            // $('.wrap_result').css({'top': spWidth,'left': spWidth});
             $('.title-second').css({'top':windowHeight,'left': spWidth});
             $('.show-fifth').css('height',rmHeight);
             $('.wrap_result').css('height',wsHeight);
             $('.right-search').hide().css('top', '0px');
-            // $('.top_search').show();
             $('.top_search').fadeIn(500);
             $('.wrap_handle').hide();
-            $('.wrap_result1').scrollTop(0)
         }
     }