import{_ as e}from"./el-navbar.DVIyjZEN.js";import{C as a,a as l,r as t,b as s,d as o,e as r,f as u,w as n,g as m,v as f,z as i,l as d,ak as c,t as p,p as h,a1 as v,y as _,aj as y,an as b}from"./index-DVkgSHpn.js";import{_ as g}from"./el-code.niKIdtJO.js";import{_ as $,a as w}from"./el-layout._U-vZTft.js";const T=$({__name:"change",setup($){a(),l().getApp();const T=t(null),x=t(!0);let j=t("");const k=()=>{var e;if(!x.value)return!1;null==(e=T.value)||e.start(),z()},V=e=>{j.value=e.detail.value};let C=t(!1);const z=()=>{j.value.length<=0?uni.$layer.showToast("请输入手机号"):c(j.value)?uni.$http.post("sms/send",{scene:"change",mobile:j.value}).then((e=>{var a;e.code?C.value=!0:(uni.$layer.showToast(e.msg),null==(a=T.value)||a.stop())})):uni.$layer.showToast("您填写的手机号不正确")};let I=t(!1);const S=e=>{if(I.value)return!1;if(!1===C.value)return uni.$layer.showToast("请发送验证码"),!1;let a=e.detail.value;return a.username.length<=0?(uni.$layer.showToast("请输入手机号"),!1):c(a.username)?a.code.length<=0?(uni.$layer.showToast("请输入验证码"),!1):(I.value=!0,void uni.$http.post("user/change",a).then((e=>{e.code?(uni.$layer.showToast(e.msg),p("pages/index/ucenter",3)):(uni.$layer.showToast(e.msg),I.value=!1)}))):(uni.$layer.showToast("您输入的手机号码不合法"),!1)};return(a,l)=>{const t=s(o("el-navbar"),e),c=h,p=v,$=_,j=s(o("el-code"),g),C=y,z=b,A=s(o("el-layout"),w);return r(),u(A,null,{default:n((()=>[m(t,{placeholder:!0,fixed:!0,autoBack:!0,border:!0,title:"变更手机"}),m(c,{class:"the-form"},{default:n((()=>[m(z,{onSubmit:S},{default:n((()=>[m(c,{class:"form-item"},{default:n((()=>[m(c,{class:"form-item-body form-item-border"},{default:n((()=>[m(c,{class:"form-item-icon"},{default:n((()=>[f(" 手机号 ")])),_:1}),m(c,{class:"form-item-input"},{default:n((()=>[m(p,{type:"text",name:"username",onInput:V,placeholder:"手机号","placeholder-class":"form-item-placeholder"})])),_:1})])),_:1})])),_:1}),m(c,{class:"form-item"},{default:n((()=>[m(c,{class:"form-item-body form-item-border"},{default:n((()=>[m(c,{class:"form-item-icon"},{default:n((()=>[m($,null,{default:n((()=>[f("验证码")])),_:1})])),_:1}),m(c,{class:"form-item-input"},{default:n((()=>[m(p,{type:"text",name:"code",placeholder:"请输入验证码",maxlength:"6","placeholder-class":"form-item-placeholder"})])),_:1}),m(c,{class:"form-item-right"},{default:n((()=>[m(c,{onClick:k},{default:n((()=>[m(j,{modelValue:x.value,"onUpdate:modelValue":l[0]||(l[0]=e=>x.value=e),ref_key:"codeRef",ref:T,color:"#4173ff",activeColor:"#666",fontSize:"26rpx"},null,8,["modelValue"])])),_:1})])),_:1})])),_:1})])),_:1}),m(c,{class:"form-item"},{default:n((()=>[m(c,{class:"form-item-body"},{default:n((()=>[m(C,{class:i(["form-item-button",{active:1==d(I)}]),"form-type":"submit"},{default:n((()=>[f("确 定")])),_:1},8,["class"])])),_:1})])),_:1})])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-bf97055f"]]);export{T as default};
//# sourceMappingURL=pages-user-change.Bebba0NC.js.map
