<template>
	<div class="pb_content" style="background: rgb(246 246 246)">
		<div class="pb_head" style="height: 6rem">
			<div class="top_first">
				<div class="tx" @click="goTo('/myDetail')">
					<img src="../../assets/icon/portal.png" alt="" />
				</div>
				<div class="tx_right">
					<div class="right_first">
						<div>蓝小琴</div>
						<div class="leader">
							<img src="../../assets/icon/gleader.png" alt="" />
						</div>
					</div>
					<div>四年级三班</div>
				</div>
			</div>
			<div class="look_work">
				<div class="clean">
					<img src="../../assets/icon/clean.png" alt="" />
				</div>
				<div class="audit_work" @click="goTo('/examine')">审核任务</div>
			</div>
		</div>
		<div class="pb_content_body">
			<div class="body_top">
				<div class="body_top_first">
					<div
						:class="choose == 0 ? 'ischoose' : 'nochoose'"
						@click="choose = 0"
					>
						家
					</div>
					<div
						:class="choose == 1 ? 'ischoose' : 'nochoose'"
						@click="choose = 1"
					>
						校
					</div>
					<div
						:class="choose == 2 ? 'ischoose' : 'nochoose'"
						@click="choose = 2"
					>
						社
					</div>
				</div>
				<div class="body_top_second">
					<el-input
						v-if="this.choose == 0 || this.choose == 1"
						placeholder="请输入任务名搜索.."
					></el-input>
					<el-input v-else placeholder="请输入社团名搜索.."></el-input>
					<div class="search_img">
						<img src="../../assets/icon/search.png" alt="" />
					</div>
				</div>
				<div
					style="font-size: 0.8rem; width: 94%; margin: 0.5rem auto"
					v-if="this.choose == 0 || this.choose == 1"
				>
					最近发布任务
				</div>
				<div class="body_content" v-if="this.choose == 0">
					<div class="content_top">
						<div class="content_top_tb">
							<img src="../../assets/icon/house.png" alt="" />
						</div>
						<div
							style="font-size: 16px; line-height: 2.2rem; padding-left: 0.5rem"
						>
							家庭劳动
						</div>
					</div>
					<div class="content_body">
						<div class="content_new" @click="goTo('/workDetail')">
							<div class="new_left">
								<div class="new_title">绿色快乐农耕园</div>
								<div class="new_content">
									开展"家务劳动小能手"让幼儿体会父母的艰苦劳动
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
						<div class="content_new" @click="goTo('/workDetail')">
							<div class="new_left">
								<div class="new_title">垃圾分类203</div>
								<div class="new_content">
									辛苦，激发幼儿为父母分担家务劳动的激情和孝敬父母的感恩之心
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
						<div class="content_new" @click="goTo('/workDetail')">
							<div class="new_left">
								<div class="new_title">制作中秋节灯笼</div>
								<div class="new_content">
									因此让幼儿在家里做一件力所能及的家务。
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
					</div>
				</div>
				<div class="body_content" v-if="this.choose == 1">
					<div class="content_top">
						<div class="content_top_tb">
							<img src="../../assets/icon/house.png" alt="" />
						</div>
						<div
							style="font-size: 16px; line-height: 2.2rem; padding-left: 0.5rem"
						>
							学校劳动
						</div>
					</div>
					<div class="content_body">
						<div class="content_new">
							<div class="new_left">
								<div class="new_title">绿色快乐农耕园</div>
								<div class="new_content">
									开展"家务劳动小能手"让幼儿体会父母的艰苦劳动
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
						<div class="content_new">
							<div class="new_left">
								<div class="new_title">垃圾分类203</div>
								<div class="new_content">
									辛苦，激发幼儿为父母分担家务劳动的激情和孝敬父母的感恩之心
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
						<div class="content_new">
							<div class="new_left">
								<div class="new_title">制作中秋节灯笼</div>
								<div class="new_content">
									因此让幼儿在家里做一件力所能及的家务。
								</div>
							</div>
							<div
								:class="finish == false ? 'new_right' : 'isfinish_new_right'"
							>
								{{ this.finish == false ? "去完成" : "已完成" }}
							</div>
						</div>
					</div>
				</div>
				<div class="body_content" v-if="this.choose == 2">
					<div class="content_community">
						<div class="community_top">
							<div class="community_people">
								<img src="../../assets/icon/people.png" alt="" />
							</div>
							<div class="community_title">莲花街社区志愿者协会</div>
						</div>
						<div class="community_content">
							<div class="community_content_title">
								“全民防新冠，健康你我他”文明劝导
							</div>
							<div class="community_content_time">2021-09-25</div>
							<div class="content_task">
								<div>任务介绍</div>
								<div>宣传防疫知识，劝导行人做好防疫措施、带好口罩</div>
							</div>
							<div class="content_rgtime">
								<div>报名时间</div>
								<div>2021-09-30</div>
							</div>
							<div class="content_phone">
								<div class="phone">
									<img src="../../assets/icon/phone.png" alt="" />
								</div>
								<div>82575674</div>
							</div>
						</div>
						<div class="community_buttom">
							<div class="community_attend">加入报名</div>
							<div>></div>
						</div>
					</div>
					<div class="content_community">
						<div class="community_top">
							<div class="community_people">
								<img src="../../assets/icon/people.png" alt="" />
							</div>
							<div class="community_title">坂田街道义工联</div>
						</div>
						<div class="community_content">
							<div class="community_content_title">
								“全民防新冠，健康你我他”文明劝导
							</div>
							<div class="community_content_time">2021-09-25</div>
							<div class="content_task">
								<div>任务介绍</div>
								<div>宣传防疫知识，劝导行人做好防疫措施、带好口罩</div>
							</div>
							<div class="content_rgtime">
								<div>报名时间</div>
								<div>2021-09-30</div>
							</div>
							<div class="content_phone">
								<div class="phone">
									<img src="../../assets/icon/phone.png" alt="" />
								</div>
								<div>82575674</div>
							</div>
						</div>
						<div class="community_buttom">
							<div class="community_attend">加入报名</div>
							<div>></div>
						</div>
					</div>
					<div class="content_community">
						<div class="community_top">
							<div class="community_people">
								<img src="../../assets/icon/people.png" alt="" />
							</div>
							<div class="community_title">福田街道志愿者协会</div>
						</div>
						<div class="community_content">
							<div class="community_content_title">
								“全民防新冠，健康你我他”文明劝导
							</div>
							<div class="community_content_time">2021-09-25</div>
							<div class="content_task">
								<div>任务介绍</div>
								<div>宣传防疫知识，劝导行人做好防疫措施、带好口罩</div>
							</div>
							<div class="content_rgtime">
								<div>报名时间</div>
								<div>2021-09-30</div>
							</div>
							<div class="content_phone">
								<div class="phone">
									<img src="../../assets/icon/phone.png" alt="" />
								</div>
								<div>82575674</div>
							</div>
						</div>
						<div class="community_buttom">
							<div class="community_attend">加入报名</div>
							<div>></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				choose: 0,
				finish: false,
			};
		},
		methods: {
			goTo(path) {
				this.$router.push(path);
			},
		},
		activated() {},
	};
