import{d as a,a as e,r as s,o as r,c as l,b as o,e as d,n as t,f as n,m as u,i,j as m,k as p,l as c}from"./index-72b896ac.js";import{_ as f,a as w,b as g,c as _}from"./logo.1cbcaa3f.js";import{o as b,r as h,_ as v}from"./uni-app.es.e89653c9.js";const V=v(a({__name:"password",setup(a){const v=e({password:"",confirmPassword:""}),V=e({password:{rules:[{required:!0,errorMessage:"请输入密码"},{validateFunction:(a,e,s,r)=>{if((null==e?void 0:e.length)>=6&&(null==e?void 0:e.length)<=20)return!0;r("密码必须为6至20位字符")}}]},confirmPassword:{rules:[{required:!0,errorMessage:"请输入密码"},{validateFunction:(a,e,s,r)=>{if(e==v.password)return!0;r("两次密码不一致")}}]}}),P=s(),y=s({}),j=()=>{v.password&&v.confirmPassword&&P.value.validate().then((async a=>{const e=encodeURIComponent(JSON.stringify({...y.value,password:v.password}));u({url:`/pages/register/register?parameter=${e}`})}))};return b((a=>{y.value=JSON.parse(decodeURIComponent(a.parameter))})),(a,e)=>{const s=i,u=m,b=h(p("uni-easyinput"),w),y=h(p("uni-forms-item"),g),x=h(p("uni-forms"),_),U=c;return r(),l(u,null,{default:o((()=>[d(u,{class:"logo"},{default:o((()=>[d(s,{src:f,mode:"aspectFit"})])),_:1}),d(u,{class:"form"},{default:o((()=>[d(x,{ref_key:"form",ref:P,modelValue:v,rules:V,"label-align":"right","label-width":90},{default:o((()=>[d(y,{label:"密码",name:"password"},{default:o((()=>[d(b,{type:"password",maxlength:"20",clearable:!1,modelValue:v.password,"onUpdate:modelValue":e[0]||(e[0]=a=>v.password=a),placeholder:"请输入新密码"},null,8,["modelValue"])])),_:1}),d(y,{label:"确认密码",name:"confirmPassword"},{default:o((()=>[d(b,{type:"password",maxlength:"20",clearable:!1,modelValue:v.confirmPassword,"onUpdate:modelValue":e[1]||(e[1]=a=>v.confirmPassword=a),placeholder:"请再次确认新密码"},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),d(U,{class:t(["submit",{"submit-disabled":!v.password||!v.confirmPassword}]),onClick:j},{default:o((()=>[n("确认")])),_:1},8,["class"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-996c94a7"]]);export{V as default};
