regist.6330e0.js 3.7 KB

1
  1. import{_ as b,d as D,w as C,Z as U,r as i,o as A,G as h,C as l,j as e,l as o,J as p,h as R,M as f,L as P,ad as N}from"./index.js";import{M as n}from"./motion.b2bbbb6a.js";import{u as T}from"./rule.06b4df69.js";import{E as B}from"./index.4ccf643b.js";import{u as v}from"./verifyCode.ea86b9b7.js";const j={class:"w-full flex justify-between"},z=D({__name:"regist",setup(M){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"),k=i("el-form");return A(),h(k,{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(()=>[R("div",j,[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(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: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=b(z,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/login/components/regist.vue"]]);export{I as default};