|
@@ -0,0 +1,3333 @@
|
|
|
+var is_mobi = navigator.userAgent.toLowerCase().match(/(ipod|iphone|android|coolpad|mmp|smartphone|midp|wap|xoom|symbian|j2me|blackberry|wince)/i) != null;
|
|
|
+if (is_mobi) {
|
|
|
+ window.location.href = "sy_mobile.html";
|
|
|
+}
|
|
|
+$(function() {
|
|
|
+ // 百度地图API功能
|
|
|
+ function G(id) {
|
|
|
+ return document.getElementById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ // var map = new BMapGL.Map('right-map'); // 创建Map实例
|
|
|
+ var map = new BMapGL.Map('right-map'); // 创建Map实例
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14); // 初始化地图,设置中心点坐标和地图级别
|
|
|
+ map.enableScrollWheelZoom(); // 启用滚轮放大缩小,默认禁用
|
|
|
+
|
|
|
+ // 区级部门与街镇解析地址批量解析开始
|
|
|
+ // var myGeo = new BMapGL.Geocoder();
|
|
|
+ var myGeo = new BMapGL.Geocoder();
|
|
|
+
|
|
|
+ var xxs=[],xx=[],zx=[],tsjy=[],dx=[],zyyx=[],yey=[],bmfwzx=[],ggfwzx=[],dqfwzx=[],bms=[],jzs=[],cyy=[],byfwjg=[],cwss=[],sqwsfwz=[],ejyljg=[],ekzlfwjg=[],kqbpsfczmz=[],myghyfjzmz=[],sjyljg=[],sqwsfwjg=[],zybzdjg=[],gy=[],tc=[],zysd=[],gc=[],hydjjg=[],zcyljg=[],ckmzfwjg=[],pcs=[];
|
|
|
+ var crjywbljg=[],jtxljcdd=[],jtwfcljg=[],jtsgcljg=[],cgs=[],jdcjccs=[],jsrtjz=[],ylfwjg=[],tsg=[],whg=[],wgs=[],ggty=[],jq=[];
|
|
|
+ var bdcdjzxbsdt=[],cjrfwzx=[],ddcjrfwjg=[],fwglzx=[],gzc=[],sfjdjg=[],jcfwfws=[],flyzzx=[],bsfwt=[],scjdglj=[];
|
|
|
+ var yb=[],dkbld=[],cjgshfwz=[],jykszx=[],xzfwzx=[],jzzx=[],jyhrczx=[],shbxswzx=[],sq=[],gjj=[],hscyd=[],slcsjz=[],gwzx=[],jd=[];
|
|
|
+ var gjIndex,gjImg;
|
|
|
+ var zjIndex,zjImg;
|
|
|
+ let allArr = [];
|
|
|
+ // 接收json内所有数据
|
|
|
+ var getAllJson = [];
|
|
|
+ // 用来接收对比参数的数组
|
|
|
+ var contrastArrey = [];
|
|
|
+ var cycsbms =[]
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: PATH + '/mapdata/getMapDataAll',
|
|
|
+ // url: "http://192.168.1.253:7777/mapdata/getMapDataAll",
|
|
|
+ async: false,
|
|
|
+ success: function(res) {
|
|
|
+ $.each(res.data.xxs,function(i){
|
|
|
+ xxs.push(res.data.xxs[i]);
|
|
|
+ allArr.push(res.data.xxs[i]);
|
|
|
+ getAllJson.push(res.data.xxs[i]);
|
|
|
+ contrastArrey.push(res.data.xxs[i]);
|
|
|
+ if (xxs[i].type == "小学") {
|
|
|
+ xx.push(xxs[i])
|
|
|
+ }
|
|
|
+ if (xxs[i].type == "中学" || xxs[i].specialtype == "中学") {
|
|
|
+ zx.push(xxs[i]);
|
|
|
+ }
|
|
|
+ if (xxs[i].type == "特殊教育学校") {
|
|
|
+ tsjy.push(xxs[i])
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $.each(res.data.dxs,function(i){
|
|
|
+ dx.push(res.data.dxs[i]);
|
|
|
+ allArr.push(res.data.dxs[i]);
|
|
|
+ getAllJson.push(res.data.dxs[i]);
|
|
|
+ contrastArrey.push(res.data.dxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.zyyxs,function(i){
|
|
|
+ zyyx.push(res.data.zyyxs[i]);
|
|
|
+ allArr.push(res.data.zyyxs[i]);
|
|
|
+ getAllJson.push(res.data.zyyxs[i]);
|
|
|
+ contrastArrey.push(res.data.zyyxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.yeys,function(i){
|
|
|
+ yey.push(res.data.yeys[i])
|
|
|
+ allArr.push(res.data.yeys[i]);
|
|
|
+ getAllJson.push(res.data.yeys[i]);
|
|
|
+ contrastArrey.push(res.data.yeys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bmfwzxs,function(i){
|
|
|
+ bmfwzx.push(res.data.bmfwzxs[i])
|
|
|
+ allArr.push(res.data.bmfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.bmfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.bmfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ggfwzxs,function(i){
|
|
|
+ ggfwzx.push(res.data.ggfwzxs[i])
|
|
|
+ allArr.push(res.data.ggfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.ggfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.ggfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.dqfwzxs,function(i){
|
|
|
+ dqfwzx.push(res.data.dqfwzxs[i])
|
|
|
+ allArr.push(res.data.dqfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.dqfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.dqfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bms,function(i){
|
|
|
+ bms.push(res.data.bms[i])
|
|
|
+ allArr.push(res.data.bms[i]);
|
|
|
+ getAllJson.push(res.data.bms[i]);
|
|
|
+ contrastArrey.push(res.data.bms[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jzs,function(i){
|
|
|
+ jzs.push(res.data.jzs[i])
|
|
|
+ allArr.push(res.data.jzs[i]);
|
|
|
+ getAllJson.push(res.data.jzs[i]);
|
|
|
+ contrastArrey.push(res.data.jzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cycsbms,function(i){
|
|
|
+ cycsbms.push(res.data.cycsbms[i])
|
|
|
+ allArr.push(res.data.cycsbms[i]);
|
|
|
+ getAllJson.push(res.data.cycsbms[i]);
|
|
|
+ contrastArrey.push(res.data.cycsbms[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cyys,function(i){
|
|
|
+ cyy.push(res.data.cyys[i])
|
|
|
+ allArr.push(res.data.cyys[i]);
|
|
|
+ getAllJson.push(res.data.cyys[i]);
|
|
|
+ contrastArrey.push(res.data.cyys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.byfwjgs,function(i){
|
|
|
+ byfwjg.push(res.data.byfwjgs[i])
|
|
|
+ allArr.push(res.data.byfwjgs[i]);
|
|
|
+ getAllJson.push(res.data.byfwjgs[i]);
|
|
|
+ contrastArrey.push(res.data.byfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cwsss,function(i){
|
|
|
+ cwss.push(res.data.cwsss[i])
|
|
|
+ allArr.push(res.data.cwsss[i]);
|
|
|
+ getAllJson.push(res.data.cwsss[i]);
|
|
|
+ contrastArrey.push(res.data.cwsss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sqwsfwzs,function(i){
|
|
|
+ sqwsfwz.push(res.data.sqwsfwzs[i])
|
|
|
+ allArr.push(res.data.sqwsfwzs[i]);
|
|
|
+ getAllJson.push(res.data.sqwsfwzs[i]);
|
|
|
+ contrastArrey.push(res.data.sqwsfwzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ekzlfwjgs,function(i){
|
|
|
+ ekzlfwjg.push(res.data.ekzlfwjgs[i])
|
|
|
+ allArr.push(res.data.ekzlfwjgs[i]);
|
|
|
+ getAllJson.push(res.data.ekzlfwjgs[i]);
|
|
|
+ contrastArrey.push(res.data.ekzlfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.kqbpsfczmzs,function(i){
|
|
|
+ kqbpsfczmz.push(res.data.kqbpsfczmzs[i])
|
|
|
+ allArr.push(res.data.kqbpsfczmzs[i]);
|
|
|
+ getAllJson.push(res.data.kqbpsfczmzs[i]);
|
|
|
+ contrastArrey.push(res.data.kqbpsfczmzs[i]);
|
|
|
+ });
|
|
|
+ for (let i = 0; i < res.data.myghyfjzmzs.length; i++) {
|
|
|
+ myghyfjzmz.push(res.data.myghyfjzmzs[i])
|
|
|
+ allArr.push(res.data.myghyfjzmzs[i]);
|
|
|
+ getAllJson.push(res.data.myghyfjzmzs[i]);
|
|
|
+ contrastArrey.push(res.data.myghyfjzmzs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.ejyljgs.length; i++) {
|
|
|
+ ejyljg.push(res.data.ejyljgs[i])
|
|
|
+ allArr.push(res.data.ejyljgs[i]);
|
|
|
+ getAllJson.push(res.data.ejyljgs[i]);
|
|
|
+ contrastArrey.push(res.data.ejyljgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.sjyljgs.length; i++) {
|
|
|
+ sjyljg.push(res.data.sjyljgs[i])
|
|
|
+ allArr.push(res.data.sjyljgs[i]);
|
|
|
+ getAllJson.push(res.data.sjyljgs[i]);
|
|
|
+ contrastArrey.push(res.data.sjyljgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.sqwsfwjgs.length; i++) {
|
|
|
+ sqwsfwjg.push(res.data.sqwsfwjgs[i])
|
|
|
+ allArr.push(res.data.sqwsfwjgs[i]);
|
|
|
+ getAllJson.push(res.data.sqwsfwjgs[i]);
|
|
|
+ contrastArrey.push(res.data.sqwsfwjgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.zybzdjgs.length; i++) {
|
|
|
+ zybzdjg.push(res.data.zybzdjgs[i])
|
|
|
+ allArr.push(res.data.zybzdjgs[i]);
|
|
|
+ getAllJson.push(res.data.zybzdjgs[i]);
|
|
|
+ contrastArrey.push(res.data.zybzdjgs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.gys.length; i++) {
|
|
|
+ gy.push(res.data.gys[i])
|
|
|
+ allArr.push(res.data.gys[i]);
|
|
|
+ getAllJson.push(res.data.gys[i]);
|
|
|
+ contrastArrey.push(res.data.gys[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.tcs.length; i++) {
|
|
|
+ tc.push(res.data.tcs[i])
|
|
|
+ allArr.push(res.data.tcs[i]);
|
|
|
+ getAllJson.push(res.data.tcs[i]);
|
|
|
+ contrastArrey.push(res.data.tcs[i]);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < res.data.zysd.length; i++) {
|
|
|
+ zysd.push(res.data.zysd[i])
|
|
|
+ allArr.push(res.data.zysd[i]);
|
|
|
+ getAllJson.push(res.data.zysd[i]);
|
|
|
+ contrastArrey.push(res.data.zysd[i]);
|
|
|
+ }
|
|
|
+ $.each(res.data.gcs,function(i){
|
|
|
+ gc.push(res.data.gcs[i])
|
|
|
+ allArr.push(res.data.gcs[i]);
|
|
|
+ getAllJson.push(res.data.gcs[i]);
|
|
|
+ contrastArrey.push(res.data.gcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.hydjcs,function(i){
|
|
|
+ hydjjg.push(res.data.hydjcs[i])
|
|
|
+ allArr.push(res.data.hydjcs[i]);
|
|
|
+ getAllJson.push(res.data.hydjcs[i]);
|
|
|
+ contrastArrey.push(res.data.hydjcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.zcyljg,function(i){
|
|
|
+ zcyljg.push(res.data.zcyljg[i])
|
|
|
+ allArr.push(res.data.zcyljg[i]);
|
|
|
+ getAllJson.push(res.data.zcyljg[i]);
|
|
|
+ contrastArrey.push(res.data.zcyljg[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ckmzfwjgs,function(i){
|
|
|
+ ckmzfwjg.push(res.data.ckmzfwjgs[i])
|
|
|
+ allArr.push(res.data.ckmzfwjgs[i]);
|
|
|
+ getAllJson.push(res.data.ckmzfwjgs[i]);
|
|
|
+ contrastArrey.push(res.data.ckmzfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.pcss,function(i){
|
|
|
+ pcs.push(res.data.pcss[i])
|
|
|
+ allArr.push(res.data.pcss[i]);
|
|
|
+ getAllJson.push(res.data.pcss[i]);
|
|
|
+ contrastArrey.push(res.data.pcss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.crjywbljgs,function(i){
|
|
|
+ crjywbljg.push(res.data.crjywbljgs[i])
|
|
|
+ allArr.push(res.data.crjywbljgs[i]);
|
|
|
+ getAllJson.push(res.data.crjywbljgs[i]);
|
|
|
+ contrastArrey.push(res.data.crjywbljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtxljcdds,function(i){
|
|
|
+ jtxljcdd.push(res.data.jtxljcdds[i])
|
|
|
+ allArr.push(res.data.jtxljcdds[i]);
|
|
|
+ getAllJson.push(res.data.jtxljcdds[i]);
|
|
|
+ contrastArrey.push(res.data.jtxljcdds[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtwfcljgs,function(i){
|
|
|
+ jtwfcljg.push(res.data.jtwfcljgs[i])
|
|
|
+ allArr.push(res.data.jtwfcljgs[i]);
|
|
|
+ getAllJson.push(res.data.jtwfcljgs[i]);
|
|
|
+ contrastArrey.push(res.data.jtwfcljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jtsgcljgs,function(i){
|
|
|
+ jtsgcljg.push(res.data.jtsgcljgs[i])
|
|
|
+ allArr.push(res.data.jtsgcljgs[i]);
|
|
|
+ getAllJson.push(res.data.jtsgcljgs[i]);
|
|
|
+ contrastArrey.push(res.data.jtsgcljgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cgss,function(i){
|
|
|
+ cgs.push(res.data.cgss[i])
|
|
|
+ allArr.push(res.data.cgss[i]);
|
|
|
+ getAllJson.push(res.data.cgss[i]);
|
|
|
+ contrastArrey.push(res.data.cgss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jdcjccss,function(i){
|
|
|
+ jdcjccs.push(res.data.jdcjccss[i])
|
|
|
+ allArr.push(res.data.jdcjccss[i]);
|
|
|
+ getAllJson.push(res.data.jdcjccss[i]);
|
|
|
+ contrastArrey.push(res.data.jdcjccss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jsrtjzs,function(i){
|
|
|
+ jsrtjz.push(res.data.jsrtjzs[i])
|
|
|
+ allArr.push(res.data.jsrtjzs[i]);
|
|
|
+ getAllJson.push(res.data.jsrtjzs[i]);
|
|
|
+ contrastArrey.push(res.data.jsrtjzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ylfwjgs,function(i){
|
|
|
+ ylfwjg.push(res.data.ylfwjgs[i])
|
|
|
+ allArr.push(res.data.ylfwjgs[i]);
|
|
|
+ getAllJson.push(res.data.ylfwjgs[i]);
|
|
|
+ contrastArrey.push(res.data.ylfwjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.tsgs,function(i){
|
|
|
+ tsg.push(res.data.tsgs[i])
|
|
|
+ allArr.push(res.data.tsgs[i]);
|
|
|
+ getAllJson.push(res.data.tsgs[i]);
|
|
|
+ contrastArrey.push(res.data.tsgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.whgs,function(i){
|
|
|
+ whg.push(res.data.whgs[i])
|
|
|
+ allArr.push(res.data.whgs[i]);
|
|
|
+ getAllJson.push(res.data.whgs[i]);
|
|
|
+ contrastArrey.push(res.data.whgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.wgss,function(i){
|
|
|
+ wgs.push(res.data.wgss[i])
|
|
|
+ allArr.push(res.data.wgss[i]);
|
|
|
+ getAllJson.push(res.data.wgss[i]);
|
|
|
+ contrastArrey.push(res.data.wgss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ggtys,function(i){
|
|
|
+ ggty.push(res.data.ggtys[i])
|
|
|
+ allArr.push(res.data.ggtys[i]);
|
|
|
+ getAllJson.push(res.data.ggtys[i]);
|
|
|
+ contrastArrey.push(res.data.ggtys[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jqs,function(i){
|
|
|
+ jq.push(res.data.jqs[i])
|
|
|
+ allArr.push(res.data.jqs[i]);
|
|
|
+ getAllJson.push(res.data.jqs[i]);
|
|
|
+ contrastArrey.push(res.data.jqs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bdcdjzxbsdts,function(i){
|
|
|
+ bdcdjzxbsdt.push(res.data.bdcdjzxbsdts[i])
|
|
|
+ allArr.push(res.data.bdcdjzxbsdts[i]);
|
|
|
+ getAllJson.push(res.data.bdcdjzxbsdts[i]);
|
|
|
+ contrastArrey.push(res.data.bdcdjzxbsdts[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cjrfwzxs,function(i){
|
|
|
+ cjrfwzx.push(res.data.cjrfwzxs[i])
|
|
|
+ allArr.push(res.data.cjrfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.cjrfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.cjrfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.qtcjrfwzxs,function(i){
|
|
|
+ ddcjrfwjg.push(res.data.qtcjrfwzxs[i])
|
|
|
+ allArr.push(res.data.qtcjrfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.qtcjrfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.qtcjrfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.fwglzxs,function(i){
|
|
|
+ fwglzx.push(res.data.fwglzxs[i])
|
|
|
+ allArr.push(res.data.fwglzxs[i]);
|
|
|
+ getAllJson.push(res.data.fwglzxs[i]);
|
|
|
+ contrastArrey.push(res.data.fwglzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.gzcs,function(i){
|
|
|
+ gzc.push(res.data.gzcs[i])
|
|
|
+ allArr.push(res.data.gzcs[i]);
|
|
|
+ getAllJson.push(res.data.gzcs[i]);
|
|
|
+ contrastArrey.push(res.data.gzcs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sfjdjgs,function(i){
|
|
|
+ sfjdjg.push(res.data.sfjdjgs[i])
|
|
|
+ allArr.push(res.data.sfjdjgs[i]);
|
|
|
+ getAllJson.push(res.data.sfjdjgs[i]);
|
|
|
+ contrastArrey.push(res.data.sfjdjgs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jcfwfwss,function(i){
|
|
|
+ jcfwfws.push(res.data.jcfwfwss[i])
|
|
|
+ allArr.push(res.data.jcfwfwss[i]);
|
|
|
+ getAllJson.push(res.data.jcfwfwss[i]);
|
|
|
+ contrastArrey.push(res.data.jcfwfwss[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.flyzzxs,function(i){
|
|
|
+ flyzzx.push(res.data.flyzzxs[i])
|
|
|
+ allArr.push(res.data.flyzzxs[i]);
|
|
|
+ getAllJson.push(res.data.flyzzxs[i]);
|
|
|
+ contrastArrey.push(res.data.flyzzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.bsfwts,function(i){
|
|
|
+ bsfwt.push(res.data.bsfwts[i])
|
|
|
+ allArr.push(res.data.bsfwts[i]);
|
|
|
+ getAllJson.push(res.data.bsfwts[i]);
|
|
|
+ contrastArrey.push(res.data.bsfwts[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.scjdgljs,function(i){
|
|
|
+ scjdglj.push(res.data.scjdgljs[i])
|
|
|
+ allArr.push(res.data.scjdgljs[i]);
|
|
|
+ getAllJson.push(res.data.scjdgljs[i]);
|
|
|
+ contrastArrey.push(res.data.scjdgljs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.ybs,function(i){
|
|
|
+ yb.push(res.data.ybs[i])
|
|
|
+ allArr.push(res.data.ybs[i]);
|
|
|
+ getAllJson.push(res.data.ybs[i]);
|
|
|
+ contrastArrey.push(res.data.ybs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.dkblds,function(i){
|
|
|
+ dkbld.push(res.data.dkblds[i])
|
|
|
+ allArr.push(res.data.dkblds[i]);
|
|
|
+ getAllJson.push(res.data.dkblds[i]);
|
|
|
+ contrastArrey.push(res.data.dkblds[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.cjgshfwzs,function(i){
|
|
|
+ cjgshfwz.push(res.data.cjgshfwzs[i])
|
|
|
+ allArr.push(res.data.cjgshfwzs[i]);
|
|
|
+ getAllJson.push(res.data.cjgshfwzs[i]);
|
|
|
+ contrastArrey.push(res.data.cjgshfwzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jykszxs,function(i){
|
|
|
+ jykszx.push(res.data.jykszxs[i])
|
|
|
+ allArr.push(res.data.jykszxs[i]);
|
|
|
+ getAllJson.push(res.data.jykszxs[i]);
|
|
|
+ contrastArrey.push(res.data.jykszxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.xzfwzxs,function(i){
|
|
|
+ xzfwzx.push(res.data.xzfwzxs[i])
|
|
|
+ allArr.push(res.data.xzfwzxs[i]);
|
|
|
+ getAllJson.push(res.data.xzfwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.xzfwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jzzxs,function(i){
|
|
|
+ jzzx.push(res.data.jzzxs[i])
|
|
|
+ allArr.push(res.data.jzzxs[i]);
|
|
|
+ getAllJson.push(res.data.jzzxs[i]);
|
|
|
+ contrastArrey.push(res.data.jzzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jyhrczxs,function(i){
|
|
|
+ jyhrczx.push(res.data.jyhrczxs[i])
|
|
|
+ allArr.push(res.data.jyhrczxs[i]);
|
|
|
+ getAllJson.push(res.data.jyhrczxs[i]);
|
|
|
+ contrastArrey.push(res.data.jyhrczxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.shbxswzxs,function(i){
|
|
|
+ shbxswzx.push(res.data.shbxswzxs[i])
|
|
|
+ allArr.push(res.data.shbxswzxs[i]);
|
|
|
+ getAllJson.push(res.data.shbxswzxs[i]);
|
|
|
+ contrastArrey.push(res.data.shbxswzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.sqs,function(i){
|
|
|
+ sq.push(res.data.sqs[i])
|
|
|
+ allArr.push(res.data.sqs[i]);
|
|
|
+ getAllJson.push(res.data.sqs[i]);
|
|
|
+ contrastArrey.push(res.data.sqs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.gjjs,function(i){
|
|
|
+ gjj.push(res.data.gjjs[i])
|
|
|
+ allArr.push(res.data.gjjs[i]);
|
|
|
+ getAllJson.push(res.data.gjjs[i]);
|
|
|
+ contrastArrey.push(res.data.gjjs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.hscyds,function(i){
|
|
|
+ hscyd.push(res.data.hscyds[i])
|
|
|
+ allArr.push(res.data.hscyds[i]);
|
|
|
+ getAllJson.push(res.data.hscyds[i]);
|
|
|
+ contrastArrey.push(res.data.hscyds[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.slcsjzs,function(i){
|
|
|
+ slcsjz.push(res.data.slcsjzs[i])
|
|
|
+ allArr.push(res.data.slcsjzs[i]);
|
|
|
+ getAllJson.push(res.data.slcsjzs[i]);
|
|
|
+ contrastArrey.push(res.data.slcsjzs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.gwzxs,function(i){
|
|
|
+ gwzx.push(res.data.gwzxs[i])
|
|
|
+ allArr.push(res.data.gwzxs[i]);
|
|
|
+ getAllJson.push(res.data.gwzxs[i]);
|
|
|
+ contrastArrey.push(res.data.gwzxs[i]);
|
|
|
+ });
|
|
|
+ $.each(res.data.jds,function(i){
|
|
|
+ jd.push(res.data.jds[i])
|
|
|
+ allArr.push(res.data.jds[i]);
|
|
|
+ getAllJson.push(res.data.jds[i]);
|
|
|
+ contrastArrey.push(res.data.jds[i]);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ error: function(err) {},
|
|
|
+ });
|
|
|
+
|
|
|
+ // var str=window.parent.location.search;
|
|
|
+ // str = decodeURI(str)
|
|
|
+ // let name = "se"
|
|
|
+ // // $("[title='重庆市第十一中学校']").click();
|
|
|
+ // if (str.indexOf(name)!=-1){
|
|
|
+ // var pos_start=str.indexOf(name)+name.length+1;
|
|
|
+ // var pos_end=str.indexOf("&",pos_start);
|
|
|
+ // if (pos_end==-1){
|
|
|
+ // let searchVal = str.substring(pos_start);
|
|
|
+ // if (searchVal!==null&&searchVal!==''){
|
|
|
+ // $('.inp').val(searchVal)
|
|
|
+ // localStorage.setItem("gjIndex","1");
|
|
|
+ // localStorage.setItem("gjImg","0");
|
|
|
+ // localStorage.setItem("zjImg","0");
|
|
|
+ // localStorage.setItem("zjIndex","0");
|
|
|
+ // xrSearchResultList(searchVal);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 点击显示弹窗
|
|
|
+ $('.flex_li').click(function() {
|
|
|
+ var tabtext = $(this).text().replace(/\s+/g, '');
|
|
|
+ $("#gj-one").val('').siblings("#gj-two").val('');
|
|
|
+ $("#zj-one").val('').siblings("#zj-two").val('');
|
|
|
+ $(".content-input .layui-tab-item:nth-child(1)").addClass("layui-show").siblings().removeClass("layui-show");
|
|
|
+ $(".search-change li:nth-child(1)").addClass("layui-this").siblings().removeClass("layui-this");
|
|
|
+ $(this).find('.flex_text').css('color','rgb(39, 117, 204)').parents('.flex_li').siblings().children('.img_tab').find('.flex_text').attr('style','');
|
|
|
+ $(this).siblings().find('.mapnav').removeClass('choice');
|
|
|
+ switch (tabtext){
|
|
|
+ case '政务公开':
|
|
|
+ $('.show-first').fadeOut(100).siblings('.show-fifth').fadeIn(200);
|
|
|
+ xxGEO(bms);
|
|
|
+ xrjz(bms);
|
|
|
+ getPointPostAjax(bms);
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '产业园区':
|
|
|
+ xxGEO(cyy);
|
|
|
+ xrxx(cyy);
|
|
|
+ getPointPostAjax(cyy);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '停车泊车':
|
|
|
+ xxGEO(tc);
|
|
|
+ xrxx(tc);
|
|
|
+ getPointPostAjax(tc);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '直饮水点':
|
|
|
+ xxGEO(zysd);
|
|
|
+ xrxx(zysd);
|
|
|
+ getPointPostAjax(zysd);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '不动产登记':
|
|
|
+ xxGEO(bdcdjzxbsdt);
|
|
|
+ xrxx(bdcdjzxbsdt);
|
|
|
+ getPointPostAjax(bdcdjzxbsdt);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '便民公厕':
|
|
|
+ xxGEO(gc);
|
|
|
+ xrxx(gc);
|
|
|
+ getPointPostAjax(gc);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '住房保障':
|
|
|
+ xxGEO(fwglzx);
|
|
|
+ xrxx(fwglzx);
|
|
|
+ getPointPostAjax(fwglzx);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '住房公积金':
|
|
|
+ xxGEO(gjj);
|
|
|
+ xrxx(gjj);
|
|
|
+ getPointPostAjax(gjj);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ case '办税服务':
|
|
|
+ xxGEO(bsfwt);
|
|
|
+ xrxx(bsfwt);
|
|
|
+ getPointPostAjax(bsfwt);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ // case '核酸检测':
|
|
|
+ // xxGEO(hscyd);
|
|
|
+ // xrxx(hscyd);
|
|
|
+ // getPointPostAjax(hscyd);
|
|
|
+ // $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ // $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ // $('.left-map').scrollTop(0);
|
|
|
+ // break;
|
|
|
+ case '市场监管':
|
|
|
+ xxGEO(scjdglj);
|
|
|
+ xrxx(scjdglj);
|
|
|
+ getPointPostAjax(scjdglj);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $(this).children('.pop').slideToggle(200);
|
|
|
+ $(this).siblings().find('.pop').hide();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 点击弹窗以外的区域隐藏弹窗
|
|
|
+ $(document).on("click", function (e) {
|
|
|
+ if (!$(e.target).is($(".img_tab img")) && !$(e.target).is($(".img_tab img")) && $(e.target).parent(".img_tab img").length === 0 && !$(e.target).is($(".flex_text")) && !$(e.target).is($(".flex_text")) && $(e.target).parent(".flex_text").length === 0) {
|
|
|
+ $(".img_tab img").parent(".img_tab").find(".pop").css("display", "none");
|
|
|
+ $(".img_tab img").parents(".flex_li").siblings().find(".pop").css("display", "none");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 点击受理场所下的街镇,页面上出现导航
|
|
|
+ $('.text-first p').click(function() {
|
|
|
+ $(this).addClass('tab').siblings().removeClass('tab');
|
|
|
+ const jztext = $(this).text();
|
|
|
+ let addDataJz = [];
|
|
|
+ let silgleJz = [];
|
|
|
+ jzs.map(function(item, index) {
|
|
|
+ addDataJz.push(Object.assign({},item,{clickIndex: 1}))
|
|
|
+ });
|
|
|
+ $.each(addDataJz,function(i){
|
|
|
+ if (addDataJz[i].dep.indexOf(jztext) >= 0){
|
|
|
+ silgleJz.push(addDataJz[i]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ xxGEO(silgleJz);
|
|
|
+ xrjz(silgleJz);
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.mapnav').click(function() {
|
|
|
+ $(this).addClass("choice");
|
|
|
+ $(this).parent("li").siblings().children(".mapnav").removeClass("choice");
|
|
|
+ $("#gj-one").val('').siblings("#gj-two").val('');
|
|
|
+ $("#zj-one").val('').siblings("#zj-two").val('');
|
|
|
+ $(".content-input .layui-tab-item:nth-child(1)").addClass("layui-show").siblings().removeClass("layui-show");
|
|
|
+ $(".search-change li:nth-child(1)").addClass("layui-this").siblings().removeClass("layui-this");
|
|
|
+ $(this).parents('.flex_li').find('.flex_text').css('color','#2775CC').siblings().children('.img_tab').find('.flex_text').css('color','#333333');
|
|
|
+ $('.left-map').scrollTop(0);
|
|
|
+ $('.flex_box').css('padding-top',$('.wrap_fwdt').outerHeight()+10);
|
|
|
+ var xxtx = $(this).text();
|
|
|
+ switch (xxtx){
|
|
|
+ case "小学":
|
|
|
+ xxGEO(xx);
|
|
|
+ xrxx(xx);
|
|
|
+ getPointPostAjax(xx);
|
|
|
+ break;
|
|
|
+ case "中学":
|
|
|
+ let zxmark = []
|
|
|
+ zx.map(function(item) {
|
|
|
+ zxmark.push(Object.assign({},item,{markMiddleSchool: 1}))
|
|
|
+ });
|
|
|
+ xxGEO(zxmark);
|
|
|
+ xrxx(zxmark);
|
|
|
+ getPointPostAjax(zxmark);
|
|
|
+ break;
|
|
|
+ case "特殊教育学校":
|
|
|
+ xxGEO(tsjy);
|
|
|
+ xrxx(tsjy);
|
|
|
+ getPointPostAjax(tsjy);
|
|
|
+ break;
|
|
|
+ case "高等院校":
|
|
|
+ xxGEO(dx);
|
|
|
+ xrxx(dx);
|
|
|
+ getPointPostAjax(dx);
|
|
|
+ break;
|
|
|
+ case "职业教育学校":
|
|
|
+ xxGEO(zyyx);
|
|
|
+ xrxx(zyyx);
|
|
|
+ getPointPostAjax(zyyx);
|
|
|
+ break;
|
|
|
+ case "幼儿园":
|
|
|
+ xxGEO(yey);
|
|
|
+ xrxx(yey);
|
|
|
+ getPointPostAjax(yey);
|
|
|
+ break;
|
|
|
+ case "镇(街道)便民服务中心":
|
|
|
+ xxGEO(ggfwzx);
|
|
|
+ xrxx(ggfwzx);
|
|
|
+ getPointPostAjax(ggfwzx);
|
|
|
+ break;
|
|
|
+ case "村(社区)便民服务站":
|
|
|
+ xxGEO(bmfwzx);
|
|
|
+ xrxx(bmfwzx);
|
|
|
+ getPointPostAjax(bmfwzx);
|
|
|
+ break;
|
|
|
+ case "党群服务中心":
|
|
|
+ xxGEO(dqfwzx);
|
|
|
+ xrxx(dqfwzx);
|
|
|
+ getPointPostAjax(dqfwzx);
|
|
|
+ break;
|
|
|
+ case "殡仪服务机构":
|
|
|
+ xxGEO(byfwjg);
|
|
|
+ xrxx(byfwjg);
|
|
|
+ getPointPostAjax(byfwjg);
|
|
|
+ break;
|
|
|
+ case "村卫生室":
|
|
|
+ xxGEO(cwss);
|
|
|
+ xrxx(cwss);
|
|
|
+ getPointPostAjax(cwss);
|
|
|
+ break;
|
|
|
+ case "社区卫生服务站":
|
|
|
+ xxGEO(sqwsfwz);
|
|
|
+ xrxx(sqwsfwz);
|
|
|
+ getPointPostAjax(sqwsfwz);
|
|
|
+ break;
|
|
|
+ case "儿科诊疗服务机构":
|
|
|
+ xxGEO(ekzlfwjg);
|
|
|
+ xrxx(ekzlfwjg);
|
|
|
+ getPointPostAjax(ekzlfwjg);
|
|
|
+ break;
|
|
|
+ case "狂犬病、破伤风处置门诊":
|
|
|
+ xxGEO(kqbpsfczmz);
|
|
|
+ xrxx(kqbpsfczmz);
|
|
|
+ getPointPostAjax(kqbpsfczmz);
|
|
|
+ break;
|
|
|
+ case "免疫规划预防接种门诊":
|
|
|
+ xxGEO(myghyfjzmz);
|
|
|
+ xrxx(myghyfjzmz);
|
|
|
+ getPointPostAjax(myghyfjzmz);
|
|
|
+ break;
|
|
|
+ case "二级医疗机构":
|
|
|
+ xxGEO(ejyljg);
|
|
|
+ xrxx(ejyljg);
|
|
|
+ getPointPostAjax(ejyljg);
|
|
|
+ break;
|
|
|
+ case "三级医疗机构":
|
|
|
+ xxGEO(sjyljg);
|
|
|
+ xrxx(sjyljg);
|
|
|
+ getPointPostAjax(sjyljg);
|
|
|
+ break;
|
|
|
+ case "社区卫生服务机构":
|
|
|
+ xxGEO(sqwsfwjg);
|
|
|
+ xrxx(sqwsfwjg);
|
|
|
+ getPointPostAjax(sqwsfwjg);
|
|
|
+ break;
|
|
|
+ case "职业病诊断机构":
|
|
|
+ xxGEO(zybzdjg);
|
|
|
+ xrxx(zybzdjg);
|
|
|
+ getPointPostAjax(zybzdjg);
|
|
|
+ break;
|
|
|
+ case "公园":
|
|
|
+ xxGEO(gy);
|
|
|
+ xrxx(gy);
|
|
|
+ getPointPostAjax(gy);
|
|
|
+ break;
|
|
|
+ case "婚姻登记机构":
|
|
|
+ xxGEO(hydjjg);
|
|
|
+ xrxx(hydjjg);
|
|
|
+ getPointPostAjax(hydjjg);
|
|
|
+ break;
|
|
|
+ case "助产医疗机构":
|
|
|
+ xxGEO(zcyljg);
|
|
|
+ xrxx(zcyljg);
|
|
|
+ getPointPostAjax(zcyljg);
|
|
|
+ break;
|
|
|
+ case "产科门诊服务机构":
|
|
|
+ xxGEO(ckmzfwjg);
|
|
|
+ xrxx(ckmzfwjg);
|
|
|
+ getPointPostAjax(ckmzfwjg);
|
|
|
+ break;
|
|
|
+ case "派出所":
|
|
|
+ xxGEO(pcs);
|
|
|
+ xrxx(pcs);
|
|
|
+ getPointPostAjax(pcs);
|
|
|
+ break;
|
|
|
+ case "出入境业务办理机构":
|
|
|
+ xxGEO(crjywbljg);
|
|
|
+ xrxx(crjywbljg);
|
|
|
+ getPointPostAjax(crjywbljg);
|
|
|
+ break;
|
|
|
+ case "交通支大队":
|
|
|
+ xxGEO(jtxljcdd);
|
|
|
+ xrxx(jtxljcdd);
|
|
|
+ getPointPostAjax(jtxljcdd);
|
|
|
+ break;
|
|
|
+ case "交通违法处理机构":
|
|
|
+ xxGEO(jtwfcljg);
|
|
|
+ xrxx(jtwfcljg);
|
|
|
+ getPointPostAjax(jtwfcljg);
|
|
|
+ break;
|
|
|
+ case "交通事故处理机构":
|
|
|
+ xxGEO(jtsgcljg);
|
|
|
+ xrxx(jtsgcljg);
|
|
|
+ getPointPostAjax(jtsgcljg);
|
|
|
+ break;
|
|
|
+ case "车管所":
|
|
|
+ xxGEO(cgs);
|
|
|
+ xrxx(cgs);
|
|
|
+ getPointPostAjax(cgs);
|
|
|
+ break;
|
|
|
+ case "机动车检测场所":
|
|
|
+ xxGEO(jdcjccs);
|
|
|
+ xrxx(jdcjccs);
|
|
|
+ getPointPostAjax(jdcjccs);
|
|
|
+ break;
|
|
|
+ case "驾驶人体检医院":
|
|
|
+ xxGEO(jsrtjz);
|
|
|
+ xrxx(jsrtjz);
|
|
|
+ getPointPostAjax(jsrtjz);
|
|
|
+ break;
|
|
|
+ case "养老机构":
|
|
|
+ xxGEO(ylfwjg);
|
|
|
+ xrxx(ylfwjg);
|
|
|
+ getPointPostAjax(ylfwjg);
|
|
|
+ break;
|
|
|
+ case "图书馆":
|
|
|
+ xxGEO(tsg);
|
|
|
+ xrxx(tsg);
|
|
|
+ getPointPostAjax(tsg);
|
|
|
+ break;
|
|
|
+ case "文化馆":
|
|
|
+ xxGEO(whg);
|
|
|
+ xrxx(whg);
|
|
|
+ getPointPostAjax(whg);
|
|
|
+ break;
|
|
|
+ case "文管所":
|
|
|
+ xxGEO(wgs);
|
|
|
+ xrxx(wgs);
|
|
|
+ getPointPostAjax(wgs);
|
|
|
+ break;
|
|
|
+ case "公共体育馆":
|
|
|
+ xxGEO(ggty);
|
|
|
+ xrxx(ggty);
|
|
|
+ getPointPostAjax(ggty);
|
|
|
+ break;
|
|
|
+ case "旅游景点":
|
|
|
+ xxGEO(jq);
|
|
|
+ xrxx(jq);
|
|
|
+ getPointPostAjax(jq);
|
|
|
+ break;
|
|
|
+ case "残疾人服务中心":
|
|
|
+ xxGEO(cjrfwzx);
|
|
|
+ xrxx(cjrfwzx);
|
|
|
+ getPointPostAjax(cjrfwzx);
|
|
|
+ break;
|
|
|
+ case "定点残疾人服务机构":
|
|
|
+ xxGEO(ddcjrfwjg);
|
|
|
+ xrxx(ddcjrfwjg);
|
|
|
+ getPointPostAjax(ddcjrfwjg);
|
|
|
+ break;
|
|
|
+ case "公证处":
|
|
|
+ xxGEO(gzc);
|
|
|
+ xrxx(gzc);
|
|
|
+ getPointPostAjax(gzc);
|
|
|
+ break;
|
|
|
+ case "司法鉴定机构":
|
|
|
+ xxGEO(sfjdjg);
|
|
|
+ xrxx(sfjdjg);
|
|
|
+ getPointPostAjax(sfjdjg);
|
|
|
+ break;
|
|
|
+ case "基层司法所":
|
|
|
+ xxGEO(jcfwfws);
|
|
|
+ xrxx(jcfwfws);
|
|
|
+ getPointPostAjax(jcfwfws);
|
|
|
+ break;
|
|
|
+ case "法律援助机构":
|
|
|
+ xxGEO(flyzzx);
|
|
|
+ xrxx(flyzzx);
|
|
|
+ getPointPostAjax(flyzzx);
|
|
|
+ break;
|
|
|
+ case "医疗保障事务中心":
|
|
|
+ xxGEO(yb);
|
|
|
+ xrxx(yb);
|
|
|
+ getPointPostAjax(yb);
|
|
|
+ break;
|
|
|
+ case "生源地助学贷款办理点":
|
|
|
+ xxGEO(dkbld);
|
|
|
+ xrxx(dkbld);
|
|
|
+ getPointPostAjax(dkbld);
|
|
|
+ break;
|
|
|
+ case "车驾管社会服务站":
|
|
|
+ xxGEO(cjgshfwz);
|
|
|
+ xrxx(cjgshfwz);
|
|
|
+ getPointPostAjax(cjgshfwz);
|
|
|
+ break;
|
|
|
+ case "教育考试中心":
|
|
|
+ xxGEO(jykszx);
|
|
|
+ xrxx(jykszx);
|
|
|
+ getPointPostAjax(jykszx);
|
|
|
+ break;
|
|
|
+ case "区级政务服务中心":
|
|
|
+ xxGEO(xzfwzx);
|
|
|
+ xrxx(xzfwzx);
|
|
|
+ getPointPostAjax(xzfwzx);
|
|
|
+ break;
|
|
|
+ case "矫正中心":
|
|
|
+ xxGEO(jzzx);
|
|
|
+ xrxx(jzzx);
|
|
|
+ getPointPostAjax(jzzx);
|
|
|
+ break;
|
|
|
+ case "就业和人才中心":
|
|
|
+ xxGEO(jyhrczx);
|
|
|
+ xrxx(jyhrczx);
|
|
|
+ getPointPostAjax(jyhrczx);
|
|
|
+ break;
|
|
|
+ case "社会保险事务中心":
|
|
|
+ xxGEO(shbxswzx);
|
|
|
+ xrxx(shbxswzx);
|
|
|
+ getPointPostAjax(shbxswzx);
|
|
|
+ break;
|
|
|
+ case "商圈":
|
|
|
+ xxGEO(sq);
|
|
|
+ xrxx(sq);
|
|
|
+ getPointPostAjax(sq);
|
|
|
+ break;
|
|
|
+ case "购物中心":
|
|
|
+ xxGEO(gwzx);
|
|
|
+ xrxx(gwzx);
|
|
|
+ getPointPostAjax(gwzx);
|
|
|
+ break;
|
|
|
+ case "核酸采样点":
|
|
|
+ xxGEO(hscyd);
|
|
|
+ xrxx(hscyd);
|
|
|
+ getPointPostAjax(hscyd);
|
|
|
+ break;
|
|
|
+ case "酒店":
|
|
|
+ xxGEO(jd);
|
|
|
+ xrxx(jd);
|
|
|
+ getPointPostAjax(jd);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ $('.title-first1:nth-child(2)').css('padding-top',60);
|
|
|
+ });
|
|
|
+ // $('input.inp').on('input',function(e){
|
|
|
+ // console.log(e)
|
|
|
+ // console.log($('.inp').val())
|
|
|
+ // let sev = $('.inp').val();
|
|
|
+ // if (sev !== null && sev !== ''){
|
|
|
+ // replaceParamVal("se",$('.inp').val())
|
|
|
+ // }else {
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ function replaceParamVal(paramName,replaceWith) {
|
|
|
+ var oUrl = this.location.href.toString();
|
|
|
+ // console.log(oUrl)
|
|
|
+ var re=eval('/('+ paramName+'=)([^&]*)/gi');
|
|
|
+ // console.log(re)
|
|
|
+ var nUrl = oUrl.replace(re,paramName+'='+replaceWith);
|
|
|
+ // console.log(nUrl)
|
|
|
+ this.location = nUrl;
|
|
|
+ window.location.hash=nUrl
|
|
|
+ }
|
|
|
+ function replaceParamVal2(paramName,replaceWith) {
|
|
|
+ let search = window.location.search;
|
|
|
+ var oUrl = this.location.href.toString();
|
|
|
+ if (search.indexOf("se")!=-1){
|
|
|
+ // console.log(oUrl)
|
|
|
+ var re=eval('/('+ paramName+'=)([^&]*)/gi');
|
|
|
+ // console.log(re)
|
|
|
+ var nUrl = oUrl.replace(re,paramName+'='+replaceWith);
|
|
|
+ // console.log(nUrl)
|
|
|
+ this.location = nUrl;
|
|
|
+ window.location.href=nUrl
|
|
|
+ }else {
|
|
|
+ var nUrl = oUrl+"?se="+replaceWith;
|
|
|
+ this.location = nUrl;
|
|
|
+ window.location.href=nUrl
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点击列表中的一条,重置地图中心点
|
|
|
+ $(document).on('click', '.title-first li', function() {
|
|
|
+ var dep_text = $(this).parents('.title-first').find('li:nth-child(1)').attr('title');
|
|
|
+ var dictType_text=$(this).parents('.title-first1').children('ul').find('li:nth-child(1)').attr('dictType');
|
|
|
+ let cilckList = [];
|
|
|
+ var getClickDep,typepage=0;
|
|
|
+ allArr.map(function(item) {
|
|
|
+ cilckList.push(Object.assign({},item,{clickIndex: 1}))
|
|
|
+ });
|
|
|
+ let getClick1 = cilckList.filter(function(item) {
|
|
|
+ return item.dep == dep_text
|
|
|
+ // return (item.dep == dep_text)&&(item.dictType == dictType_text)
|
|
|
+ });
|
|
|
+ for (let i = 0; i < getClick1.length; i++) {
|
|
|
+ for (let j = i + 1; j < getClick1.length; j++) {
|
|
|
+ if (getClick1[j].dep === getClick1[i].dep) {
|
|
|
+ getClick1.splice(j, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let getClick = getClick1.filter(function(item) {
|
|
|
+ return item.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ $.each(getClick,function(i){
|
|
|
+ getClickDep = getClick[i].dep
|
|
|
+ });
|
|
|
+ pageAjax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ $(this).parents('.title-first').css('background-color', '#d6e5f7').siblings().css('background-color', '');
|
|
|
+ });
|
|
|
+ $(document).on('click', '.title-first1 ul li,.typeFirst', function() {
|
|
|
+ var dep_text = $(this).parents('.title-first1').children('ul').find('li:nth-child(1)').attr('title');
|
|
|
+ var dictType_text=$(this).parents('.title-first1').children('ul').find('li:nth-child(1)').attr('dictType');
|
|
|
+ let cilckList = [];
|
|
|
+ var getClickAddress,getClickDep;
|
|
|
+ allArr.map(function(item) {
|
|
|
+ cilckList.push(Object.assign({},item,{clickIndex: 1}))
|
|
|
+ });
|
|
|
+ let getClick1 = cilckList.filter(function(item) {
|
|
|
+ return (item.dep == dep_text)&&(item.dictType == dictType_text)
|
|
|
+ });
|
|
|
+ for (let i=0;i<getClick1.length;i++){
|
|
|
+ for (let j=i+1;j<getClick1.length;j++) {
|
|
|
+ if (getClick1[j].dep===getClick1[i].dep){
|
|
|
+ getClick1.splice(j,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let getClick = getClick1.filter(function(item){
|
|
|
+ return item.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ $.each(getClick1,function(i){
|
|
|
+ getClickAddress = getClick1[i].address
|
|
|
+ });
|
|
|
+ $.each(getClick,function(i){
|
|
|
+ getClickDep = getClick[i].dep
|
|
|
+ });
|
|
|
+ if (getClickAddress == '重庆市南岸区茶园广福大道12号行政中心B区2号楼1楼' || getClickAddress == '重庆市南岸区南坪西路36号'){
|
|
|
+ var typepage = 3
|
|
|
+ pageAjax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }else if(getClickAddress == '重庆市南岸区广福大道12号行政中心B区1号楼3楼'){
|
|
|
+ var typepage = 5
|
|
|
+ pageAjax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }else{
|
|
|
+ var typepage = 0
|
|
|
+ pageAjax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }
|
|
|
+ $(this).parents('.title-first1').css('background-color', '#d6e5f7').siblings().css('background-color','');
|
|
|
+ });
|
|
|
+
|
|
|
+ // 鼠标hover时,出现我要纠错
|
|
|
+ $(document).on('mouseover','.title-first, .title-first1',function(){
|
|
|
+ $(this).find('.correct_text').removeAttr('style').css({'color':'#2775CC','text-decoration':'underline'});
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.title-first, .title-first1',function(){
|
|
|
+ $(this).find('.correct_text').css({'color':'#2775CC','text-decoration':'underline','visibility':'hidden'});
|
|
|
+ });
|
|
|
+
|
|
|
+ function pageAjax(getClickDep,getClick1,getClick,typepage){
|
|
|
+ if(typepage == 3){
|
|
|
+ addajax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }else if(typepage == 5){
|
|
|
+ addajax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }else if (getClick.length == 0){
|
|
|
+ xxGEO(getClick1);
|
|
|
+ }else{
|
|
|
+ addajax(getClickDep,getClick1,getClick,typepage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function addajax(getClickDep,getClick1,getClick,typepage){
|
|
|
+ var obj;
|
|
|
+ if (typepage == 3 || typepage == 5){
|
|
|
+ obj={
|
|
|
+ page: 1,
|
|
|
+ limit: 4,
|
|
|
+ type: typepage
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ obj={
|
|
|
+ page: 1,
|
|
|
+ limit: 4,
|
|
|
+ type: typepage,
|
|
|
+ matterDept: getClickDep
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: PATH + '/mapdata/getHandMatterPage',
|
|
|
+ // url: "http://192.168.1.253:7777/mapdata/getHandMatterPage",
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ data: obj,
|
|
|
+ success: function(res) {
|
|
|
+ if (res.data != null) {
|
|
|
+ map.clearOverlays();
|
|
|
+ if (typepage == 3 || typepage == 5){
|
|
|
+ renderInformationWindow(getClick1,res,typepage)
|
|
|
+ }else{
|
|
|
+ renderInformationWindow(getClick,res,typepage)
|
|
|
+ }
|
|
|
+ } else{
|
|
|
+ xxGEO(getClick)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function renderInformationWindow(arr,res,typepage){
|
|
|
+ for (var z = 0; z < arr.length; z++) {
|
|
|
+ var add = arr[z].address;
|
|
|
+ const tempAdd = add;
|
|
|
+ var addFirst;
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ var address = new BMapGL.Point(point.lng, point.lat);
|
|
|
+ addFirst = address;
|
|
|
+ for (var index = 0; index < arr.length; index++) {
|
|
|
+ var arrdep = arr[index].dep;
|
|
|
+ var arraddre = arr[index].address;
|
|
|
+ var arrtype = arr[index].type;
|
|
|
+ var arrspecial = arr[index].specialtype;
|
|
|
+ var arrcontent = arr[index].content;
|
|
|
+ var arrimg = arr[index].img;
|
|
|
+ var arrtel = arr[index].tel;
|
|
|
+ var arrtime = arr[index].time;
|
|
|
+ var arrIndex = arr[index].clickIndex;
|
|
|
+ var arrUrl = arr[index].url;
|
|
|
+ var arrSptype = arr[index].sptype;
|
|
|
+ var sContnet = ''
|
|
|
+ sContnet += "<ul class='titleFirstDifrenet'>"
|
|
|
+ sContnet +="<img class='infor-close-icon' style='' src='./img/close.png'/>"
|
|
|
+
|
|
|
+ if (arrimg == ""||(arrimg==undefined||arrimg==null)) {
|
|
|
+ sContnet += ''
|
|
|
+ }else{
|
|
|
+ sContnet += "<li class='img_box'><img class='two_img' src='"+PATH+arrimg+"'></li>"
|
|
|
+ }
|
|
|
+ sContnet+="<li class='title_flex' title='"+arrdep+"'>"+arrdep
|
|
|
+ if ((arrtype==null||arrtype==undefined)||arrtype==''){
|
|
|
+ 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'>· "+arrtype+"</p>"
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ if ((arrcontent==undefined||arrcontent==null)||arrcontent==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<li><a class='a_blue'><p class='content_p'>"+arrcontent+"</p></a>"
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ sContnet += "<li class='address_box'><p><img style='' src='./img/iconAddr.png' class='flex_address'/><span class='addTress'>"+arraddre+"</span></p>"
|
|
|
+ if ((arrtel==null||arrtel==undefined)||arrtel==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p><img src='./img/iconPhone.png' class='flex_address'/>"+arrtel+"</p>"
|
|
|
+ }
|
|
|
+ if ((arrtime==null||arrtime==undefined)||arrtime==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype=='查阅场所'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>查询时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrSptype=='受理场所'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>受理时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrSptype=='政务服务'||arrSptype=='办税服务'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>办理时间:</span>"+arrtime+"</p>"
|
|
|
+ }else {
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>办公时间:</span>"+arrtime+"</p>"
|
|
|
+ }
|
|
|
+ sContnet += "<li style='display: flex;margin-top: 10px'><a style='color: #FFFFFF;background: #2775CC;border: 1px solid #2775CC;' class='iconBtn'><img style='width: 12px' src='./img/matterc.png'/><span>可办事项</span></a>"
|
|
|
+ if ((arrUrl==undefined||arrUrl==null)||arrUrl==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype=="民政服务"){
|
|
|
+ sContnet += "<a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>预约祭扫</span></a>"
|
|
|
+ } else if(arrSptype=="住房保障"){
|
|
|
+ sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>公租房申请</span></a>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<br><a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>在线预约</span></a>"
|
|
|
+ }
|
|
|
+ sContnet += "<br><a class='correct_html iconBtn'><img src='./img/error.png'/><span>我要纠错</span></a></li>"
|
|
|
+ sContnet += "<div class='grey_line'></div>"
|
|
|
+ sContnet += "<li><div class='flex_four_wrap'>"
|
|
|
+ if (typepage==3||typepage==5){
|
|
|
+ sContnet += "<ul class='text-tab-title-two'><a><img src='./img/zxbl.png'></a>"
|
|
|
+ sContnet += "<a href='http://www.cqna.gov.cn/ghwd/znwd/index.html' target='_blank'><img src='./img/xwgd.png'></a>"
|
|
|
+ sContnet += "</ul>"
|
|
|
+ sContnet += "<div class='text-tab-content'>"
|
|
|
+ sContnet += "<ul class='text-tab-item text-show'>"
|
|
|
+ $.each(res.data,function(j){
|
|
|
+ sContnet += "<li><a href='"+res.data[j].matterUrl+"' target='_blank'><h6></h6>"
|
|
|
+ sContnet += "<p title='"+res.data[j].itemName+"'>"+res.data[j].itemName+"</p></a></li>"
|
|
|
+ });
|
|
|
+ sContnet += "</ul></div></div></li>"
|
|
|
+ // sContnet += "<li class='btn_box'><button class='one_bus'>公交</button><button class='two_car'>自驾</button></li>"
|
|
|
+ sContnet += "</ul>"
|
|
|
+ }else{
|
|
|
+ sContnet += "<ul class='text-tab-title'>"
|
|
|
+ sContnet += "<li class='text-this'>个人办事</li><li>法人办事</li>"
|
|
|
+ sContnet += "<a href='http://www.cqna.gov.cn/ghwd/znwd/index.html' target='_blank'><img src='./img/xwgd.png'></a>"
|
|
|
+ sContnet += "<a><img src='./img/zxbl.png'></a></ul>"
|
|
|
+ sContnet += "<div class='text-tab-content'><ul class='text-tab-item text-show'>"
|
|
|
+ $.each(res.data,function(j){
|
|
|
+ sContnet += "<li><a href='"+res.data[j].matterUrl+"' target='_blank'>"
|
|
|
+ sContnet += "<h6></h6>"
|
|
|
+ sContnet += "<p title='"+res.data[j].itemName+"'>"+res.data[j].itemName+"</p>"
|
|
|
+ sContnet += "</a>"
|
|
|
+ sContnet += "</li>"
|
|
|
+ });
|
|
|
+ sContnet += "</ul><ul class='text-tab-item'></ul></div>"
|
|
|
+ sContnet += "</div><div id='demo'></div></li>"
|
|
|
+ // sContnet += "<li class='btn_box'><button class='one_bus'>公交</button><button class='two_car'>自驾</button></li>"
|
|
|
+ sContnet += "</ul>"
|
|
|
+
|
|
|
+ }
|
|
|
+ if (tempAdd == arraddre) {
|
|
|
+ addMarker(arrIndex,address,new BMapGL.InfoWindow(sContnet, arraddre),arrdep,typepage);
|
|
|
+ map.setCenter(addFirst);
|
|
|
+ }
|
|
|
+ document.querySelectorAll(".two_img").onload = function() {
|
|
|
+ infoWindow.redraw();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将json数据渲染到地图
|
|
|
+ function xxGEO(arr){
|
|
|
+ map.clearOverlays();
|
|
|
+ var addFirst;
|
|
|
+ if (!arr){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ for (var z = 0; z < arr.length; z++) {
|
|
|
+ var add = arr[z].address;
|
|
|
+ const tempAdd = add;
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ // var address = new BMapGL.Point(point.lng, point.lat);
|
|
|
+ var address = new BMapGL.Point(point.lng, point.lat);
|
|
|
+ addFirst = address;
|
|
|
+ for (var index = 0; index < arr.length; index++) {
|
|
|
+ var arrdep = arr[index].dep;
|
|
|
+ var arraddre = arr[index].address;
|
|
|
+ var arrtype = arr[index].type;
|
|
|
+ var arrspecial = arr[index].specialtype
|
|
|
+ var arrlebals = arr[index].labels;
|
|
|
+ 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 arrIndex = arr[index].clickIndex;
|
|
|
+ var arrUrl = arr[index].url;
|
|
|
+ var arrSptype = arr[index].sptype;
|
|
|
+ var arrgzh = arr[index].gzh;
|
|
|
+ var typepage;
|
|
|
+ var sContnet = ''
|
|
|
+ sContnet += "<ul class='titleFirst'>"
|
|
|
+ sContnet +="<img class='infor-close-icon' style='' src='./img/close.png'/>"
|
|
|
+ if (arrimg==""||(arrimg==undefined||arrimg==null)){
|
|
|
+ sContnet += ''
|
|
|
+ }else{
|
|
|
+ sContnet += "<li class='img_box'><img class='two_img' src='"+PATH+arrimg+"'></li>"
|
|
|
+ }
|
|
|
+ sContnet+="<li style='' class='title_flex' title='"+arrdep+"'>"+arrdep
|
|
|
+ if ((arrtype==null||arrtype==undefined)||arrtype==''){
|
|
|
+ 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'>· "+arrtype+"</p>"
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ if ((arrtag==null||arrtag==undefined)||arrtag==''){
|
|
|
+ sContnet += ""
|
|
|
+ } else {
|
|
|
+ sContnet += "<li class='flex_orange'><div class='three_tag' style='border: 1px solid #FF843F;background: #FFF7F3;color: #FF843F;'>"+arrtag
|
|
|
+ if ((arrtag2==undefined||arrtag2==null)||arrtag2==''){
|
|
|
+ sContnet += "</div>"
|
|
|
+ }else{
|
|
|
+ sContnet += "</div><div class='three_tag' style='border: 1px solid #41B643;background: #F0F6F0;color: #43BB45;'>"+arrtag2+"</div>"
|
|
|
+ }
|
|
|
+ if ((arrtag3==undefined||arrtag3==null)||arrtag3==''){
|
|
|
+ sContnet += "</li>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<div class='three_tag' style='border: 1px solid #40A2F3;background: #EFF6FC;color: #40A2F3;'>"+arrtag3+"</div></li>"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sContnet += "<li class='address_box'><div style='display: flex;justify-content: space-between;'>"
|
|
|
+ sContnet += "<div><p><img style='' src='./img/iconAddr.png' class='flex_address'/><span class='addTress'>"+arraddre+"</span></p>"
|
|
|
+ if ((arrtel==null||arrtel==undefined)||arrtel==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ sContnet += "<p><img src='./img/iconPhone.png' class='flex_address'/>"+arrtel+"</p>"
|
|
|
+ }
|
|
|
+ if ((arrtime==null||arrtime==undefined)||arrtime==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype=='查阅场所'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>查询时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrSptype=='受理场所'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>受理时间:</span>"+arrtime+"</p>"
|
|
|
+ } else if(arrSptype=='政务服务'||arrSptype=='办税服务'){
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>办理时间:</span>"+arrtime+"</p>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<p style='color: #666666'><span class='flex_address'>办公时间:</span>"+arrtime+"</p>"
|
|
|
+ }
|
|
|
+ sContnet += '</div>'
|
|
|
+ if ((arrgzh==undefined||arrgzh==null)||arrgzh==''){
|
|
|
+ sContnet += ''
|
|
|
+ }else if(arrSptype=="交通服务"){
|
|
|
+ sContnet += "<div class='gzh_img'><img class='two_img' src='"+PATH+arrgzh+"'><p>微信扫描公众号办理</p></div>"
|
|
|
+ }else if(arrSptype=="文体旅游"||arrtype=="城市公园"){
|
|
|
+ sContnet += "<div class='gzh'><img class='two_img' src='"+PATH+arrgzh+ "'><p>微信扫描公众号预约服务</p></div>"
|
|
|
+ }else{
|
|
|
+ sContnet += "<div class='gzh_img'><img class='two_img' src='"+PATH+arrgzh+ "'><p>微信扫描公众号预约挂号</p></div>"
|
|
|
+ }
|
|
|
+ // var arrlebals = "这个";
|
|
|
+ if ((arrlebals==undefined||arrlebals==null)||arrlebals==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else {
|
|
|
+ var arrLebals=arrlebals.split(",");
|
|
|
+ console.log(arrLebals)
|
|
|
+ sContnet += "<li class='flex_orange'>"
|
|
|
+ for(var i=0;i<arrLebals.length;i++){
|
|
|
+ if((i+1) % 2 == 0) {
|
|
|
+ sContnet += "<div class='three_tag' style='border: 1px solid #41B643;background: #F0F6F0;color: #43BB45;'>"+arrLebals[i]+"</div>"
|
|
|
+ }else if((i+1) % 3 == 0){
|
|
|
+ sContnet += "<div class='three_tag' style='border: 1px solid #40A2F3;background: #EFF6FC;color: #40A2F3;'>"+arrLebals[i]+"</div>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<div class='three_tag' style='border: 1px solid #FF843F;background: #FFF7F3;color: #FF843F;'>"+arrLebals[i]+"</div>"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ }
|
|
|
+ if (arrcontent==""||(arrcontent==undefined||arrcontent==null)){
|
|
|
+ sContnet += "<li style='display: flex;margin-top: 10px'>"
|
|
|
+ }else{
|
|
|
+ sContnet += "<li style='display: flex;margin-top: 10px'><a class='correct_html iconBtn' style='color: #FFFFFF;background: #2775CC;border: 1px solid #2775CC;'><img src='./img/floor.png'/><span>介绍</span></a>"
|
|
|
+ }
|
|
|
+ if ((arrUrl==undefined||arrUrl==null)||arrUrl==''){
|
|
|
+ sContnet += ''
|
|
|
+ } else if(arrSptype=="民政服务") {
|
|
|
+ sContnet += "<a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>预约祭扫</span></a>"
|
|
|
+ }else if(arrSptype=="住房保障"){
|
|
|
+ sContnet += "<a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>公租房申请</span></a>"
|
|
|
+ } else {
|
|
|
+ sContnet += "<a href='"+arrUrl+"' target='_blank' style='' class='iconBtn'><img src='./img/reservation.png'/><span>在线预约</span></a>"
|
|
|
+ }
|
|
|
+ sContnet += "<a class='correct_html iconBtn'><img src='./img/error.png'/><span>我要纠错</span></a></li>"
|
|
|
+ if (arrcontent==""||(arrcontent==undefined||arrcontent==null)){
|
|
|
+ sContnet += ''
|
|
|
+ }else{
|
|
|
+ sContnet += "<li><a class='a_blue'><p class='content_p'>"+arrcontent+"</p></a>"
|
|
|
+ }
|
|
|
+ sContnet += "</li>"
|
|
|
+ // sContnet += "<li class='btn_box'><button class='one_bus'>公交</button><button class='two_car'>自驾</button></li><br/></ul>"
|
|
|
+ if (tempAdd==arraddre){
|
|
|
+ addMarker(arrIndex,address,new BMapGL.InfoWindow(sContnet, arraddre),arrdep,typepage);
|
|
|
+ }
|
|
|
+ document.querySelectorAll(".two_img").onload = function() {
|
|
|
+ infoWindow.redraw();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 将经纬度解析之后的传回后端
|
|
|
+ async function getPointPostAjax(arr){
|
|
|
+ var dataString;
|
|
|
+ var mapList=[];
|
|
|
+ if (!arr){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ for(var z=0;z<arr.length;z++){
|
|
|
+ var add=arr[z].address;
|
|
|
+ const tempAdd=add;
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(tempAdd, function(point) {
|
|
|
+ if (point) {
|
|
|
+ // var address = new BMapGL.Point(point.lng, point.lat);
|
|
|
+ var address = new BMapGL.Point(point.lng, point.lat);
|
|
|
+ var obj = {
|
|
|
+ "id": arr[z].id,
|
|
|
+ "longitude": address.lng,
|
|
|
+ "latitude": address.lat
|
|
|
+ }
|
|
|
+ mapList.push(obj);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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','.correct_text',function(){
|
|
|
+ var address_text = $(this).siblings('li').find(".jzdz").text();
|
|
|
+ var filterId = allArr.filter(function(i){
|
|
|
+ return i.address == address_text
|
|
|
+ });
|
|
|
+ $.each(filterId,function(i){
|
|
|
+ localStorage.setItem("passid",filterId[i].id);
|
|
|
+ })
|
|
|
+ $(this).attr('href','correct.html');
|
|
|
+ })
|
|
|
+
|
|
|
+ // 渲染政务公开以外的列表
|
|
|
+ function xrxx(arr) {
|
|
|
+ console.log(arr)
|
|
|
+ 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 dep = arr[item].dep;
|
|
|
+ var tel = arr[item].tel;
|
|
|
+ var address = arr[item].address;
|
|
|
+ var type = arr[item].type;
|
|
|
+ var dictType=arr[item].dictType;
|
|
|
+ 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=='') {
|
|
|
+ html += ''
|
|
|
+ } else if (markMiddleSchool != undefined){
|
|
|
+ html += "<p class='typeFirst othertypeFirst'>"+specialtype+"</p>"
|
|
|
+ }else if ((type=='路内停车场'||type=='室外停车场')||type=='职业教育学校'){
|
|
|
+ html += "<p class='typeFirst tcstyletypeFirst'>"+type+"</p>"
|
|
|
+ } else {
|
|
|
+ html += "<p class='typeFirst othertypeFirst'>"+type+"</p>"
|
|
|
+ }
|
|
|
+ if ((sptype==undefined||sptype==null)||sptype=='') {
|
|
|
+ html += ''
|
|
|
+ }else if((sptype=='不动产登记'||sptype=='党群服务中心')||sptype=='住房公积金'){
|
|
|
+ html += "<p class='typeFirst tcstyletypeFirst'>"+sptype+"</p>"
|
|
|
+ } else {
|
|
|
+ html += "<p class='typeFirst othertypeFirst'>"+sptype+"</p>"
|
|
|
+ }
|
|
|
+ html += "<ul><li title='"+dep+"' dictType='"+dictType+"'><span>"+sum+"."+"</span>"+dep+"</li><li>"
|
|
|
+ if ((tel==null||tel == undefined)||tel==''){
|
|
|
+ html += ''
|
|
|
+ } else {
|
|
|
+ html += "<p>"+"电话:"+tel+"</p>"
|
|
|
+ }
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 实现列表的收起和展开
|
|
|
+ $(document).on("click", ".back_btn ", function() {
|
|
|
+ $(".title-first1").fadeIn(600);
|
|
|
+ $('.flex_box').removeAttr('style');
|
|
|
+ $(this).text('返回');
|
|
|
+ $(".title-first1").fadeOut(0);
|
|
|
+ $(".flex_li").fadeIn(600);
|
|
|
+ $('.text-second').empty();
|
|
|
+ $('.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 == '' || tel == undefined) ||tel == null){
|
|
|
+ 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>" +
|
|
|
+ "条记录"
|
|
|
+ );
|
|
|
+ $('.districtLevel2').empty().append(html);
|
|
|
+ $('.textThird2').empty().append(
|
|
|
+ "共" +
|
|
|
+ "<span>" + sum + "</span>" +
|
|
|
+ "条记录"
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ // 渲染查阅场所列表
|
|
|
+ function cycsone(cycsbms) {
|
|
|
+ var html3 = ''
|
|
|
+ for (var index = 0; index < cycsbms.length; index++) {
|
|
|
+ var bmdep = cycsbms[index].dep;
|
|
|
+ var bmdhs = cycsbms[index].tel;
|
|
|
+ var bmdzs = cycsbms[index].address;
|
|
|
+ var num = 1;
|
|
|
+ num += index;
|
|
|
+ html3 += "<ul class='title-first'>"
|
|
|
+ html3 += "<li>"
|
|
|
+ html3 += "<span>" + num + "." + "</span>" + bmdep + "</li>"
|
|
|
+ html3 += "<li>"
|
|
|
+ if ((bmdhs == undefined || bmdhs == null) || bmdhs == ''){
|
|
|
+ html3 += ''
|
|
|
+ } else {
|
|
|
+ html3 += "<p>" + "电话:" + bmdhs + "</p>"
|
|
|
+ }
|
|
|
+ html3 += "<div class='differentdz'>" + "地址:" + "<p class='jzdz'>" + bmdzs + "</p>" + "</div>"
|
|
|
+ html3 += "</li>"
|
|
|
+ html3 += "<a class='correct_text' target='_blank' style='color: #2775CC;text-decoration:underline;visibility: hidden;'>我要纠错</a>"
|
|
|
+ html3 += "</ul>"
|
|
|
+ };
|
|
|
+ $('.districtLevel2').empty().append(html3);
|
|
|
+ $('.textThird2').empty().append(
|
|
|
+ "共" +
|
|
|
+ "<span>" + num + "</span>" +
|
|
|
+ "条记录"
|
|
|
+ );
|
|
|
+ $(".districtLevel2>input").bind('keyup blur',function(){
|
|
|
+ var reg= /[^\w\u4e00-\u9fa5\/\-]/gi;
|
|
|
+ var val=$(this).val();
|
|
|
+ if(reg.test(val)){
|
|
|
+ $(this).val($(this).val().replace(reg,''));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ // 渲染查阅场所的街镇
|
|
|
+ function slcsjzs(slcsjz) {
|
|
|
+ var html3 = ''
|
|
|
+ for (var index = 0; index < slcsjz.length; index++) {
|
|
|
+ var bmdep = slcsjz[index].dep;
|
|
|
+ var bmdhs = slcsjz[index].tel;
|
|
|
+ var bmdzs = slcsjz[index].address;
|
|
|
+ var num = 1;
|
|
|
+ num += index;
|
|
|
+ html3 += "<ul class='title-first'>"
|
|
|
+ html3 += "<li>"
|
|
|
+ html3 += "<span>" + num + "." + "</span>" + bmdep + "</li>"
|
|
|
+ html3 += "</li>"
|
|
|
+ html3 += "<li>"
|
|
|
+ if ((bmdhs == null || bmdhs == undefined) || bmdhs == ''){
|
|
|
+ html3 += ''
|
|
|
+ } else {
|
|
|
+ html3 += "<p>" + "电话:" + bmdhs + "</p>"
|
|
|
+ }
|
|
|
+ html3 += "<div class='differentdz'>" + "地址:" + "<p class='jzdz'>" + bmdzs + "</p>" + "</div>"
|
|
|
+ html3 += "</li>"
|
|
|
+ html3 += "<a class='correct_text' target='_blank' style='color: #2775CC;text-decoration:underline;visibility: hidden;'>我要纠错</a>"
|
|
|
+ html3 += "</ul>"
|
|
|
+ };
|
|
|
+ $('.districtLevel2').empty().append(html3);
|
|
|
+ $('.textThird2').empty().append(
|
|
|
+ "共" +
|
|
|
+ "<span>" + num + "</span>" +
|
|
|
+ "条记录"
|
|
|
+ );
|
|
|
+ $(".districtLevel2>input").bind('keyup blur',function(){
|
|
|
+ var reg= /[^\w\u4e00-\u9fa5\/\-]/gi;
|
|
|
+ var val=$(this).val();
|
|
|
+ if(reg.test(val)){
|
|
|
+ $(this).val($(this).val().replace(reg,''));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ function addMarker(getIndex,point,infoWindow,dep,typepage) {
|
|
|
+ // 存放总数的值
|
|
|
+ var count;
|
|
|
+ // var myIcon = new BMapGL.Icon("./img/location.png", new BMapGL.Size(40, 40));
|
|
|
+ // var marker = new BMapGL.Marker(point, {
|
|
|
+ // icon: myIcon
|
|
|
+ // });
|
|
|
+ var myIcon = new BMapGL.Icon("./img/location.png", new BMapGL.Size(40, 40));
|
|
|
+ var marker = new BMapGL.Marker(point, {
|
|
|
+ icon: myIcon
|
|
|
+ });
|
|
|
+ map.addOverlay(marker);
|
|
|
+ if (getIndex) {
|
|
|
+ map.openInfoWindow(infoWindow, point);
|
|
|
+ $(".one_bus").click(function() {
|
|
|
+ var _this = this;
|
|
|
+ busClickEvent(_this);
|
|
|
+ });
|
|
|
+ $(".two_car").click(function() {
|
|
|
+ var _this = this;
|
|
|
+ drivingClickEvent(_this);
|
|
|
+ });
|
|
|
+ //自定义弹窗的关闭按钮
|
|
|
+ $('.infor-close-icon').click(function () {
|
|
|
+ map.closeInfoWindow();
|
|
|
+ })
|
|
|
+
|
|
|
+ $(".two_img").css('cursor','pointer')
|
|
|
+ //点击图片放大
|
|
|
+ $(".two_img").click(function() {
|
|
|
+ //获取图片路径
|
|
|
+ var imgsrc = $(this).attr("src");
|
|
|
+ var opacityBottom = '<div class="opacityBottom" style = "display:none"><img class="bigImg" src="' + imgsrc + '"></div>';
|
|
|
+ $(document.body).append(opacityBottom);
|
|
|
+ $(".opacityBottom").addClass("opacityBottom");//添加遮罩层
|
|
|
+ $(".opacityBottom").show();
|
|
|
+ $("html,body").addClass("none-scroll");//下层不可滑动
|
|
|
+ $(".bigImg").addClass("bigImg");//添加图片样式
|
|
|
+ $(".opacityBottom").click(function () {//点击关闭
|
|
|
+ $("html,body").removeClass("none-scroll");
|
|
|
+ $(".opacityBottom").remove();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('.correct_html').click(function(){
|
|
|
+ // var address_text = $(this).parent(".address_box").find("p:nth-child(1)").text();
|
|
|
+ // var discript_text = address_text.split(":")[1];
|
|
|
+ var discript_text = $(this).parent().siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+
|
|
|
+ var filterId = allArr.filter(function(i){
|
|
|
+ return i.address == discript_text
|
|
|
+ });
|
|
|
+ $.each(filterId,function(i){
|
|
|
+ localStorage.setItem("passid",filterId[i].id);
|
|
|
+ })
|
|
|
+ $(this).attr('href','correct.html');
|
|
|
+ });
|
|
|
+ // 信息窗口内的我要纠错,点击之后跳转链接
|
|
|
+ $('.correct_html').click(function(){
|
|
|
+ // var address_text = $(this).parent(".address_box").find("p:nth-child(1)").text();
|
|
|
+ // var discript_text = address_text.split(":")[1];
|
|
|
+ var discript_text = $(this).parent().siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+ var filterId = allArr.filter(function(i){
|
|
|
+ return i.address == discript_text
|
|
|
+ });
|
|
|
+ $.each(filterId,function(i){
|
|
|
+ localStorage.setItem("passid",filterId[i].id);
|
|
|
+ })
|
|
|
+ $(this).attr('href','correct.html');
|
|
|
+ });
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ if(typepage==0){
|
|
|
+ var firstpage=1,pagetype=0;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 0
|
|
|
+ page(obj.curr,pagetype)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.text-tab-title li').click(function(){
|
|
|
+ var tabtex = $(this).text();
|
|
|
+ $(this).addClass('text-this').siblings().removeClass('text-this');
|
|
|
+ if(tabtex == '个人办事'){
|
|
|
+ $('.text-tab-content .text-tab-item:nth-child(1)').addClass('text-show').siblings().removeClass('text-show')
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ var firstpage = 1,pagetype = 0;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 0
|
|
|
+ page(obj.curr,pagetype)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $('.text-tab-content .text-tab-item:nth-child(2)').addClass('text-show').siblings().removeClass('text-show');
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ var firstpage=1,pagetype=1;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 1
|
|
|
+ page(obj.curr,pagetype)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ marker.addEventListener("click", function() {
|
|
|
+ map.openInfoWindow(infoWindow, point); //开启信息窗口
|
|
|
+ });
|
|
|
+ // 在地图上点击图标之后,信息窗口打开
|
|
|
+ infoWindow.addEventListener("open", function () {
|
|
|
+ $(".one_bus").click(function () {
|
|
|
+ var that = this;
|
|
|
+ busClickEvent(that);
|
|
|
+ });
|
|
|
+ $(".two_car").click(function () {
|
|
|
+ var that = this;
|
|
|
+ drivingClickEvent(that);
|
|
|
+ });
|
|
|
+
|
|
|
+ //自定义弹窗的关闭按钮
|
|
|
+ $('.infor-close-icon').click(function () {
|
|
|
+ map.closeInfoWindow();
|
|
|
+ })
|
|
|
+
|
|
|
+ $(".two_img").css('cursor','pointer')
|
|
|
+ //点击图片放大
|
|
|
+ $(".two_img").click(function() {
|
|
|
+ //获取图片路径
|
|
|
+ var imgsrc = $(this).attr("src");
|
|
|
+ var opacityBottom = '<div class="opacityBottom" style = "display:none"><img class="bigImg" src="' + imgsrc + '"></div>';
|
|
|
+ $(document.body).append(opacityBottom);
|
|
|
+ $(".opacityBottom").addClass("opacityBottom");//添加遮罩层
|
|
|
+ $(".opacityBottom").show();
|
|
|
+ $("html,body").addClass("none-scroll");//下层不可滑动
|
|
|
+ $(".bigImg").addClass("bigImg");//添加图片样式
|
|
|
+ $(".opacityBottom").click(function () {//点击关闭
|
|
|
+ $("html,body").removeClass("none-scroll");
|
|
|
+ $(".opacityBottom").remove();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('.correct_html').click(function(){
|
|
|
+ // var address_text = $(this).parent(".address_box").find("p:nth-child(1)").text();
|
|
|
+ // var discript_text = address_text.split(":")[1];
|
|
|
+ var discript_text = $(this).parent().siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+
|
|
|
+ var filterId = allArr.filter(function(i){
|
|
|
+ return i.address == discript_text
|
|
|
+ });
|
|
|
+ $.each(filterId,function(i){
|
|
|
+ localStorage.setItem("passid",filterId[i].id);
|
|
|
+ })
|
|
|
+ $(this).attr('href','correct.html');
|
|
|
+ });
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ var firstpage = 1,pagetype = 0;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 0
|
|
|
+ page(obj.curr,pagetype);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ $('.text-tab-title li').click(function(){
|
|
|
+ var tabtex = $(this).text();
|
|
|
+ $(this).addClass('text-this').siblings().removeClass('text-this');
|
|
|
+ if(tabtex == '个人办事'){
|
|
|
+ $('.text-tab-content .text-tab-item:nth-child(1)').addClass('text-show').siblings().removeClass('text-show')
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ var firstpage = 1,pagetype = 0;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 0
|
|
|
+ page(obj.curr,pagetype)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ $('.text-tab-content .text-tab-item:nth-child(2)').addClass('text-show').siblings().removeClass('text-show');
|
|
|
+ layui.use(['laypage', 'layer'], function(){
|
|
|
+ var laypage = layui.laypage;
|
|
|
+ var firstpage = 1,pagetype = 1;
|
|
|
+ page(firstpage,pagetype);
|
|
|
+ laypage.render({
|
|
|
+ elem: 'demo'
|
|
|
+ ,count: count
|
|
|
+ ,limit: 4
|
|
|
+ ,layout: ['prev', 'next']
|
|
|
+ ,prev: '<i class="layui-icon layui-icon-left"></i><span>上一页</span>'
|
|
|
+ ,next: '<span>下一页</span><i class="layui-icon layui-icon-right"></i>'
|
|
|
+ ,jump: function(obj){
|
|
|
+ pagetype = 1
|
|
|
+ page(obj.curr,pagetype);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ function page(page,pagetype) {
|
|
|
+ $.ajax({
|
|
|
+ type: 'GET',
|
|
|
+ url: PATH + '/mapdata/getHandMatterPage',
|
|
|
+ // url: "http://192.168.1.253:7777/mapdata/getHandMatterPage",
|
|
|
+ async: false,
|
|
|
+ dataType: 'json',
|
|
|
+ data: {
|
|
|
+ page: page,
|
|
|
+ limit: 4,
|
|
|
+ type: pagetype,
|
|
|
+ matterDept: dep
|
|
|
+ },
|
|
|
+ success: function(res){
|
|
|
+ count = res.count;
|
|
|
+ var html = '';
|
|
|
+ $.each(res.data,function(j){
|
|
|
+ html += "<li><a href='"+res.data[j].matterUrl+"' target='_blank'><h6></h6>"
|
|
|
+ html += "<p title='"+res.data[j].itemName+"'>"+res.data[j].itemName+"</p></a></li>"
|
|
|
+ })
|
|
|
+ $('.text-tab-item').empty().append(html)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 封装点击公交点击获取的值的部分
|
|
|
+ function busClickEvent(that){
|
|
|
+ // var address_text = $(that).parent(".btn_box").siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+ // var discript_text = address_text.split(":")[1];
|
|
|
+ var discript_text = $(that).parent(".btn_box").siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+ $("#gj-two").val(discript_text);
|
|
|
+ $(".content-input .layui-tab-item:nth-child(2)").addClass("layui-show").siblings().removeClass("layui-show");
|
|
|
+ $(".search-change li:nth-child(2)").addClass("layui-this").siblings().removeClass("layui-this");
|
|
|
+ }
|
|
|
+ // 封装点击自驾点击获取的值的部分
|
|
|
+ function drivingClickEvent(that){
|
|
|
+ // var address_text_zj = $(that).parent(".btn_box").siblings(".address_box").children("p:nth-child(1)").text();
|
|
|
+ // var discript_text_zj = address_text_zj.split(":")[1];
|
|
|
+ var discript_text_zj = $(that).parent(".btn_box").siblings(".address_box").find("p:nth-child(1)").text();
|
|
|
+ $("#zj-two").val(discript_text_zj);
|
|
|
+ $(".content-input .layui-tab-item:nth-child(3)").addClass("layui-show").siblings().removeClass("layui-show");
|
|
|
+ $(".search-change li:nth-child(3)").addClass("layui-this").siblings().removeClass("layui-this");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 公交和自驾的选择
|
|
|
+ $('.search-change li').click(function(){
|
|
|
+ const textGJZJ = $(this).text();
|
|
|
+ var inp = $('.inp').val();
|
|
|
+ var startGJ = $('#gj-one').val();
|
|
|
+ var endGJ = $('#gj-two').val();
|
|
|
+ var startZJ = $("#zj-one").val();
|
|
|
+ var endZJ = $("#zj-two").val();
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ var zjLine = JSON.parse(localStorage.getItem("zjLine"));
|
|
|
+ var gjIndex = localStorage.getItem("gjIndex");
|
|
|
+ var zjIndex = localStorage.getItem("zjIndex");
|
|
|
+ var gjImg = localStorage.getItem("gjImg");
|
|
|
+ var zjImg = localStorage.getItem("zjImg");
|
|
|
+ if (textGJZJ == '搜索') {
|
|
|
+ if (inp == '') {
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ map.clearOverlays();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ $('#gj-one').val('');
|
|
|
+ $('#gj-two').val('');
|
|
|
+ $("#zj-one").val('');
|
|
|
+ $("#zj-two").val('');
|
|
|
+ } else {
|
|
|
+ $('.show-fourth').show().siblings().hide();
|
|
|
+ localStorage.setItem("gjIndex",1);
|
|
|
+ localStorage.setItem("zjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ map.clearOverlays();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (textGJZJ == '公交'){
|
|
|
+ if (startZJ == '' || endZJ == ''){
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ // console.log(1111);
|
|
|
+ $('#gj-one').val(startZJ);
|
|
|
+ $('#gj-two').val(endZJ);
|
|
|
+ $('.inp').val('');
|
|
|
+ } else if (zjIndex == 1){
|
|
|
+ // console.log(2222);
|
|
|
+ resultBusLine(startZJ,endZJ);
|
|
|
+ $('#gj-one').val(startZJ);
|
|
|
+ $('#gj-two').val(endZJ);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("gjIndex",1);
|
|
|
+ localStorage.setItem("zjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if (gjImg == 2){
|
|
|
+ // console.log(2222);
|
|
|
+ resultBusLine(startZJ,endZJ);
|
|
|
+ $('#gj-one').val(startZJ);
|
|
|
+ $('#gj-two').val(endZJ);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("gjIndex",1);
|
|
|
+ localStorage.setItem("zjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if ((startZJ == zjLine[0] && endZJ == zjLine[1]) && zjImg != 2){
|
|
|
+ // console.log(3333);
|
|
|
+ busResultContLine();
|
|
|
+ $('.show-second').show().siblings().hide();
|
|
|
+ $('.show-second').find('.content-second').show().siblings('.content-third').show().children('#result').show();
|
|
|
+ $('#start').text(zjLine[0]).siblings('#end').text(zjLine[1]);
|
|
|
+ $('#gj-one').val(zjLine[0]);
|
|
|
+ $('#gj-two').val(zjLine[1]);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("gjIndex",2);
|
|
|
+ localStorage.setItem("zjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if ((startZJ != zjLine[0] || endZJ != zjLine[1]) && (startZJ != '' && endZJ != '')){
|
|
|
+ // console.log(4444);
|
|
|
+ resultBusLine(startZJ,endZJ);
|
|
|
+ $('#gj-one').val(zjLine[0]);
|
|
|
+ $('#gj-two').val(zjLine[1]);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("gjIndex",1);
|
|
|
+ localStorage.setItem("zjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (textGJZJ == '自驾'){
|
|
|
+ if (startGJ == '' || endGJ == ''){
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ // console.log(5555);
|
|
|
+ $('.inp').val('');
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ } else if (gjIndex == 1){
|
|
|
+ // console.log(6666);
|
|
|
+ resultDrivingLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("zjIndex",1);
|
|
|
+ localStorage.setItem("gjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if (gjImg == 2){
|
|
|
+ // console.log(1010);
|
|
|
+ resultDrivingLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("zjIndex",1);
|
|
|
+ localStorage.setItem("gjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if ((startGJ == gjLine[0] && endGJ == gjLine[1]) && gjImg != 2){
|
|
|
+ // console.log(7777);
|
|
|
+ drivingResultContLine();
|
|
|
+ $('.show-third').show().siblings().hide();
|
|
|
+ $('.show-third').find('.content-second').show().siblings('.content-third').show().children('#result1').show();
|
|
|
+ $('#start2').text(gjLine[0]).siblings('#end2').text(gjLine[1]);
|
|
|
+ $("#zj-one").val(gjLine[0]);
|
|
|
+ $("#zj-two").val(gjLine[1]);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("zjIndex",2);
|
|
|
+ localStorage.setItem("gjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ } else if ((startGJ != gjLine[0] || endGJ != gjLine[1]) && (startGJ != '' && endGJ != '')){
|
|
|
+ // console.log(8888);
|
|
|
+ resultDrivingLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(gjLine[0]);
|
|
|
+ $("#zj-two").val(gjLine[1]);
|
|
|
+ $('.inp').val('');
|
|
|
+ localStorage.setItem("zjIndex",1);
|
|
|
+ localStorage.setItem("gjIndex",0);
|
|
|
+ localStorage.setItem("gjImg",0);
|
|
|
+ localStorage.setItem("zjImg",0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 头部的公交输入框中的始末地点值切换
|
|
|
+ $('#change-word').click(function() {
|
|
|
+ let start = $('#gj-one').val();
|
|
|
+ let end = $('#gj-two').val();
|
|
|
+ $('#gj-one').val(end);
|
|
|
+ $('#gj-two').val(start);
|
|
|
+ });
|
|
|
+ var obj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("gjLine",obj);
|
|
|
+ // 点击头部的公交的搜索按钮在左边出现结果
|
|
|
+ $('.inp-icon2').click(function() {
|
|
|
+ var startGJ = $("#gj-one").val();
|
|
|
+ var endGJ = $("#gj-two").val();
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ if (startGJ == '' || endGJ == '') {
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ layer.msg('请输入起点或终点!');
|
|
|
+ } else if(startGJ != gjLine[0] || endGJ != gjLine[1]){
|
|
|
+ map.clearOverlays();
|
|
|
+ resultBusLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ startGJ = '';
|
|
|
+ endGJ = '';
|
|
|
+ } else if(startGJ == gjLine[0] && endGJ == gjLine[1]){
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ map.clearOverlays();
|
|
|
+ resultBusLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ startGJ = '';
|
|
|
+ endGJ = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#gj-one').bind('keyup',function(event) {
|
|
|
+ if(event.keyCode==13){
|
|
|
+ var startGJ = $("#gj-one").val();
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ if (startGJ == '') {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ layer.msg('请输入起点!');
|
|
|
+ } else {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('#gj-two').focus();
|
|
|
+ startGJ = '';
|
|
|
+ endGJ = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#gj-two').bind('keyup',function(event) {
|
|
|
+ if(event.keyCode==13){
|
|
|
+ var startGJ = $("#gj-one").val();
|
|
|
+ var endGJ = $("#gj-two").val();
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ if (startGJ == '') {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ layer.msg('请输入起点!');
|
|
|
+ } else if(endGJ == '') {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ layer.msg('请输入终点!');
|
|
|
+ } else if(startGJ != gjLine[0] || endGJ != gjLine[1]){
|
|
|
+ map.clearOverlays();
|
|
|
+ resultBusLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ startGJ = '';
|
|
|
+ endGJ = '';
|
|
|
+ } else if(startGJ == gjLine[0] && endGJ == gjLine[1]){
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ map.clearOverlays();
|
|
|
+ resultBusLine(startGJ,endGJ);
|
|
|
+ $("#zj-one").val(startGJ);
|
|
|
+ $("#zj-two").val(endGJ);
|
|
|
+ startGJ = '';
|
|
|
+ endGJ = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 点击政务公开的公交搜索按钮显示公交路径选择页面
|
|
|
+ // $(document).on('click', '.imgSearch', function() {
|
|
|
+ // map.clearOverlays();
|
|
|
+ // var _that = $(this);
|
|
|
+ // res = seBus(_that);
|
|
|
+ // localStorage.setItem("gjImg","2");
|
|
|
+ // localStorage.setItem("gjIndex","0");
|
|
|
+ // localStorage.setItem("zjImg","0");
|
|
|
+ // localStorage.setItem("zjIndex","0");
|
|
|
+ // resultBusLine(res[0],res[1]);
|
|
|
+ // res = JSON.stringify(res);
|
|
|
+ // localStorage.setItem("gjLine",res);
|
|
|
+ // });
|
|
|
+ // 政务公开的公交的起末位置封装成函数
|
|
|
+ // function seBus(_that) {
|
|
|
+ // var inps = $('.inps').css('left');
|
|
|
+ // var buse = [];
|
|
|
+ // if (inps == '0px') {
|
|
|
+ // var startZD = _that.siblings('.inps').val();
|
|
|
+ // var endZD = _that.parents('.title-first').find('.jzdz').text();
|
|
|
+ // buse.push(startZD);
|
|
|
+ // buse.push(endZD);
|
|
|
+ // return buse;
|
|
|
+ // } else {
|
|
|
+ // var startZD = _that.parents('.title-first').find('.jzdz').text();
|
|
|
+ // var endZD = _that.siblings('.inps').val();
|
|
|
+ // buse.push(startZD);
|
|
|
+ // buse.push(endZD);
|
|
|
+ // return buse;
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // 政务公开的自驾的起末位置封装成函数
|
|
|
+ // function seCar(those) {
|
|
|
+ // var inpst = $('.inpst').css('left');
|
|
|
+ // var Care = [];
|
|
|
+ // if (inpst == '0px') {
|
|
|
+ // var startQJ = those.siblings('.inpst').val();
|
|
|
+ // var endQJ = those.parents('.title-first').find('.jzdz').text();
|
|
|
+ // Care.push(startQJ);
|
|
|
+ // Care.push(endQJ);
|
|
|
+ // return Care;
|
|
|
+ // } else {
|
|
|
+ // var startQJ = those.parents('.title-first').find('.jzdz').text();
|
|
|
+ // var endQJ = those.siblings('.inpst').val();
|
|
|
+ // Care.push(startQJ);
|
|
|
+ // Care.push(endQJ);
|
|
|
+ // return Care;
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // 点击政务公开的自驾搜索按钮显示自驾路径选择页面
|
|
|
+ // $(document).on('click', '.imgSearch2', function() {
|
|
|
+ // var those = $(this);
|
|
|
+ // var result = seCar(those);
|
|
|
+ // map.clearOverlays();
|
|
|
+ // localStorage.setItem("zjImg","2");
|
|
|
+ // localStorage.setItem("zjIndex","0");
|
|
|
+ // localStorage.setItem("gjIndex","0");
|
|
|
+ // localStorage.setItem("gjImg","0");
|
|
|
+ // resultDrivingLine(result[0],result[1]);
|
|
|
+ // result = JSON.stringify(result);
|
|
|
+ // localStorage.setItem("zjLine",result);
|
|
|
+ // });
|
|
|
+
|
|
|
+ // 封装公交路线规划的函数,曹莉说的,有明确地址,就不作为选择点
|
|
|
+ function resultBusLine(startZD,endZD){
|
|
|
+ var startPoint,endPoint,startText,endText,startAddress,endAddress,startData,endData;
|
|
|
+ $('.show-second').show().siblings().hide();
|
|
|
+ $('.show-second .content-second').hide().siblings('.content-third').hide();
|
|
|
+ $('.zjboxpanel').show();
|
|
|
+ $('.boxpanel').hide();
|
|
|
+ let GJstart = [];
|
|
|
+ let GJend = [];
|
|
|
+ GJstart = allArr.filter(function(i){
|
|
|
+ return i.address == startZD
|
|
|
+ });
|
|
|
+ GJend = allArr.filter(function(i){
|
|
|
+ return i.address == endZD
|
|
|
+ });
|
|
|
+ let startslcs = GJstart.filter(function(i){
|
|
|
+ return i.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ let startcycs = GJstart.filter(function(i){
|
|
|
+ return i.sptype == '查阅场所'
|
|
|
+ });
|
|
|
+ let endslcs = GJend.filter(function(i){
|
|
|
+ return i.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ let endcycs = GJend.filter(function(i){
|
|
|
+ return i.sptype == '查阅场所'
|
|
|
+ });
|
|
|
+ if (GJstart.length == 0 && GJend.length == 0){
|
|
|
+ $('#startbus').removeAttr('style').siblings().removeAttr('style');
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ startLocation(startZD);
|
|
|
+ endLocation(endZD);
|
|
|
+ $('#start').text(startZD);
|
|
|
+ $('#gj-one').val(startZD);
|
|
|
+ $('#end').text(endZD);
|
|
|
+ $('#gj-two').val(endZD);
|
|
|
+ $(document).off("click").on('click','.openstartinfo',function(){
|
|
|
+ $('.zjboxpanel').show().siblings('.content-second').hide().siblings('.content-third').hide();
|
|
|
+ $('#result').hide();
|
|
|
+ map.clearOverlays();
|
|
|
+ startPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ startText = $(this).data("text");
|
|
|
+ startAddress = $(this).data("add");
|
|
|
+ map.addOverlay(new BMapGL.Marker(startPoint));
|
|
|
+ map.setCenter(startPoint);
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.left-map').scrollTop($(this).parents('#busstartPanel').outerHeight()+$('#startbus').outerHeight()+$('.title-second').outerHeight()+$('#endBus').outerHeight()+25)
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('click','.openendinfo',function(){
|
|
|
+ if (startPoint == null) {
|
|
|
+ layer.msg("请先选择起点!");
|
|
|
+ } else {
|
|
|
+ endAddress = $(this).data("add");
|
|
|
+ endPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ endText = $(this).data("text");
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-second .content-second').show().siblings('.content-third').show();
|
|
|
+ $('.zjboxpanel').hide();
|
|
|
+ $('#start').text(startText);
|
|
|
+ $('#end').text(endText);
|
|
|
+ $('#gj-one').val(startText);
|
|
|
+ $('#gj-two').val(endText);
|
|
|
+ $('#result').show();
|
|
|
+ gjIndex = localStorage.getItem("gjIndex");
|
|
|
+ if (gjIndex == 1) {
|
|
|
+ localStorage.setItem("gjIndex","2");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ var res =JSON.stringify([startText,endText]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ var resPoint =JSON.stringify([startPoint,endPoint]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var result =JSON.stringify([startText,endText]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ busResultContLine();
|
|
|
+ startZD = '';
|
|
|
+ endZD = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ } else if(GJstart.length>0) {
|
|
|
+ if (startslcs.length > 0 || startcycs.length > 0) {
|
|
|
+ localStorage.setItem("gjImg","2");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-second').show().siblings().hide();
|
|
|
+ $('.show-second .content-second').hide();
|
|
|
+ $('.show-second .content-third').hide();
|
|
|
+ $('.zjboxpanel').show();
|
|
|
+ $('#startbus').hide();
|
|
|
+ $('#busstartPanel').hide();
|
|
|
+ $('#busstartPanel').empty();
|
|
|
+ $('#endBus').show();
|
|
|
+ $('#busendPanel').show();
|
|
|
+ endLocation(endZD);
|
|
|
+ $(document).off("click").on('click','.openendinfo',async function(){
|
|
|
+ endAddress = $(this).data("add");
|
|
|
+ endPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ endText = $(this).data("text");
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-second .content-second').show();
|
|
|
+ $('.show-second .content-third').show();
|
|
|
+ $('.zjboxpanel').hide();
|
|
|
+ $('#start').text(startZD);
|
|
|
+ $('#gj-one').val(startZD);
|
|
|
+ $('#end').text(endText);
|
|
|
+ $('#gj-two').val(endText);
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(startZD, function(point) {
|
|
|
+ if (point) {
|
|
|
+ startData = new BMapGL.Point(point.lng,point.lat);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ var start = new BMapGL.Point(startData.lng, startData.lat);
|
|
|
+ gjImg = localStorage.getItem("gjImg");
|
|
|
+ if (gjImg == 2) {
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","3");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ gjIndex = localStorage.getItem("gjIndex");
|
|
|
+ if (gjIndex == 1) {
|
|
|
+ localStorage.setItem("gjIndex","2");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ var res =JSON.stringify([startZD,endText]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ var resPoint =JSON.stringify([start,endPoint]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var result =JSON.stringify([startZD,endText]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ busResultContLine();
|
|
|
+ startZD = '';
|
|
|
+ endText = '';
|
|
|
+ endZD = '';
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ } else if(GJend.length>0) {
|
|
|
+ if (endslcs.length > 0 || endcycs.length > 0) {
|
|
|
+ localStorage.setItem("gjImg","2");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-second .content-second').hide();
|
|
|
+ $('.show-second .content-third').hide();
|
|
|
+ $('.zjboxpanel').show();
|
|
|
+ $('#endBus').hide();
|
|
|
+ $('#busendPanel').hide();
|
|
|
+ $('#busendPanel').empty();
|
|
|
+ $('#startbus').show();
|
|
|
+ $('#busstartPanel').show();
|
|
|
+ startLocation(startZD);
|
|
|
+ $(document).off("click").on('click','.openstartinfo',async function(){
|
|
|
+ $('.zjboxpanel').hide();
|
|
|
+ $('.show-second .content-second').show();
|
|
|
+ $('.show-second .content-third').show();
|
|
|
+ $('#result').show();
|
|
|
+ map.clearOverlays();
|
|
|
+ startPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ startText = $(this).data("text");
|
|
|
+ startAddress = $(this).data("add");
|
|
|
+ map.addOverlay(new BMapGL.Marker(startPoint));
|
|
|
+ map.setCenter(startPoint);
|
|
|
+ $('#end').text(endZD);
|
|
|
+ $('#gj-two').val(endZD);
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('#start').text(startText);
|
|
|
+ $('#gj-one').val(startText);
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(endZD, function(point) {
|
|
|
+ if (point) {
|
|
|
+ endData = new BMapGL.Point(point.lng,point.lat);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ var end = new BMapGL.Point(endData.lng, endData.lat);
|
|
|
+ gjImg = localStorage.getItem("gjImg");
|
|
|
+ if (gjImg == 2) {
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","3");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ gjIndex = localStorage.getItem("gjIndex");
|
|
|
+ if (gjIndex == 1) {
|
|
|
+ localStorage.setItem("gjIndex","2");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ var res =JSON.stringify([startText,endZD]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ var resPoint =JSON.stringify([startPoint,end]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var result =JSON.stringify([startText,endZD]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ busResultContLine();
|
|
|
+ startZD = '';
|
|
|
+ startText = '';
|
|
|
+ endZD = '';
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 封装起点的地址选择
|
|
|
+ function startLocation(startZD){
|
|
|
+ var startResults = null;
|
|
|
+ var startOption = {
|
|
|
+ onSearchComplete: function(results){
|
|
|
+ // 判断状态是否正确
|
|
|
+ if (startSearch.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ startResults = results;
|
|
|
+ var openStartInfoHtml = '';
|
|
|
+ for (var i = 0; i < results.getCurrentNumPois(); i++) {
|
|
|
+ var startcount = i+1;
|
|
|
+ openStartInfoHtml += "<li data-add='"+results.getPoi(i).address+"' data-text='"+results.getPoi(i).title+"' data-lng='"+results.getPoi(i).point.lng+"' data-lat='"+results.getPoi(i).point.lat+"' class='openstartinfo'>"
|
|
|
+ openStartInfoHtml += "<div class='warp_choice'>"
|
|
|
+ openStartInfoHtml += "<span>"+startcount+".</span>"
|
|
|
+ openStartInfoHtml += "<p>"
|
|
|
+ openStartInfoHtml += results.getPoi(i).title
|
|
|
+ openStartInfoHtml += "</p>"
|
|
|
+ openStartInfoHtml += "</div>"
|
|
|
+ openStartInfoHtml += "<p>地址:"
|
|
|
+ if (results.getPoi(i).address == undefined) {
|
|
|
+ openStartInfoHtml += results.getPoi(i).title
|
|
|
+ } else {
|
|
|
+ openStartInfoHtml += results.getPoi(i).address
|
|
|
+ }
|
|
|
+ openStartInfoHtml += "</p></div>"
|
|
|
+ openStartInfoHtml += "<a class='startChoice hideEnd'>选为起点</a>"
|
|
|
+ openStartInfoHtml += "</li>"
|
|
|
+ }
|
|
|
+ $("#busstartPanel").empty().append(openStartInfoHtml);
|
|
|
+ } else {
|
|
|
+ startResults = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var startSearch = new BMapGL.LocalSearch(map, startOption);
|
|
|
+ startSearch.search(startZD);
|
|
|
+ }
|
|
|
+ // 封装终点的地址选择
|
|
|
+ function endLocation(endZD){
|
|
|
+ var endResults = null;
|
|
|
+ var endOption = {
|
|
|
+ onSearchComplete: function(results){
|
|
|
+ // 判断状态是否正确
|
|
|
+ if (endSearch.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ endResults = results;
|
|
|
+ var openEndInfoHtml = '';
|
|
|
+ for (var i = 0; i < results.getCurrentNumPois(); i++) {
|
|
|
+ var endcount = i+1;
|
|
|
+ openEndInfoHtml += "<li data-add='"+results.getPoi(i).address+"' data-text='"+results.getPoi(i).title+"' data-lng='"+results.getPoi(i).point.lng+"' data-lat='"+results.getPoi(i).point.lat+"' class='openendinfo'>"
|
|
|
+ openEndInfoHtml += "<div class='warp_choice'>"
|
|
|
+ openEndInfoHtml += "<span>"+endcount+".</span>"
|
|
|
+ openEndInfoHtml += "<p>"
|
|
|
+ openEndInfoHtml += results.getPoi(i).title
|
|
|
+ openEndInfoHtml += "</p>"
|
|
|
+ openEndInfoHtml += "</div>"
|
|
|
+ openEndInfoHtml += "<p>地址:"
|
|
|
+ if (results.getPoi(i).address == undefined) {
|
|
|
+ openEndInfoHtml += results.getPoi(i).title
|
|
|
+ } else {
|
|
|
+ openEndInfoHtml += results.getPoi(i).address
|
|
|
+ }
|
|
|
+ openEndInfoHtml += "</p></div>"
|
|
|
+ openEndInfoHtml += "<button class='endChoice hideEnd'>选为终点</button>"
|
|
|
+ openEndInfoHtml += "</li>"
|
|
|
+ }
|
|
|
+ $("#busendPanel").empty().append(openEndInfoHtml);
|
|
|
+ } else {
|
|
|
+ endResults = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var endSearch = new BMapGL.LocalSearch(map, endOption);
|
|
|
+ endSearch.search(endZD);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点击公交的出现结果部分的路径选择查看具体路径
|
|
|
+ $('.line-first').click(function() {
|
|
|
+ $(this).parent('.line').siblings().find(".line-hide").css('display', 'none');
|
|
|
+ $(this).parent('.line').siblings().find(".line-first").removeClass('shows');
|
|
|
+ $(this).siblings().toggle();
|
|
|
+ let lightBlue = $(this).css('backgroundColor');
|
|
|
+ if (lightBlue == 'rgb(233, 243, 255)') {
|
|
|
+ $(this).removeClass('shows');
|
|
|
+ } else {
|
|
|
+ $(this).addClass('shows');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var object = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("zjLine",object);
|
|
|
+ // 头部的自驾输入框中的始末地点值切换
|
|
|
+ $('#word-change').click(function() {
|
|
|
+ let start = $('#zj-one').val();
|
|
|
+ let end = $('#zj-two').val();
|
|
|
+ $('#zj-one').val(end);
|
|
|
+ $('#zj-two').val(start);
|
|
|
+ });
|
|
|
+ // 点击头部的自驾的搜索按钮在左边出现结果
|
|
|
+ $('.inp-icon3').click(function() {
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ var startZJ = $("#zj-one").val();
|
|
|
+ var endZJ = $("#zj-two").val();
|
|
|
+ var zjLine = JSON.parse(localStorage.getItem("zjLine"));
|
|
|
+ if (startZJ == '' || endZJ == '') {
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ } else if(startZJ != zjLine[0] || endZJ != zjLine[1]){
|
|
|
+ map.clearOverlays();
|
|
|
+ resultDrivingLine(startZJ,endZJ);
|
|
|
+ $("#gj-one").val(startZJ);
|
|
|
+ $("#gj-two").val(endZJ);
|
|
|
+ startZJ = '';
|
|
|
+ endZJ = '';
|
|
|
+ } else if(startZJ == zjLine[0] && endZJ == zjLine[1]){
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ map.clearOverlays();
|
|
|
+ resultDrivingLine(startZJ,endZJ);
|
|
|
+ $("#gj-one").val(startZJ);
|
|
|
+ $("#gj-two").val(endZJ);
|
|
|
+ startZJ = '';
|
|
|
+ endZJ = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#zj-one').bind('keyup',function(event) {
|
|
|
+ if(event.keyCode==13){
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ var startZJ = $("#zj-one").val();
|
|
|
+ if (startZJ == '') {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ layer.msg('请输入起点!');
|
|
|
+ } else {
|
|
|
+ map.clearOverlays();
|
|
|
+ $('#zj-two').focus();
|
|
|
+ startZJ = '';
|
|
|
+ endZJ = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('#zj-two').bind('keyup',function(event) {
|
|
|
+ if(event.keyCode==13){
|
|
|
+ map.clearOverlays();
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ var startZJ = $("#zj-one").val();
|
|
|
+ var endZJ = $("#zj-two").val();
|
|
|
+ var zjLine = JSON.parse(localStorage.getItem("zjLine"));
|
|
|
+ if (startZJ == '') {
|
|
|
+ $('.show-first').show();
|
|
|
+ $('.show-second').hide();
|
|
|
+ $('show-third').hide();
|
|
|
+ $('.show-fourth').hide();
|
|
|
+ $('.show-fifth').hide();
|
|
|
+ layer.msg('请输入起点!');
|
|
|
+ } else if(endZJ == '') {
|
|
|
+ $('.show-first').show();
|
|
|
+ $('.show-second').hide();
|
|
|
+ $('show-third').hide();
|
|
|
+ $('.show-fourth').hide();
|
|
|
+ $('.show-fifth').hide();
|
|
|
+ layer.msg('请输入终点!');
|
|
|
+ } else if(startZJ != zjLine[0] || endZJ != zjLine[1]){
|
|
|
+ resultDrivingLine(startZJ,endZJ);
|
|
|
+ startZJ = '';
|
|
|
+ endZJ = '';
|
|
|
+ } else {
|
|
|
+ resultDrivingLine(startZJ,endZJ);
|
|
|
+ startZJ = '';
|
|
|
+ endZJ = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 封装自驾路线规划,同以上公交
|
|
|
+ function resultDrivingLine(startZD,endZD){
|
|
|
+ var resPoint = null;
|
|
|
+ $('.show-third').show().siblings().hide();
|
|
|
+ $('.show-third .content-second').hide();
|
|
|
+ $('.show-third .content-third').hide();
|
|
|
+ $('.zjboxpanel').hide();
|
|
|
+ $('.boxpanel').show();
|
|
|
+ var startPoint,endPoint,startText,endText,startData,endData;
|
|
|
+ let ZJstart = allArr.filter(function(i){
|
|
|
+ return i.address == startZD
|
|
|
+ });
|
|
|
+ let ZJend = allArr.filter(function(i){
|
|
|
+ return i.address == endZD
|
|
|
+ });
|
|
|
+ let startslcs = ZJstart.filter(function(i){
|
|
|
+ return i.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ let startcycs = ZJstart.filter(function(i){
|
|
|
+ return i.sptype == '查阅场所'
|
|
|
+ });
|
|
|
+ let endslcs = ZJend.filter(function(i){
|
|
|
+ return i.sptype == '受理场所'
|
|
|
+ });
|
|
|
+ let endcycs = ZJend.filter(function(i){
|
|
|
+ return i.sptype == '查阅场所'
|
|
|
+ });
|
|
|
+ if (ZJstart.length == 0 && ZJend.length == 0){
|
|
|
+ $('#startDrving').show().siblings().show();
|
|
|
+ drivingStartSearch(startZD);
|
|
|
+ drivingEndSearch(endZD);
|
|
|
+ $(document).off("click").on('click','.openstartinfo',function(){
|
|
|
+ map.clearOverlays();
|
|
|
+ startPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ startText = $(this).data("text");
|
|
|
+ map.setCenter(startPoint);
|
|
|
+ map.addOverlay(new BMapGL.Marker(startPoint));
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.boxpanel').show().siblings('.content-second').hide().siblings('.content-third').hide();
|
|
|
+ $('.boxpanel').show();
|
|
|
+ $('.left-map').scrollTop($(this).parents('#startPanel').outerHeight()+$('#startDrving').outerHeight()+$('.title-second').outerHeight()+$('#endDrving').outerHeight()+27);
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('click','.openendinfo',async function(){
|
|
|
+ if (startPoint == null) {
|
|
|
+ layer.msg("请先选择起点!");
|
|
|
+ } else {
|
|
|
+ endText = $(this).data("text");
|
|
|
+ endPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-third').show().siblings().hide();
|
|
|
+ $('.show-third .content-second').show();
|
|
|
+ $('.show-third .content-third').show();
|
|
|
+ $('.boxpanel').hide();
|
|
|
+ $('#start2').text(startText);
|
|
|
+ $('#end2').text(endText);
|
|
|
+ $('#zj-one').val(startText);
|
|
|
+ $('#zj-two').val(endText);
|
|
|
+ zjIndex = localStorage.getItem("zjIndex");
|
|
|
+ zjImg = localStorage.getItem("zjImg");
|
|
|
+ if (zjIndex == 1){
|
|
|
+ localStorage.setItem("zjIndex","2");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ }
|
|
|
+ if (zjImg == 2){
|
|
|
+ localStorage.setItem("zjImg","3");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ }
|
|
|
+ var result = JSON.stringify([startText,endText]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ resPoint =JSON.stringify([startPoint,endPoint]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var res = JSON.stringify([startText,endText]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ drivingResultContLine();
|
|
|
+ startZD = '';
|
|
|
+ endZD = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ } else if(ZJstart.length>0){
|
|
|
+ if (startslcs.length > 0 || startcycs.length > 0) {
|
|
|
+ localStorage.setItem("zjImg","2");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ }
|
|
|
+ $('.show-third .content-second').hide();
|
|
|
+ $('.show-third .content-third').hide();
|
|
|
+ $('.boxpanel').show();
|
|
|
+ $('#startDrving').hide();
|
|
|
+ $('#startPanel').hide();
|
|
|
+ $('#startPanel').empty();
|
|
|
+ $('#endDrving').show();
|
|
|
+ $('#endPanel').show();
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ drivingEndSearch(endZD);
|
|
|
+ $(document).off("click").on('click','.openendinfo',async function(){
|
|
|
+ $('#start2').text(startZD);
|
|
|
+ $('#zj-one').val(startZD);
|
|
|
+ endText = $(this).data("text");
|
|
|
+ endPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('.show-third .content-second').show();
|
|
|
+ $('.show-third .content-third').show();
|
|
|
+ $('.boxpanel').hide();
|
|
|
+ $('#end2').text(endText);
|
|
|
+ $('#zj-two').val(endText);
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(startZD, function(point) {
|
|
|
+ if (point) {
|
|
|
+ startData = new BMapGL.Point(point.lng,point.lat);
|
|
|
+ resolve();
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ var start = new BMapGL.Point(startData.lng, startData.lat);
|
|
|
+ zjImg = localStorage.getItem("zjImg");
|
|
|
+ zjIndex = localStorage.getItem("zjIndex");
|
|
|
+ if (zjImg == 2){
|
|
|
+ localStorage.setItem("zjImg","3");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ }
|
|
|
+ if (zjIndex == 1){
|
|
|
+ localStorage.setItem("zjIndex","2");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ }
|
|
|
+ var result = JSON.stringify([startZD,endText]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ resPoint =JSON.stringify([start,endPoint]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var res = JSON.stringify([startZD,endText]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ drivingResultContLine();
|
|
|
+ startZD = '';
|
|
|
+ startText = '';
|
|
|
+ endText = '';
|
|
|
+ endZD = '';
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openendinfo',function(){
|
|
|
+ $(this).children('.endChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ } else if(ZJend.length>0){
|
|
|
+ if (endslcs.length > 0 || endcycs.length > 0) {
|
|
|
+ localStorage.setItem("zjImg","2");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ }
|
|
|
+ $('.show-third .content-second').hide();
|
|
|
+ $('.show-third .content-third').hide();
|
|
|
+ $('.boxpanel').show();
|
|
|
+ $('#endDrving').hide();
|
|
|
+ $('#endPanel').hide();
|
|
|
+ $('#endPanel').empty();
|
|
|
+ $('#startDrving').show();
|
|
|
+ $('#startPanel').show();
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ drivingStartSearch(startZD)
|
|
|
+ $(document).off("click").on('click','.openstartinfo',async function(){
|
|
|
+ $('.boxpanel').hide();
|
|
|
+ $('.show-third .content-second').show();
|
|
|
+ $('.show-third .content-third').show();
|
|
|
+ map.clearOverlays();
|
|
|
+ startPoint = new BMapGL.Point($(this).data("lng"), $(this).data("lat"));
|
|
|
+ startText = $(this).data("text");
|
|
|
+ map.addOverlay(new BMapGL.Marker(startPoint));
|
|
|
+ map.setCenter(startPoint);
|
|
|
+ $(this).find('p').addClass('change_text_color').parents('li').siblings().find('p').removeClass('change_text_color');
|
|
|
+ $('#start2').text(startText);
|
|
|
+ $('#zj-one').val(startText);
|
|
|
+ $('#end2').text(endZD);
|
|
|
+ $('#zj-two').val(endZD);
|
|
|
+ await new Promise((resolve, reject) => {
|
|
|
+ myGeo.getPoint(endZD, function(point) {
|
|
|
+ if (point) {
|
|
|
+ endData = new BMapGL.Point(point.lng,point.lat);
|
|
|
+ resolve()
|
|
|
+ }
|
|
|
+ }, "重庆市");
|
|
|
+ });
|
|
|
+ var end = new BMapGL.Point(endData.lng, endData.lat);
|
|
|
+ zjImg = localStorage.getItem("zjImg");
|
|
|
+ zjIndex = localStorage.getItem("zjIndex");
|
|
|
+ if (zjImg == 2) {
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("zjImg","3");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ }
|
|
|
+ if (zjIndex == 1){
|
|
|
+ localStorage.setItem("zjIndex","2");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("gjIndex","0");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ }
|
|
|
+ var result = JSON.stringify([startText,endZD]);
|
|
|
+ localStorage.setItem("zjLine",result);
|
|
|
+ resPoint =JSON.stringify([startPoint,end]);
|
|
|
+ localStorage.setItem("Point",resPoint);
|
|
|
+ var res = JSON.stringify([startText,endZD]);
|
|
|
+ localStorage.setItem("gjLine",res);
|
|
|
+ drivingResultContLine();
|
|
|
+ startText = '';
|
|
|
+ startZD = '';
|
|
|
+ endText = '';
|
|
|
+ endText = '';
|
|
|
+ });
|
|
|
+ $(document).on('mouseover','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').removeClass('hideEnd');
|
|
|
+ });
|
|
|
+ $(document).on('mouseleave','.openstartinfo',function(){
|
|
|
+ $(this).children('.startChoice').addClass('hideEnd');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function drivingStartSearch(startZD){
|
|
|
+ var startResults = null;
|
|
|
+ var startOption = {
|
|
|
+ onSearchComplete: function(results){
|
|
|
+ // 判断状态是否正确
|
|
|
+ if (startSearch.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ startResults = results;
|
|
|
+ var openStartInfoWindowHtml = '';
|
|
|
+ for (var i = 0; i < results.getCurrentNumPois(); i++) {
|
|
|
+ var startcount = i+1;
|
|
|
+ openStartInfoWindowHtml += "<li data-text='"+results.getPoi(i).title+"' data-lng='"+results.getPoi(i).point.lng+"' data-lat='"+results.getPoi(i).point.lat+"' class='openstartinfo'>"
|
|
|
+ openStartInfoWindowHtml += "<div class='warp_choice'>"
|
|
|
+ openStartInfoWindowHtml += "<span>"+startcount+".</span>"
|
|
|
+ openStartInfoWindowHtml += "<p>"
|
|
|
+ openStartInfoWindowHtml += results.getPoi(i).title
|
|
|
+ openStartInfoWindowHtml += "</p>"
|
|
|
+ openStartInfoWindowHtml += "</div>"
|
|
|
+ openStartInfoWindowHtml += "<p>地址:"
|
|
|
+ if (results.getPoi(i).address == undefined) {
|
|
|
+ openStartInfoWindowHtml += results.getPoi(i).title
|
|
|
+ } else {
|
|
|
+ openStartInfoWindowHtml += results.getPoi(i).address
|
|
|
+ }
|
|
|
+ openStartInfoWindowHtml += "</p></div>"
|
|
|
+ openStartInfoWindowHtml += "<a class='startChoice hideEnd'>选为起点</a>"
|
|
|
+ openStartInfoWindowHtml += "</li>"
|
|
|
+ }
|
|
|
+ $("#startPanel").empty().append(openStartInfoWindowHtml);
|
|
|
+ } else {
|
|
|
+ startResults = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var startSearch = new BMapGL.LocalSearch(map, startOption);
|
|
|
+ startSearch.search(startZD);
|
|
|
+ }
|
|
|
+ function drivingEndSearch(endZD){
|
|
|
+ var endResults = null;
|
|
|
+ var endOption = {
|
|
|
+ onSearchComplete: function(results){
|
|
|
+ // 判断状态是否正确
|
|
|
+ if (endSearch.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ endResults = results;
|
|
|
+ var openEndInfoWindowHtml = '';
|
|
|
+ for (var i = 0; i < results.getCurrentNumPois(); i++) {
|
|
|
+ var endcount = i+1;
|
|
|
+ openEndInfoWindowHtml += "<li data-text='"+results.getPoi(i).title+"' data-lng='"+results.getPoi(i).point.lng+"' data-lat='"+results.getPoi(i).point.lat+"' class='openendinfo'>"
|
|
|
+ openEndInfoWindowHtml += "<div class='warp_choice'>"
|
|
|
+ openEndInfoWindowHtml += "<span>"+endcount+".</span>"
|
|
|
+ openEndInfoWindowHtml += "<p>"
|
|
|
+ openEndInfoWindowHtml += results.getPoi(i).title
|
|
|
+ openEndInfoWindowHtml += "</p>"
|
|
|
+ openEndInfoWindowHtml += "</div>"
|
|
|
+ openEndInfoWindowHtml += "<p>地址:"
|
|
|
+ openEndInfoWindowHtml += results.getPoi(i).address
|
|
|
+ openEndInfoWindowHtml += "</p></div>"
|
|
|
+ openEndInfoWindowHtml += "<button class='endChoice hideEnd'>选为终点</button>"
|
|
|
+ openEndInfoWindowHtml += "</li>"
|
|
|
+ }
|
|
|
+ $("#endPanel").empty().append(openEndInfoWindowHtml);
|
|
|
+ } else {
|
|
|
+ endResults = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ var endSearch = new BMapGL.LocalSearch(map, endOption);
|
|
|
+ endSearch.search(endZD);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 封装公交的路线规划
|
|
|
+ function busResultContLine(){
|
|
|
+ var routePolicy = [BMAP_TRANSIT_POLICY_LEAST_TIME,BMAP_TRANSIT_POLICY_LEAST_TRANSFER,BMAP_TRANSIT_POLICY_LEAST_WALKING,BMAP_TRANSIT_POLICY_AVOID_SUBWAYS];
|
|
|
+ var discriptHtml = '';
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ var resultPoint = JSON.parse(localStorage.getItem("Point"));
|
|
|
+ var start = new BMapGL.Point(resultPoint[0].lng, resultPoint[0].lat);
|
|
|
+ var end = new BMapGL.Point(resultPoint[1].lng, resultPoint[1].lat);
|
|
|
+ $('#result').empty();
|
|
|
+ $('.content-title>li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ var transit = new BMapGL.TransitRoute(map, {
|
|
|
+ renderOptions: {
|
|
|
+ map: map,
|
|
|
+ panel: 'result'
|
|
|
+ },
|
|
|
+ policy: 0,
|
|
|
+ onSearchComplete: function(results) {
|
|
|
+ if (transit.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ discriptHtml = '';
|
|
|
+ $('.show-second .content-title').show();
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ $('.show-second .content-title').hide();
|
|
|
+ discriptHtml += '<div>在重庆市 '
|
|
|
+ discriptHtml += '未能计算出从“'
|
|
|
+ discriptHtml += gjLine[0]
|
|
|
+ discriptHtml += '”到“'
|
|
|
+ discriptHtml += gjLine[1]
|
|
|
+ discriptHtml += '”公交路线,抱歉。'
|
|
|
+ discriptHtml += '</div>'
|
|
|
+ $('#result').empty().append(discriptHtml);
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.clearOverlays();
|
|
|
+ transit.clearResults();
|
|
|
+ transit.setPolicy(routePolicy[0]);
|
|
|
+ transit.search(start, end);
|
|
|
+ }
|
|
|
+ // 选择其他方案
|
|
|
+ $('.content-title>li').click(function() {
|
|
|
+ const liIndex = $(this).index();
|
|
|
+ var routePolicy = [BMAP_TRANSIT_POLICY_LEAST_TIME,BMAP_TRANSIT_POLICY_LEAST_TRANSFER,BMAP_TRANSIT_POLICY_LEAST_WALKING,BMAP_TRANSIT_POLICY_AVOID_SUBWAYS];
|
|
|
+ var discriptHtml = '';
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ var resultPoint = JSON.parse(localStorage.getItem("Point"));
|
|
|
+ var start = new BMapGL.Point(resultPoint[0].lng, resultPoint[0].lat);
|
|
|
+ var end = new BMapGL.Point(resultPoint[1].lng, resultPoint[1].lat);
|
|
|
+ var transit = new BMapGL.TransitRoute(map, {
|
|
|
+ renderOptions: {
|
|
|
+ map: map,
|
|
|
+ panel: 'result'
|
|
|
+ },
|
|
|
+ policy: 0,
|
|
|
+ onSearchComplete: function(results) {
|
|
|
+ if (transit.getStatus() == BMAP_STATUS_SUCCESS) {
|
|
|
+ discriptHtml = '';
|
|
|
+ $('.show-second .content-title').show();
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ $('.show-second .content-title').hide();
|
|
|
+ discriptHtml += '<div>在重庆市 '
|
|
|
+ discriptHtml += '未能计算出从“'
|
|
|
+ discriptHtml += gjLine[0]
|
|
|
+ discriptHtml += '”到“'
|
|
|
+ discriptHtml += gjLine[1]
|
|
|
+ discriptHtml += '”公交路线,抱歉。'
|
|
|
+ discriptHtml += '</div>'
|
|
|
+ $('#result').empty().append(discriptHtml);
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.clearOverlays();
|
|
|
+ transit.clearResults();
|
|
|
+ transit.setPolicy(routePolicy[liIndex]);
|
|
|
+ transit.search(start, end);
|
|
|
+ });
|
|
|
+ // 封装自驾的路线规划
|
|
|
+ function drivingResultContLine(){
|
|
|
+ var drivingRoutePolicy = [BMAP_DRIVING_POLICY_LEAST_TIME,BMAP_DRIVING_POLICY_LEAST_DISTANCE,BMAP_DRIVING_POLICY_AVOID_HIGHWAYS];
|
|
|
+ var resultPoint = JSON.parse(localStorage.getItem("Point"));
|
|
|
+ var start = new BMapGL.Point(resultPoint[0].lng, resultPoint[0].lat);
|
|
|
+ var end = new BMapGL.Point(resultPoint[1].lng, resultPoint[1].lat);
|
|
|
+ $('#result1').empty();
|
|
|
+ $('.main-third>li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ var drivingRoute = new BMapGL.DrivingRoute(map, {
|
|
|
+ renderOptions: {
|
|
|
+ map: map,
|
|
|
+ panel: "result1",
|
|
|
+ autoViewport: true,
|
|
|
+ enableDragging: true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.clearOverlays();
|
|
|
+ drivingRoute.clearResults();
|
|
|
+ drivingRoute.setPolicy(drivingRoutePolicy[0]);
|
|
|
+ drivingRoute.search(start, end);
|
|
|
+ }
|
|
|
+ // 选择其他方案
|
|
|
+ $("#zjxz>li").click(function() {
|
|
|
+ const liIndex = $(this).index();
|
|
|
+ var drivingRoutePolicy = [BMAP_DRIVING_POLICY_LEAST_TIME,BMAP_DRIVING_POLICY_LEAST_DISTANCE,BMAP_DRIVING_POLICY_AVOID_HIGHWAYS];
|
|
|
+ var resultPoint = JSON.parse(localStorage.getItem("Point"));
|
|
|
+ var start = new BMapGL.Point(resultPoint[0].lng, resultPoint[0].lat);
|
|
|
+ var end = new BMapGL.Point(resultPoint[1].lng, resultPoint[1].lat);
|
|
|
+ $('#result1').empty();
|
|
|
+ var drivingRoute = new BMapGL.DrivingRoute(map, {
|
|
|
+ renderOptions: {
|
|
|
+ map: map,
|
|
|
+ panel: "result1",
|
|
|
+ autoViewport: true,
|
|
|
+ enableDragging: true
|
|
|
+ }
|
|
|
+ });
|
|
|
+ map.clearOverlays();
|
|
|
+ drivingRoute.clearResults();
|
|
|
+ drivingRoute.setPolicy(drivingRoutePolicy[liIndex]);
|
|
|
+ drivingRoute.search(start, end);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 写受理场所和查阅场所前的icon切换
|
|
|
+ $('.top-title>li').click(function() {
|
|
|
+ var con = $(this).text().trim();
|
|
|
+ if(con == "受理场所"){
|
|
|
+ // bdGEO(jzadds);
|
|
|
+ xxGEO(bms);
|
|
|
+ getPointPostAjax(bms);
|
|
|
+ $('.second-title li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ }
|
|
|
+ if(con == "查阅场所"){
|
|
|
+ // cycsGEO(cycsbms);
|
|
|
+ xrjz(cycsbms)
|
|
|
+ xxGEO(cycsbms);
|
|
|
+ // xrxx(cycsbms);
|
|
|
+ getPointPostAjax(cycsbms);
|
|
|
+ $('.second-title2 li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ }
|
|
|
+ let blue = $(this).css('color');
|
|
|
+ if (blue == 'rgb(51, 51, 51)') {
|
|
|
+ $(this).children(':first').css('display', 'block');
|
|
|
+ $(this).children(':last').css('display', 'none');
|
|
|
+ $(this).siblings().children(':first').css('display', 'none');
|
|
|
+ $(this).siblings().children(':last').css('display', 'block');
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //区级部门与街镇解析地址批量解析结束
|
|
|
+ $('.second-title>li').click(function() {
|
|
|
+ const xz = $(this).text();
|
|
|
+ if (xz == "区级部门") {
|
|
|
+ // bdGEO(adds);
|
|
|
+ xxGEO(bms);
|
|
|
+ xrjz(bms);
|
|
|
+ getPointPostAjax(bms);
|
|
|
+ }
|
|
|
+ if (xz == "街镇") {
|
|
|
+ // bdGEO(jzadds);
|
|
|
+ xxGEO(jzs);
|
|
|
+ xrjz(jzs);
|
|
|
+ getPointPostAjax(jzs);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('.second-title2>li').click(function() {
|
|
|
+ // 解决点击事件,多次执行的问题
|
|
|
+ const xz = $(this).text().trim();
|
|
|
+ if (xz == "区级部门") {
|
|
|
+ map.clearOverlays();
|
|
|
+ xrjz(cycsbms)
|
|
|
+ xxGEO(cycsbms);
|
|
|
+ getPointPostAjax(cycsbms);
|
|
|
+ }
|
|
|
+ if (xz == "街镇") {
|
|
|
+ map.clearOverlays();
|
|
|
+ xrjz(slcsjz)
|
|
|
+ xxGEO(slcsjz);
|
|
|
+ getPointPostAjax(slcsjz);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 点击第一个全部 显示所有街道办事处
|
|
|
+ $('.alltotal').click(function() {
|
|
|
+ $(this).addClass('tab');
|
|
|
+ $(this).siblings().removeClass('tab');
|
|
|
+ // bdGEO(jzadds);
|
|
|
+ xxGEO(jzs);
|
|
|
+ xrjz(jzs);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 点击搜索的图标,显示
|
|
|
+ $('.inp-icon1').click(function() {
|
|
|
+ map.clearOverlays();
|
|
|
+ var searchInp = $('.inp').val();
|
|
|
+ if (searchInp === "") {
|
|
|
+ $('.show-first').show();
|
|
|
+ $('.show-second').hide();
|
|
|
+ $('.show-third').hide();
|
|
|
+ $('.show-fourth').hide();
|
|
|
+ $('.show-fifth').hide();
|
|
|
+ layer.msg('输入的地址不能为空!');
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ xrSearchResultList(searchInp);
|
|
|
+ replaceParamVal2("se",searchInp)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.inp').bind('keyup',function(event){
|
|
|
+ if(event.keyCode==13){
|
|
|
+ map.clearOverlays();
|
|
|
+ var searchInp = $('.inp').val();
|
|
|
+ if (searchInp === "") {
|
|
|
+ $('.show-first').show();
|
|
|
+ $('.show-second').hide();
|
|
|
+ $('.show-third').hide();
|
|
|
+ $('.show-fourth').hide();
|
|
|
+ $('.show-fifth').hide();
|
|
|
+ layer.msg('输入的地址不能为空!')
|
|
|
+ } else {
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ xrSearchResultList(searchInp);
|
|
|
+ replaceParamVal2("se",searchInp)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ function xrSearchResultList(searchInp){
|
|
|
+ $('.show-fourth').show().siblings().hide();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14); // 初始化地图,设置中心点坐标和地图级别
|
|
|
+ var firstGroup = [];
|
|
|
+ $.each(getAllJson, function(j){
|
|
|
+ $.each(getAllJson[j],function(k){
|
|
|
+ var stringText = ('' + getAllJson[j][k]);
|
|
|
+ if(stringText.indexOf(searchInp)>-1){
|
|
|
+ var firstArrey = [];
|
|
|
+ if(getAllJson[j].dep == getAllJson[j][k] || getAllJson[j].type == getAllJson[j][k] || getAllJson[j].sptype == getAllJson[j][k]) {
|
|
|
+ firstArrey = getAllJson[j];
|
|
|
+ }
|
|
|
+ firstGroup.push(firstArrey);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ let removeFirstCroupZero = firstGroup.filter(item => item.length!=0);
|
|
|
+ // // let newFirstGroup = [...new Set(removeFirstCroupZero)];
|
|
|
+ for (let i = 0; i < removeFirstCroupZero.length; i++) {
|
|
|
+ for (let j = i + 1; j < removeFirstCroupZero.length; j++) {
|
|
|
+ if (removeFirstCroupZero[j].dep === removeFirstCroupZero[i].dep) {
|
|
|
+ removeFirstCroupZero.splice(j, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = 0; i < removeFirstCroupZero.length; i++) {
|
|
|
+ for (let j = i + 1; j < removeFirstCroupZero.length; j++) {
|
|
|
+ if (removeFirstCroupZero[j].dep === removeFirstCroupZero[i].dep) {
|
|
|
+ removeFirstCroupZero.splice(j, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (removeFirstCroupZero == '') {
|
|
|
+ var html = '';
|
|
|
+ html += '<ul class="titleFirst" style="color:#2775CC;font-size:14px;">暂无数据</ul>'
|
|
|
+ $('.show-fourth .search-result').empty().append(html);
|
|
|
+ } else {
|
|
|
+ var html = '';
|
|
|
+ for (var item = 0; item < removeFirstCroupZero.length; item++) {
|
|
|
+ var jzdep = removeFirstCroupZero[item].dep;
|
|
|
+ var jzdhs = removeFirstCroupZero[item].tel;
|
|
|
+ var jzdzs = removeFirstCroupZero[item].address;
|
|
|
+ var type = removeFirstCroupZero[item].type;
|
|
|
+ var dictType=removeFirstCroupZero[item].dictType;
|
|
|
+ var sptype = removeFirstCroupZero[item].sptype
|
|
|
+ var sum = 1;
|
|
|
+ sum += item;
|
|
|
+ html += "<div class='title-first1'>"
|
|
|
+ if ((type == undefined || type == null)||type=='') {
|
|
|
+ html += ''
|
|
|
+ } else if ((type == '路内停车场' || type == '室外停车场')|| type == '职业教育学校'){
|
|
|
+ html += "<p class='typeFirst tcstyletypeFirst'>"+type+"</p>"
|
|
|
+ } else {
|
|
|
+ html += "<p class='typeFirst othertypeFirst'>"+type+"</p>"
|
|
|
+ }
|
|
|
+ if ((sptype == undefined || sptype == null)||sptype=='') {
|
|
|
+ html += ''
|
|
|
+ }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+"' dictType='"+dictType+"'>"
|
|
|
+ html += "<span>" + sum + "." + "</span>" + jzdep + "</li>"
|
|
|
+ html += "<li>"
|
|
|
+ if ((jzdhs == undefined || jzdhs == null)||jzdhs=='') {
|
|
|
+ html += ''
|
|
|
+ } else {
|
|
|
+ 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>"
|
|
|
+ }
|
|
|
+ $('.show-fourth .search-result').empty().append(html);
|
|
|
+ }
|
|
|
+ if (removeFirstCroupZero!=''&&removeFirstCroupZero!=null){
|
|
|
+ setTimeout(function (){
|
|
|
+ $("[title='"+removeFirstCroupZero[0].dep+"']").click();
|
|
|
+ },500)
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ localStorage.setItem("gjImg","0");
|
|
|
+ localStorage.setItem("zjImg","0");
|
|
|
+ localStorage.setItem("zjIndex","0");
|
|
|
+ // 点击返回按钮回到首页
|
|
|
+ $('.backBtn').click(function() {
|
|
|
+ gjIndex = localStorage.getItem("gjIndex");
|
|
|
+ gjImg = localStorage.getItem("gjImg");
|
|
|
+ var gjLine = JSON.parse(localStorage.getItem("gjLine"));
|
|
|
+ // replaceParamVal('se','')
|
|
|
+ if(gjIndex == 1) {
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ $('.text-second').empty();
|
|
|
+ $('.flex_li').find('.flex_text').removeAttr('style').parent('.img_tab').siblings('.pop').find('.mapnav').removeClass('choice');
|
|
|
+ $('.inp').val('');
|
|
|
+ $('#gj-one').val('');
|
|
|
+ $('#gj-two').val('');
|
|
|
+ $('#zj-one').val('');
|
|
|
+ $('#zj-two').val('');
|
|
|
+ $('.search-change li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.content-input .layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ $('.alltotal').addClass('tab').siblings('p').removeClass('tab');
|
|
|
+ var objgj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("gjLine",objgj);
|
|
|
+ var objzj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("zjLine",objzj);
|
|
|
+ map.clearOverlays();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ // window.location.href = window.location.href.split('#endBus')[0];
|
|
|
+ $('.flex_box').removeAttr('style');
|
|
|
+ window.location.reload();
|
|
|
+ } else if(gjIndex == 2) {
|
|
|
+ const startGJ = $("#gj-one").val();
|
|
|
+ const endGJ = $("#gj-two").val();
|
|
|
+ resultBusLine(startGJ,endGJ);
|
|
|
+ localStorage.setItem("gjIndex","1");
|
|
|
+ }
|
|
|
+ if (gjImg == 1) {
|
|
|
+ $('.show-first').show().siblings().hide();
|
|
|
+ $('.text-second').empty();
|
|
|
+ $('.flex_li').find('.flex_text').removeAttr('style').parent('.img_tab').siblings('.pop').find('.mapnav').removeClass('choice');
|
|
|
+ $('#gj-one').val('');
|
|
|
+ $('#gj-two').val('');
|
|
|
+ $('#zj-one').val('');
|
|
|
+ $('#zj-two').val('');
|
|
|
+ $('.search-change li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.content-input .layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ $('.alltotal').addClass('tab').siblings('p').removeClass('tab');
|
|
|
+ var objgj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("gjLine",objgj);
|
|
|
+ var objzj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("zjLine",objzj);
|
|
|
+ map.clearOverlays();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ // window.location.href = window.location.href.split('#endBus')[0];
|
|
|
+ $('.flex_box').removeAttr('style');
|
|
|
+ window.location.reload();
|
|
|
+ } else if(gjImg == 2) {
|
|
|
+ $('.show-fifth').show().siblings().hide();
|
|
|
+ xxGEO(jzs);
|
|
|
+ xrjz(jzs);
|
|
|
+ localStorage.setItem("gjImg","1");
|
|
|
+ } else if(gjImg == 3) {
|
|
|
+ resultBusLine(gjLine[0],gjLine[1]);
|
|
|
+ localStorage.setItem("gjImg","2");
|
|
|
+ }
|
|
|
+ zjIndex = localStorage.getItem("zjIndex");
|
|
|
+ zjImg = localStorage.getItem("zjImg");
|
|
|
+ var zjLine = JSON.parse(localStorage.getItem("zjLine"));
|
|
|
+ if(zjIndex == 1) {
|
|
|
+ $(".show-first").show().siblings().hide();
|
|
|
+ $('.text-second').empty();
|
|
|
+ $('.flex_li').find('.flex_text').removeAttr('style').parent('.img_tab').siblings('.pop').find('.mapnav').removeClass('choice');
|
|
|
+ $('#gj-one').val('');
|
|
|
+ $('#gj-two').val('');
|
|
|
+ $('#zj-one').val('');
|
|
|
+ $('#zj-two').val('');
|
|
|
+ $('.search-change li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.content-input .layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ $('.alltotal').addClass('tab').siblings('p').removeClass('tab');
|
|
|
+ var objgj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("gjLine",objgj);
|
|
|
+ var objzj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("zjLine",objzj);
|
|
|
+ map.clearOverlays();
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ // window.location.href = window.location.href.split('#endDrving')[0];
|
|
|
+ $('.flex_box').removeAttr('style');
|
|
|
+ window.location.reload();
|
|
|
+ } else if(zjIndex == 2) {
|
|
|
+ const startZJ = $("#zj-one").val();
|
|
|
+ const endZJ = $("#zj-two").val();
|
|
|
+ resultDrivingLine(startZJ,endZJ);
|
|
|
+ localStorage.setItem("zjIndex","1");
|
|
|
+ }
|
|
|
+ if (zjImg == 1) {
|
|
|
+ $(".show-first").show().siblings().hide();
|
|
|
+ map.clearOverlays();
|
|
|
+ $('.text-second').empty();
|
|
|
+ $('.flex_li').find('.flex_text').removeAttr('style').parent('.img_tab').siblings('.pop').find('.mapnav').removeClass('choice');
|
|
|
+ $('#gj-one').val('');
|
|
|
+ $('#gj-two').val('');
|
|
|
+ $('#zj-one').val('');
|
|
|
+ $('#zj-two').val('');
|
|
|
+ $('.search-change li:nth-child(1)').addClass('layui-this').siblings().removeClass('layui-this');
|
|
|
+ $('.content-input .layui-tab-item:nth-child(1)').addClass('layui-show').siblings().removeClass('layui-show');
|
|
|
+ $('.alltotal').addClass('tab').siblings('p').removeClass('tab');
|
|
|
+ var objgj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("gjLine",objgj);
|
|
|
+ var objzj = JSON.stringify(['','']);
|
|
|
+ localStorage.setItem("zjLine",objzj);
|
|
|
+ map.centerAndZoom(new BMapGL.Point(106.563, 29.523), 14);
|
|
|
+ // window.location.href = window.location.href.split('#endDrving')[0];
|
|
|
+ $('.flex_box').removeAttr('style');
|
|
|
+ window.location.reload();
|
|
|
+ } else if(zjImg == 2) {
|
|
|
+ $(".show-fifth").show().siblings().hide();
|
|
|
+ xxGEO(jzs);
|
|
|
+ xrjz(jzs);
|
|
|
+ localStorage.setItem("zjImg","1");
|
|
|
+ } else if(zjImg == 3) {
|
|
|
+ resultDrivingLine(zjLine[0],zjLine[1]);
|
|
|
+ localStorage.setItem("zjImg","2");
|
|
|
+ }
|
|
|
+ replaceParamVal2('se','')
|
|
|
+ });
|
|
|
+})
|