<template>
	<view class="dingyue-box">
		<!-- 标题 -->
		<view class="dl-title">
			订阅
		</view>
		<!-- 操作按钮 -->
		<view class="dl-opt-box">
			<view class="dl-menu-box">
				<view v-for="(item,index) in menus" @click="itemClick(index,item)" class="dl-menu"
					:class="index==menuIndex?'dl-menu click':'dl-menu'">{{item}}</view>
			</view>
			<view class="seting">
				设置
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				menus: ['订阅', '关注'],
				menuIndex: 0,
			}
		},
		methods: {
			/**
			 * 菜单点击
			 * @param {Object} index
			 * @param {Object} item
			 */
			itemClick(index, item) {
				if ('订阅' == item) {
					//全部
				} else if ('关注' == item) {
					//关注
				}
				this.menuIndex = index
			},
		}
	}
</script>

<style lang="scss">
	.dingyue-box {
		width: 100%;
		color: #363636;
		background-color: white;
		font-size: 30rpx;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: relative;

		.dl-title {
			font-size: 38rpx;
			width: 100%;
			position: relative;
			text-align: center;
			font-weight: bold;
			z-index: 10;
			padding: 55rpx 0 25rpx 0;
			border-bottom: 1px solid #F4F4F4;
		}

		.dl-opt-box {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;

			.dl-menu-box {
				display: flex;
				flex: 1;
				align-items: center;
				justify-content: initial;
				width: 100%;
				padding-top: 20rpx;

				.dl-menu {
					width: 100rpx;
					font-size: 30rpx;
					margin: 0 20rpx;
					padding-bottom: 20rpx;
					text-align: center;
				}

				.click {
					color: #FF434E;
					font-weight: bold;
					border-bottom: 2px solid #FF434E;
				}
			}

			.seting {
				width: 200rpx;
				display: flex;
				align-items: self-end;
				justify-content: center;
			}
		}
	}
</style>