import{T as e,f as a,o as t,c as s,w as l,a as r,u as o,h as u,t as i,m as c,ag as d,L as n,M as _,g as f,d as m}from"./index-d76b1e7a.js";import{_ as p}from"./uv-navbar.59911b60.js";import{o as y,r as b,u as v}from"./useRouter.2bdb47a0.js";import{_ as k}from"./uv-icon.5730d4d2.js";import{_ as h}from"./uv-image.e629c74e.js";import{_ as j,a as g}from"./uv-list.31608877.js";import{_ as w}from"./uv-upload.9e6ede9e.js";import{_ as x}from"./uv-input.d57a3a97.js";import{_ as C}from"./uv-button.dcfcbf96.js";import{_ as I}from"./uv-datetime-picker.d35fc8d0.js";import{_ as F}from"./layout.f8e9d577.js";import{u as B,b as R,d as U}from"./store.e8087601.js";import{u as V}from"./useGlobalProperties.3fe7618e.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-status-bar.66ab7702.js";/* empty css                                                                      */import"./uv-navbar.vue_vue_type_style_index_0_scoped_8d8b32e4_lang.3fde2b65.js";import"./uv-transition.b33e1d5c.js";import"./uv-badge.8f9f267e.js";import"./uv-popup.432d8c17.js";import"./uv-picker.2c560387.js";import"./api.9246a192.js";const L=D({__name:"userInfo",setup(D){const L=B(),{user:A}=e(L),G=a(null),{$timeFormat:P}=V(),{goBack:z}=v(),E=()=>{L.logout()};y((e=>{L.getUserInfo()}));const M=async e=>{const a=await d(e.file.url);let t=new File([a],"",{type:a.type}),s=new FormData;s.append("avatarFile",t),n({title:"上传中"}),R(s).then((()=>{_(),L.getUserInfo()}))},T=()=>{L.user.nickname&&(n({title:"更新中"}),U({nickname:L.user.nickname,birthday:L.user.birthday}).then((()=>{_(),L.getUserInfo()})))},X=()=>{G.value.open()},Y=e=>{L.user.birthday=P(e.value,"yyyy-mm-dd"),T()};return(e,a)=>{const d=b(f("uv-navbar"),p),n=m,_=b(f("uv-icon"),k),y=b(f("uv-image"),h),v=b(f("uv-list-item"),j),B=b(f("uv-list"),g),R=b(f("uv-upload"),w),U=b(f("uv-input"),x),V=b(f("uv-button"),C),D=b(f("uv-datetime-picker"),I),P=b(f("layout"),F);return t(),s(P,null,{default:l((()=>[r(d,{fixed:!1,title:"账号设置","left-arrow":"",onLeftClick:o(z)},null,8,["onLeftClick"]),o(A)?(t(),s(n,{key:0},{default:l((()=>[r(n,{class:"y-list"},{default:l((()=>[r(R,{useBeforeRead:!0,onAfterRead:M},{default:l((()=>[r(n,{class:"upload-warp"},{default:l((()=>[r(B,{border:""},{default:l((()=>[r(v,{border:"","show-arrow":""},{default:l((()=>[r(n,{class:"y-list-content avatar flex flex-jc__sb"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("头像")])),_:1}),r(n,{class:"y-list-avatar"},{default:l((()=>[r(y,{class:"img",src:o(L).user.avatar,width:"90rpx",height:"90rpx",shape:"circle"},{error:l((()=>[r(_,{name:"photo"})])),_:1},8,["src"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(n,{class:"y-list"},{default:l((()=>[r(B,{border:""},{default:l((()=>[r(v,{border:"",clickable:"",onClick:a[0]||(a[0]=()=>{})},{default:l((()=>[r(n,{class:"y-list-content"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("ID")])),_:1}),r(n,{class:"y-list-select-placeholder"},{default:l((()=>[u(i(o(L).user.id),1)])),_:1})])),_:1})])),_:1}),r(v,{border:"",clickable:"","show-arrow":"",onClick:a[2]||(a[2]=()=>{})},{default:l((()=>[r(n,{class:"y-list-content"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("昵称")])),_:1}),r(n,{class:"y-list-select-placeholder"},{default:l((()=>[r(U,{placeholder:"请输入内容",border:"none",modelValue:o(L).user.nickname,"onUpdate:modelValue":a[1]||(a[1]=e=>o(L).user.nickname=e),onBlur:T,inputAlign:"right"},null,8,["modelValue"])])),_:1})])),_:1})])),_:1}),r(v,{border:"",clickable:"","show-arrow":"",onClick:a[3]||(a[3]=()=>{})},{default:l((()=>[r(n,{class:"y-list-content"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("性别")])),_:1}),r(n,{class:"y-list-select-placeholder"},{default:l((()=>[u(i(o(L).user.nickname),1)])),_:1})])),_:1})])),_:1}),r(v,{border:"",clickable:"","show-arrow":"",onClick:X},{default:l((()=>[r(n,{class:"y-list-content"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("出生日期")])),_:1}),r(n,{class:"y-list-select-placeholder"},{default:l((()=>[u(i(o(L).user.birthday),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),r(n,{class:"y-list"},{default:l((()=>[r(B,{border:""},{default:l((()=>[r(v,{border:"",clickable:"","show-arrow":"",onClick:a[4]||(a[4]=()=>{})},{default:l((()=>[r(n,{class:"y-list-content"},{default:l((()=>[r(n,{class:"y-list-label"},{default:l((()=>[u("手机号")])),_:1}),r(n,{class:"y-list-select-placeholder"},{default:l((()=>[u(i(o(L).user.mobile)+" ",1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})):c("",!0),r(n,{class:"form-buttons"},{default:l((()=>[r(V,{round:"",block:"",type:"primary",onClick:E},{default:l((()=>[u(" 退出登录 ")])),_:1})])),_:1}),r(D,{ref_key:"datetimePickerRef",ref:G,mode:"date",minDate:"1900",onConfirm:Y},null,512)])),_:1})}}},[["__scopeId","data-v-e8f1248e"]]);export{L as default};
