<template>
	<view class="container">
		<!-- 背景图片区域 -->
		<img class="img_bg" src="../../static/images/center-bg.png" />
		<!-- input组件区域 -->
		<headerInput @changeInputValue="changeInputValue" />
		<!-- 学校年级班级区域 -->
		<view class="school">万载三中/七年级/3班</view>

		<!-- 学生列表区域 -->
		<listView :list="list" :appType="appType" />
	</view>
</template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import headerInput from '@/components/headerInput.vue'
import listView from '@/components/listView.vue'

// 学生列表数组
const list = ref([
	{
		id: 1,
		name: '李商隐',
		number: 6262662
	},
	{
		id: 2,
		name: '张三',
		number: 6266662
	},
	{
		id: 3,
		name: '李四',
		number: 6862662
	},
	{
		id: 4,
		name: '王五',
		number: 8262662
	}
])

const appType = ref('')

onLoad((options) => {
	appType.value = options.type
})

// 输入框组件自定义事件
const changeInputValue = (data) => {
	console.log(data)
}
</script>

<style lang="scss" scoped>
.container {
	display: flex;
	flex-direction: column;
	padding: 0 20rpx;
	min-height: 100vh;
	background-color: #f1f6fe;

	// 背景图片区域样式
	.img_bg {
		position: absolute;
		top: -70rpx;
		right: -32rpx;
		width: 589rpx;
		height: 320rpx;
		pointer-events: none;
	}

	// 学校名称区域样式
	.school {
		margin-top: 38rpx;
		color: #808080;
		font-size: 28rpx;
	}
}
</style>
