<template>
	<view class="scrollPage-header">
		<view :style="{height:statusBarHeight+'px'}"></view>
		<view class="header-title">
			<view class="header-left" @click="goBack">
				<image style="width: 16px; height: 16px;margin-right:3px;" mode="aspectFit" src="/static/arrow-left.png"></image>
				<text>返回</text>
			</view>
			<view class="header-title"><text class="ellipsis-one" overflow="ellipsis">{{title}}</text></view>
			<view class="header-right">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "sklineHeader",
		props: {
			title: {
				type: String,
				default: '标题'
			},
		},
		data() {
			return {
				statusBarHeight: 0,
			};
		},
		created() {
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
		}
	}
</script>

<style lang="less">
	.scrollPage-header{
		z-index: 1;
		.header-title{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 10px;
			height: 44px;
			background-color: #FFFFFF;
			box-shadow: 0px 1px 0px 0px #E6E6E6;
			.header-title{
				font-size: 16px;
				color: #333333;
				max-width: 70%;
			}
			.header-left{
				display: flex;
				align-items: center;
				text{
					font-size: 14px;
					color: #333333;
					margin-left: 5px;
				}
			}
			.header-right{
				width: 50px;
			}
		}
	}
</style>