<template>
	<view>
		<view class="navbar">
			<view class="status_bar"></view>

			<view class="box">
				<view class="left" @click="navbar_back()">
					<uni-icons type="arrowleft" color="#fff" size="26"></uni-icons>
				</view>
				<view class="title">
					<slot name="title"></slot>
				</view>
				<view class="right" @click="navbar_right()">
					<slot name="icon"></slot>
				</view>
			</view>
		</view>
		<view class="status_bar"></view>
		<view style="height: 88rpx;"></view>
		
		<!-- 使用 -->
		<!-- <navbar @click_right="query()">
			<template #title>
				水文监测
			</template>
			<template #icon>
				<image src="./icon/icon.png" mode=""></image>
			</template>
		</navbar> -->
	</view>
</template>

<script>
	export default {
		name: "navbar",
		props: [
			"icon"
		],
		data() {
			return {

			};
		},
		methods:{
			navbar_back() {
				uni.navigateBack()
			},
			navbar_right(){
				this.$emit("click_right")
			}
		}
	}
</script>

<style lang="scss">
	// 标题栏
	.navbar {
		z-index: 999;
		width: 750rpx;
		position: fixed;
		top: 0;
		left: 0;
		background-color: #009FE8;

		color: #FFFFFF;

		.box {
			background-color: #009FE8;
			display: flex;
			justify-content: space-between;
			align-items: center;

			height: 88rpx;

			.left {
				width: 80rpx;
				height: 88rpx;
				line-height: 88rpx;
				text-align: center;
			}

			.title {
				width: 500rpx;
				text-align: center;
				font-size: 36rpx;
				height: 88rpx;
				line-height: 88rpx;
				font-weight: 500;

				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
			}

			.right {
				width: 80rpx;
				height: 88rpx;
				text-align: left;
				display: flex;
				align-items: center;
			}
		}
	}
</style>