import{T as e,aM as a,bo as l,a6 as t,a as o,a1 as n,o as r,e as s,h as i,w as u,i as d,F as c,B as f,I as p,j as m,k as _,z as y,l as v,a5 as b}from"./index-90c12cc1.js";import{H as k}from"./index.0e2fd26a.js";import{h as x}from"./moment.6466d922.js";import{_ as h}from"./uv-icon.c815b875.js";import{_ as g}from"./uv-image.b3f882de.js";import{_ as j}from"./uv-upload.8ada27d8.js";import{U as w}from"./uv-picker.5a69f03d.js";import{_ as U}from"./uv-datetime-picker.b70c9d70.js";import{M as V}from"./index.4bde3b32.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";import"./utils.80a0ac72.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-popup.a2d35ebb.js";import"./uv-status-bar.acda7a2c.js";/* empty css                                                                      */import"./index.188c29d6.js";const D=[{label:"ID",field:"id",type:"text",icon:!1},{label:"昵称",field:"nickname",type:"input",icon:!0},{label:"性别",field:"sex",type:"text",icon:!0,map:{0:"女",1:"男"},func:"openSex"},{label:"出生日期",field:"birthday",type:"text",icon:!0,func:"openBirthday"}],I=[{label:"手机号",field:"mobile",type:"text",icon:!1}],B=[[{label:"男",value:1},{label:"女",value:0}]],M=C({__name:"index",setup(C){const{doUpdateAvatar:M,doUpdateUserInfo:Y}=function(){const t=e();return{doUpdateAvatar:async function(e){try{await a.upload({url:"/member/user/update-avatar",filePath:e.url,name:"avatarFile"}),await t.getUserInfo()}catch(l){console.error(l)}},doUpdateUserInfo:async function(){await l(t.user),await t.getUserInfo()}}}(),A=e(),{user:P}=t(A),T={openSex:function(){d(N).open()},openBirthday:function(){d(R).open()}},F=o((new Date).getTime()),N=o(),R=o(),S=o();async function $(e){await M(e.file)}function z(e){const a=e.value[0].value;P.value.sex=a,Y()}function E(e){const a=e.value;P.value.birthday=x(a).format("YYYY-MM-DD"),Y()}function H(e){"input"!==e.type&&"text"===e.type&&e.func&&T[e.func]()}return n((async()=>{await A.getUserInfo()})),(e,a)=>{const l=f,t=b;return r(),s(c,null,[i(l,{class:"account-setting"},{default:u((()=>[i(k,{"header-area-bg":"#fff","system-bar-area-bg":"#fff"},{default:u((()=>[p(" 账号设置 ")])),_:1}),i(l,{class:"card"},{default:u((()=>[i(l,{class:"cell-row"},{default:u((()=>[i(l,{class:"label"},{default:u((()=>[p(" 头像 ")])),_:1}),i(l,{class:"value"},{default:u((()=>[i(j,{capture:["album","camera"],"use-before-read":"",onAfterRead:$},{default:u((()=>[i(g,{class:"img",src:d(P)&&d(P).avatar,width:"90rpx",height:"90rpx",shape:"circle"},{error:u((()=>[i(h,{name:"photo"})])),_:1},8,["src"])])),_:1}),i(h,{name:"arrow-right",color:"#999"})])),_:1})])),_:1})])),_:1}),d(P)?(r(),m(l,{key:0,class:"card"},{default:u((()=>[(r(!0),s(c,null,_(d(D),(e=>(r(),m(l,{key:e.field,class:"cell-row",onClick:a=>H(e)},{default:u((()=>[i(l,{class:"label"},{default:u((()=>[p(v(e.label),1)])),_:2},1024),i(l,{class:"value"},{default:u((()=>["text"===e.type?(r(),s(c,{key:0},[e.map?(r(),s(c,{key:0},[p(v(e.map[d(P)[e.field]]),1)],64)):(r(),s(c,{key:1},[p(v(d(P)[e.field]),1)],64))],64)):y("",!0),"input"===e.type?(r(),m(t,{key:1,type:"text",placeholder:`请输入${e.label}`,modelValue:d(P)[e.field],"onUpdate:modelValue":a=>d(P)[e.field]=a,onBlur:d(Y)},null,8,["placeholder","modelValue","onUpdate:modelValue","onBlur"])):y("",!0),e.icon?(r(),m(h,{key:2,name:"arrow-right",color:"#999"})):y("",!0)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):y("",!0),d(P)?(r(),m(l,{key:1,class:"card"},{default:u((()=>[(r(!0),s(c,null,_(d(I),(e=>(r(),m(l,{key:e.field,class:"cell-row",onClick:a=>H(e)},{default:u((()=>[i(l,{class:"label"},{default:u((()=>[p(v(e.label),1)])),_:2},1024),i(l,{class:"value"},{default:u((()=>["text"===e.type?(r(),s(c,{key:0},[e.map?(r(),s(c,{key:0},[p(v(e.map[d(P)[e.field]]),1)],64)):(r(),s(c,{key:1},[p(v(d(P)[e.field]),1)],64))],64)):y("",!0),"input"===e.type?(r(),m(t,{key:1,type:"text",placeholder:`请输入${e.label}`,modelValue:d(P)[e.field],"onUpdate:modelValue":a=>d(P)[e.field]=a},null,8,["placeholder","modelValue","onUpdate:modelValue"])):y("",!0),e.icon?(r(),m(h,{key:2,name:"arrow-right",color:"#999"})):y("",!0)])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})):y("",!0),i(l,{class:"card button",onClick:a[0]||(a[0]=e=>S.value.show())},{default:u((()=>[p(" 退出登录 ")])),_:1})])),_:1}),i(w,{round:20,ref_key:"sexPicker",ref:N,keyName:"label",columns:d(B),color:"#999",confirmColor:"#ee6d46",activeColor:"#ee6d46",onConfirm:z},null,8,["columns"]),i(U,{modelValue:F.value,"onUpdate:modelValue":a[1]||(a[1]=e=>F.value=e),minDate:new Date("1900-01-01").getTime(),ref_key:"birthdayPicker",ref:R,mode:"date",onConfirm:E},null,8,["modelValue","minDate"]),i(V,{content:"确认要退出登录吗？此操作将会清空登录数据以及用户信息",ref_key:"modelRef",ref:S,onConfirm:a[2]||(a[2]=e=>d(A).logout())},null,512)],64)}}},[["__scopeId","data-v-27008236"]]);export{M as default};
