<route lang="json">
{
  "style": {
    "navigationBarTitleText": "同学荟",
    "navigationBarBackgroundColor": "#fff"
  }
}
</route>
<script setup lang="ts">
import { NetImages } from '../../../core/libs/net-images'
import { getContents } from '../../../core/libs/requests'
import ClassItem from '../components/class-item.vue'

const { data: classmates, run: setClassmates } = useRequest(
  () => getContents({ contentType: '1', contentCategory: '101' }),
  { initialData: { list: [] } },
)
onMounted(async () => {
  await setClassmates()
})
</script>
<template>
  <view class="p-3.5 flex flex-col gap-6">
    <template v-for="it of classmates.list" :key="it.id">
      <ClassItem :options="it"></ClassItem>
    </template>
    <wd-status-tip
      v-if="!classmates.list?.length"
      :image="NetImages.NotContent"
      tip="暂无内容"
    ></wd-status-tip>
    <template v-if="classmates.list?.length">
      <wd-loadmore custom-class="loadmore" state="finished" />
    </template>
  </view>
</template>
