<template>
	<view class="qbox adffc">
		<div class="list" v-if="list.length">
			<up-list @scrolltolower="scrolltolower" style="height: 100%;">
				<up-list-item class="list-item" v-for="(item, index) in list" :key="index">
					<image class="expand" :src="imgBase+'questionnaire_icon_down.png'"></image>
					<div class="title">{{item.title||''}}</div>
					<div class="name">团队名称：{{item.teamName||''}}</div>
					<div class="progress adfacjb">
						<div class="progress-left adfac">
							<div class="progress-left-text">作答进度：</div>
							<div class="progress-left-box">
								<div class="progress-left-box-current" :style="{'width':(item.yzdNum/item.sum*100)+'%'}"></div>
							</div>
						</div>
						<div class="progress-right"><span>{{item.yzdNum}}/</span>{{item.sum}}</div>
					</div>
					<div class="bottom adfacjb">
						<div class="bottom-left">截止时间：{{item.endTime}}</div>
						<div class="bottom-right" v-if="item.status===0">立即作答</div>
						<div class="bottom-right" v-else-if="item.status===1">生成报告</div>
						<div class="bottom-right" v-else-if="item.status===2">发送报告</div>
					</div>
				</up-list-item>
			</up-list>
		</div>
		<div class="empty" v-else>
			<page-empty></page-empty>
		</div>
	</view>
</template>

<script>
	import PageEmpty from '@/components/pageEmpty/index.vue'
	export default {
		components:{ PageEmpty },
		props:{
			list:{
				typeof:Array,
				default:[]
			}
		},
		data(){
			return {
				
			}
		},
		methods:{
			scrolltolower(){
				this.$emit('scrolltolower')
			}
		}
	}
</script>

<style scoped lang="scss">
	.qbox{
		width: 100%;
		height: 100%;
		flex: 1;
		
		.list{
			flex: 1;
			margin-top: 20rpx;
			overflow: hidden;
			&-item{
				width: 100%;	
				background: #FFFFFF;
				border-radius: 24rpx;
				margin-top: 20rpx;
				padding: 36rpx 24rpx 19rpx;
				box-sizing: border-box;
				position: relative;
				display: block;
			
				.expand{
					width: 32rpx;
					height: 32rpx;
					position: absolute;
					top: 36rpx;
					right: 32rpx;
				}
				
				.title{
					width: calc(100% - 128rpx);
					font-family: PingFang-SC, PingFang-SC;
					font-weight: bold;
					font-size: 32rpx;
					color: #002846;
					line-height: 32rpx;
				}
				
				.name{
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #667E90;
					line-height: 24rpx;
					margin-top: 35rpx;
				}
				
				.progress{
					margin-top: 36rpx;
					&-left{
						width: calc(100% - 95rpx);
						&-text{
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #667E90;
							line-height: 24rpx;
						}
						&-box{
							flex: 1;
							position: relative;
							height: 12rpx;
							background: #F0F2F8;
							border-radius: 6rpx;
							&-current{
								height: 12rpx;
								background: #7CC5C5;
								border-radius: 6rpx;
								position: absolute;
								top: 0;
								left: 0;
							}
						}
					}
					&-right{
						font-size: 24rpx;
						line-height: 24rpx;
						color: #95A5B1;
						span{
							font-size: 24rpx;
							line-height: 24rpx;
							color: #002846;
						}
					}
				}
				
				.bottom{
					margin-top: 30rpx;
					border-top: 1rpx solid #EFEFEF;
					padding-top: 20rpx;
					&-left{
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #667E90;
						line-height: 24rpx;
					}
					&-right{
						border-radius: 32rpx;
						background: rgba(144, 74, 135, .11);
						padding: 19rpx 22rpx;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 26rpx;
						color: #761E6A;
						line-height: 26rpx;
						letter-spacing: 2rpx;
					}
				}
			}
		}
		
		.empty{
			flex: 1;
		}
	}
</style>