<template>
	<view>
		<view class="">
			<view v-if="thisClass.state != 0" :class="['flex_box',blankNumber < 3 ? 'flex_center' : 'flex_between']">
				<view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '0')"
					v-if="classModel.isTask == 1">
					<view class="img">
						<image src="@/static/icon/pigai2.png" mode="widthFix"></image>
					</view>
					<text>作业评分</text>
				</view>
				<view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '1')"
					v-if="classModel.isMedicalcase == 1">
					<view class="img">
						<image src="@/static/icon/pigai1.png" mode="widthFix"></image>
					</view>
					<text>医案评分</text>
				</view>
				<view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goXindeList('/pages/miniClass/xindeList')"
					v-if="classModel.isExperience == 1">
					<view class="img ">
						<image src="@/static/icon/pigai3.png" mode="widthFix"></image>
					</view>
					<text>心得评分</text>
				</view>
				<view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)" 
				v-if="classModel.isQuestion == 1">
					<view class="img">
						<image src="@/static/icon/sikaoti.png" mode="widthFix"></image>
					</view>
					<text>思考题评分</text>
				</view>
				<!-- <view :class="['item',blankNumber < 3 ? 'flex_box' : '']" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)"
				v-if="classModel.isExam == 1 && thisClass.state == '2'">
					<view class="img">
						<image src="@/static/icon/teseIcon.png" mode="widthFix"></image>
					</view>
					<text>考试评分</text>
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['thisClass', 'roleCode', 'classModel'],
		name: "classInfoWorkBlank",
		data() {
			return {
				blankNumber:0
			};
		},
		onShow() {
			// var _number = this.getBlankNumber
		},
		mounted() {
			this.blankNumber = 0
			console.log('进入mounted');
			if(this.classModel.isTask == 1){
				this.blankNumber++
			}
			if(this.classModel.isMedicalcase == 1){
				this.blankNumber++
			}
			if(this.classModel.isExperience == 1){
				this.blankNumber++
			}
			if(this.classModel.isQuestion == 1){
				this.blankNumber++
			}
			if(this.classModel.isExam == 1){
				this.blankNumber++
			}	
		},
		computed:{
			getBlankNumber(){
				
				var number = 0
							
			},
		},
		methods: {
			goAddHomeWork(type) {

				uni.navigateTo({
					url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}&type=${type}`
				})

			},
			goPingfen(url, classId, type) {
				uni.navigateTo({
					url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}&classState=${this.thisClass.state}`
				})
			},
			goSikaoList(url, id) {
				uni.navigateTo({
					url: `${url}?classId=${id}&roleCode=${this.roleCode}&classState=${this.thisClass.state}`
				})
			},
			goXindeList(url) {
				uni.navigateTo({
					url: `${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}&classState=${this.thisClass.state}`
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.flex_box {
		// justify-content: space-between;
	}
	.flex_center{ 
		// justify-content: center;
	}
	 .item{ margin: 0 0rpx;}
	
	.fabuhomework {
		margin: 20rpx 0;
		margin-top: -10rpx;
		width: 100%;

		text {
			display: block;
			text-align: center;
			border-radius: 10rpx;
			box-sizing: border-box;
			padding: 20rpx;
			color: #fff;
			background-image: linear-gradient(-90deg, #576afc 0%, #97a1ff 100%);
		}
	}

	.item {
		text-align: center;

		text {
			font-size: 28rpx;
			display: inline-block;
			padding-top: 20rpx;
		}
	}

	.img {
		width: 100rpx;
		height: 100rpx;
		margin: 0 auto;

		image {
			width: 100%;
			height: 100%;
		}
	}
	.item.flex_box{align-items: center; justify-content: space-between;
			text{padding-top: 0;}
	}
</style>