|
@@ -8,13 +8,24 @@
|
|
|
</route>
|
|
|
<script setup lang="ts">
|
|
|
import SectionHeading from '@/components/section-heading.vue'
|
|
|
-import { getContents, getStudyTours } from '../../../core/libs/requests'
|
|
|
+import { getAppMemberLevelConfigs, getStudyTours } from '../../../core/libs/requests'
|
|
|
import dayjs from 'dayjs'
|
|
|
import StudyTourCard from './components/study-tour-card.vue'
|
|
|
import PageHelper from '@/components/page-helper.vue'
|
|
|
|
|
|
const title = computed(() => `${dayjs().year()}年游学计划`)
|
|
|
-onMounted(async () => {})
|
|
|
+const { data: levels, run: setLevels } = useRequest(() => getAppMemberLevelConfigs(), {
|
|
|
+ initialData: [],
|
|
|
+})
|
|
|
+const levelsByMemberLevel = computed(() =>
|
|
|
+ levels.value.reduce((acc, item) => {
|
|
|
+ acc[item.memberLevel] = item
|
|
|
+ return acc
|
|
|
+ }, {}),
|
|
|
+)
|
|
|
+onMounted(async () => {
|
|
|
+ await setLevels()
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="flex flex-col gap-6 p-3.5">
|
|
@@ -29,7 +40,10 @@ onMounted(async () => {})
|
|
|
<div class="py-4 flex flex-col gap-6">
|
|
|
<template v-for="(it, index) in source.list" :key="index">
|
|
|
<div class="mx--2.5 my--2.5">
|
|
|
- <StudyTourCard custom-class="" :options="it"></StudyTourCard>
|
|
|
+ <StudyTourCard
|
|
|
+ custom-class=""
|
|
|
+ :options="{ ...it, levelsByMemberLevel }"
|
|
|
+ ></StudyTourCard>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|