1 |
- import{d as i,g as o,T as s,w as n,n as c,j as t,z as a,M as d,F as m,B as p}from"./index.cf487d9e.js";import{C as h,a as l}from"./index.c5c049f9.js";import{C as f}from"./index.36fcf68d.js";import{C as g}from"./index.92528e2b.js";import"./index.3a938adc.js";import"./index.e3693273.js";import{F as u}from"./index.1c8c6ce9.js";import{a as N,i as C}from"./icon_checkbox_default.2fe5d57e.js";import{a as x}from"./icon_checkbox-tenant.06c74bc2.js";import{F as T}from"./index.db7e92e2.js";const y="_userAuth_1egg3_1",b="_btnGroup_1egg3_6",_="_colProtocol_1egg3_10",B="_protocolText_1egg3_15",F="_boxStyle_1egg3_19";var r={userAuth:y,btnGroup:b,colProtocol:_,protocolText:B,boxStyle:F},P=i({name:"UserAuth",props:{onSuccess:{type:Function,default:()=>{}},exists:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1}},data(){return{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({api:"openWebView",content:{url:`${location.origin}/${e}/#/previewProtocol`,orientation:1,isHideTitle:!1}})}},render(){return t(T,{class:r.userAuth,onSubmit:this.onSubmit},{default:()=>[!this.hideHeader&&t(f,{title:"\u5B9E\u540D\u8BA4\u8BC1"},null),t(h,{style:{marginTop:"15px"}},{default:()=>[t(l,{title:"\u59D3\u540D",required:!0},{default:()=>[t(u,{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(u,{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:r.colProtocol},[!this.exists&&t(g,{modelValue:this.checked,"onUpdate:modelValue":e=>this.checked=e},{default:()=>[a("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")],icon:e=>t(d,{class:r.boxStyle,name:e.checked?o.projectType==="tenant"?x:N:C,size:"15"},null)}),this.exists&&t(m,null,[a("\u67E5\u770B")]),t("span",{onClick:this.getContractDetail,class:r.protocolText},[a("\u300A\u7528\u6237\u6CE8\u518C\u534F\u8BAE\u300B")])]),t("div",{class:["btnGroup"]},[t(p,{block:!0,round:!0,type:"primary","native-type":"submit"},{default:()=>[a("\u786E\u5B9A")]})])]})}});export{P as U};
|