import{I as e,v as l,J as a,o,s,K as t,L as n,M as i,e as r,k as d,j as u,w as c,u as m,F as p,i as f,l as b,p as g,z as _,N as h,t as V,O as U,P as y,Q as w,D as x,m as v}from"./index-219abc09.js";import{c as P,m as L,_ as R,a as E,b as O,d as j}from"./form.480ce5b4.js";import{_ as C}from"./_plugin-vue_export-helper.1b428a4d.js";const k=C({__name:"login",setup(C){const k=e(null),q=l({isPopup:!0,loginReqVO:{type:31,code:"",state:""},isMobileEnd:!1,codeText:"获取验证码",model:{mobile:"",code:"",scene:1},rules:{code:P,mobile:L}});async function F(){if(!(await m(k).validate().catch((e=>{console.log("error: ",e)}))))return;const{code:e}=await w.OfficialEnterLogin(q.model,q.loginReqVO);if(0===e){y();let e=t("returnUrl");e?(n("returnUrl"),location.replace(e)):i({url:"/"})}}return a((async()=>{const e={};new URLSearchParams(location.search).forEach(((l,a)=>{e[a]=l})),q.loginReqVO.code=e.code,q.loginReqVO.state=e.state})),o((async e=>{new URLSearchParams(location.search).forEach(((l,a)=>{e[a]=l}));const l=e.event,a=e.code,o=e.state;if("login"===l){if(!(await s.$platform.useProvider().login(a,o)))return o.isPopup=!0,!1}else"bind"===l&&s.$platform.useProvider().bind(a,o);let r=t("returnUrl");r?(n("returnUrl"),location.replace(r)):i({url:"/"})})),(e,l)=>{const a=f,o=x,s=b(v("uni-easyinput"),R),t=b(v("uni-forms-item"),E),n=b(v("uni-forms"),O),i=b(v("su-popup"),j);return r(),d(p,null,[u(a),u(i,{show:q.isPopup,round:"10",showClose:!1,onClose:m(y)},{default:c((()=>[u(a,null,{default:c((()=>[u(a,{class:"head-box"},{default:c((()=>[u(a,{class:"ss-flex ss-m-b-20"},{default:c((()=>[u(a,{class:"isActive head-title"},{default:c((()=>[g(" 您首次登录，请输入手机号验证 ")])),_:1})])),_:1})])),_:1}),u(n,{ref_key:"smsLoginRef",ref:k,modelValue:q.model,"onUpdate:modelValue":l[3]||(l[3]=e=>q.model=e),rules:q.rules,validateTrigger:"bind",labelWidth:"140",labelAlign:"center",class:"loginUniForm"},{default:c((()=>[u(t,{name:"mobile",label:"手机号",class:"loginUniFormItem"},{default:c((()=>[u(s,{placeholder:"请输入手机号",modelValue:q.model.mobile,"onUpdate:modelValue":l[1]||(l[1]=e=>q.model.mobile=e),inputBorder:!1,type:"number"},{right:c((()=>[u(o,{class:_(["ss-reset-button code-btn code-btn-start",{"code-btn-end":q.isMobileEnd}]),disabled:q.isMobileEnd,onClick:l[0]||(l[0]=e=>m(h)("smsLogin",q.model.mobile))},{default:c((()=>[g(V(m(U)("smsLogin")),1)])),_:1},8,["disabled","class"])])),_:1},8,["modelValue"])])),_:1}),u(t,{name:"code",label:"验证码",class:"loginUniFormItem"},{default:c((()=>[u(s,{placeholder:"请输入验证码",modelValue:q.model.code,"onUpdate:modelValue":l[2]||(l[2]=e=>q.model.code=e),inputBorder:!1,type:"number",maxlength:"4"},null,8,["modelValue"])])),_:1})])),_:1},8,["modelValue","rules"]),u(a,{style:{display:"flex","justify-content":"space-between",padding:"40rpx","padding-bottom":"0rpx"}},{default:c((()=>[u(o,{class:"ss-reset-button login-btn-start",onClick:F},{default:c((()=>[g(" 继续登录 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["show","onClose"])],64)}}},[["__scopeId","data-v-806bc799"]]);export{k as default};
