import{s,r as a,p as o}from"./index.3d95a92c.js";import{d as i,T as n,a as t,F as c,B as u,j as l}from"./vendor.a0144ce9.js";import{U as d}from"./index.f4e8cdea.js";import"./index.5a88d81f.js";/* empty css              */import"./index.fc7d34d1.js";/* empty css               *//* empty css               *//* empty css               */const m="_cashProtocol_ifi2b_1",p="_submit_ifi2b_4";var r={cashProtocol:m,submit:p},w=i({name:"cash-protocol",data(){return{realStatus:!0,url:""}},async mounted(){try{console.log(s.user);const e=s.user.data;!e.realName||!e.idCardNo?this.realStatus=!1:this.getDetail()}catch{}},methods:{async getDetail(){try{const e=await a.get("/api-teacher/sysUserContractRecord/queryLatestContractTemplate",{params:{contractType:"WITHDRAW"}});this.url=window.location.origin+window.location.pathname+"/pdf/web/viewer.html?file="+encodeURIComponent(e.data.origanalFileUrl)+"&btn=1"}catch{}},async onSubmit(){try{await a.get("/api-teacher/sysUserContractRecord/sign",{params:{contractType:"WITHDRAW"}}),setTimeout(()=>{n("\u7B7E\u7F72\u6210\u529F")},100),setTimeout(()=>{o({api:"openPageSuccess",content:{page:"WITHDRAW"}})},1e3)}catch{}},onSuccess(){this.realStatus=!0,this.getDetail()}},render(){return t("div",{class:r.cashProtocol},[this.realStatus?t(c,null,[t("iframe",{src:this.url,frameborder:"0",style:{width:"100%",height:"100vh",border:"none"}},null),t(u,{type:"primary",size:"large",block:!0,round:!0,class:r.submit,onClick:this.onSubmit},{default:()=>[l("\u6211\u5DF2\u9605\u8BFB\u5E76\u540C\u610F")]})]):t(d,{onSuccess:this.onSuccess},null)])}});export{w as default};
