import{T as e,a6 as a,a as l,O as s,o as t,j as o,w as r,G as u,h as i,I as _,i as d,l as n,z as c,bp as p,ab as f,bq as m,ad as y,br as b,B as v,H as j}from"./index-90c12cc1.js";import{_ as h}from"./uv-icon.c815b875.js";import{_ as k}from"./uv-image.b3f882de.js";import{_ as g,a as w}from"./uv-list.de4e7769.js";import{_ as x}from"./uv-upload.8ada27d8.js";import{_ as C}from"./uv-input.934893c4.js";import{_ as I}from"./uv-button.8e862d87.js";import{_ as D}from"./uv-datetime-picker.b70c9d70.js";import{_ as F}from"./layout.e3de63ac.js";import{H as R}from"./index.0e2fd26a.js";import{u as U}from"./useGlobalProperties.3697e46f.js";import{_ as V}from"./_plugin-vue_export-helper.1b428a4d.js";import"./uv-icon.vue_vue_type_style_index_0_scoped_23936b10_lang.7145f5b2.js";import"./uv-loading-icon.ad70964c.js";import"./uv-loading-icon.vue_vue_type_style_index_0_scoped_bad0efbf_lang.de7e0d02.js";import"./uv-badge.e49836ae.js";import"./uv-popup.a2d35ebb.js";import"./uv-status-bar.acda7a2c.js";/* empty css                                                                      */import"./uv-input.vue_vue_type_style_index_0_scoped_a7ca300a_lang.8012b887.js";import"./uv-button.vue_vue_type_style_index_0_scoped_bc0e850d_lang.79bfdc50.js";import"./uv-picker.5a69f03d.js";/* empty css                                                               */import"./utils.80a0ac72.js";const B=V({__name:"userInfo",setup(V){const B=e(),{user:q}=a(B),A=l(null),{$timeFormat:G}=U(),H=()=>{B.logout()};s((e=>{B.getUserInfo()}));const O=async e=>{const a=await p(e.file.url);let l=new File([a],"",{type:a.type}),s=new FormData;s.append("avatarFile",l),f({title:"上传中"}),m(s).then((()=>{y(),B.getUserInfo()}))},P=()=>{B.user.nickname&&(f({title:"更新中"}),b({nickname:B.user.nickname,birthday:B.user.birthday}).then((()=>{y(),B.getUserInfo()})))},z=()=>{A.value.open()},E=e=>{B.user.birthday=G(e.value,"yyyy-mm-dd"),P()};return(e,a)=>{const l=v,s=u(j("uv-icon"),h),p=u(j("uv-image"),k),f=u(j("uv-list-item"),g),m=u(j("uv-list"),w),y=u(j("uv-upload"),x),b=u(j("uv-input"),C),U=u(j("uv-button"),I),V=u(j("uv-datetime-picker"),D),G=u(j("layout"),F);return t(),o(G,null,{default:r((()=>[i(R,null,{default:r((()=>[_("账号设置")])),_:1}),d(q)?(t(),o(l,{key:0},{default:r((()=>[i(l,{class:"y-list"},{default:r((()=>[i(y,{useBeforeRead:!0,onAfterRead:O},{default:r((()=>[i(l,{class:"upload-warp"},{default:r((()=>[i(m,{border:""},{default:r((()=>[i(f,{border:"","show-arrow":""},{default:r((()=>[i(l,{class:"y-list-content avatar flex flex-jc__sb"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("头像")])),_:1}),i(l,{class:"y-list-avatar"},{default:r((()=>[i(p,{class:"img",src:d(B).user.avatar,width:"90rpx",height:"90rpx",shape:"circle"},{error:r((()=>[i(s,{name:"photo"})])),_:1},8,["src"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),i(l,{class:"y-list"},{default:r((()=>[i(m,{border:""},{default:r((()=>[i(f,{border:"",clickable:"",onClick:a[0]||(a[0]=()=>{})},{default:r((()=>[i(l,{class:"y-list-content"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("ID")])),_:1}),i(l,{class:"y-list-select-placeholder"},{default:r((()=>[_(n(d(B).user.id),1)])),_:1})])),_:1})])),_:1}),i(f,{border:"",clickable:"","show-arrow":"",onClick:a[2]||(a[2]=()=>{})},{default:r((()=>[i(l,{class:"y-list-content"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("昵称")])),_:1}),i(l,{class:"y-list-select-placeholder"},{default:r((()=>[i(b,{placeholder:"请输入内容",border:"none",modelValue:d(B).user.nickname,"onUpdate:modelValue":a[1]||(a[1]=e=>d(B).user.nickname=e),onBlur:P,inputAlign:"right"},null,8,["modelValue"])])),_:1})])),_:1})])),_:1}),i(f,{border:"",clickable:"","show-arrow":"",onClick:a[3]||(a[3]=()=>{})},{default:r((()=>[i(l,{class:"y-list-content"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("性别")])),_:1}),i(l,{class:"y-list-select-placeholder"},{default:r((()=>[_(n(d(B).user.nickname),1)])),_:1})])),_:1})])),_:1}),i(f,{border:"",clickable:"","show-arrow":"",onClick:z},{default:r((()=>[i(l,{class:"y-list-content"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("出生日期")])),_:1}),i(l,{class:"y-list-select-placeholder"},{default:r((()=>[_(n(d(B).user.birthday),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),i(l,{class:"y-list"},{default:r((()=>[i(m,{border:""},{default:r((()=>[i(f,{border:"",clickable:"","show-arrow":"",onClick:a[4]||(a[4]=()=>{})},{default:r((()=>[i(l,{class:"y-list-content"},{default:r((()=>[i(l,{class:"y-list-label"},{default:r((()=>[_("手机号")])),_:1}),i(l,{class:"y-list-select-placeholder"},{default:r((()=>[_(n(d(B).user.mobile)+" ",1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})):c("",!0),i(l,{class:"form-buttons"},{default:r((()=>[i(U,{round:"",block:"",type:"primary",onClick:H},{default:r((()=>[_(" 退出登录 ")])),_:1})])),_:1}),i(V,{ref_key:"datetimePickerRef",ref:A,mode:"date",minDate:"1900",onConfirm:E},null,512)])),_:1})}}},[["__scopeId","data-v-f4080223"]]);export{B as default};
