var h=(o,l,s)=>new Promise((f,n)=>{var d=t=>{try{c(s.next(t))}catch(r){n(r)}},e=t=>{try{c(s.throw(t))}catch(r){n(r)}},c=t=>t.done?f(t.value):Promise.resolve(t.value).then(d,e);c((s=s.apply(o,l)).next())});import{_ as p,b as w,P as I,aP as v,h as b,c as u,w as a,f as k,o as _,k as i,j as x,p as m,t as g,al as T}from"./index-CZJgrp0v.js";import{h as y}from"./eventJava.C13-6nEn.js";const A={props:{agreementId:{type:String,default:""}},data(){return{options:{},isAgree:!1,agreementDetail:"",title:"",disabled:!0,countdownTime:5,countdownInterval:null}},onLoad(o){this.options=o},watch:{agreementId:{handler(){this.agreementId&&this.getAgreementDetail()},immediate:!0}},methods:{countdown(){this.countdownInterval=setInterval(()=>{this.countdownTime--,this.countdownTime<=0&&(this.disabled=!1,this.countdownTime=0,this.countdownInterval&&clearInterval(this.countdownInterval))},1e3)},getAgreementDetail(){return h(this,null,function*(){w({title:"加载中"});let o=yield y(this.agreementId),{data:l,code:s}=o;if(s!==0){I({title:o.msg,icon:"none"});return}this.agreementDetail=v(l.content),this.title=l.name,b(),this.countdown()})},clickAgree(){this.$emit("clickAgree")}}};function D(o,l,s,f,n,d){const e=x,c=T,t=k("layout-default-uni");return _(),u(t,null,{default:a(()=>[i(e,{class:"protocol-read"},{default:a(()=>[i(e,{class:"header"},{default:a(()=>[i(e,{class:"title"},{default:a(()=>[m(g(n.title),1)]),_:1})]),_:1}),i(e,{class:"content"},{default:a(()=>[i(c,{nodes:n.agreementDetail},null,8,["nodes"])]),_:1}),i(e,{class:"footer"},{default:a(()=>[n.disabled?(_(),u(e,{key:0,class:"agree-btn disabled",disabled:n.disabled},{default:a(()=>[m(" 同意("+g(n.countdownTime)+"s) ",1)]),_:1},8,["disabled"])):(_(),u(e,{key:1,class:"agree-btn",onClick:d.clickAgree},{default:a(()=>[m("同意")]),_:1},8,["onClick"]))]),_:1})]),_:1})]),_:1})}const N=p(A,[["render",D],["__scopeId","data-v-f60cf188"]]);export{N as default};
