<template>
	<view class="navbar"
	:style="{backgroundColor : bgColor}">
		<view class="title"
		:style="{backgroundColor : bgColor}">
			<view class="left">
				<uv-icon name="arrow-left"
				v-if="leftClick"
				@click="$emit('leftClick')"
				color="#333" size="46rpx"></uv-icon>
			</view>
			<view>{{ title }}</view>
			<view class="icon">
				
				<uv-icon name="search"
				v-if="isSearch"
				color="#333" size="58rpx"></uv-icon>
				
				<uv-icon name="plus-circle" color="#333" 
				v-if="isPlus"
				@click="plusCircleShow = true"
				size="46rpx" style="margin-left: 30rpx;"></uv-icon>
				
				<view v-if="moreClick" style="margin-left: 30rpx;">
					<uv-icon name="more-dot-fill" color="#333"
					v-if="!moreText"
					@click="moreClick()"
					size="46rpx"></uv-icon>
					<view v-else @click="moreClick"
					style="font-weight: 400;font-size: 30rpx;">
						{{ moreText }}
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		name:"navbar",
		props : {
			title : {
				type : String,
				default : ''
			},
			leftClick : {
				type : Boolean,
			},
			moreClick : {
				type : Function,
			},
			isSearch : {
				type : Boolean,
				default : false,
			},
			isPlus : {
				type : Boolean,
				default : false,
			},
			moreText : {
				
			},
			bgColor : {
				default : '#fff'
			}
		},
		created() {
		},
		beforeDestroy() {
		},
		data() {
			return {
			};
		},
		methods : {
		}
	}
</script>


<style lang="scss" scoped>
.navbar{
	width: 100%;
	height: 120rpx;
	padding-top: var(--status-bar-height);
}
.title{
	position: fixed;
	top: 0;
	left: 0;
	padding-top: calc(var(--status-bar-height) + 20rpx);
	width: 100%;
	height: 100rpx;
	background-color: #fff;
	display: flex;
	justify-content: center;
	font-size: 32rpx;
	align-items: center;
	z-index: 99999;
	.left{
		position: absolute;
		left: 40rpx;
		display: flex;
		justify-content: flex-start;
	}
	.icon{
		position: absolute;
		right: 40rpx;
		display: flex;
		justify-content: flex-end;
	}
}


@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
</style>