import{d as u,g as o,T as s,y as n,f as c,n as p,A as d,j as t,B as r,O as m,F as h,E as f,aT as T}from"./ResizeObserver.es.62ab429c.js";import{C as l}from"./index.3b8bb459.js";import{C as b}from"./index.ac0c4528.js";import{C as y}from"./index.786e83cc.js";import{C}from"./index.2745b15c.js";import"./index.9a52dc9a.js";import"./index.d7a13e47.js";import{F as i}from"./index.82be4917.js";import{a as N}from"./icon_checkbox.808b953c.js";import{i as x}from"./icon_checkbox_default.256c0849.js";import{a as _}from"./icon_checkbox-tenant.ecfa11df.js";import S from"./index.2bf63958.js";import{F as g}from"./index.2b14f9f1.js";const A="_userAuth_863ih_1",B="_btnGroup_863ih_6",F="_btnTenant_863ih_10",v="_colProtocol_863ih_18",w="_protocolText_863ih_23",k="_boxStyle_863ih_27";var a={userAuth:A,btnGroup:B,btnTenant:F,colProtocol:v,protocolText:w,boxStyle:k},M=u({name:"UserAuth",props:{onSuccess:{type:Function,default:()=>{}},exists:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1}},data(){return{popupShow:!1,iframeSrc:"",form:{realName:"",idCardNo:""},checked:!1}},mounted(){this.checked=this.checked||this.exists;const e=o.user.data;this.form.realName=e==null?void 0:e.realName},methods:{async onSubmit(){try{if(!this.checked){s("\u8BF7\u5148\u9605\u8BFB\u5E76\u540C\u610F\u300A\u7528\u6237\u6CE8\u518C\u534F\u8BAE\u300B");return}const e=o.platformType==="STUDENT"?"/api-student/student/realNameAuth":"/api-teacher/teacher/realNameAuth";await n.post(e,{data:{...this.form,contract:!0,save:!0}}),s("\u5B9E\u540D\u6210\u529F"),o.user.data.realName=this.form.realName,o.user.data.idCardNo=this.form.idCardNo,setTimeout(()=>{this.onSuccess()},500)}catch{}},getContractDetail(){const e=o.platformType==="STUDENT"?"student":"teacher";c().isApp?p({api:"openWebView",content:{url:`${d()}/${e}/#/previewProtocol`,orientation:1,isHideTitle:!1}}):this.popupShow=!0}},render(){return t(g,{class:a.userAuth,onSubmit:this.onSubmit},{default:()=>[!this.hideHeader&&t(y,{title:"\u5B9E\u540D\u8BA4\u8BC1"},null),t(b,{style:{marginTop:"15px"}},{default:()=>[t(l,{title:"\u59D3\u540D",required:!0},{default:()=>[t(i,{name:"lessonName",maxlength:20,modelValue:this.form.realName,"onUpdate:modelValue":e=>this.form.realName=e,placeholder:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u771F\u5B9E\u59D3\u540D"}]},null)]}),t(l,{title:"\u8BC1\u4EF6\u53F7\u7801",required:!0},{default:()=>[t(i,{name:"lessonSubjectName",modelValue:this.form.idCardNo,"onUpdate:modelValue":e=>this.form.idCardNo=e,rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7"},{pattern:/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8EAB\u4EFD\u8BC1\u53F7"}],placeholder:"\u8BF7\u8F93\u5165\u8EAB\u4EFD\u8BC1\u53F7"},null)]})]}),t("div",{class:a.colProtocol},[!this.exists&&t(C,{modelValue:this.checked,"onUpdate:modelValue":e=>this.checked=e},{default:()=>[r("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")],icon:e=>t(m,{class:a.boxStyle,name:e.checked?o.projectType==="tenant"?_:N:x,size:"15"},null)}),this.exists&&t(h,null,[r("\u67E5\u770B")]),t("span",{onClick:this.getContractDetail,class:a.protocolText},[r("\u300A\u7528\u6237\u6CE8\u518C\u534F\u8BAE\u300B")])]),t("div",{class:["btnGroup"]},[t(f,{block:!0,round:!0,type:"primary","native-type":"submit",class:o.projectType==="tenant"&&a.btnTenant},{default:()=>[r("\u786E\u5B9A")]})]),t(T,{show:this.popupShow,"onUpdate:show":e=>this.popupShow=e,round:!0,position:"bottom",style:{height:"80vh"}},{default:()=>[t(S,null,null)]})]})}});export{M as U};
