regist.2c67133b.js 3.7 KB

1
  1. import{_ as k,d as D,w as C,Z as U,r as i,o as A,G as R,C as l,l as e,u as o,J as p,b as P,M as f,L as h,ad as N}from"./index.fd765376.js";import{M as n}from"./motion.c4790012.js";import{u as T}from"./rule.2b637160.js";import{E as B}from"./index.17fb711d.js";import{u as v}from"./verifyCode.1eac8229.js";const z={class:"w-full flex justify-between"},M=D({__name:"regist",setup(S){const _=C(!1),d=C(!1),r=U({username:"",phone:"",verifyCode:"",password:"",repeatPassword:""}),w=C(),{isDisabled:V,text:y}=v(),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"}],F=async m=>{d.value=!0,m&&await m.validate((u,s)=>{if(u)_.value?setTimeout(()=>{B.success("\u6CE8\u518C\u6210\u529F"),d.value=!1},2e3):(d.value=!1,B.warning("\u8BF7\u52FE\u9009\u9690\u79C1\u653F\u7B56"));else return d.value=!1,s})};function x(){v().end(),N().SET_CURRENTPAGE(0)}return(m,u)=>{const s=i("el-input"),t=i("el-form-item"),c=i("el-button"),g=i("el-checkbox"),b=i("el-form");return A(),R(b,{ref_key:"ruleFormRef",ref:w,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(()=>[P("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(c,{disabled:o(V),class:"ml-2",onClick:u[3]||(u[3]=a=>o(v)().start(w.value,"phone"))},{default:l(()=>[f(h(o(y)),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:_.value,"onUpdate:modelValue":u[6]||(u[6]=a=>_.value=a)},{default:l(()=>[f(" \u6211\u5DF2\u4ED4\u7EC6\u9605\u8BFB\u5E76\u63A5\u53D7 ")]),_:1},8,["modelValue"]),e(c,{link:"",type:"primary"},{default:l(()=>[f(" \u300A\u9690\u79C1\u653F\u7B56\u300B ")]),_:1})]),_:1})]),_:1}),e(o(n),{delay:350},{default:l(()=>[e(t,null,{default:l(()=>[e(c,{class:"w-full",size:"default",type:"primary",loading:d.value,onClick:u[7]||(u[7]=a=>F(w.value))},{default:l(()=>[f(" \u786E\u5B9A ")]),_:1},8,["loading"])]),_:1})]),_:1}),e(o(n),{delay:400},{default:l(()=>[e(t,null,{default:l(()=>[e(c,{class:"w-full",size:"default",onClick:x},{default:l(()=>[f(" \u8FD4\u56DE ")]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});var I=k(M,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/login/components/regist.vue"]]);export{I as default};