index-b889325d.js 8.0 KB

1
  1. import{D as _,d as I,U as R,x as E,y as S,a as u,A as s,F as g,C as c,E as b,V as C}from"./index-a890cc58.js";import{M as w}from"./index-ac852b17.js";import{A as P}from"./index-ba0ed4b5.js";import{F as W}from"./index-3369ec7a.js";import{C as f}from"./index-2acfe5f2.js";import{F as o}from"./index-5929a3eb.js";import"./index-e8c4b787.js";import"./index-3819b2ef.js";import"./index-56347a11.js";import"./index-46403f33.js";const V="_container_vqg6b_1",x="_titleIcon_vqg6b_9",L="_title_vqg6b_9",M="_tagWrap_vqg6b_24",T="_tag_vqg6b_24",N="_contentWrap_vqg6b_45",Y="_content_vqg6b_45",k="_icon_vqg6b_56",z="_group_vqg6b_62",$="_radio_vqg6b_77",G="_tips_vqg6b_88",J="_submit_vqg6b_98",O="_submitIcon_vqg6b_108",X="_successWrap_vqg6b_113",j="_p1_vqg6b_120",H="_p2_vqg6b_125",Q="_btnWrap_vqg6b_130",K="_btnTitle_vqg6b_141",Z="_btnDes_vqg6b_150",ee="_btn_vqg6b_130",ue="_codeWrap_vqg6b_170",t={container:V,titleIcon:x,title:L,tagWrap:M,tag:T,contentWrap:N,content:Y,icon:k,group:z,radio:$,tips:G,submit:J,submitIcon:O,successWrap:X,p1:j,p2:H,btnWrap:Q,btnTitle:K,btnDes:Z,btn:ee,codeWrap:ue},ae=""+new URL("icon_school-246e55f8.png",import.meta.url).href,te=""+new URL("icon_person-e885956c.png",import.meta.url).href,ne=""+new URL("icon_submit-1b1e3ed1.png",import.meta.url).href,oe=""+new URL("logo-f2c1f146.png",import.meta.url).href,se=""+new URL("icon_p1-49eb8f11.png",import.meta.url).href,le=""+new URL("icon_p2-ecea3fa8.png",import.meta.url).href,re=()=>_.get("/edu-app/open/sysArea/queryAllProvince"),ce=l=>_.post("/edu-app/open/school/add",{data:l}),ie=l=>_.post("/edu-app/open/sendSms",{data:l,requestType:"form"}),Ee=I({name:"SchoolRegister",setup(){const l=R(),p={nature:[{label:"公立",value:"PUBLIC"},{label:"私立",value:"PRIVATE"}],types:[{label:"小学",value:"PRIMARY"},{label:"初中",value:"JUNIOR"},{label:"小初一体",value:"PRIMARY_JUNIOR"}],grades:[{label:"六年制",value:"SIX_YEAR_SYSTEM"},{label:"五年制",value:"FIVE_YEAR_SYSTEM"}],genaral:[{label:"男",value:"1"},{label:"女",value:"0"}]},a=E({name:"",regionCode:"",cityCode:"",provinceCode:"",schoolNature:"PUBLIC",schoolType:"PRIMARY_JUNIOR",gradeYear:"SIX_YEAR_SYSTEM",emergencyContact:"",emergencyContactPhone:"",educationalAdministrationUsername:"",educationalAdministrationPhone:"",genaral:"1",code:"",buyGoods:!0,tenantId:l.query.id||"",sourceForm:"TEACHER"}),n=E({cityName:"",showArea:!1,success:!1,areaList:{},sendMsg:"发送验证码",imgCodeStatus:!1}),B=e=>{const d={},h={},F={};return e.forEach(r=>{d[r.code]=r.name}),e.forEach(r=>{var i;(i=r.areas)==null||i.forEach(m=>{h[m.code]=m.name})}),e.forEach(r=>{var i;(i=r.areas)==null||i.forEach(m=>{var v;(v=m.areas)==null||v.forEach(A=>{F[A.code]=A.name})})}),{province_list:d,city_list:h,county_list:F}},y=()=>{re().then(e=>{(e==null?void 0:e.code)===200&&(n.areaList=B(e.data),console.log("🚀 ~ data.areaList:",n.areaList))})};S(()=>{y()});const q=async()=>{try{await ie({clientId:"cooleshow-student",type:"REGISTER",mobile:a.educationalAdministrationPhone}),D(),b("验证码已发送")}catch(e){n.sendMsg="重新发送"}},D=()=>{n.sendMsg="30s";let e=30;setInterval(()=>{e--,n.sendMsg=`${e}s后重新发送`,e<=0&&(n.sendMsg="重新发送")},1e3)},U=async()=>{const e=await ce({...a});(e==null?void 0:e.code)===200&&(n.success=!0)};return()=>u("div",{class:t.container},[u("img",{class:t.titleIcon,src:oe},null),u("div",{class:t.title},[l.query.name]),u("div",{class:t.tagWrap},[u("div",{class:t.tag},[u("span",null,[s("·")]),s(" 课堂乐器学校登记 "),u("span",null,[s("·")])])]),u("div",{class:t.contentWrap},[u("div",{class:t.content},[u(W,{onSubmit:()=>U()},{default:()=>[u(f,{class:t.group},{default:()=>[u("img",{src:ae,class:t.icon},null),u(o,{border:!0,name:"name",label:"学校全称",rows:"1",autosize:!0,type:"textarea",placeholder:"请输入学校全称",inputAlign:"right",modelValue:a.name,"onUpdate:modelValue":e=>a.name=e,maxlength:20,rules:[{required:!0,message:"请输入学校全称"}]},null),u(o,{isLink:!0,border:!0,label:"所属城市",placeholder:"请选择",readonly:!0,inputAlign:"right",modelValue:n.cityName,"onUpdate:modelValue":e=>n.cityName=e,onClick:()=>n.showArea=!0,rules:[{required:!0,message:"请选择"}]},null),u(o,{center:!0,border:!0,name:"schoolNature",label:"办学性质"},{input:()=>u(g,null,[p.nature.map(e=>u(c,{class:t.radio,size:"small",color:e.value===a.schoolNature?"#198CFE":"",onClick:()=>a.schoolNature=e.value},{default:()=>[e.label]}))])}),u(o,{center:!0,border:!0,label:"学年制"},{input:()=>u(g,null,[p.grades.map(e=>u(c,{class:t.radio,size:"small",color:e.value===a.gradeYear?"#198CFE":"",onClick:()=>a.gradeYear=e.value},{default:()=>[e.label]}))])})]}),u(f,{class:t.group},{default:()=>[u("img",{src:te,class:t.icon},null),u(o,{border:!0,name:"emergencyContact",label:"校长姓名",placeholder:"请输入校长姓名",inputAlign:"right",maxlength:6,modelValue:a.emergencyContact,"onUpdate:modelValue":e=>a.emergencyContact=e,rules:[{required:!0,message:"请输入校长姓名"}]},null),u(o,{border:!0,name:"emergencyContactPhone",label:"校长联系方式",maxlength:11,placeholder:"请输入校长手机号码",inputAlign:"right",modelValue:a.emergencyContactPhone,"onUpdate:modelValue":e=>a.emergencyContactPhone=e,rules:[{required:!0,message:"请输入校长手机号码"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号码"}]},null),u(o,{border:!0,name:"educationalAdministrationUsername",label:"负责人姓名",placeholder:"请输入负责人姓名",inputAlign:"right",maxlength:6,modelValue:a.educationalAdministrationUsername,"onUpdate:modelValue":e=>a.educationalAdministrationUsername=e,rules:[{required:!0,message:"请输入负责人姓名"}]},null),u(o,{border:!0,name:"educationalAdministrationPhone",label:"负责人联系方式",labelWidth:"40%",inputAlign:"right",placeholder:"请输入负责人手机号码",maxlength:11,modelValue:a.educationalAdministrationPhone,"onUpdate:modelValue":e=>a.educationalAdministrationPhone=e,rules:[{required:!0,message:"请输入负责人手机号码"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号码"}]},null),u(o,{center:!0,border:!0,label:"性别"},{input:()=>u(g,null,[p.genaral.map(e=>u(c,{class:t.radio,size:"small",color:e.value===a.genaral?"#198CFE":"",onClick:()=>a.genaral=e.value},{default:()=>[e.label]}))])}),u(o,{class:t.codeWrap,border:!0,name:"code",label:"验证码",placeholder:"请输入验证码",modelValue:a.code,"onUpdate:modelValue":e=>a.code=e,maxlength:6,rules:[{required:!0,message:"请输入验证码"}]},{button:()=>u(c,{size:"small",type:"primary",color:"#198CFE",onClick:()=>{if(!a.educationalAdministrationPhone){b("请输入负责人手机号码");return}if(!/^1[3456789]\d{9}$/.test(a.educationalAdministrationPhone)){b("手机号码格式不正确");return}n.imgCodeStatus=!0}},{default:()=>[n.sendMsg]})}),u("div",{style:{padding:"10px 16px"}},[u("div",{class:t.tips},[s("负责人即为该学校酷乐秀课堂乐器老师端管理员,手机号即为酷乐秀课堂乐器老师端账号,默认密码为:ktyq+手机号后四位")])])]}),u(c,{class:t.submit,round:!0,block:!0,"native-type":"submit"},{default:()=>[u("img",{class:t.submitIcon,src:ne},null)]})]}),u(C,{show:n.showArea,"onUpdate:show":e=>n.showArea=e,position:"bottom"},{default:()=>[u(P,{areaList:n.areaList,onCancel:()=>n.showArea=!1,onConfirm:({selectedOptions:e})=>{a.provinceCode=e[0].value,a.cityCode=e[1].value,a.regionCode=e[2].value,n.cityName=e.map(d=>d.text).join("-"),n.showArea=!1}},null)]}),u(C,{class:"popup-custom van-scale",transition:"van-scale",closeOnClickOverlay:!1,show:n.success,"onUpdate:show":e=>n.success=e},{default:()=>[u("div",{class:t.successWrap},[u("img",{class:t.p1,src:se},null),u("img",{class:t.p2,src:le},null),u("div",{class:t.btnWrap},[u("div",{class:t.btnTitle},[s("您已成功登记")]),u("div",{class:t.btnDes},[s("欢迎您使用酷乐秀课堂乐器~")]),u(c,{class:t.btn,type:"primary",round:!0},{default:()=>[s("我知道了")]})])])]}),n.imgCodeStatus?u(w,{value:n.imgCodeStatus,"onUpdate:value":e=>n.imgCodeStatus=e,phone:a.educationalAdministrationPhone,onClose:()=>{n.imgCodeStatus=!1},onSendCode:q},null):null])])])}});export{Ee as default};