<template>
	<view class="classmeeting">
		<view class="title" @click="goMaterials(item.crId)" v-for="(item,index) in mettingList" :key="index">
			<text>主题班会: {{item.crCmTitle}}</text>
			<text>时间: {{item.crTime}}</text>
		</view>
		<view class="bottom-container">
			<button @click="goAddClassMeeting">新增班级材料</button>
		</view>

	</view>
</template>

<script>
	import {
		classMettingContent
	} from "@/api/classmetting/classmeting.js"
	export default {
		data() {
			return {
				mettingList: [],
				pageId: null
			};
		},
		onLoad() {
			this.pageId = this.$route.query.id;
			this.getclassMettingContent(this.pageId)
		},
		methods: {
			getclassMettingContent(id) {
				classMettingContent(id).then(res => {
					if (res.rows) {
						this.mettingList = res.rows.filter(item => item.crCmNo === this.pageId);
					}
				})
			},
			goMaterials(id) {
				uni.navigateTo({
					url: "/pages/classMeeting/classMaterials?id=" + id
				})
			},
			goAddClassMeeting() {
				uni.navigateTo({
					url: "/pages/classMeeting/addClassMeeting"
				})
			}
		}
	}
</script>

<style lang="scss">
	.classmeeting {
		padding: 60rpx 30rpx;
		background-color: #F6F6F6;
		height: 100vh;
		position: relative;

		.title {
			position: relative;
			display: flex;
			flex-direction: column;
			background-color: white;
			border-radius: 10rpx;
			margin-bottom: 40rpx;
			height: 190rpx;
			text {
				// margin-top: 40rpx;
				margin-left: 40rpx;
			}

			text:nth-child(1) {
				margin-top: 40rpx;
				margin-bottom: 15rpx;
				font-weight: bold;
				font-size: 36rpx;
			}

			text:nth-child(2) {
				color: #B2B2B2;
			}

			
		}
		.bottom-container {
				position: fixed;
				width: 80%;
				bottom: 60rpx;
				left: 50%;
				transform: translateX(-50%);
					button{
						background-color: #3388CC;
						color: white;
					}
			}


	}
</style>