<template>
	<view class="header-bar">
		<view class="">
			<uni-icons type="back" size="30" @click="backFn"></uni-icons>
		</view>
		<view class="text">
			{{title || '导航'}}
		</view>
		<view class="">
			<uni-icons type="plusempty" @click.native="toAdd()" v-if="addUrl" size="30"></uni-icons>
			<uni-icons type="bars" size="30"></uni-icons>
		</view>
	</view>
</template>

<script>
	export default{
		name:"header-bar",
		props:{
			title:{
				type: String,
			},
			addUrl:{
				type: String,
			}
		},
		methods:{
			backFn(){
				uni.navigateBack({
						delta:1,//返回层数，2则上上页
					})
			},
			toAdd(){
				uni.navigateTo({
					url:'/pages/supplyChain' + this.addUrl
				})
			},
		},
	}
</script>

<style lang="less">
	.header-bar{
		height: 100rpx;
		line-height: 100rpx;
		display: flex;
		justify-content: space-between;
		padding: 40rpx 24rpx 0;
		background-color: #fff;
	}
</style>