<template>
	<view class="box">
		<view class="box_item" v-for="item in list" :key="item.id" @click="goPage(item)">
			{{ item.name }}（{{ item.cardNo }}）
			<img class="item_img" src="../../static/images/right.png" />
		</view>

		<NoData v-if="!list.length" />
	</view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app'
import NoData from '@/components/noData.vue'

const props = defineProps({
	list: Array,
	appType: String
})

onLoad(() => {})

// 点击每一个学生回调
const goPage = (item) => {
	// console.log(item)

	if (props.appType == '学生轨迹') {
		uni.navigateTo({
			url: `/pages/track/track?id=${item.id}`
		})
	} else {
		uni.navigateTo({
			url: `/pages/student/student?msg=${JSON.stringify(item)}`
		})
	}
}
</script>

<style lang="scss" scoped>
.box {
	margin-top: 22rpx;
	padding: 0 20rpx 30rpx 30rpx;
	box-sizing: border-box;
	width: 710rpx;
	background-color: #fff;
	overflow: hidden;

	.box_item {
		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 90rpx;
		font-size: 28rpx;
		border-bottom: 1rpx solid #e6e6e6;

		.item_img {
			width: 31rpx;
			height: 31rpx;
		}
	}
}
</style>
