edu/h5/assets/pages-bind_mobile-bind_mobi...

2 lines
2.2 KiB
JavaScript

import{d as e,ac as a,A as o,a9 as l,m as t,o as r,c as s,w as u,b as d,l as i,t as m,af as n,aA as c,ae as b,r as f,a as p,k as _}from"./index.ef372d98.js";import{_ as x,a as v}from"./u-form-item.3e4ea6bc.js";import{_ as h}from"./u-verification-code.5c5fbd7d.js";import{_ as j}from"./u-form.33540811.js";import{_ as g}from"./u-button.7e0d03be.js";import{S as k}from"./appEnums.a2ba827b.js";import{_ as w}from"./plugin-vue_export-helper.21dcd24c.js";import"./u-icon.7d02c0ea.js";var y=w(e({__name:"bind_mobile",setup(e){const w=a(),y=o(""),V=l(),B=e=>{y.value=e},C=t({type:"bind",mobile:"",code:""}),$=async()=>{var e,a;if(!C.mobile)return uni.$u.toast("请输入手机号码");(null==(e=w.value)?void 0:e.canGetCode)&&(await n({scene:k.BIND_MOBILE,mobile:C.mobile}),uni.$u.toast("发送成功"),null==(a=w.value)||a.start())},I=async()=>C.mobile?C.code?(await c(C,{token:V.temToken}),uni.$u.toast("绑定成功"),V.login(V.temToken),void b()):uni.$u.toast("请输入验证码"):uni.$u.toast("请输入手机号码");return(e,a)=>{const o=f(p("u-input"),x),l=f(p("u-form-item"),v),t=f(p("u-verification-code"),h),n=_,c=f(p("u-form"),j),b=f(p("u-button"),g);return r(),s(n,{class:"bg-white min-h-full flex flex-col items-center px-[40rpx] pt-[40rpx] box-border"},{default:u((()=>[d(n,{class:"w-full"},{default:u((()=>[d(c,{borderBottom:"","label-width":150},{default:u((()=>[d(l,{label:"手机号",borderBottom:""},{default:u((()=>[d(o,{class:"flex-1",modelValue:C.mobile,"onUpdate:modelValue":a[0]||(a[0]=e=>C.mobile=e),border:!1,placeholder:"请输入手机号码"},null,8,["modelValue"])])),_:1}),d(l,{label:"验证码",borderBottom:""},{default:u((()=>[d(o,{class:"flex-1",modelValue:C.code,"onUpdate:modelValue":a[1]||(a[1]=e=>C.code=e),placeholder:"请输入验证码",border:!1},null,8,["modelValue"]),d(n,{class:"border-l border-solid border-0 border-light pl-3 text-muted leading-4 ml-3 w-[180rpx]",onClick:$},{default:u((()=>[d(t,{ref_key:"uCodeRef",ref:w,seconds:60,onChange:B,"change-text":"x秒"},null,512),i(" "+m(y.value),1)])),_:1})])),_:1})])),_:1}),d(n,{class:"mt-[40rpx]"},{default:u((()=>[d(b,{type:"primary",shape:"circle",onClick:I},{default:u((()=>[i(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1})}}}),[["__scopeId","data-v-3b29402b"]]);export{y as default};