<template>
	<!-- 教研室详情 -->
	<view class="teachingDetail">
		<statusBar :item="navbar"></statusBar>
		
		<!-- 顶部 -->
		<view class="backPic" v-for="(item,index) in actItemList" :key="index + 'a' ">
			<image src="http://43.139.158.220:5007/img/static/yym/Rectangle 40.png" mode="aspectFill"></image>
			<view class="card">
				<view class="cardTop">
					<view class="title three-font">{{ item.acName }}</view>
					<view class="icons">
						<view class="icon">
							<image src="http://43.139.158.220:5007/img/static/yym/Star 1 (Stroke) (2).png" style="width: 42rpx;height: 40rpx;" mode="aspectFill"></image>
						</view>
						<view class="icon">
							<image src="http://43.139.158.220:5007/img/static/yym/Vector (Stroke) (1).png" style="width: 38rpx;height: 42rpx;" mode="aspectFill"></image>
						</view>
					</view>
				</view>
				<view class="col fz-font">
					成立日期：暂无
				</view>
				<view class="col fz-font">
					人数：{{ item.pers }}人
				</view>
				<view class="tag col">
					<view class="fz-font">教研标签：</view>
					<view class="" style="display: flex;">
						<view class="bqZ-font" style="color: #00b2b6; border: 1px #00b2b6 solid;padding: 2rpx 10rpx;border-radius: 5rpx;font-weight: 600;">
							类型标签
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 两个大资料文件 -->
		<view class="teaData">
			<view class="cla">
				<view class="tit1 three-font">课程资料</view>
				<view class="tit2 fz-font">教研室专属课程</view>
			</view>
			<view class="cla2">
				<view class="tit1 titColor three-font">资源文件</view>
				<view class="tit2 titColor fz-font">教研室专属资源</view>
			</view>
		</view>
		
		<!-- 教研室详情 -->
		<view class="" style="padding: 0 30rpx;">
			<detailBlock :actItemList='actItemList' :item="judge"></detailBlock>
		</view>
		
		<!-- 创建者用户名 -->
		<view style="padding: 0 30rpx;">
			<view class="creator" v-for="(item,index) in actItemList" :key="index + 'b' ">
				<image :src="item.avatar == null ? 'http://43.139.158.220:5007/img/static/mine/Avatar_default.png' : item.avatar" mode="aspectFill"></image>
				<view class="creName btn-font">
					{{ item.username }}
				</view>
			</view>
		</view>
		
		<!-- 当前成员 -->
		<view style="padding: 0 30rpx;">
			<view class="member">
				<view class="memberTop">
					<view class="btn-font" >当前成员</view>
					<view class="fz-font" style="color: rgba(0, 0, 0, 0.4);display: flex;align-items: center;" @click="gotoMorePer">
						<text>查看更多</text>
						<image src="http://43.139.158.220:5007/img/static/mine/arrow-right.png" style="width: 32rpx;height: 32rpx;" mode="aspectFill"></image>
						<!-- <uni-icons type="right"></uni-icons> -->
					</view>
				</view>
				
				<view class="pers">
					<!-- <view class="per" v-for="i in perNum">
						<image :src="i.img"></image>
						<view class="perName fz-font">
							{{i.Name}}
						</view>
					</view> -->
					<view class="per">
						<!-- <image :src="item.img"></image> -->
						<view class="perName fz-font">
							暂无人员
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<!-- 申请加入 -->
		<view class="btnBlock">
			<button class="btn zw-font" @click="applyAdd">申请加入</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				navbar:{
					title:'教研室详情',
					btn:1
				},
				actItemList: [],
				perNum:[
					{Name:'金晶',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (1).png'},
					{Name:'朱心艺',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (2).png'},
					{Name:'李红',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (3).png'},
					{Name:'杨婉',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (4).png'},
					{Name:'郑元雄',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4.png'},
					{Name:'罗佳诚',img:'http://43.139.158.220:5007/img/static/yym/Ellipse 4 (3).png'}
				],
				judge: {
					isShow: 0,
					info:""
				}
			};
		},
		methods:{
			gotoMorePer(){
				uni.navigateTo({
					url:'/pages/dy/dy'
				})
			},
			applyAdd(){
				const clickedAcId = this.actItemList[0].acId;
				console.log(clickedAcId);
				uni.navigateTo({
					url:'/pages/jys/jys?acId=' + clickedAcId
				})
			},
			getActivity() {
				// 获取当前页面的URL
				const routes = getCurrentPages();
				console.log(routes);
				const acId = routes[1].options.acId ? routes[1].options.acId : routes[2].options.acId
				let data = {
					acId: acId,
					ty: 2
				}
				this.$request('/selectActivityID', "POST", data).then(res => {
					console.log(res[0]);
					// this.activeList=[...this.activeList,...res[0]]
					this.actItemList = res[0]
				})
			},
		},
		onShow() {
			this.getActivity()
		}
	}
</script>

<style lang="scss">
	.teachingDetail{
		padding-bottom: 80px;
		.backPic{
			width: 750rpx;
			position: relative;
			image{
				width: 100%;
				display: block;
			}
			.card{
				position: absolute;
				width: 690rpx;
				height: 256rpx;
				bottom: 10px;
				left: 50%;
				padding: 30rpx;
				background-color: rgba(0, 0, 0, 0.26);
				border-radius: 10px;
				transform: translate(-50%,0);
				border: 1rpx #667870 solid;
				color: #ffffff;
				// display: flex;
				// flex-direction: column;
				// justify-content: space-between;
				.cardTop{
					display: flex;
					justify-content: space-between;
					.title{
						// padding-bottom: 20rpx;
						margin-bottom: 20rpx;
						width: 506rpx;
						height: 48rpx;
						color: #ffffff;
						font-family: PingFang SC;
						// font-weight: 550;
						overflow: hidden;
						text-overflow:ellipsis;
						white-space: nowrap;
					}
					.icons{
						flex: 1;
						display: flex;
						align-items: center;
						justify-content: space-between;
						.icon{
							width: 48rpx;
							height: 48rpx;
							display: flex;
							align-items: center;
							justify-content: center;
						}
					}
					
				}
				.col{
					margin-bottom: 10rpx;
					font-weight: 100;
					color: #f0edea;
					// font-size: 30rpx;
				}
				.tag{
					display: flex;
				}
			}
			// background-image: url(http://43.139.158.220:5007/img/static/resource/jqr.png);
		}
		
		.teaData{
			width: 750rpx;
			display: flex;
			padding:20rpx 30rpx;
			justify-content: space-between;
			// padding: 20px 0;
			.cla{
				width: 49%;
				background: linear-gradient(to bottom , #fcfcff 30%, #e8ecfd 100%);
				border-radius: 10px;
				padding: 35rpx 30rpx;
				color: #424f85;
				.tit1{
					// font-size: 38rpx;
					margin-bottom: 10rpx;
					font-weight: bold;
				}
				.tit2{
					// font-size: 22px;
					// font-size: 30rpx;
					// margin-bottom: 5px;
				}
			}
			.cla2{
				width: 45%;
				background: linear-gradient(to bottom , #fcfcff 10%, #fef3ea 100%);
				border-radius: 10px;
				padding: 35rpx 30rpx;
				color: #855e42;
				.tit1{
					// font-size: 38rpx;
					margin-bottom: 10rpx;
					font-weight: bold;
				}
				.tit2{
					// font-size: 22px;
					// margin-bottom: 5px;
					// font-size: 30rpx;
				}
			}
		}
		
		
		.creator{
			display: flex;
			padding: 30rpx;
			background-color: #ffffff;
			align-items: center;
			margin-top: 20rpx;
			border-radius: 10px;
			image{
				width: 96rpx;
				height: 96rpx;
				border-radius: 50%;
				margin-right: 20rpx;
			}
			.creName{
				font-weight: bold;
			}
		}
		
		.member{
			background-color: #ffffff;
			margin-top: 20rpx;
			padding: 30rpx;
			border-radius: 10px;
			margin-bottom: 30rpx;
			.memberTop{
				display: flex;
				justify-content: space-between;
				margin-bottom: 10px;
			}
				
				.pers{
					display: flex;
					justify-content: space-between;
					align-items: center;
					.per{
						display: flex;
						flex-direction: column;
						image{
							width: 72rpx;
							height: 72rpx;
							border-radius: 50%;
						}
						.perName{
							// font-size: 14px;
							text-align: center;
						}
					}
					
				}
				
		}
		
		.btnBlock{
			position: fixed;
			bottom: 0;
			width: 750rpx;
			background-color: #ffffff;
			// padding: 20px 0;
			padding: 2vh 0;
			.btn{
				width: 432rpx;
				height: 88rpx;
				font-weight: 500;
				display: flex;
				justify-content: center;
				align-items: center;
				margin: auto;
				background-color: #0056a8;
				color: #ffffff;
			}
		}
	}
</style>