<template>
	<view>
		<view class="header-wrap" :style="{backgroundColor: bg}">
			<view :style="{opacity: showLeft ? 1 : 0}" class="left" @click="goBack()">
				<image src="@/static/right-arrow.png" alt="" />
			</view>
			<view class="center">{{ name }}</view>
			<view class="right"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			}
		},
		props: ['name','showLeft','showRight', 'bg'],
		onLoad() {

		},
		methods: {
			goBack() {
				this.$emit('goBack')
			}
		}
	}
</script>

<style scoped lang="scss">
	.header-wrap {
		display: flex;
		justify-content: center;
		align-items: center;
		color: white;
		height: 85rpx;
		font-size: 38rpx;
		padding: 0 34rpx;
		
		.left {
			width: 20%;
			transform: rotate(180deg);
			text-align: right;
			image {
				width: 20rpx;
				height: 36rpx;
			}
		}
		
		.center {
			width: 60%;
			text-align: center;
		}
		
		.right {
			width: 20%;
		}
	}
</style>
