regist.f3a708.js 3.7 KB

1
  1. import{_ as b,d as D,x as w,Z as U,r as i,o as A,G as R,D as l,l as e,m as o,J as p,h,M as f,L as P,ad as N}from"./index.js";import{M as n}from"./motion.6a462330.js";import{u as T}from"./rule.9287b9d2.js";import{E as B}from"./index.29a6d90d.js";import{u as C}from"./verifyCode.bd1f9cdb.js";const z={class:"w-full flex justify-between"},M=D({__name:"regist",setup(S){const _=w(!1),d=w(!1),r=U({username:"",phone:"",verifyCode:"",password:"",repeatPassword:""}),v=w(),{isDisabled:V,text:y}=C(),x=[{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"}],E=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 F(){C().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"),k=i("el-form");return A(),R(k,{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(()=>[h("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(C)().start(v.value,"phone"))},{default:l(()=>[f(P(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:x,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=>E(v.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:F},{default:l(()=>[f(" \u8FD4\u56DE ")]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])}}});var I=b(M,[["__file","C:/Users/89793/Desktop/projects/settle-vue3/src/views/login/components/regist.vue"]]);export{I as default};