<template>
	<view class="navbar">
		<view class="title">
			<view class="left">
				<uv-icon name="arrow-left"
				v-if="leftClick"
				@click="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 : Function,
			},
			moreClick : {
				type : Function,
			},
			isSearch : {
				type : Boolean,
				default : false,
			},
			isPlus : {
				type : Boolean,
				default : false,
			},
			moreText : {
				
			}
		},
		created() {
		},
		beforeDestroy() {
		},
		data() {
			return {
			};
		},
		methods : {
		}
	}
</script>


<style lang="scss" scoped>
.navbar{
	width: 100%;
	height: 100rpx;
	.cover{
		position: fixed;
		left: 0;
		top: 0;
		width: 100vw;
		height: 100vh;
		z-index: 9999999;
	}
	.plusCircle{
		position: fixed;
		top: calc(100rpx + var(--status-bar-height));
		right: 10rpx;
		background-color: rgb(76, 76, 76);
		z-index: 99999999;
		border-radius: 10rpx;
		animation: fade-in .5s;
		&::after{
			content: '';
			display: block;
			position: absolute;
			top: -34rpx;
			right: 35rpx;
			border-left: 20rpx solid transparent;
			border-right: 20rpx solid transparent;
			border-top: 20rpx solid transparent;
			border-bottom: 20rpx solid rgb(76, 76, 76);
		}
		&>view{
			display: flex;
			color: #fff;
			width: 300rpx;
			height: 120rpx;
			align-items: center;
			border-bottom: 1px solid #ffffff22;
			font-size: 30rpx;
			.icon{
				padding-left: 30rpx;
				padding-right: 20rpx;
				image{
					width: 40rpx;
					height: 40rpx;
				}
			}
		}
	}
}
.title{
	position: fixed;
	top: 0;
	left: 0;
	padding-top: var(--status-bar-height);
	width: 100%;
	height: 100rpx;
	background-color: #f7f7f7;
	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>