import{_ as e}from"./el-navbar.DVIyjZEN.js";import{C as a,a as s,r as l,b as t,d as o,e as r,f as u,w as m,g as d,v as i,z as f,l as c,t as n,y as p,p as y,a1 as _,aj as h,an as v}from"./index-DVkgSHpn.js";import{_ as w,b,a as g}from"./el-layout._U-vZTft.js";const x=w({__name:"password",setup(w){a(),s().getApp();const x=l(1),$=l(1),T=l(1);let j=l(!1);const k=e=>{if(j.value)return!1;let a=e.detail.value;return a.old_password.length<=0?(uni.$layer.showToast("请输入原密码"),!1):a.password.length<=0?(uni.$layer.showToast("请输入新密码"),!1):a.confirm_password.length<=0?(uni.$layer.showToast("请输入确认密码"),!1):a.password!=a.confirm_password?(uni.$layer.showToast("您输入的两次密码不相等"),!1):(j.value=!0,void uni.$http.post("user/password",a).then((e=>{e.code?(uni.$layer.showToast(e.msg),n("pages/ucenter/user/setting",3)):(uni.$layer.showToast(e.msg),j.value=!1)})))};return(a,s)=>{const l=t(o("el-navbar"),e),n=p,w=y,z=_,C=t(o("uni-icons"),b),A=h,B=v,I=t(o("el-layout"),g);return r(),u(I,null,{default:m((()=>[d(l,{placeholder:!0,fixed:!0,autoBack:!0,border:!0,title:"修改密码"}),d(w,{class:"the-form"},{default:m((()=>[d(B,{onSubmit:k},{default:m((()=>[d(w,{class:"form-item"},{default:m((()=>[d(w,{class:"form-item-body form-item-border"},{default:m((()=>[d(w,{class:"form-item-icon"},{default:m((()=>[d(n,{style:{"padding-right":"10rpx"}},{default:m((()=>[i("原 密 码")])),_:1})])),_:1}),d(w,{class:"form-item-input"},{default:m((()=>[d(z,{type:1==T.value?"password":"text",name:"old_password",placeholder:"请输入原密码","placeholder-class":"form-item-placeholder"},null,8,["type"])])),_:1}),d(w,{class:"form-item-right"},{default:m((()=>[d(C,{type:1==T.value?"eye":"eye-slash",size:"20",color:"#9fa3ab",onClick:s[0]||(s[0]=e=>T.value=1==T.value?0:1)},null,8,["type"])])),_:1})])),_:1})])),_:1}),d(w,{class:"form-item"},{default:m((()=>[d(w,{class:"form-item-body form-item-border"},{default:m((()=>[d(w,{class:"form-item-icon"},{default:m((()=>[i(" 设置密码 ")])),_:1}),d(w,{class:"form-item-input"},{default:m((()=>[d(z,{type:1==x.value?"password":"text",name:"password",placeholder:"请输入密码","placeholder-class":"form-item-placeholder"},null,8,["type"])])),_:1}),d(w,{class:"form-item-right"},{default:m((()=>[d(C,{type:1==x.value?"eye":"eye-slash",size:"20",color:"#9fa3ab",onClick:s[1]||(s[1]=e=>x.value=1==x.value?0:1)},null,8,["type"])])),_:1})])),_:1})])),_:1}),d(w,{class:"form-item"},{default:m((()=>[d(w,{class:"form-item-body form-item-border"},{default:m((()=>[d(w,{class:"form-item-icon"},{default:m((()=>[i(" 确认密码 ")])),_:1}),d(w,{class:"form-item-input"},{default:m((()=>[d(z,{type:1==$.value?"password":"text",name:"confirm_password",placeholder:"请输入确认密码","placeholder-class":"form-item-placeholder"},null,8,["type"])])),_:1}),d(w,{class:"form-item-right"},{default:m((()=>[d(C,{type:1==$.value?"eye":"eye-slash",size:"20",color:"#9fa3ab",onClick:s[2]||(s[2]=e=>$.value=1==$.value?0:1)},null,8,["type"])])),_:1})])),_:1})])),_:1}),d(w,{class:"form-item"},{default:m((()=>[d(w,{class:"form-item-body"},{default:m((()=>[d(A,{class:f(["form-item-button",{active:1==c(j)}]),"form-type":"submit"},{default:m((()=>[i("确 定")])),_:1},8,["class"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-2c2844cf"]]);export{x as default};
//# sourceMappingURL=pages-ucenter-user-password.CEiTppc9.js.map
