import{d as e,b as a,c as o,e as l,r as s,f as t,g as n,o as r,h as u,w as i,i as p,j as d,a as f,A as c,t as m,x as h,av as _,z as g,y as v,a1 as y}from"./index-WeUkftbp.js";import{_ as x}from"./uni-easyinput.D5FSIQIk.js";import{_ as C,a as b}from"./uni-forms.CCONsUgM.js";import{_ as V}from"./uni-popup.CI1Fmu1z.js";import{f as j}from"./forum.BGXd3LTG.js";import{a as k,b as z}from"./useVerifyCode.Bm9sm4v1.js";import{_ as I}from"./_plugin-vue_export-helper.BCo6x5W8.js";const D=I(e({__name:"loginPop",setup(e,{expose:I}){const D=a(),P=o((()=>D.state.app.userInfo));let{text:U,disabled:w,sendCode:A}=k(),{getKeyVerify:K}=z(),Q=l({phone:"",verificationCode:""});const T=s(!1),q=s(null);let B=s(!0);const E=()=>{if(!Q.phone)return h.error("电话号码不能为空"),!1;if(!Q.verificationCode)return h.error("验证码不能为空"),!1;const e={phone:Q.phone,captcha:Q.verificationCode};T.value=!0,j(e).then((e=>{T.value=!1,200===e.status&&(h.success("登录成功"),q.value.close())})).catch((e=>{T.value=!1,h.error(e.message)}))},F=()=>{if(!B.value||w.value)return!1;K(Q.phone,1)},G=e=>{B.value=_.test(e)};return I({inputDialogToggle:()=>{Q.phone=P.value.phone,q.value.open()}}),(e,a)=>{const o=g,l=t(n("uni-easyinput"),x),s=t(n("uni-forms-item"),C),h=v,_=y,j=t(n("uni-forms"),b),k=t(n("uni-popup"),V);return r(),u(o,null,{default:i((()=>[p(k,{ref_key:"inputDialog",ref:q,type:"dialog","is-mask-click":!0},{default:i((()=>[p(o,{class:"login"},{default:i((()=>[p(o,{class:"login-text"},{default:i((()=>[d(" 登录 ")])),_:1}),p(j,{ref:"forms",modelValue:f(Q),"label-position":"left"},{default:i((()=>[p(s,null,{default:i((()=>[p(o,{class:"flex"},{default:i((()=>[p(o,{class:"iconfont icon-danchuang-shoujihao"}),p(l,{type:"number",modelValue:f(Q).phone,"onUpdate:modelValue":a[0]||(a[0]=e=>f(Q).phone=e),clearable:!0,maxlength:11,onInput:G,styles:{borderColor:"transparent"},placeholder:"请输入手机号码"},null,8,["modelValue"])])),_:1})])),_:1}),p(s,null,{default:i((()=>[p(o,{class:"flex"},{default:i((()=>[p(o,{class:"iconfont icon-danchuang-yanzhengma"}),p(l,{type:"number",modelValue:f(Q).verificationCode,"onUpdate:modelValue":a[1]||(a[1]=e=>f(Q).verificationCode=e),maxlength:6,clearable:!1,styles:{borderColor:"transparent"},placeholder:"请输入验证码"},null,8,["modelValue"]),p(h,{class:c(["item-text",f(B)&&!f(w)?"default-color":"default-text-color-four"]),onClick:F},{default:i((()=>[d(m(f(U)),1)])),_:1},8,["class"])])),_:1})])),_:1}),p(_,{class:"preserve",type:"primary",loading:f(T),onClick:E},{default:i((()=>[d("登录")])),_:1},8,["loading"])])),_:1},8,["modelValue"])])),_:1})])),_:1},512)])),_:1})}}}),[["__scopeId","data-v-52e3a5d7"]]);export{D as l};
