import{d as l,D as a,a as o,A as n,I as p,V as r,S as i}from"./index-971588a5.js";import{C as u}from"./index-7d44a89e.js";const h="_mProtocol_7s6ie_1",d="_center_7s6ie_6",m="_protocolText_7s6ie_11",C="_boxStyle_7s6ie_15",T="_protocolContent_7s6ie_40",e={mProtocol:h,center:d,protocolText:m,boxStyle:C,protocolContent:T},w="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAeCAYAAAA/xX6fAAAAAXNSR0IArs4c6QAAAn1JREFUSEu9lstPU1EQh79pSwEJKkoMcWeMGl24cGEgCtXNrUSWiIH/waWoSHxENJG/wJ278tClxtgFCCwgrkw0UaOJr8RHgGAbIgUpY869thZ629uHuXd7ZuabO+c3c0bw+RMvnirCuNWOylmUNkQOgDY5frKE6juEWUQf0xOfEUGLxSwK1BGrG5EhlENeiTl83qI6KL3xh4XsXYE6bu0jTQyktSRQnpHOEaRPeuIfth7lATXWGUE2TIbNlcGyXgtooFv6nkzlxtkE/AuLA+EqYRn3NTRg5UKzQKeM8vw//NnWXBcI6vFMef8BR6zZyu/Mqx46J73xNkdXgK1G5IGXW3Xnes6oV+w+G4u+Lln6lVJNy5x/elh0zOpgQzYpqdKY1O6AuiZIfHQPEdCIaMwaRuRixZCM4879cPoOhLfDRD/Mv8wPKQyLjkSngfaqgLsOwqnbEG6E9BrEL0Dik1vIGdHRM99QbSkIDISwp6Ouu5s0H4HILahpgPUUzNyAHy/cbUW+i45GUyi1rhYm4857ztHkACS3ZL3nKHTchFA9/P4F09dg/lXhYgmrxYH1u6HrPgTDkFqCiUuQ/OwEbDkGJ69DqBbWlmFqEBbfFL8ZB+hR0tzAKwbaD4174cRVJ5HVJDwbgKX33jKwS1qKaHJLl0pAuAHM3aZ+wuQVSOQ9CoXgRjTRuyj9nunZ4hiCmm2O6coiTF6G5BdP16yB3RblNL6Rv4EaNRrY8tfSYcbSbvxyR1uoDlQhvVoeLDPajJevwzuTpvr5PNl/6fcDbEOdfcafFSNbWj+XqCzUzzUxV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bHaBVruj59TsxQZb+QZ+ZWihyWJ8mVmh79TLXt010UOp7VrQ0YzzvQgnoTzbrSCTq/68du7tP2r9kkP+2pKJAAAAAElFTkSuQmCC",E={BUY_ORDER:"《课堂乐器服务协议》",REGISTER:"《课堂乐器注册协议》"},b=l({name:"o-protocol",props:{showHeader:{type:Boolean,default:!1},modelValue:{type:Boolean,default:!1},prototcolType:{type:String,default:"BUY_ORDER"},center:{type:Boolean,default:!1}},data(){return{exists:!0,checked:this.modelValue,popupStatus:!1,protocolHTML:"",protocolPopup:null}},async mounted(){try{this.checked=this.checked||this.exists,this.$emit("update:modelValue",this.checked||this.exists)}catch(t){}this.checked=this.modelValue,window.addEventListener("hashchange",this.onHash,!1)},unmounted(){window.removeEventListener("hashchange",this.onHash,!1)},watch:{checked(t){this.$emit("update:modelValue",t)},modelValue(){this.checked=this.modelValue}},methods:{async getContractDetail(){try{if(!this.protocolHTML)if(this.prototcolType==="REGISTER"){const{data:t}=await a.get("/edu-app/open/userContractRecord/queryLatestContractTemplate",{params:{contractType:"REGISTER"}});this.protocolHTML=t.contractTemplateContent}else{const{data:t}=await a.get("/edu-app/schoolContractTemplate/queryLatestContractTemplate",{params:{contractType:this.prototcolType}});this.protocolHTML=t.contractTemplateContent}this.onPopupClose()}catch(t){}},onHash(){this.popupStatus=!1},onPopupClose(){if(this.popupStatus=!this.popupStatus,this.popupStatus){const t=this.$route;let s=0;for(const S in t.query)s+=1;const A=window.location.href,c=s>0?"&pto="+ +new Date:"?pto="+ +new Date;history.pushState("","",`${A}${c}`)}else window.history.go(-1);this.protocolPopup&&(this.protocolPopup.scrollTop=0)}},render(){return o("div",{class:[e.mProtocol,this.center?e.center:""]},[o(u,{modelValue:this.checked,"onUpdate:modelValue":t=>this.checked=t},{default:()=>[n("我已阅读并同意")],icon:t=>o(p,{class:e.boxStyle,name:t.checked?w:R},null)}),o("span",{onClick:this.getContractDetail,class:e.protocolText},[E[this.prototcolType]]),o(r,{ref:this.protocolPopup,show:this.popupStatus,position:"bottom",style:{height:"100%"}},{default:()=>[this.showHeader&&o(i,{title:"管乐团平台服务协议"},null),this.popupStatus&&o("div",{id:"mProtocol"},[o("div",{class:e.protocolContent,innerHTML:this.protocolHTML},null)])]})])}});export{b as O};
