import{p as a,e as c}from"./index.3d95a92c.js";import{d as g,a as s,F as d,N as p}from"./vendor.a0144ce9.js";/* empty css               */const u="_colHeader_1ruqc_1",H="_transparent_1ruqc_8",v="_headerSection_1ruqc_11";var n={colHeader:u,transparent:H,headerSection:v},m=g({name:"col-header",props:{title:String,isBack:{type:Boolean,default:!1},backIconColor:{type:String,default:"black"},isFixed:{type:Boolean,default:!0},styleName:{type:Object,default:()=>({})},titleClass:String,background:{type:String,default:"white"},color:{type:String,default:"#323233"},rightText:String,onClickRight:{type:Function,default:()=>{}},border:{type:Boolean,default:!0},onHeaderBack:{type:Function,default:()=>{}}},data(){return{headerTitle:null,navBarHeight:0,titleHeight:44}},mounted(){this.headerTitle=this.title||this.$route.meta.title,this.navBarInit(()=>{this.onHeaderBack&&this.onHeaderBack()})},unmounted(){a({api:"setBarStatus",content:{status:1}}),a({api:"backIconChange",content:{iconStyle:"black"}})},methods:{navBarInit(t){a({api:"setBarStatus",content:{status:0}}),a({api:"backIconChange",content:{iconStyle:this.backIconColor||"black"}});let r=sessionStorage.getItem("navHeight"),h=sessionStorage.getItem("titleHeight");r&&h?(this.navBarHeight=Number(r),t&&t()):a({api:"getNavHeight"},l=>{const{content:e}=l,o=e.dpi||2;if(e.navHeight){const i=e.navHeight/o;sessionStorage.setItem("navHeight",String(i)),this.navBarHeight=i}if(e.titleHeight){const i=e.titleHeight/o;sessionStorage.setItem("titleHeight",String(i)),this.titleHeight=i}t&&t()}),!c().isApp&&t&&t()},onClickLeft(){this.$router.back()},clickRight(){this.onClickRight&&this.onClickRight()}},render(){return s("div",null,[this.$slots.content?s("div",{style:{paddingTop:`${this.navBarHeight}px`},class:n.headerSection},[this.$slots.content(this.navBarHeight)]):s(d,null,[s("div",{style:{minHeight:`calc(var(--van-nav-bar-height) + ${this.navBarHeight}px)`},class:n.headerSection},[s(p,{title:this.headerTitle,class:[n.colHeader],style:{background:this.background,color:this.color,paddingTop:`${this.navBarHeight}px`,zIndex:99},"left-arrow":this.isBack,rightText:this.rightText,fixed:this.isFixed,border:this.border,"onClick-right":this.clickRight,"onClick-left":this.onClickLeft},{right:()=>this.$slots.right&&this.$slots.right()||this.rightText})]),this.$slots.default?this.$slots.default():null])])}});export{m as C};
