From fe7cb98410f50925c051a94ea8da233ed9de0022 Mon Sep 17 00:00:00 2001 From: SunCheng Date: Wed, 4 Feb 2026 15:36:42 +0800 Subject: [PATCH] fix --- Web/src/views/calendarV2/Index.vue | 46 ++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/Web/src/views/calendarV2/Index.vue b/Web/src/views/calendarV2/Index.vue index 0f83fac..1694db5 100644 --- a/Web/src/views/calendarV2/Index.vue +++ b/Web/src/views/calendarV2/Index.vue @@ -65,6 +65,14 @@
+ + + @@ -75,6 +83,8 @@ import { showToast } from 'vant' import CalendarModule from './modules/Calendar.vue' import StatsModule from './modules/Stats.vue' import TransactionListModule from './modules/TransactionList.vue' +import TransactionDetailSheet from '@/components/Transaction/TransactionDetailSheet.vue' +import { getTransactionDetail } from '@/api/transactionRecord' // 定义组件名称(keep-alive 需要通过 name 识别) defineOptions({ @@ -135,12 +145,35 @@ const onDayClick = async (day) => { selectedDate.value = clickedDate } -// 点击交易卡片 - 跳转到详情页 -const onTransactionClick = (txn) => { - router.push({ - path: '/transaction-detail', - query: { id: txn.id } - }) +// 交易详情弹窗相关 +const showTransactionDetail = ref(false) +const currentTransaction = ref(null) + +// 点击交易卡片 - 打开详情弹窗 +const onTransactionClick = async (txn) => { + try { + // 获取完整的交易详情 + const response = await getTransactionDetail(txn.id) + if (response.success && response.data) { + currentTransaction.value = response.data + showTransactionDetail.value = true + } else { + showToast('获取交易详情失败') + } + } catch (error) { + console.error('获取交易详情失败:', error) + showToast('获取交易详情失败') + } +} + +// 保存交易后刷新列表 +const handleTransactionSave = () => { + handleTransactionsChanged() +} + +// 删除交易后刷新列表 +const handleTransactionDelete = () => { + handleTransactionsChanged() } // 点击通知按钮 @@ -301,6 +334,7 @@ onBeforeUnmount(() => { /* ========== 页面容器 ========== */ .calendar-v2-wrapper { + background-color: var(--bg-primary); font-family: var(--font-primary); color: var(--text-primary); }