You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
17 KiB

3 days ago
import{h as e,d as t,r as a,c as l,w as s,o as u,a as n,b as c,s as i,e as o,f as r,S as d,g as f,i as v,j as p,k as m,l as _,m as g,n as y,p as h,q as k,t as A,u as b,v as w,F as I,x as C,y as S,z as E,I as $,A as x,B as U,M as F,C as P,D as K,E as Q,G as B}from"./index-C46MzMfW.js";import{h as N,f as R}from"./geo.BHVFNtB7.js";import{_ as V}from"./_plugin-vue_export-helper.BCo6x5W8.js";const T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAKCAYAAABSfLWiAAAAyklEQVQokY3SPUpDQRiF4cdLXEDAIm1a3YGkDWKWIohgkS1YpFBQIdlBFmGliAiKW3ADYjRR8T98MIHLJRPuC1PMmcPL/K1tXB5tYRNv+MIUP3jBH57xi1cZGnjEEJ1cqcQ3ZvjEexp7RdpBD9c1JOtoooU2znBVpMVpEt3UEAX/2McoJkVpIc68i9saggOcL4KiUojL3MHdCskhTstBVbIQdXGfEZxUw2WSYJJED6Wsj+Nl5XjiHPE/QnSBMQa54ipJ8IRtfGQbmANeKSt76556cgAAAABJRU5ErkJggg==",j=new Map,J="#05c9ac";function D(e){const t=function(e){if(!e||"string"!=typeof e)return J;let t=e.trim();if(t.startsWith("#")||(t=`#${t}`),/^#[0-9A-Fa-f]{6}$/.test(t))return t;if(/^#[0-9A-Fa-f]{3}$/.test(t)){const e=t[1],a=t[2],l=t[3];return`#${e}${e}${a}${a}${l}${l}`}return J}(e||"");if(j.has(t))return j.get(t);if("undefined"==typeof document)return j.set(t,""),"";const a=document.createElement("canvas");a.width=48,a.height=56;const l=a.getContext("2d");if(!l)return j.set(t,""),"";const s=24;l.clearRect(0,0,48,56),l.beginPath(),l.arc(s,18,14,0,2*Math.PI),l.fillStyle="#ffffff",l.fill(),l.beginPath(),l.arc(s,18,12,0,2*Math.PI),l.fillStyle=t,l.fill(),l.beginPath(),l.moveTo(16,28),l.lineTo(s,50),l.lineTo(32,28),l.closePath(),l.fillStyle=t,l.fill(),l.beginPath(),l.arc(21,15,3,0,2*Math.PI),l.fillStyle="rgba(255,255,255,0.35)",l.fill();const u=a.toDataURL("image/png");return j.set(t,u),u}const W="szkp_loc_consent",X=V(t({__name:"index",setup(t){const V=a(!1),j=a(null),J=a({latitude:31.2989,longitude:120.5853}),X=a("map"),L=a(""),M=a("全部区域"),Y=a(""),G=a("全部类型"),q=a(""),H=a("全部"),O=a(""),Z=a(null),z=a(null),ee={science_venue:"科技场馆类",education_research:"教育科研类",agriculture:"“三农”类",enterprise:"企业类",nature_resource:"自然资源类",other:"其他类"},te={free:"免费",paid:"收费"};function ae(e){return e?te[e]||e:""}function le(e){try{"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem(W,e)}catch{}try{_(W,e)}catch{}}const se=l(()=>{var e,t;return((null==(t=null==(e=j.value)?void 0:e.stats)?void 0:t.reservation_total)??0).toLocaleString()}),ue=l(()=>{var e;const t=(null==(e=j.value)?void 0:e.top_live_venues)??[],a=[];for(let l=0;l<3;l++){const e=t[l];e?a.push({id:e.id,name:e.name,people_count:e.people_count,empty:!1}):a.push({id:0,name:"",people_count:0,empty:!0})}return a}),ne=l(()=>{var e;const t=new Set;return((null==(e=j.value)?void 0:e.map_venues)??[]).forEach(e=>{e.district&&t.add(String(e.district))}),["全部区域",...Array.from(t)]}),ce=l(()=>{var e;const t=new Set;((null==(e=j.value)?void 0:e.map_venues)??[]).forEach(e=>{e.venue_type&&t.add(String(e.venue_type))});const a=[{label:"全部类型",value:""}];return Array.from(t).forEach(e=>{a.push({label:ee[e]||e,value:e})}),a}),ie=[{label:"全部",value:""},{label:"免费",value:"free"},{label:"收费",value:"paid"}],oe=l(()=>{var e;const t=L.value.trim();return((null==(e=j.value)?void 0:e.map_venues)??[]).filter(e=>{if(Y.value&&(e.district||"")!==Y.value)return!1;if(q.value&&(e.venue_type||"")!==q.value)return!1;if("free"===O.value&&"free"!==(e.ticket_type||""))return!1;if("paid"===O.value&&"paid"!==(e.ticket_type||""))return!1;if(t){if(!`${e.name||""}${e.address||""}`.includes(t))return!1}return!0})}),re=l(()=>{const e=[...oe.value],t=Z.value;return t?e.sort((e,a)=>N(t.lat,t.lng,e.lat,e.lng)-N(t.lat,t.lng,a.lat,a.lng)):e}),de=l(()=>null==z.value?null:oe.value.find(e=>e.id===z.value)??null),fe=l(()=>{const e=de.value,t=Z.value;if(!e||!t)return"定位后可显示距离";const a=N(t.lat,t.lng,e.lat,e.lng);return`距您 ${R(a)}`});s(oe,e=>{null==z.value||e.some(e=>e.id===z.value)||(z.value=null)}),s(X,e=>{"list"===e&&(z.value=null)});const ve=l(()=>oe.value.map(e=>{const t=D(e.venue_type_color);return{id:e.id,latitude:e.lat,longitud