<template>
	<view style="height: 100%;">
		<view class="title">
			应到：8人
		</view>
		<view style="padding: 26rpx;overflow: hidden;">
			<view class="cate">
				<view class="cateList">
					<view v-for="item in cateList" :class="{active:item.value == cate}" :key="item.value" class="item" @click="cateItemClick(item)">
						{{item.label}}({{item.value}})
					</view>
				</view>
			</view>
		</view>
		<view style="height:calc(100% - 200rpx);overflow: auto;">
			<view class="list">
				<view v-for="(item, index) in list" :key="index" class="item">
					<view class="right">
						<image src="@/static/image/test/image2.png" mode="aspectFill" style="width: 160rpx;height: 160rpx;"></image>
						<view class="des">
							<view class="top">
								<view class="status" :style="{backgroundColor:cate == 1?'#0FAF76':cate == 2?'#EF2D2D':'#F49D19' }">
									{{cateList.find(e=>e.value == cate).label}}
								</view>
								<view class="name">
									杨云
								</view>
							</view>
							<view class="depart">
								系部：安环部
							</view>
							<view class="bottom">
								<view class="major">专业：环艺</view>
								<view class="class">班级：第二班</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: 1
				}, {
					name: 2
				}, {
					name: 3
				}],
				cateList: [{
						value: 1,
						label: '实到'
					},
					{
						value: 2,
						label: '未到'
					},
					{
						value: 3,
						label: '趴桌子'
					},
					{
						value: 4,
						label: '玩手机'
					},
					{
						value: 5,
						label: '睡觉'
					},
				],
				cate: 1,
				checkboxValue: [],
			}
		},
		methods: {
			cateItemClick(item){
				this.cate = item.value
			}
		}
	}
</script>

<style scoped lang="scss">
	.title {
		display: flex;
		color: #333333;
		padding: 26rpx;
		background: #fff;
		border-top: 1rpx solid rgba(0, 0, 0, 0.03);
		font-size: 30rpx;
	}

	.cate {
		font-size: 30rpx;
		overflow-x: auto;

		.cateList {
			display: flex;
			width: auto;

			.item {
				background-color: #fff;
				border-radius: 35rpx;
				padding: 0 56rpx;
				line-height: 70rpx;
				margin-right: 30rpx;
				white-space: nowrap;
				color: #333;
				&.active{
					background-color: #2388FF;
					color: #fff;
				}
			}
		}
	}

	.list {
		padding: 0 26rpx;
		margin-bottom: 60rpx;

		.item {
			display: flex;
			margin-bottom: 28rpx;

			&:last-child {
				margin-bottom: 0;
			}

			.right {
				padding: 30rpx;
				flex: 1;
				background-color: #fff;
				border-radius: 18rpx;
				display: flex;

				.des {
					flex: 1;
					padding-left: 24rpx;
					font-size: 26rpx;
					color: #333;

					.top {
						color: #333;
						font-size: 32rpx;
						display: flex;

						.status {
							display: inline-block;
							font-size: 24rpx;
							line-height: 1.8;
							color: #fff;
							padding: 0 12rpx;
							border-radius: 8rpx;
							margin-right: 12rpx;
						}
					}

					.depart {
						margin-top: 28rpx;
						font-size: 26rpx;
					}

					.bottom {
						font-size: 26rpx;
						margin-top: 18rpx;
						display: flex;
						justify-content: space-between;

						.major {}

						.class {}
					}
				}
			}
		}
	}
</style>