test_lgq/niucloud/public/web/_nuxt/register.fc026755.js

2 lines
6.8 KiB
JavaScript
Raw Normal View History

2024-01-24 17:36:08 +08:00
import{u as N,t as T,E as j,_ as z}from"./test.b4f3927f.js";import{E as D}from"./el-input.60ea0dae.js";import{E as $,a as G}from"./el-overlay.172e9766.js";import{E as H}from"./el-button.b86b6ea8.js";import{_ as J}from"./nuxt-link.47b9aec4.js";import{a as M,W as O,$ as Q,r as b,s as E,D as Y,o as v,e as y,j as d,f as a,u as o,I as K,F as W,G as X,w as i,a0 as A,a1 as S,V as s,h as w,t as c,k as Z,a7 as ee,a8 as oe,y as le,J as se,K as ae}from"./entry.539d3b49.js";import{u as re}from"./useLogin.3a7e13da.js";import{_ as te}from"./_plugin-vue_export-helper.c27b6911.js";import"./throttle.4fc9319f.js";import"./debounce.7822d733.js";import"./use-form-item.aa386fad.js";import"./index.e7365e3c.js";import"./index.68b3a059.js";import"./_initCloneObject.18c5d913.js";import"./vnode.48eda29e.js";const R=_=>(se("data-v-c9f5abc0"),_=_(),ae(),_),ie={class:"w-full h-full bg-page flex items-center justify-center"},ne={class:"flex bg-white"},de={class:"flex flex-col items-center w-[330px] py-[100px] border-r"},me=R(()=>d("div",{class:"title font-bold text-xl"},"打开手机微信",-1)),ue=R(()=>d("div",{class:"tips text-sm mt-[5px]"},"点击右上角打开扫一扫",-1)),pe={class:"qrcode mt-[30px] border leading-none"},ce={class:"bg-white w-[380px] p-[30px]"},ge={class:"flex items-end my-[30px]"},fe=["onClick"],_e={class:"py-0 leading-none"},he={class:"flex justify-end leading-none"},be={key:0,class:"text-xs py-[50rpx] flex justify-center w-full"},ve={class:"text-primary"},ye={class:"text-primary"},we=M({__name:"register",setup(_){const x=O(),u=Q();u.getLoginConfig();const n=b(""),q=E(()=>{const e=[];return u.login.is_username&&e.push({type:"username",title:s("usernameRegister")}),u.login.is_mobile&&!u.login.is_bind_mobile&&e.push({type:"mobile",title:s("mobileRegister")}),n.value=e[0]?e[0].type:"",e}),f=b(!1),r=Y({username:"",password:"",confirm_password:"",mobile:"",mobile_code:"",mobile_key:"",captcha_key:"",captcha_code:""}),L=E(()=>({username:{type:"string",required:n.value=="username",message:s("usernamePlaceholder"),trigger:["blur","change"]},password:{type:"string",required:n.value=="username",message:s("passwordPlaceholder"),trigger:["blur","change"]},confirm_password:[{type:"string",required:n.value=="username",message:s("confirmPasswordPlaceholder"),trigger:["blur","change"]},{validator(e,l,g){return l==r.password},message:s("confirmPasswordError"),trigger:["change","blur"]}],mobile:[{type:"string",required:n.value=="mobile"||u.login.is_bind_mobile,message:s("mobilePlaceholder"),trigger:["blur","change"]},{validator(e,l,g){return n.value!="mobile"&&!u.login.is_bind_mobile?!0:T.mobile(l)},message:s("mobileError"),trigger:["change","blur"]}],mobile_code:{type:"string",required:n.value=="mobile"||u.login.is_bind_mobile,message:s("codePlaceholder"),trigger:["blur","change"]},captcha_code:{type:"string",required:n.value=="username",message:s("captchaPlaceholder"),trigger:["blur","change"]}})),V=b(),U=async()=>{var e;await((e=V.value)==null?void 0:e.validate(async(l,g)=>{if(l){if(f.value)return;f.value=!0,(n.value=="username"?ee:oe)(r).then(p=>{x.setToken(p.data.token),re().handleLoginBack()}).catch(()=>{f.value=!1,h.refresh()})}}))},h=N(r);h.refresh();const C=b(null),I=async()=>{var e;await((e=V.value)==null?void 0:e.validateField("mobile",async(l,g)=>{var m;l&&((m=C.value)==null||m.send())}))};return(e,l)=>{const g=j,m=D,p=$,B=z,P=H,k=J,F=G;return v(),y("div",ie,[d("div",ne,[d("div",de,[me,ue,d("div",pe,[a(g,{src:("img"in e?e.img:o(K))("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHU7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAySlJSbU1Sb0hiMlQxOEcwSGhBY1AAAgTSfStkAwRYAgAA"),class:"w-[120px]"},null,8,["src"])])]),d("div",ce,[d("div",ge,[(v(!0),y(W,null,X(o(q),t=>(v(),y("div",{class:le(["mr-[20px] text-base cursor-pointer leading-none",{"font-bold":o(n)==t.type}]),onClick:Ve=>n.value=t.type},c(t.title),11,fe))),256))]),a(F,{model:o(r),ref_key:"formRef",ref:V,rules:o(L),"validate-on-rule-change":!1},{default:i(()=>[A(d("div",null,[a(p,{prop:"username"},{default:i(()=>[a(m,{modelValue:o(r).username,"onUpdate:modelValue":l[0]|