<template>
	<view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
		<cus-header title='我的问卷' bgColor="transparent"></cus-header>
		<image class="top_bg" :src="imgBase+'questionnaire_top_bg.png'" mode="widthFix"></image>
		<div class="tab adfac">
			<div class="tab-pre" :class="{'active':tindex===0}" @click="changeTab(0)">我收到的</div>
			<div class="tab-pre" :class="{'active':tindex===1}" @click="changeTab(1)">我创建的</div>
		</div>
		<div class="query adfacjb">
			<u-icon name="search" size="38rpx" color="#B3BFC8"></u-icon>
			<div class="query-inp">
				<u-input v-model="keyword" border="none" fontSize="26rpx" color="#002846" clearable
				 placeholder="请输入团队名称查询" @confirm="getList"></u-input>
			</div>
		</div>
		<div class="box">
			<template v-if="tindex===0">
				<receive-list :list="receiveList" @scrolltolower="receiveScrolltolower"></receive-list>
			</template>
			<template v-else-if="tindex===1">
				<create-list :list="createList" @scrolltolower="createScrolltolower"></create-list>
			</template>
		</div>
	</view>
</template>

<script>
	import ReceiveList from './components/receiveList.vue'
	import CreateList from './components/createList.vue'
	export default {
		components:{ ReceiveList, CreateList },
		data(){
			return {
				tindex:0,
				keyword:'',
				receiveList:[
					{
						status:0,
						title:'GW+MC PREILL36测评题库版本',
						teamName:'甜梦巧克力有限公司',
						endTime:'2025-05-28 24:00:00'
					},
					{
						status:1,
						title:'GW+MC PREILL36测评题库版本',
						teamName:'甜梦巧克力有限公司',
						endTime:'2025-05-28 24:00:00'
					},
				],
				createList:[
					{
						status:0,
						title:'GW+MC PREILL36测评题库版本',
						teamName:'甜梦巧克力有限公司',
						yzdNum:0,
						sum:1,
						endTime:'2025-05-28 24:00:00'
					},
					{
						status:1,
						title:'GW+MC PREILL36测评题库版本',
						teamName:'甜梦巧克力有限公司',
						yzdNum:5,
						sum:15,
						endTime:'2025-05-28 24:00:00'
					},
					{
						status:2,
						title:'GW+MC PREILL36测评题库版本',
						teamName:'甜梦巧克力有限公司',
						yzdNum:15,
						sum:15,
						endTime:'2025-05-28 24:00:00'
					},
				],
				teamUserShow:false,
			}
		},
		methods:{
			changeTab(index){
				this.tindex = index;
			},
			getReceiveList(){
				
			},
			getCreateList(){
				
			},
			receiveScrolltolower(){
				console.log(1);
			},
			createScrolltolower(){
				console.log(2);
			}
		}
	}
</script>

<style scoped lang="scss">
	.default_page{
		padding: 0 24rpx 40rpx;
		background: #F7F7F7;
		box-sizing: border-box;
		
		.top_bg{
			width: 100%;
			position: absolute;
			left: 0;
			top: 0;
		}
	
		.query{
			width: calc(100% - 12rpx);
			margin: 40rpx 6rpx 0;
			height: 72rpx;
			background: #FFFFFF;
			border-radius: 36rpx;
			padding: 0 36rpx;
			box-sizing: border-box;
			position: relative;
			&-inp{
				width: calc(100% - 55rpx);
			}
		}
	
		.box{
			flex: 1;
		}
	
		.tab{
			margin-top: 20rpx;
			position: relative;
			&-pre{
				width: 50%;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 30rpx;
				color: #002846;
				line-height: 42rpx;
				text-align: center;
				&.active{
					font-weight: bold;
					font-size: 32rpx;
					line-height: 45rpx;
					position: relative;
					&::after{
						content: '';
						width: 48rpx;
						height: 6rpx;
						background: #904A87;
						border-radius: 9rpx;
						position: absolute;
						left: 50%;
						margin-left: -24rpx;
						bottom: -22rpx;
					}
				}
			}
		}
	}
</style>