|
1 | 1 | <script setup lang="ts"> |
2 | 2 | import { ref, onMounted } from 'vue'; |
3 | | -import { getReportEasterEgg, getReportSummary ,getReportMemory, getReportLocation, getReportSeason, getReportEmotion} from '@/api/annualReport'; |
| 3 | +import { getReportEasterEgg, getReportSummary ,getReportMemory, getReportLocation, getReportSeason, getReportEmotion, getReportExpenses} from '@/api/annualReport'; |
4 | 4 | import type { AnnualReportData } from '@/types/annualReport'; |
5 | 5 | import AnnualContainer from '@/components/annual-report/AnnualContainer.vue'; |
6 | 6 | import SectionCover from '@/components/annual-report/SectionCover.vue'; |
7 | 7 | import SectionPhotoWall from '@/components/annual-report/SectionPhotoWall.vue'; |
8 | 8 | import SectionTime from '@/components/annual-report/SectionTime.vue'; |
9 | 9 | import SectionAccount from '@/components/annual-report/SectionAccount.vue'; |
| 10 | +import SectionExpense from '@/components/annual-report/SectionExpense.vue'; |
10 | 11 | import SectionCategory from '@/components/annual-report/SectionCategory.vue'; |
11 | 12 | import SectionHighlight from '@/components/annual-report/SectionHighlight.vue'; |
12 | 13 | import SectionEmotion from '@/components/annual-report/SectionEmotion.vue'; |
@@ -40,6 +41,8 @@ onMounted(async () => { |
40 | 41 | reportData.value.emotion = emotionData; |
41 | 42 | const easterEggData = await getReportEasterEgg(startTime, endTime); |
42 | 43 | reportData.value.easterEgg = easterEggData; |
| 44 | + const expenseData = await getReportExpenses(startTime, endTime); |
| 45 | + reportData.value.expense = expenseData; |
43 | 46 | } catch (error) { |
44 | 47 | console.error('Failed to load report data', error); |
45 | 48 | } finally { |
@@ -79,6 +82,9 @@ const handleReplay = () => { |
79 | 82 | <!-- 3. Account --> |
80 | 83 | <SectionAccount :time="reportData.time" :emotion="reportData.emotion" /> |
81 | 84 |
|
| 85 | + <!-- 3.5 Expense --> |
| 86 | + <SectionExpense v-if="reportData.expense" :data="reportData.expense" :startTime="startTime" :endTime="endTime" /> |
| 87 | + |
82 | 88 | <!-- 4. Category --> |
83 | 89 | <SectionCategory :data="reportData.memory" /> |
84 | 90 |
|
|
0 commit comments