From 387df07659b99d43fd6e5d5d91517e9d8ccf4732 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 24 May 2025 22:25:23 +0800 Subject: [PATCH] fix transaction list not display after expand the month transaction list --- src/stores/transaction.ts | 6 ++-- src/views/mobile/transactions/ListPage.vue | 41 ++++++++++++---------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/stores/transaction.ts b/src/stores/transaction.ts index e7f0a692..d67f2bdf 100644 --- a/src/stores/transaction.ts +++ b/src/stores/transaction.ts @@ -1274,9 +1274,9 @@ export const useTransactionsStore = defineStore('transactions', () => { return services.getTransactionPictureUrlWithToken(pictureInfo.originalUrl, disableBrowserCache); } - function collapseMonthInTransactionList({ month, collapse }: { month: TransactionMonthList, collapse: boolean }): void { - if (month) { - month.opened = !collapse; + function collapseMonthInTransactionList({ monthList, collapse }: { monthList: TransactionMonthList, collapse: boolean }): void { + if (monthList) { + monthList.opened = !collapse; } } diff --git a/src/views/mobile/transactions/ListPage.vue b/src/views/mobile/transactions/ListPage.vue index 193f058e..72d3c9a3 100644 --- a/src/views/mobile/transactions/ListPage.vue +++ b/src/views/mobile/transactions/ListPage.vue @@ -177,7 +177,9 @@ :key="transactionMonthList.yearMonth" v-for="(transactionMonthList) in transactions"> + @accordion:opened="onTransactionMonthListCollapseStateChanged" + @accordion:close="collapseTransactionMonthList(transactionMonthList, true)" + @accordion:closed="onTransactionMonthListCollapseStateChanged"> - + + - { - return setTransactionMonthListHeights(false); - }).then(() => { - setTransactionInvisibleYearMonthList(); - }); + if (!collapse && transactionInvisibleYearMonths.value[monthList.yearMonth]) { + delete transactionInvisibleYearMonths.value[monthList.yearMonth]; + } } function onPopoverOpen(event: { $el: Framework7Dom }): void { @@ -1443,6 +1441,13 @@ function onScroll(): void { setTransactionInvisibleYearMonthList(); } +function onTransactionMonthListCollapseStateChanged(): void { + setTransactionMonthListHeights(false) + .then(() => { + setTransactionInvisibleYearMonthList(); + }); +} + onMounted(() => { window.addEventListener('resize', onResize); onInfiniteScrolling(onScroll);