1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407 |
- 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.html";
- }
- var deptArr = {
- "重庆市南岸区政务服务中心(江南新城中心)": [
- "重庆市南岸区残联",
- "重庆市南岸区财政局",
- "重庆市南岸区文化和旅游发展委员会",
- "重庆市南岸区档案馆",
- "重庆市南岸区卫生健康委员会",
- "重庆市南岸区交通局",
- "重庆市南岸区规划自然资源局",
- "重庆市南岸区住房和城乡建设委员会",
- "重庆市南岸区生态环境局",
- "重庆市南岸区农业农村委员会",
- "重庆市南岸区发展和改革委员会",
- "重庆市南岸区消防救援支队",
- "重庆市南岸区城市管理局",
- "重庆市公安局南岸分局",
- ],
- "重庆市南岸区政务服务中心(南坪中心)": [
- "重庆市南岸区市场监管局",
- "重庆市公安局南岸分局",
- ],
- jnxc: 0,
- npzx: 1,
- };
- layui.use("element", function () {
- var element = layui.element;
- layer = layui.layer;
- });
- $(function () {
- // 获取高度
- var hlHeight =
- window.outerHeight -
- $(".head").outerHeight() -
- $(".bttom-tab").outerHeight() +
- 85;
- $(".right-map").css("height", hlHeight);
- var msHeight =
- $(".right-map").outerHeight() - $(".right-search").outerHeight() / 1.3;
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
-
- $('.icon-shq').on('click', function() {
- window.top.location.href = "sy_life.html";
- })
- // 点击图片,显示弹窗
- $(".img_tab").click(function (e) {
- $(this).find(".pop").toggle();
- $(this).parent("li").siblings().children(".img_tab").find(".pop").hide();
- $(this)
- .parents("ul")
- .siblings()
- .children("li")
- .children(".img_tab")
- .find(".pop")
- .hide();
- });
- // 百度地图API功能
- function G(id) {
- return document.getElementById(id);
- }
- var map = new BMap.Map("right-map"); // 创建Map实例
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14); // 初始化地图,设置中心点坐标和地图级别
- map.enableDragging();
- // 区级部门与街镇解析地址批量解析开始
- var myGeo = new BMap.Geocoder();
- var xxs = [],
- xx = [],
- zx = [],
- tsjy = [],
- dx = [],
- zyyx = [],
- yey = [],
- bmfwzx = [],
- ggfwzx = [],
- dqfwzx = [],
- cyy = [],
- byfwjg = [],
- cwss = [],
- sqwsfwz = [],
- ejyljg = [];
- var ekzlfwjg = [],
- kqbpsfczmz = [],
- myghyfjzmz = [],
- sjyljg = [],
- sqwsfwjg = [],
- zybzdjg = [],
- gy = [],
- tc = [],
- zysd = [],
- gc = [],
- hydjjg = [],
- zcyljg = [],
- ckmzfwjg = [],
- pcs = [],
- ldzgw = [];
- 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 = [],
- gwzx = [],
- jd = [];
- // 数组接收的是渲染页面的值
- var getAllArr = [];
- // 参数用来判断进入的页面
- var indexList = 0;
- // 用来接收对比参数的数组
- var contrastArrey = [];
- var arraddre = [];
- // 接收json内所有数据
- var getAllJson = [];
- // 受理场所
- var qjjz = [];
- // 查阅场所
- var cycsbms = [];
- // 存放点击列表的事件的高度
- var scrollListHeight;
- var scrollListHeight1;
- var discrptAddress;
- var gjIndex = 1;
- var zjIndex = 1;
- // 防抖,清除定时器
- var timeout = null;
- $.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]);
- 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]);
- getAllJson.push(res.data.dxs[i]);
- contrastArrey.push(res.data.dxs[i]);
- });
- $.each(res.data.zyyxs, function (i) {
- zyyx.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]);
- getAllJson.push(res.data.yeys[i]);
- contrastArrey.push(res.data.yeys[i]);
- });
- $.each(res.data.bmfwzxs, function (i) {
- bmfwzx.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]);
- getAllJson.push(res.data.ggfwzxs[i]);
- contrastArrey.push(res.data.ggfwzxs[i]);
- });
- $.each(res.data.dqfwzxs, function (i) {
- dqfwzx.push(res.data.dqfwzxs[i]);
- getAllJson.push(res.data.dqfwzxs[i]);
- contrastArrey.push(res.data.dqfwzxs[i]);
- });
- $.each(res.data.bms, function (i) {
- qjjz.push(res.data.bms[i]);
- getAllJson.push(res.data.bms[i]);
- contrastArrey.push(res.data.bms[i]);
- });
- $.each(res.data.jzs, function (i) {
- qjjz.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]);
- getAllJson.push(res.data.cycsbms[i]);
- contrastArrey.push(res.data.cycsbms[i]);
- });
- $.each(res.data.slcsjzs, function (i) {
- cycsbms.push(res.data.slcsjzs[i]);
- getAllJson.push(res.data.slcsjzs[i]);
- contrastArrey.push(res.data.slcsjzs[i]);
- });
- $.each(res.data.cyys, function (i) {
- cyy.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]);
- getAllJson.push(res.data.byfwjgs[i]);
- contrastArrey.push(res.data.byfwjgs[i]);
- });
- $.each(res.data.cwsss, function (i) {
- cwss.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]);
- getAllJson.push(res.data.sqwsfwzs[i]);
- contrastArrey.push(res.data.sqwsfwzs[i]);
- });
- $.each(res.data.ekzlfwjgs, function (i) {
- ekzlfwjg.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]);
- getAllJson.push(res.data.kqbpsfczmzs[i]);
- contrastArrey.push(res.data.kqbpsfczmzs[i]);
- });
- $.each(res.data.myghyfjzmzs, function (i) {
- myghyfjzmz.push(res.data.myghyfjzmzs[i]);
- getAllJson.push(res.data.myghyfjzmzs[i]);
- contrastArrey.push(res.data.myghyfjzmzs[i]);
- });
- $.each(res.data.ejyljgs, function (i) {
- ejyljg.push(res.data.ejyljgs[i]);
- getAllJson.push(res.data.ejyljgs[i]);
- contrastArrey.push(res.data.ejyljgs[i]);
- });
- $.each(res.data.sjyljgs, function (i) {
- sjyljg.push(res.data.sjyljgs[i]);
- getAllJson.push(res.data.sjyljgs[i]);
- contrastArrey.push(res.data.sjyljgs[i]);
- });
- $.each(res.data.sqwsfwjgs, function (i) {
- sqwsfwjg.push(res.data.sqwsfwjgs[i]);
- getAllJson.push(res.data.sqwsfwjgs[i]);
- contrastArrey.push(res.data.sqwsfwjgs[i]);
- });
- $.each(res.data.zybzdjgs, function (i) {
- zybzdjg.push(res.data.zybzdjgs[i]);
- getAllJson.push(res.data.zybzdjgs[i]);
- contrastArrey.push(res.data.zybzdjgs[i]);
- });
- $.each(res.data.gys, function (i) {
- gy.push(res.data.gys[i]);
- getAllJson.push(res.data.gys[i]);
- contrastArrey.push(res.data.gys[i]);
- });
- $.each(res.data.tcs, function (i) {
- tc.push(res.data.tcs[i]);
- getAllJson.push(res.data.tcs[i]);
- contrastArrey.push(res.data.tcs[i]);
- });
- $.each(res.data.zysd, function (i) {
- zysd.push(res.data.zysd[i]);
- getAllJson.push(res.data.zysd[i]);
- contrastArrey.push(res.data.zysd[i]);
- });
- $.each(res.data.ldzgw, function (i) {
- ldzgw.push(res.data.ldzgw[i]);
- getAllJson.push(res.data.ldzgw[i]);
- contrastArrey.push(res.data.ldzgw[i]);
- });
- $.each(res.data.gcs, function (i) {
- gc.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]);
- getAllJson.push(res.data.hydjcs[i]);
- contrastArrey.push(res.data.hydjcs[i]);
- });
- $.each(res.data.zcyljg, function (i) {
- zcyljg.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]);
- getAllJson.push(res.data.ckmzfwjgs[i]);
- contrastArrey.push(res.data.ckmzfwjgs[i]);
- });
- $.each(res.data.pcss, function (i) {
- pcs.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]);
- getAllJson.push(res.data.crjywbljgs[i]);
- contrastArrey.push(res.data.crjywbljgs[i]);
- });
- $.each(res.data.jtxljcdds, function (i) {
- jtxljcdd.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]);
- getAllJson.push(res.data.jtwfcljgs[i]);
- contrastArrey.push(res.data.jtwfcljgs[i]);
- });
- $.each(res.data.jtsgcljgs, function (i) {
- jtsgcljg.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]);
- getAllJson.push(res.data.cgss[i]);
- contrastArrey.push(res.data.cgss[i]);
- });
- $.each(res.data.jdcjccss, function (i) {
- jdcjccs.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]);
- getAllJson.push(res.data.jsrtjzs[i]);
- contrastArrey.push(res.data.jsrtjzs[i]);
- });
- $.each(res.data.ylfwjgs, function (i) {
- ylfwjg.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]);
- getAllJson.push(res.data.tsgs[i]);
- contrastArrey.push(res.data.tsgs[i]);
- });
- $.each(res.data.whgs, function (i) {
- whg.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]);
- getAllJson.push(res.data.wgss[i]);
- contrastArrey.push(res.data.wgss[i]);
- });
- $.each(res.data.ggtys, function (i) {
- ggty.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]);
- getAllJson.push(res.data.jqs[i]);
- contrastArrey.push(res.data.jqs[i]);
- });
- $.each(res.data.bdcdjzxbsdts, function (i) {
- bdcdjzxbsdt.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]);
- getAllJson.push(res.data.cjrfwzxs[i]);
- contrastArrey.push(res.data.cjrfwzxs[i]);
- });
- $.each(res.data.qtcjrfwzxs, function (i) {
- ddcjrfwjg.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]);
- getAllJson.push(res.data.fwglzxs[i]);
- contrastArrey.push(res.data.fwglzxs[i]);
- });
- $.each(res.data.gzcs, function (i) {
- gzc.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]);
- getAllJson.push(res.data.sfjdjgs[i]);
- contrastArrey.push(res.data.sfjdjgs[i]);
- });
- $.each(res.data.jcfwfwss, function (i) {
- jcfwfws.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]);
- getAllJson.push(res.data.flyzzxs[i]);
- contrastArrey.push(res.data.flyzzxs[i]);
- });
- $.each(res.data.bsfwts, function (i) {
- bsfwt.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]);
- getAllJson.push(res.data.scjdgljs[i]);
- contrastArrey.push(res.data.scjdgljs[i]);
- });
- $.each(res.data.ybs, function (i) {
- yb.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]);
- getAllJson.push(res.data.dkblds[i]);
- contrastArrey.push(res.data.dkblds[i]);
- });
- $.each(res.data.cjgshfwzs, function (i) {
- cjgshfwz.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]);
- getAllJson.push(res.data.jykszxs[i]);
- contrastArrey.push(res.data.jykszxs[i]);
- });
- $.each(res.data.xzfwzxs, function (i) {
- xzfwzx.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]);
- getAllJson.push(res.data.jzzxs[i]);
- contrastArrey.push(res.data.jzzxs[i]);
- });
- $.each(res.data.jyhrczxs, function (i) {
- jyhrczx.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]);
- getAllJson.push(res.data.shbxswzxs[i]);
- contrastArrey.push(res.data.shbxswzxs[i]);
- });
- $.each(res.data.sqs, function (i) {
- sq.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]);
- getAllJson.push(res.data.gjjs[i]);
- contrastArrey.push(res.data.gjjs[i]);
- });
- $.each(res.data.hscyds, function (i) {
- hscyd.push(res.data.hscyds[i]);
- getAllJson.push(res.data.hscyds[i]);
- contrastArrey.push(res.data.hscyds[i]);
- });
- $.each(res.data.gwzxs, function (i) {
- gwzx.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]);
- getAllJson.push(res.data.jds[i]);
- contrastArrey.push(res.data.jds[i]);
- });
- },
- error: function (err) {},
- });
- // 渲染点击小学等的结果页面样式
- function applyClickList() {
- let ran = navigator.userAgent;
- let isIOS = !!ran.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- if (isIOS) {
- var hBHeight = (window.outerHeight - $(".head").outerHeight()) / 2;
- $(".show-fifth").fadeIn(500).siblings().fadeOut(50);
- $(".right-map").css("height", hBHeight);
- var wsHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight() -
- 11;
- var windowHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- var spWidth =
- ($(".show-fifth").innerWidth() - $(".wrap_result").innerWidth()) / 2;
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".show-fifth").css("height", hBHeight);
- $(".wrap_result").css("height", wsHeight);
- $(".right-search").hide().css("top", "0px");
- $(".top_search").fadeIn(500);
- $(".wrap_handle").hide();
- $("body").css("overflow", "hidden");
- } else {
- $(".show-fifth").fadeIn(500).siblings().fadeOut(50);
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- var wsHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight() -
- 11;
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-fifth").innerWidth() - $(".wrap_result").innerWidth()) / 2;
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".show-fifth").css("height", rmHeight);
- $(".wrap_result").css("height", wsHeight);
- $(".right-search").hide().css("top", "0px");
- $(".top_search").fadeIn(500);
- $(".wrap_handle").hide();
- }
- }
- var str = window.parent.location.search;
- console.log(str);
- 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 !== "") {
- console.log(searchVal);
- $(".inp").val(searchVal);
- localStorage.setItem("gjIndex", "1");
- localStorage.setItem("gjImg", "0");
- localStorage.setItem("zjImg", "0");
- localStorage.setItem("zjIndex", "0");
- setTimeout(function () {
- $(".inp-icon1").click();
- }, 500);
- }
- }
- }
- // 点击弹窗以外的区域隐藏弹窗
- $(document).on("click", function (e) {
- if (
- !$(e.target).is($(".gn_img")) &&
- !$(e.target).is($(".gn_img")) &&
- $(e.target).parent(".gn_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");
- }
- });
- $(".mapnav").click(function () {
- $(this).addClass("choice");
- $(this).parent("div").siblings().children(".mapnav").removeClass("choice");
- var xxtx = $(this).text();
- indexList = 2;
- switch (xxtx) {
- case "小学":
- applyClickList();
- xrList(xx);
- getPointPostAjax(xx);
- break;
- case "中学":
- applyClickList();
- xrList(zx);
- getPointPostAjax(zx);
- break;
- case "特殊教育学校":
- applyClickList();
- xrList(tsjy);
- getPointPostAjax(tsjy);
- break;
- case "高等院校":
- applyClickList();
- xrList(dx);
- getPointPostAjax(dx);
- break;
- case "职业教育学校":
- applyClickList();
- xrList(zyyx);
- getPointPostAjax(zyyx);
- break;
- case "幼儿园":
- applyClickList();
- xrList(yey);
- getPointPostAjax(yey);
- break;
- case "镇(街道)便民服务中心":
- applyClickList();
- xrList(ggfwzx);
- getPointPostAjax(ggfwzx);
- break;
- case "村(社区)便民服务站":
- applyClickList();
- xrList(bmfwzx);
- getPointPostAjax(bmfwzx);
- break;
- case "党群服务中心":
- applyClickList();
- xrList(dqfwzx);
- getPointPostAjax(dqfwzx);
- break;
- case "受理场所":
- applyClickList();
- xrList(qjjz);
- getPointPostAjax(qjjz);
- break;
- case "查阅场所":
- applyClickList();
- xrList(cycsbms);
- getPointPostAjax(cycsbms);
- break;
- case "殡仪服务机构":
- applyClickList();
- xrList(byfwjg);
- getPointPostAjax(byfwjg);
- break;
- case "村卫生室":
- applyClickList();
- xrList(cwss);
- getPointPostAjax(cwss);
- break;
- case "社区卫生服务站":
- applyClickList();
- xrList(sqwsfwz);
- getPointPostAjax(sqwsfwz);
- break;
- case "儿科诊疗服务机构":
- applyClickList();
- xrList(ekzlfwjg);
- getPointPostAjax(ekzlfwjg);
- break;
- case "狂犬病、破伤风处置门诊":
- applyClickList();
- xrList(kqbpsfczmz);
- getPointPostAjax(kqbpsfczmz);
- break;
- case "免疫规划预防接种门诊":
- applyClickList();
- xrList(myghyfjzmz);
- getPointPostAjax(myghyfjzmz);
- break;
- case "二级医疗机构":
- applyClickList();
- xrList(ejyljg);
- getPointPostAjax(ejyljg);
- break;
- case "三级医疗机构":
- applyClickList();
- xrList(sjyljg);
- getPointPostAjax(sjyljg);
- break;
- case "社区卫生服务机构":
- applyClickList();
- xrList(sqwsfwjg);
- getPointPostAjax(sqwsfwjg);
- break;
- case "职业病诊断机构":
- applyClickList();
- xrList(zybzdjg);
- getPointPostAjax(zybzdjg);
- break;
- case "公园":
- applyClickList();
- xrList(gy);
- getPointPostAjax(gy);
- break;
- case "婚姻登记机构":
- applyClickList();
- xrList(hydjjg);
- getPointPostAjax(hydjjg);
- break;
- case "助产医疗机构":
- applyClickList();
- xrList(zcyljg);
- getPointPostAjax(zcyljg);
- break;
- case "产科门诊服务机构":
- applyClickList();
- xrList(ckmzfwjg);
- getPointPostAjax(ckmzfwjg);
- break;
- case "派出所":
- applyClickList();
- xrList(pcs);
- getPointPostAjax(pcs);
- break;
- case "出入境业务办理机构":
- applyClickList();
- xrList(crjywbljg);
- getPointPostAjax(crjywbljg);
- break;
- case "交通支大队":
- applyClickList();
- xrList(jtxljcdd);
- getPointPostAjax(jtxljcdd);
- break;
- case "交通违法处理机构":
- applyClickList();
- xrList(jtwfcljg);
- getPointPostAjax(jtwfcljg);
- break;
- case "交通事故处理机构":
- applyClickList();
- xrList(jtsgcljg);
- getPointPostAjax(jtsgcljg);
- break;
- case "车管所":
- applyClickList();
- xrList(cgs);
- getPointPostAjax(cgs);
- break;
- case "机动车检测场所":
- applyClickList();
- xrList(jdcjccs);
- getPointPostAjax(jdcjccs);
- break;
- case "驾驶人体检医院":
- applyClickList();
- xrList(jsrtjz);
- getPointPostAjax(jsrtjz);
- break;
- case "养老机构":
- applyClickList();
- xrList(ylfwjg);
- getPointPostAjax(ylfwjg);
- break;
- case "图书馆":
- applyClickList();
- xrList(tsg);
- getPointPostAjax(tsg);
- break;
- case "文化馆":
- applyClickList();
- xrList(whg);
- getPointPostAjax(whg);
- break;
- case "文管所":
- applyClickList();
- xrList(wgs);
- getPointPostAjax(wgs);
- break;
- case "公共体育馆":
- applyClickList();
- xrList(ggty);
- getPointPostAjax(ggty);
- break;
- case "旅游景点":
- applyClickList();
- xrList(jq);
- getPointPostAjax(jq);
- break;
- case "残疾人服务中心":
- applyClickList();
- xrList(cjrfwzx);
- getPointPostAjax(cjrfwzx);
- break;
- case "定点残疾人服务机构":
- applyClickList();
- xrList(ddcjrfwjg);
- getPointPostAjax(ddcjrfwjg);
- break;
- case "公证处":
- applyClickList();
- xrList(gzc);
- getPointPostAjax(gzc);
- break;
- case "司法鉴定机构":
- applyClickList();
- xrList(sfjdjg);
- getPointPostAjax(sfjdjg);
- break;
- case "基层司法所":
- applyClickList();
- xrList(jcfwfws);
- getPointPostAjax(jcfwfws);
- break;
- case "法律援助机构":
- applyClickList();
- xrList(flyzzx);
- getPointPostAjax(flyzzx);
- break;
- case "医疗保障事务中心":
- applyClickList();
- xrList(yb);
- getPointPostAjax(yb);
- break;
- case "生源地助学贷款办理点":
- applyClickList();
- xrList(dkbld);
- getPointPostAjax(dkbld);
- break;
- case "车驾管社会服务站":
- applyClickList();
- xrList(cjgshfwz);
- getPointPostAjax(cjgshfwz);
- break;
- case "教育考试中心":
- applyClickList();
- xrList(jykszx);
- getPointPostAjax(jykszx);
- break;
- case "区级政务服务中心":
- applyClickList();
- xrList(xzfwzx);
- getPointPostAjax(xzfwzx);
- break;
- case "矫正中心":
- applyClickList();
- xrList(jzzx);
- getPointPostAjax(jzzx);
- break;
- case "就业和人才中心":
- applyClickList();
- xrList(jyhrczx);
- getPointPostAjax(jyhrczx);
- break;
- case "社会保险事务中心":
- applyClickList();
- xrList(shbxswzx);
- getPointPostAjax(shbxswzx);
- break;
- case "商圈":
- applyClickList();
- xrList(sq);
- getPointPostAjax(sq);
- break;
- case "核酸采样点":
- applyClickList();
- xrList(hscyd);
- getPointPostAjax(hscyd);
- break;
- case "购物中心":
- applyClickList();
- xrList(gwzx);
- getPointPostAjax(gwzx);
- break;
- case "酒店":
- applyClickList();
- xrList(jd);
- getPointPostAjax(jd);
- break;
- }
- var getimgs = $(".pad_box").children(".titleFirst").find(".two_img");
- function callback(entries) {
- for (let i of entries) {
- if (i.isIntersecting) {
- let img = i.target;
- let trueSrc = img.getAttribute("data-src");
- img.setAttribute("src", trueSrc);
- observer.unobserve(img);
- }
- }
- }
- const observer = new IntersectionObserver(callback);
- for (let i of getimgs) {
- observer.observe(i);
- }
- lazyLoad();
- });
- function lazyLoad() {
- var startTime = "";
- var startDistanceY = "";
- var endTime = "";
- var endDistanceY = "";
- var moveTime = "";
- var moveDistanceY = "";
- var divs = document.querySelector(".wrap_result");
- divs.addEventListener("touchstart", function (e) {
- startTime = new Date().getTime();
- startDistanceY = e.touches[0].screenY;
- });
- divs.addEventListener("touchend", function (e) {
- endTime = new Date().getTime();
- endDistanceY = e.changedTouches[0].screenY;
- moveTime = endTime - startTime;
- moveDistanceY = startDistanceY - endDistanceY;
- });
- var ptHeight = $(".pad_box .titleFirst").outerHeight();
- if (Math.abs(moveDistanceY) > 40 && moveTime < 200) {
- $(".wrap_result").offset().top = ptHeight;
- }
- }
- $(".flex_box ul li").click(function () {
- var cyytext = $(this).find(".flex_text").text();
- indexList = 2;
- switch (cyytext) {
- case "产业园区":
- applyClickList();
- xrList(cyy);
- getPointPostAjax(cyy);
- break;
- case "停车泊车":
- applyClickList();
- xrList(tc);
- getPointPostAjax(tc);
- break;
- case "直饮水点":
- applyClickList();
- xrList(zysd);
- getPointPostAjax(zysd);
- break;
- case "劳动者港湾":
- applyClickList();
- xrList(ldzgw);
- getPointPostAjax(ldzgw);
- break;
- case "不动产登记":
- applyClickList();
- xrList(bdcdjzxbsdt);
- getPointPostAjax(bdcdjzxbsdt);
- break;
- case "便民公厕":
- applyClickList();
- xrList(gc);
- getPointPostAjax(gc);
- break;
- case "住房保障":
- applyClickList();
- xrList(fwglzx);
- getPointPostAjax(fwglzx);
- break;
- case "住房公积金":
- applyClickList();
- xrList(gjj);
- getPointPostAjax(gjj);
- break;
- case "办税服务":
- applyClickList();
- xrList(bsfwt);
- getPointPostAjax(bsfwt);
- break;
- case "核酸检测":
- applyClickList();
- xrList(hscyd);
- getPointPostAjax(hscyd);
- break;
- case "市场监管":
- applyClickList();
- xrList(scjdglj);
- getPointPostAjax(scjdglj);
- break;
- }
- });
- // 渲染列表
- function xrList(arr) {
- map.clearOverlays();
- var sContnet = "";
- var addFirst;
- getAllArr = arr;
- if (!arr) {
- return;
- } else {
- for (var index = 0; index < arr.length; index++) {
- var arrdep = arr[index].dep;
- arraddre = arr[index].address;
- var arrtype = arr[index].type;
- var arrspecial = arr[index].specialtype;
- var arrtag = arr[index].tag;
- var arrtag2 = arr[index].tag2;
- var arrtag3 = arr[index].tag3;
- var arrcontent = arr[index].content;
- var arrimg = arr[index].img;
- var arrtel = arr[index].tel;
- var arrtime = arr[index].time;
- var arrsptype = arr[index].sptype;
- sContnet +=
- "<ul class='titleFirst'><div class='wrap_apply'><li class='title_flex'>";
- sContnet += "<p style='width:100%'>" + arrdep + "</p>";
- if (arrtype == "" || arrtype == undefined || arrtype == null) {
- sContnet += "";
- } else {
- if (arrspecial == "中学") {
- if (arrtype == "中学") {
- sContnet += "";
- } else {
- sContnet += "<p class='flex_blue'>· " + arrtype + "</p>";
- }
- sContnet += "<p class='flex_blue'>· " + arrspecial + "</p>";
- } else {
- sContnet += "<p class='flex_blue'>· " + arrtype + "</p>";
- }
- }
- sContnet += "</li>";
- if (arrtag == "" || arrtag == undefined || arrtag == null) {
- sContnet += "";
- } else {
- sContnet +=
- "<li class='flex_orange'><div class='three_tag'>" + arrtag;
- if (arrtag2 == undefined || arrtag2 == "" || arrtag2 == null) {
- sContnet += "</div>";
- } else {
- sContnet += "</div><div class='three_tag'>" + arrtag2 + "</div>";
- }
- if (arrtag3 == undefined || arrtag3 == "" || arrtag3 == null) {
- sContnet += "</li>";
- } else {
- sContnet += "<div class='three_tag'>" + arrtag3 + "</div></li>";
- }
- }
- if (arrcontent == undefined || arrcontent == null || arrcontent == "") {
- sContnet += "";
- } else {
- sContnet +=
- "<li><a class='a_blue'><p class='content_p' style='overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;'>";
- sContnet += arrcontent + "</p></a></li>";
- }
- if (arrimg == undefined || arrimg == null || arrimg == "") {
- sContnet += "";
- } else {
- sContnet +=
- "<li class='img_box'><img data-src='" +
- PATH +
- arrimg +
- "' class='two_img' src='" +
- PATH +
- arrimg +
- "'></li>";
- }
- sContnet +=
- "<li class='address_box'><p><span class='flex_address'>地址:</span>" +
- arraddre +
- "</p>";
- if (arrtime == "" || arrtime == undefined || arrtime == null) {
- sContnet += "";
- } else if (arrsptype == "查阅场所") {
- sContnet +=
- "<p><span class='flex_address'>查询时间:</span>" +
- arrtime +
- "</p>";
- } else if (arrsptype == "受理场所") {
- sContnet +=
- "<p><span class='flex_address'>受理时间:</span>" +
- arrtime +
- "</p>";
- } else if (arrsptype == "政务服务" || arrsptype == "办税服务") {
- sContnet +=
- "<p><span class='flex_address'>办理时间:</span>" +
- arrtime +
- "</p>";
- } else {
- sContnet +=
- "<p><span class='flex_address'>办公时间:</span>" +
- arrtime +
- "</p>";
- }
- if (arrtel == "" || arrtel == undefined || arrtel == null) {
- sContnet += "";
- } else {
- sContnet += "<p><span class='flex_address'>办公电话:</span>";
- for (var i = 0; i < arrtel.split(";").length; i++) {
- if (arrtel.split(";").length - i != 1) {
- sContnet +=
- "<a href='tel:" +
- arrtel.split(";")[i] +
- "' style='text-decoration:underline'>" +
- arrtel.split(";")[i] +
- "</a>;";
- } else {
- sContnet +=
- "<a href='tel:" +
- arrtel.split(";")[i] +
- "' style='text-decoration:underline'>" +
- arrtel.split(";")[i] +
- "</a>";
- }
- }
- sContnet += "</p>";
- }
- if (
- arr[index].sptype == "受理场所" ||
- arr[index].dep == "重庆市南岸区政务服务中心(江南新城中心)" ||
- arr[index].dep == "重庆市南岸区政务服务中心(南坪中心)"
- ) {
- sContnet += " <div class='handle_business'>点击查看详情</div>";
- } else if (
- arrdep == "重庆市南岸区民政局婚姻登记处(茶园)" ||
- arrdep == "重庆市南岸区民政局婚姻登记处(南坪)"
- ) {
- sContnet += " <div class='handle_business1'>点击查看详情</div>";
- } else if (arrdep == "重庆市南岸区社会保险事务中心") {
- sContnet += " <div class='handle_business2'>点击查看详情</div>";
- } else {
- sContnet += "<div class='detailCheck'>点击查看详情</div>";
- }
- sContnet += "</li></div><li class='btn_box'>";
- sContnet +=
- "<button class='one_bus'>公交</button><button class='two_car'>自驾</button>";
- sContnet += "</li></ul>";
- }
- $(".show-fifth .pad_box").empty().append(sContnet);
- $(".show-fourth .pad_box").empty().append(sContnet);
- }
- }
- function xrList2(arr) {
- map.clearOverlays();
- var sContnet = "";
- var addFirst;
- if (!arr) {
- return;
- } else {
- for (var index = 0; index < arr.length; index++) {
- var arrdep = arr[index].dep;
- arraddre = arr[index].address;
- var arrtype = arr[index].type;
- var arrspecial = arr[index].specialtype;
- var arrtag = arr[index].tag;
- var arrtag2 = arr[index].tag2;
- var arrtag3 = arr[index].tag3;
- var arrcontent = arr[index].content;
- var arrimg = arr[index].img;
- var arrtel = arr[index].tel;
- var arrtime = arr[index].time;
- var arrsptype = arr[index].sptype;
- sContnet +=
- "<ul class='titleFirst'><div class='wrap_apply'><li class='title_flex'>";
- sContnet += "<p style='width:100%'>" + arrdep + "</p>";
- if (arrtype == "" || arrtype == undefined || arrtype == null) {
- sContnet += "";
- } else {
- if (arrspecial == "中学") {
- if (arrtype == "中学") {
- sContnet += "";
- } else {
- sContnet += "<p class='flex_blue'>· " + arrtype + "</p>";
- }
- sContnet += "<p class='flex_blue'>· " + arrspecial + "</p>";
- } else {
- sContnet += "<p class='flex_blue'>· " + arrtype + "</p>";
- }
- }
- sContnet += "</li>";
- if (arrtag == "" || arrtag == undefined || arrtag == null) {
- sContnet += "";
- } else {
- sContnet +=
- "<li class='flex_orange'><div class='three_tag'>" + arrtag;
- if (arrtag2 == undefined || arrtag2 == "" || arrtag2 == null) {
- sContnet += "</div>";
- } else {
- sContnet += "</div><div class='three_tag'>" + arrtag2 + "</div>";
- }
- if (arrtag3 == undefined || arrtag3 == "" || arrtag3 == null) {
- sContnet += "</li>";
- } else {
- sContnet += "<div class='three_tag'>" + arrtag3 + "</div></li>";
- }
- }
- if (arrcontent == undefined || arrcontent == null || arrcontent == "") {
- sContnet += "";
- } else {
- sContnet +=
- "<li><a class='a_blue'><p class='content_p' style='overflow: hidden;text-overflow: ellipsis;display: -webkit-box;-webkit-line-clamp: 2;-webkit-box-orient: vertical;'>";
- sContnet += arrcontent + "</p></a></li>";
- }
- if (arrimg == undefined || arrimg == null || arrimg == "") {
- sContnet += "";
- } else {
- sContnet +=
- "<li class='img_box'><img data-src='" +
- PATH +
- arrimg +
- "' class='two_img' src='" +
- PATH +
- arrimg +
- "'></li>";
- }
- sContnet +=
- "<li class='address_box'><p><span class='flex_address'>地址:</span>" +
- arraddre +
- "</p>";
- if (arrtime == "" || arrtime == undefined || arrtime == null) {
- sContnet += "";
- } else if (arrsptype == "查阅场所") {
- sContnet +=
- "<p><span class='flex_address'>查询时间:</span>" +
- arrtime +
- "</p>";
- } else if (arrsptype == "受理场所") {
- sContnet +=
- "<p><span class='flex_address'>受理时间:</span>" +
- arrtime +
- "</p>";
- } else if (arrsptype == "政务服务" || arrsptype == "办税服务") {
- sContnet +=
- "<p><span class='flex_address'>办理时间:</span>" +
- arrtime +
- "</p>";
- } else {
- sContnet +=
- "<p><span class='flex_address'>办公时间:</span>" +
- arrtime +
- "</p>";
- }
- if (arrtel == "" || arrtel == undefined || arrtel == null) {
- sContnet += "";
- } else {
- sContnet += "<p><span class='flex_address'>办公电话:</span>";
- for (var i = 0; i < arrtel.split(";").length; i++) {
- if (arrtel.split(";").length - i != 1) {
- sContnet +=
- "<a href='tel:" +
- arrtel.split(";")[i] +
- "' style='text-decoration:underline'>" +
- arrtel.split(";")[i] +
- "</a>;";
- } else {
- sContnet +=
- "<a href='tel:" +
- arrtel.split(";")[i] +
- "' style='text-decoration:underline'>" +
- arrtel.split(";")[i] +
- "</a>";
- }
- }
- sContnet += "</p>";
- }
- if (
- arr[index].sptype == "受理场所" ||
- arr[index].dep == "重庆市南岸区政务服务中心(江南新城中心)" ||
- arr[index].dep == "重庆市南岸区政务服务中心(南坪中心)"
- ) {
- sContnet +=
- " <div class='handle_business' data-sign='isflag'>点击查看详情</div>";
- } else if (
- arrdep == "重庆市南岸区民政局婚姻登记处(茶园)" ||
- arrdep == "重庆市南岸区民政局婚姻登记处(南坪)"
- ) {
- sContnet +=
- " <div class='handle_business1' data-sign='isflag'>点击查看详情</div>";
- } else if (arrdep == "重庆市南岸区社会保险事务中心") {
- sContnet +=
- " <div class='handle_business2' data-sign='isflag'>点击查看详情</div>";
- } else {
- sContnet += "<div class='detailCheck'>点击查看详情</div>";
- }
- sContnet += "</li></div><li class='btn_box'>";
- sContnet +=
- "<button class='one_bus'>公交</button><button class='two_car'>自驾</button>";
- sContnet += "</li></ul>";
- }
- $(".show-fourth .result_form_ajax").empty().append(sContnet);
- }
- }
- async function getPointPostAjax(arr) {
- var dataString;
- var mapList = [];
- if (!arr) {
- return;
- } else {
- for (var index = 0; index < arr.length; index++) {
- arraddre = arr[index].address;
- const tempAdd = arraddre;
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- tempAdd,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- var obj = {
- id: arr[index].id,
- longitude: address.lng,
- latitude: address.lat,
- };
- mapList.push(obj);
- resolve();
- }
- },
- "重庆市"
- );
- });
- }
- }
- 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 },
- });
- }
- // 封装渲染列表
- function xrResultList(arrey, isSign) {
- $("#deptDiv2").empty();
- $("#deptDiv2").prev().remove();
- $(".wrap_handle").hide();
- var discript = "";
- $.each(arrey, function (i) {
- discrptAddress = arrey[i].address;
- discript += "<ul class='titleFirst'>";
- discript += "<div class='wrap_apply'>";
- discript += "<li class='title_flex'>";
- discript += "<p style='width:100%'>";
- discript += arrey[i].dep;
- discript += "</p>";
- if (
- arrey[i].type == "" ||
- arrey[i].type == undefined ||
- arrey[i].type == null
- ) {
- discript += "";
- } else {
- if (arrey[i].specialtype == "中学") {
- if (arrey[i].type == "中学") {
- discript += "";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += arrey[i].type;
- discript += "</p>";
- }
- discript += "<p class='flex_blue'>· ";
- discript += arrey[i].specialtype;
- discript += "</p>";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += arrey[i].type;
- discript += "</p>";
- }
- discript += "</li>";
- }
- if (
- arrey[i].tag == undefined ||
- arrey[i].tag == "" ||
- arrey[i].tag == null
- ) {
- discript += "";
- } else {
- discript += "<li class='flex_orange'>";
- discript += "<div class='three_tag'>";
- discript += arrey[i].tag;
- discript += "</div>";
- if (
- arrey[i].tag2 == undefined ||
- arrey[i].tag2 == "" ||
- arrey[i].tag2 == null
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += arrey[i].tag2;
- discript += "</div>";
- }
- if (
- arrey[i].tag3 == undefined ||
- arrey[i].tag3 == "" ||
- arrey[i].tag3 == null
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += arrey[i].tag3;
- discript += "</div>";
- }
- }
- discript += "<li>";
- if (
- arrey[i].content == "" ||
- arrey[i].content == undefined ||
- arrey[i].content == null
- ) {
- discript += "";
- } else {
- discript += "<a class='a_blue'>";
- discript += "<p class='content_p'>";
- discript += arrey[i].content;
- discript += "</p>";
- discript += "</a>";
- }
- discript += "</li>";
- discript += "<li class='img_box'>";
- if (
- arrey[i].img == "" ||
- arrey[i].img == undefined ||
- arrey[i].img == null
- ) {
- discript += "";
- } else {
- discript +=
- "<img data-src='" +
- PATH +
- arrey[i].img +
- "' class='two_img' src='" +
- PATH +
- arrey[i].img +
- "'>";
- }
- discript += "</li>";
- discript += "<li class='address_box'>";
- discript += "<p><span class='flex_address'>地址:</span>";
- discript += arrey[i].address;
- discript += "</p>";
- if (
- arrey[i].time == "" ||
- arrey[i].time == undefined ||
- arrey[i].time == null
- ) {
- discript += "";
- } else if (arrey[i].sptype == "查阅场所") {
- discript += "<p><span class='flex_address'>查询时间:</span>";
- discript += arrey[i].time;
- discript += "</p>";
- } else if (arrey[i].sptype == "受理场所") {
- discript += "<p><span class='flex_address'>受理时间:</span>";
- discript += arrey[i].time;
- discript += "</p>";
- } else if (
- arrey[i].sptype == "政务服务" ||
- arrey[i].sptype == "办税服务"
- ) {
- discript += "<p><span class='flex_address'>办理时间:</span>";
- discript += arrey[i].time;
- discript += "</p>";
- } else {
- discript += "<p><span class='flex_address'>办公时间:</span>";
- discript += arrey[i].time;
- discript += "</p>";
- }
- if (
- arrey[i].tel == "" ||
- arrey[i].tel == undefined ||
- arrey[i].tel == null
- ) {
- discript += "";
- } else {
- var discriptone_tel = arrey[i].tel.split(";")[0];
- var discripttwo_tel = arrey[i].tel.split(";")[1];
- var discripthree_tel = arrey[i].tel.split(";")[2];
- var discriptfour_tel = arrey[i].tel.split(";")[3];
- discript += "<p><span class='flex_address'>办公电话:</span>";
- discript +=
- "<a href='tel:" +
- discriptone_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptone_tel +
- "</a>";
- if (discripttwo_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripttwo_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripttwo_tel +
- "</a>";
- }
- if (discripthree_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripthree_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripthree_tel +
- "</a>";
- }
- if (discriptfour_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discriptfour_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptfour_tel +
- "</a>";
- }
- discript += "</p>";
- }
- discript += "</li>";
- discript += "</div>";
- discript += "<li class='btn_box'>";
- discript += "<button class='one_bus'>公交</button>";
- discript += "<button class='two_car'>自驾</button>";
- discript += "</li>";
- discript += "</ul>";
- });
- $(".pad_box").empty().append(discript);
- if (isSign == "isShowAddress") {
- $(".pad_box").attr("sign", "isShowAddress");
- } else {
- $(".pad_box").attr("sign", "");
- }
- }
- // 点击列表之一,中心重新渲染
- $(document).on("click", ".detailCheck", async function () {
- $(".show-fourth").hide();
- $(".content_from_ajax3").parent().removeClass("layui-hide");
- var addText = $(this).parent(".address_box").find("p:nth-child(1)").text();
- var discriptText = addText.split(":")[1];
- var addFirst;
- scrollListHeight = $(".wrap_result").scrollTop();
- scrollListHeight1 = $(".wrap_result1").scrollTop();
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discriptText,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discriptText;
- });
- applyClickList();
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- xrResultList(getClick);
- if (discriptText == discrptAddress) {
- addMarker(getClick, address);
- }
- $(".content_from_ajax3 .layui-tab-title li").eq(0).click();
- indexList = 1;
- ssList = 1;
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- $(document).on("click", "#deptDiv div", function () {
- $("#deptDiv div")
- .removeClass("layui-border-green")
- .addClass("layui-border-blue");
- $(this).removeClass("layui-border-blue").addClass("layui-border-green");
- var firstpage = 1;
- var pagetype = 0;
- let dep = $(this).attr("data-dep");
- if ($(this).text().trim() == "全部") {
- dep = $(this).parent().prev().prev().attr("data-dep");
- }
- page(firstpage, pagetype, dep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.230:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data == null) {
- applyClickList();
- $(".show-sixth").fadeOut(0);
- $(".show-fifth").fadeIn(100);
- indexList = 1;
- } else if (res.data != null) {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth").show().css("height", rmHeight).siblings().hide();
- $(".wrap_handle").show();
- count = res.count;
- var html = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- $(".layui-show .result_form_ajax").empty().append(html);
- }
- },
- });
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- 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, first) {
- pagetype = 0;
- page(obj.curr, pagetype, dep);
- },
- });
- });
- blList = 1;
- });
- $(document).on("click", ".handle_business", async function () {
- var dep = $(this)
- .parents(".address_box")
- .siblings(".title_flex")
- .children("p")
- .text();
- $(".content_from_ajax .layui-tab-title")
- .find(".layui-this")
- .attr("id", dep);
- $(".content_from_ajax").show().siblings(".marrige").hide();
- var addText = $(this).parent(".address_box").find("p:nth-child(1)").text();
- var discriptText = addText.split(":")[1];
- var addFirst, count;
- var firstpage = 1;
- var pagetype = 0;
- scrollListHeight = $(".wrap_result").scrollTop();
- const sign = $(this).attr("data-sign");
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discriptText,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discriptText;
- });
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- if ($("#deptDiv").prev().hasClass("isDel")) {
- $("#deptDiv").prev().remove();
- $("#deptDiv").empty();
- }
- if (sign == "isflag") {
- getClick = digitGroupItem.filter((i) => {
- return i.address == discriptText;
- });
- if (getClick[0].searchDept) {
- dep = getClick[0].searchDept.join(",");
- $(".show-sixth .pad_box").attr("data-dep", dep);
- let html =
- '<div class="layui-border-green dept-sty" data-dep="">全部</div>';
- for (let n = 0; n < getClick[0].searchDept.length; n++) {
- html += `<div class="layui-border-blue dept-sty" data-dep="${
- getClick[0].searchDept[n]
- }">
- ${getClick[0].searchDept[n].replace("重庆市", "").replace("南岸", "")}</div>`;
- }
- $("#deptDiv").empty().append(html);
- $("#deptDiv").before(
- `<div class="isDel" style="background: #fff;font-size: 20px;padding-left: 20px;">入驻部门</div>`
- );
- }
- } else {
- if (deptArr[dep]) {
- dep = deptArr[dep].join(",");
- $(".show-sixth .pad_box").attr("data-dep", dep);
- let html =
- '<div class="layui-border-green dept-sty" data-dep="">全部</div>';
- let depArr = dep.split(",");
- for (let n = 0; n < depArr.length; n++) {
- html += `<div class="layui-border-blue dept-sty" data-dep="${
- depArr[n]
- }">
- ${depArr[n].replace("重庆市", "").replace("南岸", "")}</div>`;
- }
- $("#deptDiv").empty().append(html);
- $("#deptDiv").before(
- `<div class="isDel" style="background: #fff;font-size: 20px;padding-left: 20px;">入驻部门</div>`
- );
- }
- }
- page(getClick, firstpage, pagetype, dep);
- function page(getClick, page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.230:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data == null) {
- applyClickList();
- $(".show-sixth").fadeOut(0);
- $(".show-fifth").fadeIn(100);
- xrResultList(getClick);
- indexList = 1;
- } else if (res.data != null) {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth")
- .show()
- .css("height", rmHeight)
- .siblings()
- .hide();
- $(".wrap_handle").show();
- count = res.count;
- var discript = "";
- var html = "";
- $.each(getClick, function (i) {
- discrptAddress = getClick[i].address;
- discript += "<ul class='titleFirst'>";
- discript += "<div class='wrap_apply'>";
- discript += "<li class='title_flex'>";
- discript += "<p style='width:100%'>";
- discript += getClick[i].dep;
- discript += "</p>";
- if (
- getClick[i].type == "" ||
- getClick[i].type == undefined ||
- getClick[i].type == null
- ) {
- discript += "";
- } else {
- if (getClick[i].specialtype == "中学") {
- if (getClick[i].type == "中学") {
- discript += "";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].specialtype;
- discript += "</p>";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "</li>";
- }
- if (
- getClick[i].tag == undefined ||
- getClick[i].tag == "" ||
- getClick[i].tag == null
- ) {
- discript += "";
- } else {
- discript += "<li class='flex_orange'>";
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag;
- discript += "</div>";
- if (
- getClick[i].tag2 == undefined ||
- getClick[i].tag2 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag2;
- discript += "</div>";
- }
- if (
- getClick[i].tag3 == undefined ||
- getClick[i].tag3 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag3;
- discript += "</div>";
- }
- }
- discript += "<li>";
- if (
- getClick[i].content == undefined ||
- getClick[i].content == null ||
- getClick[i].content == ""
- ) {
- discript += "";
- } else {
- discript += "<a class='a_blue'>";
- discript += "<p class='content_p'>";
- discript += getClick[i].content;
- discript += "</p>";
- discript += "</a>";
- }
- discript += "</li>";
- discript += "<li class='img_box'>";
- if (
- getClick[i].img == undefined ||
- getClick[i].img == null ||
- getClick[i].img == ""
- ) {
- discript += "";
- } else {
- discript +=
- "<img data-src='" +
- PATH +
- getClick[i].img +
- "' class='two_img' src='" +
- PATH +
- getClick[i].img +
- "'>";
- }
- discript += "</li>";
- discript += "<li class='address_box'>";
- discript += "<p><span class='flex_address'>地址:</span>";
- discript += getClick[i].address;
- discript += "</p>";
- if (
- getClick[i].time == "" ||
- getClick[i].time == undefined ||
- getClick[i].time == null
- ) {
- discript += "";
- } else if (getClick[i].sptype == "查阅场所") {
- discript +=
- "<p><span class='flex_address'>查询时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (getClick[i].sptype == "受理场所") {
- discript +=
- "<p><span class='flex_address'>受理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (
- getClick[i].sptype == "政务服务" ||
- getClick[i].sptype == "办税服务"
- ) {
- discript +=
- "<p><span class='flex_address'>办理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else {
- discript +=
- "<p><span class='flex_address'>办公时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- }
- if (
- getClick[i].tel == "" ||
- getClick[i].tel == undefined ||
- getClick[i].tel == null
- ) {
- discript += "";
- } else {
- var discriptone_tel = getClick[i].tel.split(";")[0];
- var discripttwo_tel = getClick[i].tel.split(";")[1];
- var discripthree_tel = getClick[i].tel.split(";")[2];
- var discriptfour_tel = getClick[i].tel.split(";")[3];
- discript +=
- "<p><span class='flex_address'>办公电话:</span>";
- discript +=
- "<a href='tel:" +
- discriptone_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptone_tel +
- "</a>";
- if (discripttwo_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripttwo_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripttwo_tel +
- "</a>";
- }
- if (discripthree_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripthree_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripthree_tel +
- "</a>";
- }
- if (discriptfour_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discriptfour_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptfour_tel +
- "</a>";
- }
- discript += "</p>";
- }
- discript += "</li>";
- discript += "</div>";
- discript += "<li class='btn_box'>";
- discript += "<button class='one_bus'>公交</button>";
- discript += "<button class='two_car'>自驾</button>";
- discript += "</li>";
- discript += "</ul>";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- });
- $(".layui-show .result_form_ajax").empty().append(html);
- $(".show-sixth .pad_box").empty().append(discript);
- }
- },
- });
- // if (discriptText == discrptAddress) {
- // }
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- 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, first) {
- pagetype = 0;
- page(getClick, obj.curr, pagetype, dep);
- },
- });
- });
- blList = 1;
- addMarker(getClick, address);
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- $(document).on("click", ".handle_business1", async function () {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth").show().css("height", rmHeight).siblings().hide();
- $(".wrap_handle").show();
- $(".content_from_ajax").hide().siblings(".marrige").show();
- var addText = $(this).parent(".address_box").find("p:nth-child(1)").text();
- var discriptText = addText.split(":")[1];
- var addFirst, count;
- var firstpage = 1;
- var pagetype = 3;
- scrollListHeight = $(".wrap_result").scrollTop();
- const sign = $(this).attr("data-sign");
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discriptText,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discriptText;
- });
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- if (sign == "isflag") {
- getClick = digitGroupItem.filter((i) => {
- return i.address == discriptText;
- });
- }
- page(getClick, firstpage, pagetype);
- function page(getClick, page, pagetype) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- },
- success: function (res) {
- if (res.data != null) {
- count = res.count;
- var discript = "";
- var html = "";
- $.each(getClick, function (i) {
- discrptAddress = getClick[i].address;
- discript += "<ul class='titleFirst'>";
- discript += "<div class='wrap_apply'>";
- discript += "<li class='title_flex'>";
- discript += "<p style='width:100%'>";
- discript += getClick[i].dep;
- discript += "</p>";
- if (
- getClick[i].type == "" ||
- getClick[i].type == undefined ||
- getClick[i].type == null
- ) {
- discript += "";
- } else {
- if (getClick[i].specialtype == "中学") {
- if (getClick[i].type == "中学") {
- discript += "";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].specialtype;
- discript += "</p>";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "</li>";
- }
- if (
- getClick[i].tag == undefined ||
- getClick[i].tag == "" ||
- getClick[i].tag == null
- ) {
- discript += "";
- } else {
- discript += "<li class='flex_orange'>";
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag;
- discript += "</div>";
- if (
- getClick[i].tag2 == undefined ||
- getClick[i].tag2 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag2;
- discript += "</div>";
- }
- if (
- getClick[i].tag3 == undefined ||
- getClick[i].tag3 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag3;
- discript += "</div>";
- }
- }
- discript += "<li>";
- if (
- getClick[i].content == "" ||
- getClick[i].content == undefined ||
- getClick[i].content == null
- ) {
- discript += "";
- } else {
- discript += "<a class='a_blue'>";
- discript += "<p class='content_p'>";
- discript += getClick[i].content;
- discript += "</p>";
- discript += "</a>";
- }
- discript += "</li>";
- discript += "<li class='img_box'>";
- if (
- getClick[i].img == "" ||
- getClick[i].img == undefined ||
- getClick[i].img == null
- ) {
- discript += "";
- } else {
- discript +=
- "<img data-src='" +
- PATH +
- getClick[i].img +
- "' class='two_img' src='" +
- PATH +
- getClick[i].img +
- "'>";
- }
- discript += "</li>";
- discript += "<li class='address_box'>";
- discript += "<p><span class='flex_address'>地址:</span>";
- discript += getClick[i].address;
- discript += "</p>";
- if (
- getClick[i].time == "" ||
- getClick[i].time == undefined ||
- getClick[i].time == null
- ) {
- discript += "";
- } else if (getClick[i].sptype == "查阅场所") {
- discript +=
- "<p><span class='flex_address'>查询时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (getClick[i].sptype == "受理场所") {
- discript +=
- "<p><span class='flex_address'>受理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (
- getClick[i].sptype == "政务服务" ||
- getClick[i].sptype == "办税服务"
- ) {
- discript +=
- "<p><span class='flex_address'>办理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else {
- discript +=
- "<p><span class='flex_address'>办公时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- }
- if (
- getClick[i].tel == "" ||
- getClick[i].tel == undefined ||
- getClick[i].tel == null
- ) {
- discript += "";
- } else {
- var discriptone_tel = getClick[i].tel.split(";")[0];
- var discripttwo_tel = getClick[i].tel.split(";")[1];
- var discripthree_tel = getClick[i].tel.split(";")[2];
- var discriptfour_tel = getClick[i].tel.split(";")[3];
- discript +=
- "<p><span class='flex_address'>办公电话:</span>";
- discript +=
- "<a href='tel:" +
- discriptone_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptone_tel +
- "</a>";
- if (discripttwo_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripttwo_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripttwo_tel +
- "</a>";
- }
- if (discripthree_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripthree_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripthree_tel +
- "</a>";
- }
- if (discriptfour_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discriptfour_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptfour_tel +
- "</a>";
- }
- discript += "</p>";
- }
- discript += "</li>";
- discript += "</div>";
- discript += "<li class='btn_box'>";
- discript += "<button class='one_bus'>公交</button>";
- discript += "<button class='two_car'>自驾</button>";
- discript += "</li>";
- discript += "</ul>";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- });
- $(".marrige").empty().append(html);
- $(".show-sixth .pad_box").empty().append(discript);
- }
- },
- });
- }
- // if (discriptText == discrptAddress) {
- addMarker(getClick, address);
- // }
- blList = 1;
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- $(document).on("click", ".handle_business2", async function () {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth").show().css("height", rmHeight).siblings().hide();
- $(".wrap_handle").show();
- $(".content_from_ajax").hide().siblings(".marrige").show();
- var addText = $(this).parent(".address_box").find("p:nth-child(1)").text();
- var discriptText = addText.split(":")[1];
- var addFirst, count;
- var firstpage = 1;
- var pagetype = 5;
- scrollListHeight = $(".wrap_result").scrollTop();
- const sign = $(this).attr("data-sign");
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discriptText,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discriptText;
- });
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- if (sign == "isflag") {
- getClick = digitGroupItem.filter((i) => {
- return i.address == discriptText;
- });
- }
- page(getClick, firstpage, pagetype);
- function page(getClick, page, pagetype) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- },
- success: function (res) {
- if (res.data != null) {
- count = res.count;
- var discript = "";
- var html = "";
- $.each(getClick, function (i) {
- discrptAddress = getClick[i].address;
- discript += "<ul class='titleFirst'>";
- discript += "<div class='wrap_apply'>";
- discript += "<li class='title_flex'>";
- discript += "<p style='width:100%'>";
- discript += getClick[i].dep;
- discript += "</p>";
- if (
- getClick[i].type == "" ||
- getClick[i].type == undefined ||
- getClick[i].type == null
- ) {
- discript += "";
- } else {
- if (getClick[i].specialtype == "中学") {
- if (getClick[i].type == "中学") {
- discript += "";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].specialtype;
- discript += "</p>";
- } else {
- discript += "<p class='flex_blue'>· ";
- discript += getClick[i].type;
- discript += "</p>";
- }
- discript += "</li>";
- }
- if (
- getClick[i].tag == undefined ||
- getClick[i].tag == "" ||
- getClick[i].tag == null
- ) {
- discript += "";
- } else {
- discript += "<li class='flex_orange'>";
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag;
- discript += "</div>";
- if (
- getClick[i].tag2 == undefined ||
- getClick[i].tag2 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag2;
- discript += "</div>";
- }
- if (
- getClick[i].tag3 == undefined ||
- getClick[i].tag3 == ""
- ) {
- discript += "";
- } else {
- discript += "<div class='three_tag'>";
- discript += getClick[i].tag3;
- discript += "</div>";
- }
- }
- discript += "<li>";
- if (
- getClick[i].content == "" ||
- getClick[i].content == undefined ||
- getClick[i].content == null
- ) {
- discript += "";
- } else {
- discript += "<a class='a_blue'>";
- discript += "<p class='content_p'>";
- discript += getClick[i].content;
- discript += "</p>";
- discript += "</a>";
- }
- discript += "</li>";
- discript += "<li class='img_box'>";
- if (
- getClick[i].img == "" ||
- getClick[i].img == undefined ||
- getClick[i].img == null
- ) {
- discript += "";
- } else {
- discript +=
- "<img data-src='" +
- PATH +
- getClick[i].img +
- "' class='two_img' src='" +
- PATH +
- getClick[i].img +
- "'>";
- }
- discript += "</li>";
- discript += "<li class='address_box'>";
- discript += "<p><span class='flex_address'>地址:</span>";
- discript += getClick[i].address;
- discript += "</p>";
- if (
- getClick[i].time == "" ||
- getClick[i].time == undefined ||
- getClick[i].time == null
- ) {
- discript += "";
- } else if (getClick[i].sptype == "查阅场所") {
- discript +=
- "<p><span class='flex_address'>查询时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (getClick[i].sptype == "受理场所") {
- discript +=
- "<p><span class='flex_address'>受理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else if (
- getClick[i].sptype == "政务服务" ||
- getClick[i].sptype == "办税服务"
- ) {
- discript +=
- "<p><span class='flex_address'>办理时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- } else {
- discript +=
- "<p><span class='flex_address'>办公时间:</span>";
- discript += getClick[i].time;
- discript += "</p>";
- }
- if (
- getClick[i].tel == "" ||
- getClick[i].tel == undefined ||
- getClick[i].tel == null
- ) {
- discript += "";
- } else {
- var discriptone_tel = getClick[i].tel.split(";")[0];
- var discripttwo_tel = getClick[i].tel.split(";")[1];
- var discripthree_tel = getClick[i].tel.split(";")[2];
- var discriptfour_tel = getClick[i].tel.split(";")[3];
- discript +=
- "<p><span class='flex_address'>办公电话:</span>";
- discript +=
- "<a href='tel:" +
- discriptone_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptone_tel +
- "</a>";
- if (discripttwo_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripttwo_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripttwo_tel +
- "</a>";
- }
- if (discripthree_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discripthree_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discripthree_tel +
- "</a>";
- }
- if (discriptfour_tel == undefined) {
- discript += "";
- } else {
- discript +=
- ";<a href='tel:" +
- discriptfour_tel +
- "' style='color: #2775CC;text-decoration:underline'>" +
- discriptfour_tel +
- "</a>";
- }
- discript += "</p>";
- }
- discript += "</li>";
- discript += "</div>";
- discript += "<li class='btn_box'>";
- discript += "<button class='one_bus'>公交</button>";
- discript += "<button class='two_car'>自驾</button>";
- discript += "</li>";
- discript += "</ul>";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- });
- $(".marrige").empty().append(html);
- $(".show-sixth .pad_box").empty().append(discript);
- }
- },
- });
- }
- // if (discriptText == discrptAddress) {
- addMarker(getClick, address);
- // }
- blList = 1;
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- $(document).on(
- "click",
- ".content_from_ajax .layui-tab-title li",
- function () {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth").show().css("height", rmHeight).siblings().hide();
- $(".right-map").css("height", hlHeight);
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-sixth").innerWidth() - $(".wrap_handle").innerWidth()) / 2;
- $(".wrap_handle").css({ top: spWidth, left: spWidth });
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".right-search").hide().css("top", "0px");
- var getdep = $(this)
- .parents(".layui-tab-title")
- .find("li:nth-child(1)")
- .attr("id");
- if (
- $(this).parent().parent().prev().prev().prev().attr("data-dep") &&
- deptArr[getdep]
- ) {
- if ($("#deptDiv .layui-border-green").text().trim() == "全部") {
- getdep = $(this)
- .parent()
- .parent()
- .prev()
- .prev()
- .prev()
- .attr("data-dep");
- } else {
- getdep = $("#deptDiv .layui-border-green").attr("data-dep");
- }
- }
- var getText = $(this).text();
- if (getText == "个人办事") {
- var count;
- var firstpage = 1;
- var pagetype = 0;
- page(firstpage, pagetype, getdep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 6,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data != null) {
- count = res.count;
- var sContnet = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- sContnet += "";
- } else {
- sContnet +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- sContnet += "<h6 class='point_from_ajax'></h6>";
- sContnet +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- sContnet += "</a>";
- }
- });
- $(".result_form_ajax").empty().append(sContnet);
- }
- },
- });
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- 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, first) {
- pagetype = 0;
- page(obj.curr, pagetype, getdep);
- },
- });
- });
- blList = 1;
- } else if (getText == "法人办事") {
- var count;
- var firstpage = 1;
- var pagetype = 1;
- page(firstpage, pagetype, getdep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data != null) {
- count = res.count;
- var sContnet = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- sContnet += "";
- } else {
- sContnet +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- sContnet += "<h6 class='point_from_ajax'></h6>";
- sContnet +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- sContnet += "</a>";
- }
- });
- $(".result_form_ajax").empty().append(sContnet);
- }
- },
- });
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- 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, first) {
- pagetype = 1;
- page(obj.curr, pagetype, getdep);
- },
- });
- });
- blList = 1;
- }
- }
- );
- function addMarker(arrey, point) {
- var myIcon = new BMap.Icon("./img/location.png", new BMap.Size(40, 40));
- var marker = new BMap.Marker(point, {
- icon: myIcon,
- });
- map.addOverlay(marker);
- }
- // 点击按钮公交实现路线规划
- $(document).on("click", ".one_bus", async function () {
- var address_text = $(this)
- .parent(".btn_box")
- .siblings(".wrap_apply")
- .find("p:nth-child(1)")
- .text();
- var discript_text = address_text.split(":")[1];
- $("#gj-two").val(discript_text);
- $(".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");
- $(".right-search").show();
- $(".right-search").animate({ top: "3.06666vw" }, 400);
- $(".top_search").fadeOut(50);
- var addFirst;
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discript_text,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discript_text;
- });
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- xrResultList(getClick);
- if (discript_text == discrptAddress) {
- addMarker(getClick, address);
- }
- indexList = 1;
- ssList = 1;
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- // 点击按钮自驾实现路线规划
- $(document).on("click", ".two_car", async function () {
- var address_text = $(this)
- .parent(".btn_box")
- .siblings(".wrap_apply")
- .find("p:nth-child(1)")
- .text();
- var discript_text = address_text.split(":")[1];
- $("#zj-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");
- $(".right-search").show();
- $(".right-search").animate({ top: "3.06666vw" }, 400);
- $(".top_search").fadeOut(50);
- var addFirst;
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- discript_text,
- function (point) {
- if (point) {
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- let getClick = getAllArr.filter((i) => {
- return i.address == discript_text;
- });
- for (let i = 0; i < getClick.length; i++) {
- for (let j = i + 1; j < getClick.length; j++) {
- if (getClick[j].dep === getClick[i].dep) {
- getClick.splice(j, 1);
- }
- }
- }
- xrResultList(getClick);
- if (discript_text == discrptAddress) {
- addMarker(getClick, address);
- }
- indexList = 1;
- ssList = 1;
- map.setCenter(addFirst);
- resolve();
- }
- },
- "重庆市"
- );
- });
- });
- // 触发输入框时,地图不被拖动
- $("input").focus(function () {
- map.disableDragging(); // 禁用地图拖拽
- map.disableContinuousZoom(); // 关闭双击平滑缩放效果
- map.disablePinchToZoom(); // 禁用双指缩放地图
- var rsTop = $(".right-search").css("top");
- var ksHeight =
- window.outerHeight -
- $(".right-map").outerHeight() -
- $(".head").outerHeight;
- if (rsTop > "60px") {
- $(".right-search").css("top", "20.0667vw");
- $(".icon-shq").css("top", "20.0667vw");
- } else if (rsTop < ksHeight) {
- $(".right-search").css("top", "3.06666vw");
- $(".icon-shq").css("top", "3.06666vw");
- } else {
- $(".right-search").css("top", ksHeight);
- $(".icon-shq").css("top", ksHeight);
- }
- $(".back_top").hide();
- });
- // 输入框失焦时,地图恢复拖动
- $("input").blur(function () {
- setTimeout(function () {
- var rsTop = $(".right-search").css("top");
- var ksHeight =
- window.outerHeight -
- $(".right-map").outerHeight() -
- $(".head").outerHeight;
- map.enableInertialDragging();
- map.enableDragging();
- map.enableContinuousZoom();
- map.enablePinchToZoom();
- if (rsTop > "60px") {
- $(".right-search").css("top", "20.0667vw");
- $(".icon-shq").css("top", "20.0667vw");
- } else if (rsTop < ksHeight) {
- $(".right-search").css("top", "3.06666vw");
- $(".icon-shq").css("top", "3.06666vw");
- } else {
- $(".right-search").css("top", ksHeight);
- $(".icon-shq").css("top", ksHeight);
- }
- var topHeight = $(".wrap_result")
- .children(".pad_box")
- .find(".titleFirst")
- .outerHeight();
- var topHeight1 = $(".wrap_result1")
- .find(".pad_box")
- .find(".titleFirst")
- .outerHeight();
- console.log(topHeight1);
- var top = $(".wrap_result").scrollTop();
- var top1 = $(".wrap_result1").scrollTop();
- if (top > topHeight) {
- $(".show-fourth .back_top").css("display", "block");
- } else if (top < topHeight) {
- $(".show-fourth .back_top").hide();
- }
- if (top1 > topHeight1) {
- $(".show-fifth .back_top").css("display", "block");
- } else if (top1 < topHeight1) {
- $(".show-fifth .back_top").hide();
- }
- }, 1000);
- });
- // 点击头部的公交和自驾时切换
- $(".search-change li").click(function () {
- var gjzjtext = $(this).text();
- var startGJ = $("#gj-one").val();
- var endGJ = $("#gj-two").val();
- var startZJ = $("#zj-one").val();
- var endZJ = $("#zj-two").val();
- if (gjzjtext == "公交") {
- console.log("1:", startZJ, endZJ);
- $(".show-first").show().siblings().hide();
- $(".top_search").show().siblings(".right-map").show();
- $(".right-search")
- .css("top", msHeight)
- .siblings(".right-map")
- .css("top", "0px");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- $("#gj-one").val(startZJ);
- $("#gj-two").val(endZJ);
- }
- if (gjzjtext == "自驾") {
- console.log("2:", startGJ, endGJ);
- $(".show-first").show().siblings().hide();
- $(".top_search").show().siblings(".right-map").show();
- $(".right-search")
- .css("top", msHeight)
- .siblings(".right-map")
- .css("top", "0px");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- $("#zj-one").val(startGJ);
- $("#zj-two").val(endGJ);
- }
- });
- var obj = JSON.stringify(["", ""]);
- localStorage.setItem("line", obj);
- var resultObject = JSON.stringify(["", ""]);
- localStorage.setItem("lineText", resultObject);
- localStorage.setItem("discern", 0);
- // 点击头部的公交的搜索按钮在左边出现结果
- $(".inp-icon2").click(async function () {
- var startZD = $("#gj-one").val();
- var endZD = $("#gj-two").val();
- var startPoint, endPoint;
- if (startZD == "" || endZD == "") {
- $(".top_search")
- .show()
- .siblings(".right-map")
- .show()
- .css("top", "0px")
- .siblings(".right-search")
- .css("top", msHeight);
- $(".show-first").show().siblings().hide();
- $("#result").empty();
- localStorage.setItem("discern", "0");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- localStorage.setItem("discern", "0");
- layer.msg("请输入起点或终点!");
- } else {
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- layui.use("layer", function () {
- var $ = layui.jquery,
- layer = layui.layer;
- layer.open({
- title: false,
- content: false,
- id: "layerchoicebaidugaode",
- btn: ["百度地图导航", "高德地图导航"],
- btnAlign: "c",
- yes: function () {
- var baiduConfig = {
- scheme_Android:
- "bdapp://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_IOS:
- "baidumap://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_web:
- "http://api.map.baidu.com/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- },
- btn2: function () {
- var baiduConfig = {
- scheme_Android:
- "androidamap://route/plan/?sourceApplication=appname&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=1",
- scheme_IOS:
- "iosamap://path?sourceApplication=applicationName&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=1",
- scheme_web:
- "https://uri.amap.com/navigation?from=" +
- startPoint.lng +
- "," +
- startPoint.lat +
- "," +
- startZD +
- "&to=" +
- endPoint.lng +
- "," +
- endPoint.lat +
- "," +
- endZD +
- "&mode=bus&callnative=1&coordinate=wgs84&src=mypage",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- return false;
- },
- });
- });
- }
- });
- $("#gj-one").bind("keyup", function (event) {
- var startZD = $("#gj-one").val();
- map.clearOverlays();
- if (event.keyCode == 13) {
- if (startZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- layer.msg("请输入起点!");
- } else {
- $("#gj-two").focus();
- }
- }
- });
- $("#gj-two").bind("keyup", async function (event) {
- var startZD = $("#gj-one").val();
- var endZD = $("#gj-two").val();
- if (event.keyCode == 13) {
- if (startZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- layer.msg("请输入起点!");
- } else if (endZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- layer.msg("请输入终点!");
- } else {
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- layui.use("layer", function () {
- var $ = layui.jquery,
- layer = layui.layer;
- layer.open({
- title: false,
- content: false,
- id: "layerchoicebaidugaode",
- btn: ["百度地图导航", "高德地图导航"],
- btnAlign: "c",
- yes: function () {
- var baiduConfig = {
- scheme_Android:
- "bdapp://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_IOS:
- "baidumap://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_web:
- "http://api.map.baidu.com/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=transit®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- },
- btn2: function () {
- var baiduConfig = {
- scheme_Android:
- "androidamap://route/plan/?sourceApplication=appname&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=1",
- scheme_IOS:
- "iosamap://path?sourceApplication=applicationName&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=1",
- scheme_web:
- "https://uri.amap.com/navigation?from=" +
- startPoint.lng +
- "," +
- startPoint.lat +
- "," +
- startZD +
- "&to=" +
- endPoint.lng +
- "," +
- endPoint.lat +
- "," +
- endZD +
- "&mode=bus&callnative=1&coordinate=wgs84&src=mypage",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- return false;
- },
- });
- });
- }
- document.activeElement.blur(); // 关闭软键盘
- }
- });
- // 公交的渲染结果
- function busResultLine(startZD, endZD) {
- var resPoint = null;
- var startPoint, endPoint, startText, endText, startAddress, endAddress;
- $(".show-second").show().siblings().hide();
- $(".top_search")
- .hide()
- .siblings(".right-map")
- .hide()
- .css("top", "20.06666vw");
- $(".right-search").css("top", "20.06666vw");
- $(".icon-shq").css("top", "20.06666vw");
- $(".title-second")
- .css("margin", "2.93333vw auto 44vw")
- .siblings(".show-second .content-third")
- .hide();
- $(".zjboxpanel").show();
- $(".boxpanel").hide();
- let GJstart = contrastArrey.filter(function (i) {
- return i.address == startZD;
- });
- let GJend = contrastArrey.filter(function (i) {
- return i.address == endZD;
- });
- if (GJstart.length == 0 && GJend.length == 0) {
- $(".show-second .content-third").hide();
- $("#startbus").show().siblings().show();
- $("#result").empty();
- busStartSearch(startZD);
- busEndSearch(endZD);
- $(document)
- .off("click")
- .on("click", ".openstartinfo", function () {
- map.clearOverlays();
- startPoint = new BMap.Point($(this).data("lng"), $(this).data("lat"));
- startText = $(this).data("text");
- startAddress = $(this).data("add");
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $(".zjboxpanel").show().siblings(".content-third").hide();
- });
- $(document).on("click", ".openendinfo", function () {
- if (startPoint == null) {
- layer.msg("请先选择起点!");
- } else {
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $(".show-second .content-third").show();
- $(".zjboxpanel").hide();
- endText = $(this).data("text");
- endAddress = $(this).data("add");
- endPoint = new BMap.Point($(this).data("lng"), $(this).data("lat"));
- $("#gj-one").val(startText);
- $("#gj-two").val(endText);
- var res = JSON.stringify([startText, endText]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([startPoint, endPoint]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startText, endText]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "2");
- }
- });
- } else if (GJstart.length > 0) {
- $(".zjboxpanel").show();
- $("#startbus")
- .hide()
- .siblings("#busstartPanel")
- .empty()
- .hide()
- .siblings("#endBus")
- .show()
- .siblings("#busendPanel")
- .show();
- $("#result").empty();
- busEndSearch(endZD);
- $(document)
- .off("click")
- .on("click", ".openendinfo", async function () {
- endAddress = $(this).data("add");
- endPoint = new BMap.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-third")
- .show()
- .siblings(".zjboxpanel")
- .hide();
- $("#gj-one").val(startZD);
- $("#gj-two").val(endText);
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startData = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- var start = new BMap.Point(startData.lng, startData.lat);
- var res = JSON.stringify([startZD, endText]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([start, endPoint]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startZD, endText]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "2");
- });
- } else if (GJend.length > 0) {
- $("#startbus").show().siblings("#busstartPanel").show();
- $("#endBus").hide().siblings("#busendPanel").hide();
- $(".show-second .content-third").hide();
- busStartSearch(startZD);
- $(document)
- .off("click")
- .on("click", ".openstartinfo", async function () {
- $(".zjboxpanel").hide();
- $(".show-second .content-third").show();
- map.clearOverlays();
- startPoint = new BMap.Point($(this).data("lng"), $(this).data("lat"));
- startText = $(this).data("text");
- startAddress = $(this).data("add");
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $("#gj-one").val(startText);
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endData = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- var end = new BMap.Point(endData.lng, endData.lat);
- var res = JSON.stringify([startText, endZD]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([startPoint, end]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startText, endZD]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "2");
- });
- }
- // 封装起点选择
- function busStartSearch(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-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'>";
- openStartInfoWindowHtml += "<a href='#endBus'>";
- 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>";
- openStartInfoWindowHtml += "</li>";
- }
- $("#busstartPanel").empty().append(openStartInfoWindowHtml);
- } else {
- startResults = null;
- }
- },
- };
- var startSearch = new BMap.LocalSearch(map, startOption);
- startSearch.search(startZD);
- }
- // 封装终点选择
- function busEndSearch(endZD) {
- var endResults = null;
- var endOption = {
- onSearchComplete: function (results) {
- // 判断状态是否正确
- // openEndInfoWindowHtml += "<button class='endChoice hideEnd'>选为终点</button>"
- 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-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'>";
- openEndInfoWindowHtml += "<div class='warp_choice'>";
- openEndInfoWindowHtml += "<span>" + endcount + ".</span>";
- openEndInfoWindowHtml += "<p>";
- openEndInfoWindowHtml += results.getPoi(i).title;
- openEndInfoWindowHtml += "</p>";
- openEndInfoWindowHtml += "</div>";
- openEndInfoWindowHtml += "<p>地址:";
- if (results.getPoi(i).address == undefined) {
- openEndInfoWindowHtml += results.getPoi(i).title;
- } else {
- openEndInfoWindowHtml += results.getPoi(i).address;
- }
- openEndInfoWindowHtml += "</p></div>";
- openEndInfoWindowHtml += "</li>";
- }
- $("#busendPanel").empty().append(openEndInfoWindowHtml);
- } else {
- endResults = null;
- }
- },
- };
- var endSearch = new BMap.LocalSearch(map, endOption);
- endSearch.search(endZD);
- }
- }
- // 点击头部的自驾的搜索按钮在左边出现结果
- $(".inp-icon3").click(async function () {
- var startZD = $("#zj-one").val();
- var endZD = $("#zj-two").val();
- if (startZD == "" || endZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- $("#result1").empty();
- localStorage.setItem("discern", "0");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- layer.msg("请输入起点或终点!");
- } else {
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- layui.use("layer", function () {
- var $ = layui.jquery,
- layer = layui.layer;
- layer.open({
- title: false,
- content: false,
- id: "layerchoicebaidugaode",
- btn: ["百度地图导航", "高德地图导航"],
- btnAlign: "c",
- yes: function () {
- var baiduConfig = {
- scheme_Android:
- "bdapp://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_IOS:
- "baidumap://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_web:
- "http://api.map.baidu.com/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- },
- btn2: function () {
- var baiduConfig = {
- scheme_Android:
- "androidamap://route/plan/?sourceApplication=appname&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=0",
- scheme_IOS:
- "iosamap://path?sourceApplication=applicationName&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=0",
- scheme_web:
- "https://uri.amap.com/navigation?from=" +
- startPoint.lng +
- "," +
- startPoint.lat +
- "," +
- startZD +
- "&to=" +
- endPoint.lng +
- "," +
- endPoint.lat +
- "," +
- endZD +
- "&mode=car&callnative=1&coordinate=wgs84&src=mypage",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- return false;
- },
- });
- });
- }
- });
- $("#zj-one").bind("keyup", function (event) {
- var startZD = $("#zj-one").val();
- if (event.keyCode == 13) {
- if (startZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- layer.msg("请输入起点!");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- } else {
- $("#zj-two").focus();
- }
- }
- });
- $("#zj-two").bind("keyup", async function (event) {
- var startZD = $("#zj-one").val();
- var endZD = $("#zj-two").val();
- if (event.keyCode == 13) {
- if (startZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- layer.msg("请输入起点!");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- } else if (endZD == "") {
- $(".top_search").show().siblings(".right-map").show();
- $(".show-first").show().siblings().hide();
- $(".right-search").css("top", msHeight);
- $(".icon-shq").css("top", msHeight);
- localStorage.setItem("discern", "0");
- layer.msg("请输入终点!");
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- } else {
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endPoint = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- layui.use("layer", function () {
- var $ = layui.jquery,
- layer = layui.layer;
- layer.open({
- title: false,
- content: false,
- id: "layerchoicebaidugaode",
- btn: ["百度地图导航", "高德地图导航"],
- btnAlign: "c",
- yes: function () {
- var baiduConfig = {
- scheme_Android:
- "bdapp://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_IOS:
- "baidumap://map/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- scheme_web:
- "http://api.map.baidu.com/direction?origin=" +
- startZD +
- "&destination=" +
- endZD +
- "&mode=driving®ion=重庆&output=html&src=webapp.baidu.openAPIdemo",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- },
- btn2: function () {
- var baiduConfig = {
- scheme_Android:
- "androidamap://route/plan/?sourceApplication=appname&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=0",
- scheme_IOS:
- "iosamap://path?sourceApplication=applicationName&sid=&slat=" +
- startPoint.lat +
- "&slon=" +
- startPoint.lng +
- "&sname=" +
- startZD +
- "&did=&dlat=" +
- endPoint.lat +
- "&dlon=" +
- endPoint.lng +
- "&dname=" +
- endZD +
- "&dev=0&t=0",
- scheme_web:
- "https://uri.amap.com/navigation?from=" +
- startPoint.lng +
- "," +
- startPoint.lat +
- "," +
- startZD +
- "&to=" +
- endPoint.lng +
- "," +
- endPoint.lat +
- "," +
- endZD +
- "&mode=car&callnative=1&coordinate=wgs84&src=mypage",
- };
- var timeout = 600;
- // 判断操作系统,返回百度的不同操作系统下的接口
- function adjustOS() {
- var ua = window.navigator.userAgent.toLowerCase();
- return ua.indexOf("os") > 0
- ? baiduConfig.scheme_IOS
- : baiduConfig.scheme_Android;
- }
- var startTime = Date.now();
- var ifr = document.createElement("iframe");
- ifr.src = adjustOS();
- ifr.style.display = "none";
- document.body.appendChild(ifr);
- var t = setTimeout(function () {
- var endTime = Date.now();
- if (!startTime || endTime - startTime < timeout + 200) {
- window.location.href = baiduConfig.scheme_web;
- }
- }, timeout);
- window.onblur = function () {
- clearTimeout(t);
- };
- return false;
- },
- });
- });
- }
- document.activeElement.blur(); // 关闭软键盘
- }
- });
- // 自驾的渲染结果
- function drivingResultLine(startZD, endZD) {
- var resPoint = null;
- var startPoint, endPoint, startText, endText, startAddress, endAddress;
- $(".show-third").show().siblings().hide();
- $(".right-map").hide().siblings(".top_search").hide();
- $(".right-search").css("top", "20.06666vw");
- $(".icon-shq").css("top", "20.06666vw");
- $(".title-second")
- .css("margin", "2.93333vw auto 44vw")
- .siblings(".show-third .content-third")
- .hide();
- $(".boxpanel").show();
- $(".zjboxpanel").hide();
- let ZJstart = contrastArrey.filter(function (i) {
- return i.address == startZD;
- });
- let ZJend = contrastArrey.filter(function (i) {
- return i.address == endZD;
- });
- 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 BMap.Point($(this).data("lng"), $(this).data("lat"));
- startText = $(this).data("text");
- startAddress = $(this).data("add");
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $(".boxpanel").show().siblings(".content-third").show();
- });
- $(document).on("click", ".openendinfo", async function () {
- if (startPoint == null) {
- layer.msg("请先选择起点!");
- } else {
- endPoint = new BMap.Point($(this).data("lng"), $(this).data("lat"));
- endText = $(this).data("text");
- endAddress = $(this).data("add");
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $(".show-third .content-third").show();
- $(".boxpanel").hide();
- $("#zj-one").val(startText);
- $("#zj-two").val(endText);
- var res = JSON.stringify([startText, endText]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([startPoint, endPoint]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startText, endText]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "4");
- startZD = "";
- endZD = "";
- }
- });
- } else if (ZJstart.length > 0) {
- $(".boxpanel").show();
- $("#startDrving")
- .hide()
- .siblings("#startPanel")
- .empty()
- .hide()
- .siblings("#endDrving")
- .show()
- .siblings("#endPanel")
- .show();
- $("#result1").empty();
- drivingEndSearch(endZD);
- $(document)
- .off("click")
- .on("click", ".openendinfo", async function () {
- endText = $(this).data("text");
- endPoint = new BMap.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-third").show().siblings(".boxpanel").hide();
- $("#zj-one").val(startZD);
- $("#zj-two").val(endText);
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- startZD,
- function (point) {
- if (point) {
- startData = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- var start = new BMap.Point(startData.lng, startData.lat);
- var res = JSON.stringify([startZD, endText]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([start, endPoint]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startZD, endText]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "4");
- startZD = "";
- endZD = "";
- });
- } else if (ZJend.length > 0) {
- $(".show-third .content-third").hide();
- $(".boxpanel").show();
- $("#endDrving").hide().siblings("#endPanel").hide();
- $("#startDrving").show().siblings("#startPanel").show();
- drivingStartSearch(startZD);
- $(document)
- .off("click")
- .on("click", ".openstartinfo", async function () {
- $(".boxpanel").hide();
- $(".show-third .content-third").show();
- map.clearOverlays();
- startPoint = new BMap.Point($(this).data("lng"), $(this).data("lat"));
- startText = $(this).data("text");
- $(this)
- .find("p")
- .addClass("change_text_color")
- .parents("li")
- .siblings()
- .find("p")
- .removeClass("change_text_color");
- $("#zj-one").val(startText);
- $("#zj-two").val(endZD);
- await new Promise((resolve, reject) => {
- myGeo.getPoint(
- endZD,
- function (point) {
- if (point) {
- endData = new BMap.Point(point.lng, point.lat);
- resolve();
- }
- },
- "重庆市"
- );
- });
- var end = new BMap.Point(endData.lng, endData.lat);
- var res = JSON.stringify([startText, endZD]);
- localStorage.setItem("line", res);
- resPoint = JSON.stringify([startPoint, end]);
- localStorage.setItem("Point", resPoint);
- busResultContLine();
- drivingResultContLine();
- var result = JSON.stringify([startText, endZD]);
- localStorage.setItem("lineText", result);
- localStorage.setItem("discern", "4");
- startZD = "";
- endZD = "";
- });
- }
- 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-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'>";
- openStartInfoWindowHtml += "<a href='#endDrving'>";
- openStartInfoWindowHtml += "<div class='warp_choice'>";
- openStartInfoWindowHtml += "<span>" + startcount + ".</span>";
- openStartInfoWindowHtml += "<p>";
- openStartInfoWindowHtml += results.getPoi(i).title;
- openStartInfoWindowHtml += "</p>";
- openStartInfoWindowHtml += "</div>";
- openStartInfoWindowHtml += "<p>地址:";
- openStartInfoWindowHtml += results.getPoi(i).address;
- openStartInfoWindowHtml += "</p></div>";
- openStartInfoWindowHtml += "</a>";
- openStartInfoWindowHtml += "</li>";
- }
- $("#startPanel").empty().append(openStartInfoWindowHtml);
- } else {
- startResults = null;
- }
- },
- };
- var startSearch = new BMap.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-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'>";
- 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 += "</li>";
- }
- $("#endPanel").empty().append(openEndInfoWindowHtml);
- } else {
- endResults = null;
- }
- },
- };
- var endSearch = new BMap.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 line = JSON.parse(localStorage.getItem("line"));
- var resultPoint = JSON.parse(localStorage.getItem("Point"));
- var start = new BMap.Point(resultPoint[0].lng, resultPoint[0].lat);
- var end = new BMap.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 BMap.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 class='no_results'>在重庆市 ";
- discriptHtml += "未能计算出从“";
- discriptHtml += line[0];
- discriptHtml += "”到“";
- discriptHtml += line[1];
- discriptHtml += "”公交路线,抱歉。";
- discriptHtml += "</div>";
- $("#result").empty().append(discriptHtml);
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- }
- },
- });
- map.clearOverlays();
- transit.clearResults();
- transit.setPolicy(routePolicy[0]);
- transit.search(start, end);
- }
- // 公交选择其他方案
- $(".show-second .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 line = JSON.parse(localStorage.getItem("line"));
- var resultPoint = JSON.parse(localStorage.getItem("Point"));
- var start = new BMap.Point(resultPoint[0].lng, resultPoint[0].lat);
- var end = new BMap.Point(resultPoint[1].lng, resultPoint[1].lat);
- var transit = new BMap.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 class='no_results'>在重庆市 ";
- discriptHtml += "未能计算出从“";
- discriptHtml += line[0];
- discriptHtml += "”到“";
- discriptHtml += line[1];
- discriptHtml += "”公交路线,抱歉。";
- discriptHtml += "</div>";
- $("#result").empty().append(discriptHtml);
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- }
- },
- });
- transit.clearResults();
- map.clearOverlays();
- 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 BMap.Point(resultPoint[0].lng, resultPoint[0].lat);
- var end = new BMap.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 BMap.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 BMap.Point(resultPoint[0].lng, resultPoint[0].lat);
- var end = new BMap.Point(resultPoint[1].lng, resultPoint[1].lat);
- $("#result1").empty();
- var drivingRoute = new BMap.DrivingRoute(map, {
- renderOptions: {
- map: map,
- panel: "result1",
- autoViewport: true,
- enableDragging: true,
- },
- });
- map.clearOverlays();
- drivingRoute.clearResults();
- drivingRoute.setPolicy(drivingRoutePolicy[liIndex]);
- drivingRoute.search(start, end);
- });
- // 点击搜索的图标,显示
- $(".inp-icon1").click(function () {
- searchClick();
- });
- function searchClick() {
- indexList = 0;
- ssList = 2;
- map.clearOverlays();
- var searchInp = $(".inp").val();
- if (searchInp == "" || searchInp == null) {
- layer.msg("输入的值不能为空!");
- } else {
- document.activeElement.blur();
- setTimeout(function () {
- var wsHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight() -
- 11;
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".wrap_result1").css("height", wsHeight);
- $(".show-fourth").css("height", rmHeight);
- searchEvent(searchInp);
- searchJSON(searchInp);
- }, 800);
- }
- }
- $(".inp").bind("keyup", function (event) {
- indexList = 0;
- ssList = 2;
- var searchInp = $(".inp").val();
- map.clearOverlays();
- if (event.keyCode == 13) {
- if (searchInp == "" || searchInp == null) {
- layer.msg("输入的值不能为空!");
- } else {
- document.activeElement.blur();
- setTimeout(function () {
- var wsHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight() -
- 11;
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".wrap_result1").css("height", wsHeight);
- $(".show-fourth").css("height", rmHeight);
- searchEvent(searchInp);
- searchJSON(searchInp);
- }, 800);
- }
- // document.activeElement.blur(); // 关闭软键盘
- }
- });
- function searchJSON(searchInp) {
- $(".show-fourth").show().siblings().hide();
- $(".right-search").hide();
- $(".top_search").show();
- var digitGroup = [];
- $.each(getAllJson, function (j) {
- $.each(getAllJson[j], function (k) {
- var stringText = "" + getAllJson[j][k];
- if (stringText.indexOf(searchInp) > -1) {
- var getArrey = [];
- if (
- getAllJson[j].dep == getAllJson[j][k] ||
- getAllJson[j].type == getAllJson[j][k] ||
- getAllJson[j].sptype == getAllJson[j][k]
- ) {
- getArrey = getAllJson[j];
- }
- digitGroup.push(getArrey);
- }
- });
- });
- let removeZero = digitGroup.filter((item) => item.length != 0);
- // let newDigitGroup = [...new Set(removeZero)]
- for (let i = 0; i < removeZero.length; i++) {
- for (let j = i + 1; j < removeZero.length; j++) {
- if (removeZero[j].dep === removeZero[i].dep) {
- removeZero.splice(j, 1);
- }
- }
- }
- for (let i = 0; i < removeZero.length; i++) {
- for (let j = i + 1; j < removeZero.length; j++) {
- if (removeZero[j].dep === removeZero[i].dep) {
- removeZero.splice(j, 1);
- }
- }
- }
- for (let i = 0; i < removeZero.length; i++) {
- for (let j = i + 1; j < removeZero.length; j++) {
- if (removeZero[j].dep === removeZero[i].dep) {
- removeZero.splice(j, 1);
- }
- }
- }
- for (let i = 0; i < removeZero.length; i++) {
- for (let j = i + 1; j < removeZero.length; j++) {
- if (removeZero[j].dep === removeZero[i].dep) {
- removeZero.splice(j, 1);
- }
- }
- }
- // console.log(removeZero)
- if (removeZero == "") {
- var html = "";
- html +=
- '<div style="width: 85.5%;margin: 0 auto 0;color: #2775CC;font-size:14px;text-align:center;">暂无数据</div>';
- $(".show-fourth .pad_box").empty().append(html);
- $(".show-first").hide();
- $(".show-fourth").show();
- $(".right-map").css("height", hlHeight);
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-fourth").innerWidth() - $(".wrap_result1").innerWidth()) / 2;
- // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
- $(".title-second").css({ top: windowHeight, left: spWidth });
- } else {
- $(".show-fourth").show().siblings().hide();
- $(".right-map").css("height", hlHeight);
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-fourth").innerWidth() - $(".wrap_result1").innerWidth()) / 2;
- // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".right-search").hide();
- $(".top_search").show();
- var loading = layer.msg("加载中..", {
- icon: 16,
- shade: 0.3,
- time: false,
- });
- setTimeout(function (data) {
- //最后数据加载完 让 loading层消失
- xrList(removeZero);
- layer.close(loading);
- }, 500);
- }
- }
- // 上下移动的内容框
- $(".arrowss").click(function () {
- var height = $(".left-map").height();
- if ($(this).hasClass("layui-icon-up")) {
- $(".left-map").height(70 + "%");
- $(this).removeClass("layui-icon-up").addClass("layui-icon-down");
- } else {
- $(".left-map").height(355);
- $(this).removeClass("layui-icon-down").addClass("layui-icon-up");
- }
- });
- $(".btn_back").click(function () {
- map.clearOverlays();
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- let ran = navigator.userAgent;
- let isIOS = !!ran.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
- if (blList == 1) {
- if (isIOS) {
- $(".show-fourth").show().siblings().hide();
- var hBHeight = (window.outerHeight - $(".head").outerHeight()) / 2;
- var windowHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- var spWidth =
- ($(".show-fourth").innerWidth() - $(".wrap_result1").innerWidth()) /
- 2;
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".right-search").hide();
- $(".right-map").show().siblings(".top_search").show();
- $(".right-map").css("height", hBHeight);
- $(".content_from_ajax .layui-tab-title>li:nth-child(1)")
- .addClass("layui-this")
- .siblings()
- .removeClass("layui-this");
- $(".content_from_ajax .layui-tab-content .layui-tab-item:nth-child(1)")
- .addClass("layui-show")
- .siblings()
- .removeClass("layui-show");
- $(".result_form_ajax").empty();
- xrList(getAllArr);
- initSearchEventPage();
- blList = 2;
- ssList = 2;
- $(".wrap_result1").scrollTop(scrollListHeight1);
- } else {
- $(".show-fourth").show().siblings().hide();
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-fourth").innerWidth() - $(".wrap_result1").innerWidth()) /
- 2;
- // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".right-search").hide();
- $(".right-map").show().siblings(".top_search").show();
- $(".right-map").css("height", hlHeight);
- // $('.show-fifth .back_top').show();
- $(".content_from_ajax .layui-tab-title>li:nth-child(1)")
- .addClass("layui-this")
- .siblings()
- .removeClass("layui-this");
- $(".content_from_ajax .layui-tab-content .layui-tab-item:nth-child(1)")
- .addClass("layui-show")
- .siblings()
- .removeClass("layui-show");
- $(".result_form_ajax").empty();
- xrList(getAllArr);
- initSearchEventPage();
- blList = 2;
- ssList = 2;
- $(".wrap_result1").scrollTop(scrollListHeight1);
- }
- } else if (blList == 2) {
- window.location.reload();
- }
- });
- // 点击搜索的出现结果部分的返回到首页
- $(".backBtn").click(function () {
- // if (gjIndex == 1){
- // window.location.reload();
- // localStorage.setItem('discern','0');
- // } else if(gjIndex == 2){
- // const startGJ = $("#gj-one").val();
- // const endGJ = $("#gj-two").val();
- // busResultLine(startGJ,endGJ);
- // gjIndex = 1;
- // }
- // if (zjIndex == 1){
- // window.location.reload();
- // localStorage.setItem('discern','0');
- // } else if(zjIndex == 2){
- // const startZJ = $("#zj-one").val();
- // const endZJ = $("#zj-two").val();
- // drivingResultLine(startZJ,endZJ);
- // zjIndex = 1;
- // }
- var discern = localStorage.getItem("discern");
- if (discern == 1) {
- window.location.reload();
- localStorage.setItem("discern", "0");
- var object = JSON.stringify(["", ""]);
- localStorage.setItem("lineText", object);
- } else if (discern == 3) {
- window.location.reload();
- localStorage.setItem("discern", "0");
- var object = JSON.stringify(["", ""]);
- localStorage.setItem("lineText", object);
- } else if (discern == 2) {
- const startGJ = $("#gj-one").val();
- const endGJ = $("#gj-two").val();
- busResultLine(startGJ, endGJ);
- localStorage.setItem("discern", "1");
- } else if (discern == 4) {
- const startZJ = $("#zj-one").val();
- const endZJ = $("#zj-two").val();
- drivingResultLine(startZJ, endZJ);
- localStorage.setItem("discern", "3");
- }
- });
- $(".back_btn").click(function () {
- map.clearOverlays();
- map.centerAndZoom(new BMap.Point(106.563, 29.523), 14);
- if ($(this).parent().next().attr("sign") == "isShowAddress") {
- window.location.reload();
- return;
- }
- if (indexList == 1) {
- applyClickList();
- xrList(getAllArr);
- indexList = 2;
- $(".show-fifth .back_top").show();
- $(".wrap_result").scrollTop(scrollListHeight);
- $(".content_from_ajax3").parent().addClass("layui-hide");
- } else if (indexList == 2) {
- window.location.reload();
- }
- });
- $(".back_Btn").click(function () {
- // 清空url中携带的参数
- // 获取当前页面的url
- var url = window.location.href;
- // 判断是否存在参数
- if (url.indexOf("?") != -1) {
- // 去除参数
- url = url.replace(/(\?|#)[^'"]*/, "");
- window.history.pushState({}, 0, url);
- }
- if (ssList == 1) {
- map.clearOverlays();
- $(".show-first").hide();
- $(".show-fourth").show();
- $(".right-map").css("height", hlHeight);
- var windowHeight =
- $(".right-map").innerHeight() - $(".head").innerHeight() + 45;
- var spWidth =
- ($(".show-fourth").innerWidth() - $(".wrap_result1").innerWidth()) / 2;
- // $('.wrap_result1').css({'top': spWidth,'left': spWidth});
- $(".title-second").css({ top: windowHeight, left: spWidth });
- $(".right-search").hide();
- $(".top_search").show();
- $(".show-fifth .back_top").show();
- xrList(getAllArr);
- ssList = 2;
- indexList = 0;
- $(".wrap_result1").scrollTop(scrollListHeight1);
- } else if (ssList == 2) {
- window.location.reload();
- } else if (ssList == 3) {
- searchClick()
- }
- });
- $(".wrap_result").scroll(function () {
- var topHeight = $(this)
- .children(".pad_box")
- .find(".titleFirst")
- .outerHeight();
- var top = $(this).scrollTop();
- if (top > topHeight) {
- $(".show-fifth .back_top").css("display", "block");
- } else if (top < topHeight) {
- $(".show-fifth .back_top").hide();
- }
- });
- $(".wrap_result1").scroll(function () {
- var topHeight = $(this)
- .children(".pad_box")
- .find(".titleFirst")
- .outerHeight();
- var top = $(this).scrollTop();
- if (top > topHeight) {
- $(".show-fourth .back_top").css("display", "block");
- } else if (top < topHeight) {
- $(".show-fourth .back_top").hide();
- }
- });
- $(".show-fourth .back_top").click(function () {
- $(".wrap_result1").scrollTop(0);
- });
- $(".show-fifth .back_top").click(function () {
- $(".wrap_result").scrollTop(0);
- });
- var markerInfo = {
- markers: [],
- data: [],
- myMark: null,
- };
- var geolocation = new BMap.Geolocation();
- geolocation.getCurrentPosition(function (r) {
- if (this.getStatus() == BMAP_STATUS_SUCCESS) {
- var mk = new BMap.Marker(r.point);
- markerInfo.myMark = r.point;
- let ccount = 0;
- let sta = false,
- sta2 = false;
- for (let i = 0; i < ggfwzx.length; i++) {
- myGeo.getPoint(
- ggfwzx[i].address,
- function (point) {
- if (point) {
- const addr = map.getDistance(r.point, point);
- if (addr <= 1000) {
- if (i == ggfwzx.length - 1) {
- sta = true;
- }
- markerInfo.data.push(ggfwzx[i]);
- markerInfo.markers.push(point);
- ccount++;
- var myIcon = new BMap.Icon(
- "./img/location.png",
- new BMap.Size(40, 40)
- );
- var marker = new BMap.Marker(point, {
- icon: myIcon,
- });
- map.addOverlay(marker);
- marker.addEventListener("click", function (e) {
- showAddressDetail(ggfwzx[i], point);
- });
- }
- }
- },
- "重庆市"
- );
- }
- for (let i = 0; i < xzfwzx.length; i++) {
- myGeo.getPoint(
- xzfwzx[i].address,
- function (point) {
- if (point) {
- const addr = map.getDistance(r.point, point);
- if (addr <= 1000) {
- if (i == xzfwzx.length - 1) {
- sta2 = true;
- }
- markerInfo.data.push(xzfwzx[i]);
- markerInfo.markers.push(point);
- ccount++;
- var myIcon = new BMap.Icon(
- "./img/location.png",
- new BMap.Size(40, 40)
- );
- var marker = new BMap.Marker(point, {
- icon: myIcon,
- });
- map.addOverlay(marker);
- marker.addEventListener("click", function (e) {
- showAddressDetail(xzfwzx[i], point);
- });
- }
- }
- },
- "重庆市"
- );
- }
- var myTask = setInterval(function () {
- if (sta && sta2) {
- $("#bsddNum").text(ccount);
- clearInterval(myTask);
- }
- }, 500);
- map.addOverlay(mk);
- map.panTo(r.point);
- myGeo.getLocation(r.point, function (rs) {
- var addComp = rs.surroundingPois[0].title;
- $("#gj-one").val(addComp);
- $("#zj-one").val(addComp);
- });
- } else {
- // alert('未能获得您的定位,请手动输入起点');
- }
- });
- function showAddressDetail(getClick, point) {
- $(".show-fourth").hide();
- var addFirst;
- scrollListHeight = $(".wrap_result").scrollTop();
- scrollListHeight1 = $(".wrap_result1").scrollTop();
- var address = new BMap.Point(point.lng, point.lat);
- addFirst = address;
- applyClickList();
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- let arr = [];
- arr.push(getClick);
- xrResultList(arr, "isShowAddress");
- indexList = 1;
- ssList = 1;
- map.setCenter(addFirst);
- $("#deptDiv div")
- .removeClass("layui-border-green")
- .addClass("layui-border-blue");
- $(this).removeClass("layui-border-blue").addClass("layui-border-green");
- var firstpage = 1;
- var pagetype = 0;
- setTimeout(function () {
- if (deptArr[getClick.dep]) {
- initmarkDetail(getClick);
- } else {
- initmarkDetail2(getClick);
- }
- }, 200);
- }
- var digitGroupItem = [];
- function searchEvent(val) {
- getDeptList(val);
- }
- function getDeptList(val) {
- $.ajax({
- url: PATH + "/mapdata/searchHandMatterByVal",
- type: "GET",
- data: {
- queryVal: val,
- },
- success: function (res) {
- let sContnet = "";
- if (res && res.data && res.data.length) {
- $.each(res.data, function (j) {
- if (res.data[j].itemName == undefined) {
- sContnet += "";
- } else {
- let filterArr = res.data[j].depts.split(",");
- let bool = filterArr.every((item) =>
- deptArr["重庆市南岸区政务服务中心(南坪中心)"].includes(item)
- );
- let bool1 = filterArr.every((item) =>
- deptArr["重庆市南岸区政务服务中心(江南新城中心)"].includes(
- item
- )
- );
- if (bool) {
- res.data[j].fomartDept += ",区政务服务中心(南坪中心)";
- }
- if (bool1) {
- res.data[j].fomartDept += ",区政务服务中心(江南新城中心)";
- }
- if (res.data[j].type === 0) {
- sContnet +=
- "<div ><p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "<span style='padding-left:15px'><span style='padding-right:20px'>(" +
- res.data[j].fomartDept +
- ")</span>(<span class='type'>个人</span>)</span></p></div>";
- } else {
- sContnet +=
- "<div><p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "<span style='padding-left:15px'><span style='padding-right:20px'>(" +
- res.data[j].fomartDept +
- ")</span>(<span class='type'>法人</span>)</span></p></div>";
- }
- }
- });
- $(".result_form_ajax").empty().append(sContnet);
- }
- },
- });
- }
- function getDetail(val) {
- ssList = 3;
- $.ajax({
- url: PATH + "/mapdata/getHandMatterBySearch",
- type: "GET",
- data: {
- queryVal: val,
- },
- success: function (json) {
- if (json && json.data && json.data.length) {
- digitGroupItem = [];
- let st1 = true,
- st2 = true;
- let dept1 = [],
- dept2 = [];
- $.each(json.data, function (j) {
- if (
- deptArr["重庆市南岸区政务服务中心(江南新城中心)"].indexOf(
- json.data[j]
- ) >= 0
- ) {
- dept1.push(json.data[j]);
- st1 = false;
- }
- if (
- deptArr["重庆市南岸区政务服务中心(南坪中心)"].indexOf(
- json.data[j]
- ) >= 0
- ) {
- dept2.push(json.data[j]);
- st2 = false;
- }
- });
- if (!st1) {
- let d = xzfwzx[deptArr.jnxc];
- d.searchDept = dept1;
- digitGroupItem.push(d);
- }
- if (!st2) {
- let d = xzfwzx[deptArr.npzx];
- d.searchDept = dept2;
- digitGroupItem.push(d);
- }
- $.each(getAllJson, function (j) {
- if (json.data.indexOf(getAllJson[j].dep) >= 0) {
- digitGroupItem.push(getAllJson[j]);
- }
- });
- setTimeout(function () {
- initSearchEventPage();
- }, 500);
- }
- },
- error: function (err) {
- var html = "";
- html +=
- '<div style="width: 85.5%;margin: 0 auto 0;color: #2775CC;font-size:14px;text-align:center;">暂无数据</div>';
- $(".show-fourth .result_form_ajax").empty().append(html);
- },
- });
- }
- $(document).on("click", ".result_form_ajax div .text_from_ajax", function () {
- getDetail($(this).attr("title"));
- });
- function initSearchEventPage() {
- if (digitGroupItem.length) {
- xrList2(digitGroupItem);
- } else {
- var html = "";
- html +=
- '<div style="width: 85.5%;margin: 0 auto 0;color: #2775CC;font-size:14px;text-align:center;">暂无数据</div>';
- $(".show-fourth .result_form_ajax").empty().append(html);
- }
- }
- function initmarkDetail(getClick) {
- var dep = getClick.dep;
- $(".content_from_ajax .layui-tab-title")
- .find(".layui-this")
- .attr("id", dep);
- $(".content_from_ajax").show().siblings(".marrige").hide();
- var count;
- var firstpage = 1;
- var pagetype = 0;
- scrollListHeight = $(".wrap_result").scrollTop();
- const sign = $(this).attr("data-sign");
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- if ($("#deptDiv").prev().hasClass("isDel")) {
- $("#deptDiv").prev().remove();
- $("#deptDiv").empty();
- }
- if (deptArr[getClick.dep]) {
- dep = deptArr[getClick.dep].join(",");
- $(".show-sixth .pad_box").attr("data-dep", dep);
- let html =
- '<div class="layui-border-green dept-sty" data-dep="">全部</div>';
- for (let n = 0; n < deptArr[getClick.dep].length; n++) {
- html += `<div class="layui-border-blue dept-sty" data-dep="${
- deptArr[getClick.dep][n]
- }">
- ${deptArr[getClick.dep][n].replace("重庆市", "").replace("南岸", "")}</div>`;
- }
- $("#deptDiv").empty().append(html);
- $("#deptDiv").before(
- `<div class="isDel" style="background: #fff;font-size: 20px;padding-left: 20px;">入驻部门</div>`
- );
- }
- page(firstpage, pagetype, dep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.230:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data == null) {
- applyClickList();
- $(".show-sixth").fadeOut(0);
- $(".show-fifth").fadeIn(100);
- indexList = 1;
- } else if (res.data != null) {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-sixth").show().css("height", rmHeight).siblings().hide();
- $(".wrap_handle").show();
- count = res.count;
- var html = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- $(".layui-show .result_form_ajax").empty().append(html);
- }
- },
- });
- // if (discriptText == discrptAddress) {
- // }
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- 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, first) {
- pagetype = 0;
- page(obj.curr, pagetype, dep);
- },
- });
- });
- blList = 2;
- }
- function initmarkDetail2(getClick) {
- var dep = getClick.dep.replace("便民服务中心", "").replace("政府", "");
- console.log(dep);
- $(".content_from_ajax .layui-tab-title")
- .find(".layui-this")
- .attr("id", dep);
- $(".content_from_ajax").show().siblings(".marrige").hide();
- var count;
- var firstpage = 1;
- var pagetype = 0;
- scrollListHeight = $(".wrap_result").scrollTop();
- const sign = $(this).attr("data-sign");
- $(".right-search").hide().css("top", "0px");
- $(".top_search").hide();
- page(firstpage, pagetype, dep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.230:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data == null) {
- applyClickList();
- $(".show-sixth").fadeOut(0);
- $(".show-fifth").fadeIn(100);
- indexList = 1;
- } else if (res.data != null) {
- var rmHeight =
- window.outerHeight -
- $(".right-map").innerHeight() -
- $(".head").innerHeight();
- $(".show-fifth").show().css("height", rmHeight).siblings().hide();
- $(".wrap_handle").show();
- count = res.count;
- var html = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- html += "";
- } else {
- html +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- html += "<h6 class='point_from_ajax'></h6>";
- html +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- html += "</a>";
- }
- });
- $(".layui-show .result_form_ajax2").empty().append(html);
- }
- },
- });
- // if (discriptText == discrptAddress) {
- // }
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- laypage.render({
- elem: "demo2",
- 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, first) {
- pagetype = 0;
- page(obj.curr, pagetype, dep);
- },
- });
- });
- blList = 2;
- }
- $(document).on(
- "click",
- ".content_from_ajax3 .layui-tab-title li",
- function () {
- var getdep = $(this)
- .parent()
- .parent()
- .parent()
- .prev()
- .find(".title_flex")
- .text()
- .trim();
- getdep = getdep.replace("便民服务中心", "").replace("政府", "");
- var getText = $(this).text();
- if (getText == "个人办事") {
- var count;
- var firstpage = 1;
- var pagetype = 0;
- page(firstpage, pagetype, getdep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data != null) {
- $(".content_from_ajax3").parent().removeClass("layui-hide");
- count = res.count;
- var sContnet = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- sContnet += "";
- } else {
- sContnet +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- sContnet += "<h6 class='point_from_ajax'></h6>";
- sContnet +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- sContnet += "</a>";
- }
- });
- $(".result_form_ajax2").empty().append(sContnet);
- } else {
- $(".content_from_ajax3").parent().addClass("layui-hide");
- }
- },
- });
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- laypage.render({
- elem: "demo2",
- 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, first) {
- pagetype = 0;
- page(obj.curr, pagetype, getdep);
- },
- });
- });
- blList = 1;
- } else if (getText == "法人办事") {
- var count;
- var firstpage = 1;
- var pagetype = 1;
- page(firstpage, pagetype, getdep);
- function page(page, pagetype, dep) {
- $.ajax({
- type: "GET",
- url: PATH + "/mapdata/getHandMatterPage",
- // url: "http://192.168.0.40:7777/mapdata/getHandMatterPage",
- async: false,
- dataType: "json",
- data: {
- page: page,
- limit: 4,
- type: pagetype,
- matterDept: dep,
- },
- success: function (res) {
- if (res.data != null) {
- $(".content_from_ajax3").parent().removeClass("layui-hide");
- count = res.count;
- var sContnet = "";
- $.each(res.data, function (j) {
- if (
- res.data[j].itemName == undefined &&
- res.data[j].matterUrl == undefined &&
- res.data[j].matterDept == undefined
- ) {
- sContnet += "";
- } else {
- sContnet +=
- "<a href='" +
- res.data[j].matterUrl +
- "' target='_blank' class='url_from_ajax'>";
- sContnet += "<h6 class='point_from_ajax'></h6>";
- sContnet +=
- "<p title='" +
- res.data[j].itemName +
- "' class='text_from_ajax'>" +
- res.data[j].itemName +
- "</p>";
- sContnet += "</a>";
- }
- });
- $(".result_form_ajax2").empty().append(sContnet);
- } else {
- $(".content_from_ajax3").parent().addClass("layui-hide");
- }
- },
- });
- }
- layui.use(["laypage", "layer"], function () {
- var laypage = layui.laypage,
- layer = layui.layer;
- laypage.render({
- elem: "demo2",
- 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, first) {
- pagetype = 1;
- page(obj.curr, pagetype, getdep);
- },
- });
- });
- blList = 1;
- }
- }
- );
- $(document).on("click", "#aroundEvent", function () {
- if (!markerInfo.myMark) {
- layer.msg("初始定位还未完成,请稍后再试");
- return;
- }
- if (!markerInfo.data || !markerInfo.data.length) {
- layer.msg("附近一公里没有办事地点");
- return;
- }
- indexList = 2;
- applyClickList();
- xrList(markerInfo.data);
- getPointPostAjax(markerInfo.data);
- });
- });
|