</script>

<style scoped>
	.top_first {
		display: flex;
		flex-direction: row;
		justify-content: center;
		height: 100%;
	}
	.tx {
		width: 2.1rem;
		height: 2.1rem;
		line-height: 7.5rem;
	}
	.tx > img,
	.search_img > img,
	.content_top_tb > img,
	.community_people > img,
	.phone > img,
	.leader > img,
	.clean > img {
		width: 100%;
		height: 100%;
	}
	.tx_right {
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		text-align: left;
		padding-left: 0.4rem;
	}
	.right_first > div:nth-child(1) {
		font-size: 1rem;
		line-height: 3rem;
		padding-top: 0.8rem;
	}
	.right_first {
		display: flex;
	}
	.tx_right > div:nth-child(2) {
		font-size: 0.1rem;
		line-height: 0.1rem;
	}
	.body_top_first {
		margin: 0.3rem 0 0.3rem 0;
		display: flex;
	}
	.ischoose {
		width: 4rem;
		text-align: center;
		background: #ff6666;
		border: 0.1rem solid #ff6666;
		border-radius: 3rem;
		color: #fff;
		font-size: 0.7rem;
		margin-left: 0.8rem;
		line-height: 1.2rem;
		box-shadow: 0px 0.3rem 0.1rem #db4141;
	}
	.nochoose {
		background: #dbdbdb;
		width: 4rem;
		text-align: center;
		border-radius: 3rem;
		color: #fff;
		font-size: 0.7rem;
		margin-left: 0.8rem;
		line-height: 1.2rem;
	}
	.body_top_second {
		margin-top: 1rem;
		position: relative;
	}
	.body_top_second >>> .el-input {
		width: 95%;
		border: none;
		margin-left: 0.5rem;
	}
	.body_top_second >>> .el-input > input {
		height: 1.8rem;
		font-size: 0.2rem;
	}
	.search_img {
		width: 1.1rem;
		position: absolute;
		top: 0.3rem;
		right: 0.8rem;
	}
	.content_top {
		width: 95%;
		margin: 0 auto;
		display: flex;
		background: #e8e8e8;
		height: 2.2rem;
		border-radius: 0.2rem;
		box-shadow: 0.1rem 0.2rem 0.2rem #ccc;
	}
	.content_top_tb {
		width: 1.2rem;
		height: 1.2rem;
		padding: 0.5rem 0 0.5rem 0.5rem;
	}
	.content_body {
		width: 95%;
		margin: 0 auto;
		height: 17rem;
		background: #fff;
		overflow: auto;
		border-radius: 0.3rem;
		box-shadow: 0.1rem 0.2rem 0.2rem #ccc;
	}
	.content_new {
		display: flex;
		width: 86%;
		margin: 0 auto;
		flex-direction: row;
		padding: 0.4rem 0.6rem 0.2rem 0.6rem;
		justify-content: space-around;
		border-bottom: 1px dashed #999;
	}
	.new_left {
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
	}
	.new_title {
		font-size: 0.8rem;
		font-weight: bold;
		margin-bottom: 0.4rem;
	}
	.new_content {
		font-size: 0.5rem;
		text-overflow: ellipsis;
		overflow: hidden;
		width: 250px;
		white-space: nowrap;
	}
	.new_right {
		font-size: 0.2rem;
		line-height: 3rem;
		color: #f54444;
	}
	.isfinish_new_right {
		font-size: 0.2rem;
		line-height: 3rem;
		color: #6ec784;
	}
	.content_community {
		background: #fff;
		width: 90%;
		margin: 1rem auto;
		border-radius: 0.4rem;
		border: 1px solid #e0e0e0;
		box-shadow: 0.1rem 0.1rem 0.2rem #ccc;
	}
	.community_top {
		background: rgb(241 241 241);
		display: flex;
		width: 100%;
		padding: 0.5rem 0;
		margin: 0 auto;
		height: 1.5rem;
	}
	.community_people {
		width: 1rem;
		height: 1rem;
		line-height: 1.5rem;
		margin: 0 0.5rem;
	}
	.community_title {
		font-size: 16px;
		line-height: 1.2rem;
	}
	.community_content {
		display: flex;
		flex-direction: column;
		border-bottom: 1px solid #e6e6e6;
	}
	.community_content_title {
		font-size: 0.7rem;
		font-weight: bold;
		margin: 0.5rem 0;
	}
	.community_content_time {
		font-size: 0.1rem;
		margin: 0 0.8rem;
		color: #969696;
	}
	.content_task,
	.content_rgtime,
	.content_phone {
		display: flex;
		align-items: center;
		margin: 0.4rem 0 0 0.8rem;
	}
	.content_phone {
		padding-bottom: 0.8rem;
	}
	.content_task > div:nth-child(1),
	.content_rgtime > div:nth-child(1) {
		font-size: 12px;
		color: #c3c3c3;
		width: 3rem;
		line-height: 1rem;
	}
	.content_task > div:nth-child(2),
	.content_rgtime > div:nth-child(2),
	.content_phone > div:nth-child(2) {
		font-size: 15px;
		width: 14rem;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
	.phone {
		width: 0.9rem;
	}
	.content_phone > div:nth-child(2) {
		padding-left: 0.4rem;
		color: #878a89;
		font-size: 0.1rem;
	}
	.community_attend {
		padding: 0.5rem 0 0.5rem 0.8rem;
		font-size: 16px;
	}
	.leader {
		width: 1.5rem;
		height: 1rem;
		line-height: 4.3rem;
	}
	.look_work {
		display: flex;
		align-items: center;
		position: absolute;
		right: 0.5rem;
		top: 0;
	}
	.clean {
		width: 0.8rem;
		height: 0.8rem;
		line-height: 1rem;
	}
	.audit_work {
		padding-left: 0.2rem;
		font-size: 0.5rem;
	}
	.community_buttom {
		display: flex;
		align-items: center;
		flex-direction: row;
		justify-content: space-between;
	}
	.community_buttom > div:nth-child(2) {
		padding-right: 1rem;
	}
</style>
