niucloud-admin/niucloud/public/wap/assets/app-pages-auth-register.78444564.js
全栈小学生 f909eea173 update wap
2023-09-19 18:04:59 +08:00

2 lines
6.9 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{d as e,a as l,a4 as a,Y as r,a1 as o,r as s,c as t,i as u,j as d,w as i,k as n,K as p,L as m,n as c,F as b,H as _,G as g,m as f,l as h,v as x,a5 as y,a6 as v,a0 as w,x as V,q as k,t as j,M as P,N as U,Z as q,I as T}from"./index-aafd04f6.js";import{_ as A,a as C,b as L}from"./u-form.1b384245.js";import{u as R,_ as E}from"./sms-code.vue_vue_type_script_setup_true_lang.188da4e7.js";import{_ as F}from"./app-link.vue_vue_type_script_setup_true_lang.9d5edf71.js";import{_ as M}from"./u-button.7a78cac5.js";import"./u-icon.0ce29e5a.js";import"./_plugin-vue_export-helper.1b428a4d.js";import"./u-line.689cce91.js";import"./u-modal.bdceb19a.js";import"./u-loading-icon.660c9bdb.js";import"./u-popup.2be273f7.js";import"./u-transition.14e36316.js";import"./u-safe-bottom.1659b859.js";const N=e({__name:"register",setup(e){const N=l({username:"",password:"",confirm_password:"",mobile:"",mobile_code:"",mobile_key:"",captcha_key:"",captcha_code:""});a("openid")&&Object.assign(N,{openid:a("openid")});const O=R(N);O.refresh();const Y=r(),Z=o(),B=s(!1),G=s(""),H=t((()=>{const e=[];return Z.login.is_username&&e.push({type:"username",title:q("usernameRegister")}),Z.login.is_mobile&&!Z.login.is_bind_mobile&&e.push({type:"mobile",title:q("mobileRegister")}),G.value=e[0]?e[0].type:"",e})),I=t((()=>({username:{type:"string",required:"username"==G.value,message:q("usernamePlaceholder"),trigger:["blur","change"]},password:{type:"string",required:"username"==G.value,message:q("passwordPlaceholder"),trigger:["blur","change"]},confirm_password:[{type:"string",required:"username"==G.value,message:q("confirmPasswordPlaceholder"),trigger:["blur","change"]},{validator:(e,l)=>l==N.password,message:q("confirmPasswordError"),trigger:["change","blur"]}],mobile:[{type:"string",required:"mobile"==G.value||Z.login.is_bind_mobile,message:q("mobilePlaceholder"),trigger:["blur","change"]},{validator:(e,l)=>"mobile"!=G.value&&!Z.login.is_bind_mobile||uni.$u.test.mobile(l),message:q("mobileError"),trigger:["change","blur"]}],mobile_code:{type:"string",required:"mobile"==G.value||Z.login.is_bind_mobile,message:q("codePlaceholder"),trigger:["blur","change"]},captcha_code:{type:"string",required:"username"==G.value,message:q("captchaPlaceholder"),trigger:["blur","change"]}}))),K=s(null),Q=()=>{K.value.validate().then((()=>{if(B.value)return;B.value=!0;("username"==G.value?y:v)(N).then((e=>{Y.setToken(e.data.token),w().handleLoginBack()})).catch((()=>{B.value=!1,O.refresh()}))}))};return(e,l)=>{const a=V,r=k(j("u-input"),A),o=k(j("u-form-item"),C),s=k(j("sms-code"),E),t=P,y=U,v=k(j("app-link"),F),w=k(j("u-button"),M),R=k(j("u-form"),L);return u(),d(a,{class:"w-screen h-screen flex flex-col"},{default:i((()=>[n(a,{class:"flex-1"},{default:i((()=>[n(a,{class:"h-[100rpx]"}),n(a,{class:"px-[60rpx] pt-[100rpx] mb-[100rpx]"},{default:i((()=>[n(a,{class:"font-bold text-xl"},{default:i((()=>[p(m(c(q)("register")),1)])),_:1})])),_:1}),c(H).length>1?(u(),d(a,{key:0,class:"px-[60rpx] text-sm flex mb-[50rpx] font-bold leading-none"},{default:i((()=>[(u(!0),b(g,null,_(c(H),((e,l)=>(u(),b(g,null,[n(a,{class:T({"text-gray-300":e.type!=G.value}),onClick:l=>G.value=e.type},{default:i((()=>[p(m(e.title),1)])),_:2},1032,["class","onClick"]),h(n(a,{class:"mx-[30rpx] border-solid border-0 border-r-[2px] border-gray-300"},null,512),[[x,0==l]])],64)))),256))])),_:1})):f("v-if",!0),n(a,{class:"px-[60rpx]"},{default:i((()=>[n(R,{labelPosition:"left",model:N,errorType:"toast",rules:c(I),ref_key:"formRef",ref:K},{default:i((()=>[h(n(a,null,{default:i((()=>[n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"username","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.username,"onUpdate:modelValue":l[0]||(l[0]=e=>N.username=e),border:"none",clearable:"",placeholder:c(q)("usernamePlaceholder")},null,8,["modelValue","placeholder"])])),_:1})])),_:1}),n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"password","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.password,"onUpdate:modelValue":l[1]||(l[1]=e=>N.password=e),border:"none",type:"password",clearable:"",placeholder:c(q)("passwordPlaceholder")},null,8,["modelValue","placeholder"])])),_:1})])),_:1}),n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"confirm_password","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.confirm_password,"onUpdate:modelValue":l[2]||(l[2]=e=>N.confirm_password=e),border:"none",type:"password",clearable:"",placeholder:c(q)("confirmPasswordPlaceholder")},null,8,["modelValue","placeholder"])])),_:1})])),_:1})])),_:1},512),[[x,"username"==G.value]]),h(n(a,null,{default:i((()=>[n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"mobile","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.mobile,"onUpdate:modelValue":l[3]||(l[3]=e=>N.mobile=e),border:"none",clearable:"",placeholder:c(q)("mobilePlaceholder")},null,8,["modelValue","placeholder"])])),_:1})])),_:1}),n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"code","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.mobile_code,"onUpdate:modelValue":l[5]||(l[5]=e=>N.mobile_code=e),border:"none",type:"password",clearable:"",placeholder:c(q)("codePlaceholder")},{suffix:i((()=>[n(s,{mobile:N.mobile,type:"register",modelValue:N.mobile_key,"onUpdate:modelValue":l[4]||(l[4]=e=>N.mobile_key=e)},null,8,["mobile","modelValue"])])),_:1},8,["modelValue","placeholder"])])),_:1})])),_:1})])),_:1},512),[[x,"mobile"==G.value||c(Z).login.is_bind_mobile]]),h(n(a,null,{default:i((()=>[n(a,{class:"mt-[30rpx]"},{default:i((()=>[n(o,{label:"",prop:"captcha_code","border-bottom":!0},{default:i((()=>[n(r,{modelValue:N.captcha_code,"onUpdate:modelValue":l[7]||(l[7]=e=>N.captcha_code=e),border:"none",clearable:"",placeholder:c(q)("captchaPlaceholder")},{suffix:i((()=>[n(t,{src:c(O).image.value,class:"h-[48rpx] ml-[20rpx]",mode:"heightFix",onClick:l[6]||(l[6]=e=>c(O).refresh())},null,8,["src"])])),_:1},8,["modelValue","placeholder"])])),_:1})])),_:1})])),_:1},512),[[x,"username"==G.value]]),n(a,{class:"flex text-xs justify-between mt-[20rpx] text-gray-400"},{default:i((()=>[n(v,{url:"/app/pages/auth/login"},{default:i((()=>[p(m(c(q)("haveAccount"))+"",1),n(y,{class:"text-primary"},{default:i((()=>[p(m(c(q)("toLogin")),1)])),_:1})])),_:1})])),_:1}),n(a,{class:"mt-[80rpx]"},{default:i((()=>[n(w,{type:"primary",loading:B.value,loadingText:c(q)("registering"),onClick:Q},{default:i((()=>[p(m(c(q)("register")),1)])),_:1},8,["loading","loadingText"])])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1}),c(Z).login.agreement_show?(u(),d(a,{key:0,class:"text-xs py-[50rpx] flex justify-center w-full"},{default:i((()=>[p(m(c(q)("registerAgreeTips"))+" ",1),n(v,{url:"/app/pages/auth/agreement?key=service"},{default:i((()=>[n(y,{class:"text-primary"},{default:i((()=>[p(m(c(q)("userAgreement")),1)])),_:1})])),_:1}),p(" "+m(c(q)("and"))+" ",1),n(v,{url:"/app/pages/auth/agreement?key=privacy"},{default:i((()=>[n(y,{class:"text-primary"},{default:i((()=>[p(m(c(q)("privacyAgreement")),1)])),_:1})])),_:1})])),_:1})):f("v-if",!0)])),_:1})}}});export{N as default};