jiuyiUniapp/jiuyi2/unpackage/dist/build/web/assets/getCode.DZprfOqV.js

2 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{r as e,y as a,ai as l,o as t,c as u,w as n,a9 as s,b as r,e as o,aa as v,t as p,h as c,j as d,v as _,i}from"./index-CZsuXyof.js";/* empty css */import{_ as g}from"./_plugin-vue_export-helper.BCo6x5W8.js";const f=g({__name:"getCode",props:{event:{type:String,default:"register"},count:{type:Number,default:60},phone:{type:String,default:""}},setup(g){const f=g,m=e(60),h=e(null),y=e(1);function C(){return f.phone?2==y.value?(c.alert("请稍后获取验证码"),!1):(y.value=2,h.value=setInterval((()=>{m.value>0?m.value--:(y.value=3,m.value=f.count,clearInterval(h.value))}),1e3),void d.login.getCaptcha({query:{phoneNumber:f.phone}}).then((e=>{console.log(e),200==e.code?c.alert("验证码已发送"):(c.alert(e.msg),y.value=3,clearInterval(h.value))}))):(c.alert("手机号不正确"),!1)}return a((()=>{m.value=f.count})),l((()=>{y.value=1,clearInterval(h.value)})),(e,a)=>{const l=_,c=i;return t(),u(c,{class:"getCode",onClick:C},{default:n((()=>[s(r(l,null,{default:n((()=>[o("发送")])),_:1},512),[[v,1==y.value]]),s(r(l,null,{default:n((()=>[o(""+p(m.value)+"s",1)])),_:1},512),[[v,2==y.value]]),s(r(l,null,{default:n((()=>[o("重新发送")])),_:1},512),[[v,3==y.value]])])),_:1})}}},[["__scopeId","data-v-56cada6a"]]);export{f as g};