12 |
- import{_ as e,W as o,G as s,n as a,y as r,r as t,a as n,o as i,c as u,w as l,i as d,g as p,j as m,q as c,u as f,m as h}from"./index-BAMs4g2N.js";import{_ as w}from"./uni-match-media.DdBreTiv.js";import{_ as g}from"./uni-easyinput.BtmRbBVL.js";import{_}from"./uni-forms-item.2I4PBt0Q.js";import{_ as b}from"./uni-id-pages-sms-form.BYqnP4Ki.js";import{_ as y}from"./uni-forms.oA3JcH9o.js";import{_ as k}from"./uni-popup-captcha.BX5_0lX0.js";import{m as D}from"./login-page.mixin.Co1wd1R5.js";import"./uni-captcha.uBG0dSY-.js";const C=o.importObject("uni-id-co",{errorOptions:{type:"toast"}});const V=e({mixins:[D],data:()=>({lock:!1,focusPhone:!0,focusPassword:!1,focusPassword2:!1,formData:{phone:"",code:"",password:"",password2:"",captcha:""},rules:{phone:{rules:[{required:!0,errorMessage:"请输入手机号"},{pattern:/^1\d{10}$/,errorMessage:"手机号码格式不正确"}]},code:{rules:[{required:!0,errorMessage:"请输入短信验证码"},{pattern:/^.{6}$/,errorMessage:"请输入6位验证码"}]},password:{rules:[{required:!0,errorMessage:"请输入新密码"},{pattern:/^.{6,20}$/,errorMessage:"密码为6 - 20位"}]},password2:{rules:[{required:!0,errorMessage:"请确认密码"},{pattern:/^.{6,20}$/,errorMessage:"密码为6 - 20位"},{validateFunction:function(e,o,s,a){return o!=s.password&&a("两次输入密码不一致"),!0}}]}},logo:"/static/logo.png"}),computed:{isPhone(){return/^1\d{10}$/.test(this.formData.phone)},isPwd(){return/^.{6,20}$/.test(this.formData.password)},isCode(){return/^\d{6}$/.test(this.formData.code)}},onLoad(e){e&&e.phoneNumber&&(this.formData.phone=e.phoneNumber,e.lock&&(this.lock=e.lock,this.focusPhone=!0))},onReady(){this.formData.phone&&this.$refs.shortCode.start(),this.$refs.form.setRules(this.rules)},onShow(){document.onkeydown=e=>{let o=e||window.event;o&&13==o.keyCode&&this.submit()}},methods:{submit(){this.$refs.form.validate().then((e=>{let{phone:o,password:a,captcha:r,code:t}=this.formData;C.resetPwdBySms({mobile:o,code:t,password:a,captcha:r}).then((e=>{s()})).catch((e=>{"uni-id-captcha-required"==e.errCode&&this.$refs.popup.open()})).finally((e=>{this.formData.captcha=""}))})).catch((e=>{let o=e[0].key;if("code"==o)return this.$refs.shortCode.focusSmsCodeInput=!0;o=o.replace(o[0],o[0].toUpperCase()),this["focus"+o]=!0}))},retrieveByEmail(){a({url:"/uni_modules/uni-id-pages/pages/retrieve/retrieve-by-email"})},backLogin(){r({url:"/uni_modules/uni-id-pages/pages/login/login-withpwd"})}}},[["render",function(e,o,s,a,r,D){const C=c,V=d,P=f,$=t(n("uni-match-media"),w),j=t(n("uni-easyinput"),g),v=t(n("uni-forms-item"),_),x=t(n("uni-id-pages-sms-form"),b),B=h,M=t(n("uni-forms"),y),q=t(n("uni-popup-captcha"),k);return i(),u(V,{class:"uni-content"},{default:l((()=>[p($,{"min-width":690},{default:l((()=>[p(V,{class:"login-logo"},{default:l((()=>[p(C,{src:r.logo},null,8,["src"])])),_:1}),p(P,{class:"title title-box"},{default:l((()=>[m("通过手机验证码找回密码")])),_:1})])),_:1}),p(M,{ref:"form",value:r.formData,"err-show-type":"toast"},{default:l((()=>[p(v,{name:"phone"},{default:l((()=>[p(j,{focus:r.focusPhone,onBlur:o[0]||(o[0]=e=>r.focusPhone=!1),class:"input-box",disabled:r.lock,type:"number",inputBorder:!1,modelValue:r.formData.phone,"onUpdate:modelValue":o[1]||(o[1]=e=>r.formData.phone=e),maxlength:"11",placeholder:"请输入手机号"},null,8,["focus","disabled","modelValue"])])),_:1}),p(v,{name:"code"},{default:l((()=>[p(x,{ref:"shortCode",phone:r.formData.phone,type:"reset-pwd-by-sms",modelValue:r.formData.code,"onUpdate:modelValue":o[2]||(o[2]=e=>r.formData.code=e)},null,8,["phone","modelValue"])])),_:1}),p(v,{name:"password"},{default:l((()=>[p(j,{focus:r.focusPassword,onBlur:o[3]||(o[3]=e=>r.focusPassword=!1),class:"input-box",type:"password",inputBorder:!1,modelValue:r.formData.password,"onUpdate:modelValue":o[4]||(o[4]=e=>r.formData.password=e),placeholder:"请输入新密码"},null,8,["focus","modelValue"])])),_:1}),p(v,{name:"password2"},{default:l((()=>[p(j,{focus:r.focusPassword2,onBlur:o[5]||(o[5]=e=>r.focusPassword2=!1),class:"input-box",type:"password",inputBorder:!1,modelValue:r.formData.password2,"onUpdate:modelValue":o[6]||(o[6]=e=>r.formData.password2=e),placeholder:"请再次输入新密码"},null,8,["focus","modelValue"])])),_:1}),p(B,{class:"uni-btn send-btn-box",type:"primary",onClick:D.submit},{default:l((()=>[m("提交")])),_:1},8,["onClick"]),p($,{"min-width":690},{default:l((()=>[p(V,{class:"link-box"},{default:l((()=>[p(P,{class:"link",onClick:D.retrieveByEmail},{default:l((()=>[m("通过邮箱验证码找回密码")])),_:1},8,["onClick"]),p(V),p(P,{class:"link",onClick:D.backLogin},{default:l((()=>[m("返回登录")])),_:1},8,["onClick"])])),_:1})])),_:1})])),_:1},8,["value"]),p(q,{onConfirm:D.submit,modelValue:r.formData.captcha,"onUpdate:modelValue":o[7]||(o[7]=e=>r.formData.captcha=e),scene:"reset-pwd-by-sms",ref:"popup"},null,8,["onConfirm","modelValue"])])),_:1})}],["__scopeId","data-v-98d40a0e"]]);export{V as default};
|