regist.e98ace76.js 3.7 KB

1
  1. import{_ as k,d as D,E as w,a7 as U,x as i,o as h,N as A,K as l,y as e,u as o,R as p,b as R,W as f,T as P,ag as N}from"./index.1417328f.js";import{M as n}from"./motion.5477d563.js";import{u as T}from"./rule.54f74b6e.js";import{E as y}from"./index.3400b003.js";import{u as C}from"./verifyCode.90314a53.js";const z={class:"w-full flex justify-between"},S=f(" \u6211\u5DF2\u4ED4\u7EC6\u9605\u8BFB\u5E76\u63A5\u53D7 "),j=f(" \u300A\u9690\u79C1\u653F\u7B56\u300B "),M=f(" \u786E\u5B9A "),$=f(" \u8FD4\u56DE "),q=D({__name:"regist",setup(G){const c=w(!1),d=w(!1),r=U({username:"",phone:"",verifyCode:"",password:"",repeatPassword:""}),v=w(),{isDisabled:B,text:V}=C(),E=[{validator:(m,u,s)=>{u===""?s(new Error("\u8BF7\u8F93\u5165\u786E\u8BA4\u5BC6\u7801")):r.password!==u?s(new Error("\u4E24\u6B21\u5BC6\u7801\u4E0D\u4E00\u81F4!")):s()},trigger:"blur"}],x=async m=>{d.value=!0,m&&await m.validate((u,s)=>{if(u)c.value?setTimeout(()=>{y.success("\u6CE8\u518C\u6210\u529F"),d.value=!1},2e3):(d.value=!1,y.warning("\u8BF7\u52FE\u9009\u9690\u79C1\u653F\u7B56"));else return d.value=!1,s})};function F(){C().end(),N().SET_CURRENTPAGE(0)}return(m,u)=>{const s=i("el-input"),t=i("el-form-item"),_=i("el-button"),g=i("el-checkbox"),b=i("el-form");return h(),A(b,{ref_key:"ruleFormRef",ref:v,model:r,rules:o(T),size:"large"},{default:l(()=>[e(o(n),null,{default:l(()=>[e(t,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u53F7",trigger:"blur"}],prop:"username"},{default:l(()=>[e(s,{clearable:"",modelValue:r.username,"onUpdate:modelValue":u[0]||(u[0]=a=>r.username=a),placeholder:"\u8D26\u53F7","prefix-icon":o(p)("user")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(n),{delay:100},{default:l(()=>[e(t,{prop:"phone"},{default:l(()=>[e(s,{clearable:"",modelValue:r.phone,"onUpdate:modelValue":u[1]||(u[1]=a=>r.phone=a),placeholder:"\u624B\u673A\u53F7\u7801","prefix-icon":o(p)("iphone")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(n),{delay:150},{default:l(()=>[e(t,{prop:"verifyCode"},{default:l(()=>[R("div",z,[e(s,{clearable:"",modelValue:r.verifyCode,"onUpdate:modelValue":u[2]||(u[2]=a=>r.verifyCode=a),placeholder:"\u77ED\u4FE1\u9A8C\u8BC1\u7801","prefix-icon":o(p)("ri:shield-keyhole-line",{online:!0})},null,8,["modelValue","prefix-icon"]),e(_,{disabled:o(B),class:"ml-2",onClick:u[3]||(u[3]=a=>o(C)().start(v.value,"phone"))},{default:l(()=>[f(P(o(V)),1)]),_:1},8,["disabled"])])]),_:1})]),_:1}),e(o(n),{delay:200},{default:l(()=>[e(t,{prop:"password"},{default:l(()=>[e(s,{clearable:"","show-password":"",modelValue:r.password,"onUpdate:modelValue":u[4]||(u[4]=a=>r.password=a),placeholder:"\u5BC6\u7801","prefix-icon":o(p)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(n),{delay:250},{default:l(()=>[e(t,{rules:E,prop:"repeatPassword"},{default:l(()=>[e(s,{clearable:"","show-password":"",modelValue:r.repeatPassword,"onUpdate:modelValue":u[5]||(u[5]=a=>r.repeatPassword=a),placeholder:"\u786E\u8BA4\u5BC6\u7801","prefix-icon":o(p)("lock")},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1}),e(o(n),{delay:300},{default:l(()=>[e(t,null,{default:l(()=>[e(g,{modelValue:c.value,"onUpdate:modelValue":u[6]||(u[6]=a=>c.value=a)},{default:l(()=>[S]),_:1},8,["modelValue"]),e(_,{link:"",type:"primary"},{default:l(()=>[j]),_:1})]),_:1})]),_:1}),e(o(n),{delay:350},{default:l(()=>[e(t,null,{default:l(()=>[e(_,{class:"w-full",size:"default",type:"primary",loading:d.value,onClick:u[7]||(u[7]=a=>x(v.value))},{default:l(()=>[M]),_:1},8,["loading"])]),_:1})]),_:1}),e(o(n),{delay:400},{default:l(()=>[e(t,null,{default:l(()=>[e(_,{class:"w-full",size:"default",onClick:F},{default:l(()=>[$]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});var L=k(q,[["__file","/Users/apple/Desktop/Company Projects/accout-vue3-ui/src/views/login/components/regist.vue"]]);export{L as default};