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
15 KiB
2 lines
15 KiB
|
3 days ago
|
import{h as e,d as l,r as a,c as t,w as s,o as u,a as n,b as c,e as i,s as o,f as r,g as d,i as v,j as f,S as _,k as p,l as m,m as y,n as g,p as k,q as h,t as b,u as w,v as C,x,y as j,z as F,A as I,F as S,B as $,C as L,D as T,I as J,E as P,G as V,M as A,H as M,J as q,K as z,L as B}from"./index-BznAv2H5.js";import{s as D}from"./search.BJnl3YRK.js";import{d as E}from"./down.BCKq9i8s.js";import{f as G}from"./activity.k1jR9V-B.js";import{h as H,f as K}from"./geo.BHVFNtB7.js";import{g as N}from"./markerPin.DdplcbG_.js";import{_ as U}from"./_plugin-vue_export-helper.BCo6x5W8.js";const O=U(l({__name:"index",setup(l){const U=a(!1),O=a(null),Q=a({latitude:31.2989,longitude:120.5853}),R=a("map"),W=a(""),X=a("全部区域"),Y=a(""),Z=a("全部类型"),ee=a(""),le=a("收费类型"),ae=a(""),te=a(null),se=a(null),ue=t(()=>{var e,l;const a={};for(const t of(null==(l=null==(e=O.value)?void 0:e.venue_dicts)?void 0:l.venue_type)??[])a[t.value]=t.label;return a}),ne=t(()=>{var e,l;const a={};for(const t of(null==(l=null==(e=O.value)?void 0:e.venue_dicts)?void 0:l.ticket_type)??[])a[t.value]=t.label;return a});function ce(e){return e?ue.value[e]||e:""}function ie(e){return e?ne.value[e]||e:""}function oe(e){try{"undefined"!=typeof window&&window.sessionStorage&&window.sessionStorage.setItem(p.locConsent,e)}catch{}try{h(p.locConsent,e)}catch{}}const re=t(()=>{var e,l;return((null==(l=null==(e=O.value)?void 0:e.stats)?void 0:l.reservation_total)??0).toLocaleString()}),de=t(()=>{var e;const l=(null==(e=O.value)?void 0:e.top_live_venues)??[],a=[];for(let t=0;t<3;t++){const e=l[t];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}),ve=t(()=>{var e,l;return[{label:"全部区域",value:""},...((null==(l=null==(e=O.value)?void 0:e.venue_dicts)?void 0:l.district)??[]).map(e=>({label:e.label,value:e.value}))]}),fe=t(()=>{var e,l;return[{label:"全部类型",value:""},...((null==(l=null==(e=O.value)?void 0:e.venue_dicts)?void 0:l.venue_type)??[]).map(e=>({label:e.label,value:e.value}))]}),_e=t(()=>{var e,l;return[{label:"收费类型",value:""},...((null==(l=null==(e=O.value)?void 0:e.venue_dicts)?void 0:l.ticket_type)??[]).map(e=>({label:e.label,value:e.value}))]}),pe=t(()=>{var e;const l=W.value.trim();return((null==(e=O.value)?void 0:e.map_venues)??[]).filter(e=>{if(Y.value&&(e.district||"")!==Y.value)return!1;if(ee.value&&(e.venue_type||"")!==ee.value)return!1;if("free"===ae.value&&"free"!==(e.ticket_type||""))return!1;if("paid"===ae.value&&"paid"!==(e.ticket_type||""))return!1;if(l){if(!`${e.name||""}${e.address||""}`.includes(l))return!1}return!0})}),me=t(()=>{const e=[...pe.value],l=te.value;return l?e.sort((e,a)=>H(l.lat,l.lng,e.lat,e.lng)-H(l.lat,l.lng,a.lat,a.lng)):e}),ye=t(()=>null==se.value?null:pe.value.find(e=>e.id===se.value)??null),ge=t(()=>{const e=ye.value,l=te.value;if(!e||!l)return"定位后可显示距离";const a=H(l.lat,l.lng,e.lat,e.lng);return`距您 ${K(a)}`});s(pe,e=>{null==se.value||e.some(e=>e.id===se.value)||(se.value=null)}),s(R,e=>{"list"===e&&(se.value=null)});const ke=t(()=>pe.value.map(e=>{const l=N(e.venue_type_color);return{id:e.id,latitude:e.lat,longitude:e.lng,width:32,height:38,iconPath:l||void 0,anchor:{x:.5,y:1}}}));function he(e){const l=te.value;if(!l)return"距离 --";const a=H(l.lat,l.lng,e.lat,e.lng);return`距您 ${K(a)}`}function be(e){if("district"===e){const e=ve.value;q({itemList:e.map(e=>e.label),success:l=>{const a=e[l.tapIndex];X.value=a.label,Y.value=a.value}})}else if("type"===e){const e=fe.value;q({itemList:e.map(e=>e.label),success:l=>{const a=e[l.tapIndex];Z.value=a.label,ee.value=a.value}})}else{const e=_e.value;q({itemList:e.map(e=>e.label),success:l=>{const a=e[l.tapIndex];le.value=a.label,ae.value=a.value}})}}let we=!1;function Ce(e){var l;const a=null==(l=null==e?void 0:e.detail)?void 0:l.markerId;null!=a&&(se.value=Number(a),we=!0,setTimeout(()=>{we=!1},400))}function xe(){we||(se.value=null)}function je(){se.value=null}function Fe(e){e&&z({url:`/pages/venue/detail?id=${e}`})}function Ie(){z({url:"/pages/stats/
|