<template>
	<view class="task">
		<!-- 切换 -->
		<view class="task_tab">
			<view class="task_tab_title" v-for="(item, index) in title" :key="item.name" @tap="selectTitle(item.name)"
				:class="{ 'selected': item.name === selectedTitle }">
				{{item.name}}
			</view>
		</view>
		<!-- 列表 -->
		<view class="task_list">
			<view class="task_list_column">
				<view class="task_list_column_label">
					<view class="quest_label">
						急救任务 ：BHU78685F
					</view>
					<view class="quest_status">
						已完成
					</view>
				</view>
				<view class="task_list_column_car">
					
				</view>
				<view class="task_list_column_time">
					
				</view>
			</view>
			<view class="task_list_column">
				
			</view>
			<view class="task_list_column">
				
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: [{
					name: "今日急诊任务"
				}, {
					name: "本周"
				}, {
					name: "本月"
				}, {
					name: "所有任务"
				}],
				selectedTitle: '今日急诊任务' // 初始选中第一个标题
			}
		},
		methods:{
			selectTitle(title) {
			    this.selectedTitle = title;
			  }
		}
	}
</script>

<style lang="scss" scoped>
	.task {
		width: 100%;
		height: 100%;
		box-sizing: border-box;
		.task_tab {
			width: 100%;
			height: 120rpx;
			padding-left: 30rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			border-bottom: 20rpx solid #F5F7FC;
			.task_tab_title {
				margin-right: 40rpx;
				padding-bottom: 20rpx;
			}
			.selected {
			  /* 添加选中标题的样式 */
			  color: #466CB4;
			  font-weight: bold;
			  
			  border-bottom: 1rpx solid #466CB4;
			}
		}
		.task_list{
			width: calc(100% - 30rpx);
			min-height: 300rpx;
			margin-left: 30rpx;
			background: #F5F7FC;
			.task_list_column{
				
				height: 346rpx;
				background: #fff;
				margin-top: 20rpx;
				padding-right: 30rpx;
				display: flex;
				flex-wrap: wrap;
				justify-content: center;
				align-content: space-around;
				.task_list_column_label{
					width: 100%;
					height: 50rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					.quest_label{
						font-weight: 400;
						font-size: 24rpx;
						color: #3B3B3B;
					}
					.quest_status{
						font-weight: 400;
						font-size: 24rpx;
						color: #959595;
					}
				}
				.task_list_column_car{
					width: 100%;
					height: 150rpx;
					// background-color: #466CB4;
				}
				.task_list_column_time{
					width: 100%;
					height: 100rpx;
					// background-color: rosybrown;
				}
				
			}
		}
	}
</style>