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
5.5 KiB
2 lines
5.5 KiB
|
2 days ago
|
import{d as e,e as t,f as l,w as a,Z as n,j as s,k as i,n as r,a6 as u,t as o,u as d,v as c,M as g,x as v,y as f,z as p,B as m,F as h,C as b,G as _,O as y,J as k,D as x,E as $,a1 as N,K as w,s as C,a2 as S,Q as j,a4 as z,a5 as F}from"./index-BqJ4W6ZW.js";import{k as B}from"./content.B4VyUnMP.js";import{a as M,M as R,m as I}from"./ticketMap.By4_sH7a.js";import{_ as K}from"./_plugin-vue_export-helper.BCo6x5W8.js";const Y=K(e({__name:"detail",setup(e){const K=t(null),Y=t(!0),q=t(!1),D=l(()=>{var e;const t=null==(e=K.value)?void 0:e.intro_html;if(null==t||""===t)return"";const l=String(t);let a="";if(/<[a-z][\s\S]*>/i.test(l))a=function(e){if(!e||"string"!=typeof e)return"";const t="max-width:100%;height:auto;display:block;vertical-align:top;";return e.replace(/<img\b([\s\S]*?)(\/>|>)/gi,(e,l,a)=>{const n=String(l).trim();return/style\s*=/i.test(n)?/max-width\s*:/i.test(n)?e:e.replace(/style\s*=\s*(["'])([\s\S]*?)\1/i,(e,l,a)=>/max-width/i.test(a)?e:`style=${l}${a};${t}${l}`):`<img ${n} style="${t}"${"/>"===a?" />":">"}`})}(l);else{const e=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}(l);a=`<div style="white-space:pre-wrap;font-size:13px;color:#4e5969;line-height:1.5;">${e}</div>`}return(n=a)&&String(n).trim()&&String(n).replace(/<[^>]+>/g," ").replace(/ /gi," ").replace(/\s+/g," ").trim().length>0?a:"";var n}),E=l(()=>{var e;const t=((null==(e=K.value)?void 0:e.venues)||[]).map(e=>({lat:Number(e.lat),lng:Number(e.lng)})).filter(e=>Number.isFinite(e.lat)&&Number.isFinite(e.lng)&&e.lat&&e.lng);if(!t.length)return{latitude:31.2989,longitude:120.5853};const l=t.reduce((e,t)=>({lat:e.lat+t.lat,lng:e.lng+t.lng}),{lat:0,lng:0});return{latitude:l.lat/t.length,longitude:l.lng/t.length}}),G=l(()=>{var e;return((null==(e=K.value)?void 0:e.venues)||[]).map(e=>({latitude:Number(e.lat),longitude:Number(e.lng)})).filter(e=>Number.isFinite(e.latitude)&&Number.isFinite(e.longitude)&&e.latitude&&e.longitude)}),J=l(()=>{const e=G.value.length;return e>=5?10:e>=3?11:e>=2?12:13}),L=l(()=>{if(G.value.length)try{const e=u(56);return[e,e,e,e]}catch{return[20,20,20,20]}});function O(e,t){const l=String(e+1),a=l.length>=2?24:22;return`<div style="box-sizing:border-box;width:${a}px;height:${a}px;border-radius:50%;background:${t};color:#fff;font-size:${l.length>=2?9:10}px;line-height:${a}px;text-align:center;font-weight:600;">${l}</div>`}const P=l(()=>{var e;return((null==(e=K.value)?void 0:e.venues)||[]).map((e,t)=>{const l=Number(e.lat),a=Number(e.lng);if(!l||!a)return null;const n=M(e.ticket_type);return{id:Number(e.id)||t+1,latitude:l,longitude:a,width:R,height:R,iconPath:I(e.ticket_type),anchor:{x:.5,y:1},label:{content:O(t,n),color:"#ffffff",fontSize:10,anchorX:0,anchorY:0,borderWidth:0,bgColor:"transparent",borderRadius:0,padding:0},callout:{content:`${t+1}. ${e.name||"场馆"}`,color:"#333333",fontSize:12,borderRadius:8,bgColor:"#ffffff",padding:8,display:"BYCLICK"}}}).filter(Boolean)});function Q(){j(()=>{setTimeout(()=>{var e;const t=null==(e=z())?void 0:e.proxy,l=F();t&&l.in(t);const a=u(180);l.select(".judge-intro").boundingClientRect(),l.exec(e=>{const[t]=e||[];q.value=!!(t&&t.height&&t.height>a+1)})},120)})}return a(D,()=>{Y.value=!0,Q()}),a(K,()=>{Q()}),n(async e=>{const t=Number((null==e?void 0:e.id)||0);t&&(K.value=await B(t))}),(e,t)=>{const l=g,a=v,n=r,u=N,j=c;return o(),s(n,{class:"page"},{default:i(()=>[d(j,{"scroll-y":"",class:"scroll"},{default:i(()=>[d(l,{class:"map",latitude:E.value.latitude,longitude:E.value.longitude,markers:P.value,scale:J.value,"include-points":G.value.length?G.value:void 0,padding:L.value,"show-location":""},null,8,["latitude","longitude","markers","scale","include-points","padding"]),d(n,{class:"main-card"},{default:i(()=>{var e,t,l;return[d(a,{class:"tour-title"},{default:i(()=>{var e;return[f(p((null==(e=K.value)?void 0:e.name)||"-"),1)]}),_:1}),(null==(t=null==(e=K.value)?void 0:e.tags)?void 0:t.length)?(o(),s(n,{key:0,class:"act-tags"},{default:i(()=>[(o(!0),m(h,null,b(K.value.tags,e=>(o(),s(a,{key:e,class:"act-tag-chip"},{default:i
|