<template>
	<view class="head-box" :style="{color:color,backgroundColor:backgroundColor}">
		<uni-icons type="back" size="25" :color="color" @click="navigateBack"></uni-icons>
		<text>{{title}}</text>
		<uni-icons type="home" size="25" :color="color" @click="handleToHome"></uni-icons>
	</view>
</template>

<script>
	export default {
		name: "back",
		props: {
			title: {
				type: String,
			},
			color: {
				type: String,
				default: '#fff'
			},
			backgroundColor: {
				type: String,
				default: '#2476f5'
			},
		},
		data() {
			return {};
		},
		methods: {
			navigateBack() {
				uni.navigateBack();
			},
			handleToHome() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.head-box {
		height: 70rpx;
		padding: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 34rpx;
	}
</style>
