<template>
	<view class="footer" v-if="show">
		<view class="footer-item" @tap="onCatalog">
			<text class="iconfont icon-mulu"></text>
			<text>目录</text>
		</view>
		<view class="footer-item" @tap="onNotes">
			<text class="iconfont icon-liuyan"></text>
			<text>记录</text>
		</view>
		<view class="footer-item" @tap="onProgress">
			<text class="iconfont icon-schedule"></text>
			<text>进度</text>
		</view>
		<view class="footer-item" @tap="onSettings">
			<text class="iconfont icon-Aa"></text>
			<text>设置</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'ReaderFooter',
		props: {
			show: {
				type: Boolean,
				default: false
			}
		},
		methods: {
			onCatalog() {
				this.$emit('show-catalog')
			},
			onNotes() {
				this.$emit('show-notes')
			},
			onProgress() {
				this.$emit('show-progress')
			},
			onSettings() {
				this.$emit('show-settings')
			}
		}
	}
</script>

<style scoped>
	.footer {
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		height: 100rpx;
		display: flex;
		justify-content: space-around;
		align-items: center;
		background-color: #ffffff;
		z-index: 100;
	}

	.footer-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		color: #000000;
		font-size: 24rpx;
	}

	.icon {
		font-family: "iconfont";
		font-size: 40rpx;
	}
</style>