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
9.6 KiB

2 days ago
import{d as e,e as l,f as a,w as t,Z as s,j as c,k as i,q as n,n as u,t as r,u as o,v as d,_ as v,B as f,F as p,C as _,$ as m,H as g,a0 as y,y as h,z as k,x as b,O as x,E as w,G as $,J as j,a1 as S,W as C,s as F,a3 as N,K as A,a2 as z,Q as q,a4 as I,a5 as R,a6 as B}from"./index-DcvbZGSt.js";import{l as E}from"./content.Cgu-vdzk.js";import{f as G}from"./activity.k1jR9V-B.js";import{h as H,f as J}from"./geo.BHVFNtB7.js";import{u as K,t as O,a as Q,g as T,m as W}from"./tip.CRDnOkzn.js";import{_ as Z}from"./_plugin-vue_export-helper.BCo6x5W8.js";const D=Z(e({__name:"detail",setup(e){const Z={science_venue:"科技场馆类",education_research:"教育科研类",agriculture:"“三农”类",enterprise:"企业类",nature_resource:"自然资源类",other:"其他类"},D={free:"免费",paid:"收费"};function L(e,l){let a=e.replace("#","").trim();if(3===a.length&&(a=a.split("").map(e=>e+e).join("")),6!==a.length)return`rgba(5, 201, 172, ${l})`;const t=parseInt(a,16);return`rgba(${t>>16&255},${t>>8&255},${255&t},${l})`}function M(e){if(!e||"string"!=typeof e)return"";const l="max-width:100%;height:auto;display:block;vertical-align:top;";return e.replace(/<img\b([\s\S]*?)(\/>|>)/gi,(e,a,t)=>{const s=String(a).trim();if(/style\s*=/i.test(s))return/max-width\s*:/i.test(s)?e:e.replace(/style\s*=\s*(["'])([\s\S]*?)\1/i,(e,a,t)=>/max-width/i.test(t)?e:`style=${a}${t};${l}${a}`);return`<img ${s} style="${l}"${"/>"===t?" />":">"}`})}function P(e){if(!e||!String(e).trim())return!1;return String(e).replace(/<[^>]+>/g," ").replace(/&nbsp;/gi," ").replace(/\s+/g," ").trim().length>0}const U=l(null),V=l(!0),X=l(!0),Y=l(!1),ee=l(!1),le=l("--"),ae=l(null),te=a(()=>{const e=U.value;return e?Array.isArray(e.carousel)&&e.carousel.length?e.carousel:e.cover_image?[{type:"image",url:e.cover_image}]:[]:[]}),se=a(()=>{var e;const l=null==(e=U.value)?void 0:e.reservation_notice;if(null==l||""===l)return"";const a=String(l);let t="";if(/<[a-z][\s\S]*>/i.test(a))t=M(a);else{const e=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}(a);t=`<div style="white-space:pre-wrap;font-size:13px;color:#4e5969;line-height:1.5;">${e}</div>`}return P(t)?t:""}),ce=a(()=>{var e;const l=null==(e=U.value)?void 0:e.detail_html;if(!l)return"";const a=M(String(l));return P(a)?a:""});function ie(e){const l=e||"#05c9ac";return{color:l,backgroundColor:L(l,.14),border:`1px solid ${L(l,.35)}`}}const ne=a(()=>{const e=U.value;if(!e)return[];const l=e.venue_types;return Array.isArray(l)&&l.length?l.map(String):e.venue_type?[String(e.venue_type)]:[]});function ue(){const e=U.value;if(!(null==e?void 0:e.lat)||!(null==e?void 0:e.lng)||!ae.value)return void(le.value="--");const l=H(ae.value.lat,ae.value.lng,Number(e.lat),Number(e.lng));le.value=J(l)}function re(){var e;const l=String((null==(e=U.value)?void 0:e.contact_phone)||"").trim();if(!l)return void F({title:"暂无联系电话",icon:"none"});const a=l.replace(/\s/g,"");N({phoneNumber:a})}function oe(){var e,l,a,t;const s=Number((null==(e=U.value)?void 0:e.lat)||0),c=Number((null==(l=U.value)?void 0:l.lng)||0);s&&c?z({latitude:s,longitude:c,name:(null==(a=U.value)?void 0:a.name)||"场馆",address:(null==(t=U.value)?void 0:t.address)||""}):F({title:"暂无导航坐标",icon:"none"})}return t(U,()=>{ue()}),t([ce,se],()=>{V.value=!0,X.value=!0,q(()=>{setTimeout(()=>{var e;const l=null==(e=I())?void 0:e.proxy,a=R();l&&a.in(l);const t=B(180);a.select(".judge-intro").boundingClientRect(),a.select(".judge-notice").boundingClientRect(),a.exec(e=>{const[l,a]=e||[];Y.value=!!(l&&l.height&&l.height>t+1),ee.value=!!(a&&a.height&&a.height>t+1)})},120)})}),s(async e=>{const l=Number((null==e?void 0:e.id)||0);l&&(U.value=await E(l),n({type:"gcj02",success:e=>{ae.value={lat:e.latitude,lng:e.longitude},ue()},fail:()=>{le.value="--"}}))}),(e,l)=>{const a=g,t=y,s=m,n=v,F=u,N=b,z=S,q=d,I=C;return r(),c(F,{class:"page"},{default:i(()=>[o(q,{"scroll-y":"",class:"scroll"},{default:i(()=>{var e,u;return[o(F,{class:"hero"},{default:i(()=>[te.value.length?(r(),c(n,{key:0,class:"hero-swiper",circular: