import{U as e,aI as t,r as a,o as s,y as o,I as l,h as n,u as r,x as i,t as d,q as u,z as c,s as m,aC as p,af as f}from"./vendor-jA_NIjzi.js";import{_ as g,u as h,aN as v}from"./common-store-kFD1YPwN.js";import{u as y,l as w}from"./common-utils-RDWuRZ1M.js";const _={class:"content"},x={class:"content-title"},b={class:"left"},S=["src"],j=g({__name:"date",props:{showValue:{type:Boolean,default:!1},type:{type:String},teleport:{type:String,default:"#app"}},emits:["update:dialog","value"],setup(g,{emit:j}){const{t:D}=e(),{theme:V}=y(),C=new Date,I=g,{showValue:U,type:k,teleport:q}=t(I),z=h(),B=j,F=()=>{B("update:dialog",!1)},M=a((()=>{if(!["",null,void 0].includes(z.userinfo.birthday)&&z.userinfo.birthday.indexOf("/")>-1)return z.userinfo.birthday.split("/");const e=new Date;return[e.getFullYear().toString(),(e.getMonth()+1).toString().padStart(2,"0"),e.getDate().toString().padStart(2,"0")]})()),N=(e,t)=>("year"===e&&(t.text+="年"),"month"===e&&(t.text+="月"),"day"===e&&(t.text+="日"),t),O=async()=>{if(new Date(M.value.join("-"))>C)m("出生日期不能超过当前日期");else if("register"===k.value)B("value",M.value.join("-")),F();else{const e=await v({birthday:M.value.join("-")});if(!e.success)return e.message&&m(e.message);m("提交成功"),F(),await z.getWalletInfo()}};return(e,t)=>{const a=p,m=f;return s(),o(m,{class:"date-dialog",teleport:r(q),round:"",show:r(U),"onUpdate:show":t[1]||(t[1]=e=>c(U)?U.value=e:null),position:"bottom",onClose:F},{default:l((()=>[n("div",_,[n("div",x,[n("div",b,[n("img",{src:r(w)("header/close_".concat(r(V),".png")),onClick:F,alt:""},null,8,S),i(" "+d(r(D)("请选择生日")),1)]),n("div",{class:"right",onClick:O},d(r(D)("完成")),1)]),u(a,{class:"content-date",modelValue:M.value,"onUpdate:modelValue":t[0]||(t[0]=e=>M.value=e),title:r(D)("选择日期"),"show-toolbar":!1,"min-date":new Date(1900,0,1),"max-date":r(C),formatter:N,"columns-type":["year","month","day"]},null,8,["modelValue","title","min-date","max-date"])])])),_:1},8,["teleport","show"])}}},[["__scopeId","data-v-79ce0b42"],["__file","date.vue"]]);export{j as d};
