2 lines
2.4 KiB
JavaScript
2 lines
2.4 KiB
JavaScript
import{_ as k,r as u,c as n,b as r,l as N,t as _,F as h,x as m,S as w,u as L,j as c,ag as j,v as E}from"./index-CIAVq8iD-1776148658686.js";import{u as S}from"./country-DywnO8EI-1776148658686.js";import{G as V}from"./GeneralHeader-ClI1i1Ud-1776148658686.js";const A={class:"fullPage"},B={class:"bg"},F={style:{padding:"10px",display:"grid",gap:"10px"}},$={style:{"font-weight":"510",color:"rgba(0, 0, 0, 0.4)"}},z={style:{"font-weight":"400",color:"rgba(0, 0, 0, 0.4)","margin-bottom":"10px"}},G={style:{"border-radius":"12px","box-shadow":"0 0 4px 0 #00000050",padding:"10px","background-color":"white",display:"grid",gap:"10px"}},O=["onClick"],P={style:{display:"flex","align-items":"center",gap:"10px"}},U=["src"],D={style:{width:"16px",height:"16px",border:"1px solid rgba(0, 0, 0, 0.4)","border-radius":"50%",display:"flex","justify-content":"center","align-items":"center"}},H={key:0,style:{width:"10px",height:"10px","border-radius":"50%","background-color":"rgba(187, 146, 255, 1)"}},R={__name:"map",setup(T){const v=L(),d=S(),f=u(d.list),i=u(d.selectedCountry),p=u(-1),y=u(-1),x=(o,l,a)=>{p.value=o,y.value=l,i.value=a,C()},b=w(()=>{const o={};f.value.forEach(e=>{let s=e.countryName.charAt(0)?.toUpperCase()||"#";const t=/[A-Z]/.test(s)?s:"#";o.hasOwnProperty(t)||(o[t]=[]),o[t].push(e)});let l=Object.keys(o).sort().map(e=>({letter:e,countries:o[e].sort((s,t)=>s.countryName.localeCompare(t.countryName))})),a=i.value.countryName.charAt(0)?.toUpperCase()||"#";return l.forEach((e,s)=>{e.letter==a&&e.countries.forEach((t,g)=>{t.countryName==i.value.countryName&&(p.value=s,y.value=g)})}),l}),C=()=>{console.log("点击确认按钮"),d.setCountry(i.value),v.go(-1)};return(o,l)=>(c(),n("div",A,[r("div",B,[N(V,{title:o.$t("select_country"),color:"black",style:{"box-shadow":"0 0 10px rgba(0, 0, 0, 0.1)","z-index":"999"}},null,8,["title"]),r("div",F,[r("div",$,_(o.$t("select_your_country")),1),(c(!0),n(h,null,m(b.value,(a,e)=>(c(),n("div",{key:e},[r("div",z,_(a.letter),1),r("div",G,[(c(!0),n(h,null,m(a.countries,(s,t)=>(c(),n("div",{key:t,style:{display:"flex","justify-content":"space-between","align-items":"center"},onClick:g=>x(e,t,s)},[r("div",P,[r("img",{src:s.country.nationalFlag,alt:"",style:{height:"16px"}},null,8,U),j(" "+_(s.countryName),1)]),r("div",D,[p.value==e&&y.value==t?(c(),n("div",H)):E("",!0)])],8,O))),128))])]))),128))])])]))}},K=k(R,[["__scopeId","data-v-47cd0f91"]]);export{K as default};
|