<template name="headerNavbar">
	<!-- 自定义导航栏 -->
	<view class='navbar-wrap' :style="{height:CustomBar+'px',paddingTop:StatusBar+'px',background:navbarData.bgColor ? navbarData.bgColor : ''}"> 
	  	<view class="navbar-text" 
			  :style="{color:navbarData.textColor ? navbarData.textColor:'',lineHeight:(CustomBar - StatusBar)+'px;',fontSize:fontSizeSetting+'px;',paddingLeft:navbarData.textLeft ? '' : 12+'px'}" :class="platformClass">
	    	  {{navbarData.title ? navbarData.title : " "}}
	  	</view>
	</view>
</template>

<script>
	var self;
	export default{
		name:'headerNavbar',
		props:{
		    navbarData: { // 由父页面传递的数据
				type: Object
		    }
		},
		data() {
			return{
				CustomBar:this.CustomBar,// 顶部导航栏高度
				StatusBar: this.StatusBar,
				fontSizeSetting:this.fontSizeSetting,
				screenWidth:this.screenWidth,
				capsule:this.capsule,
				platformClass:this.platformClass,
			}
		},
		created() {
			if (getCurrentPages().length === 1) { // 当只有一个页面时
			      this.navbarData.haveBack = false;
			} else {
			      this.navbarData.haveBack = true;
			}
		},
		onLoad(){
			
		},
		methods:{
			
		},
		onShow(){
	
		}
	}
</script>

<style lang="scss">
	.navbar-wrap {
		 position: fixed;
		 width: 100%;
		 top: 0;
		 z-index: 100000;
		 box-sizing: border-box;
	}
	.navbar-text {
		 font-size: 30rpx;
		 color: #000000;
		 font-weight: 500;
	}
	.navbar-text.center{
		text-align: center;
	}
	.navbar-text.left{
		text-align: left;
		padding-left: 45px;
	}
</style>