From b3a666f87643658920c11b5f3cce325b2ca73536 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Wed, 28 May 2025 00:18:55 +0800 Subject: [PATCH] support always showing transaction pictures in transaction edit page for mobile version --- src/core/setting.ts | 2 ++ src/locales/de.json | 1 + src/locales/en.json | 1 + src/locales/es.json | 1 + src/locales/it.json | 1 + src/locales/ja.json | 1 + src/locales/ru.json | 1 + src/locales/uk.json | 1 + src/locales/vi.json | 1 + src/locales/zh_Hans.json | 1 + src/locales/zh_Hant.json | 1 + src/stores/setting.ts | 6 ++++++ .../mobile/settings/PageSettingsPage.vue | 19 +++++++++++++++++-- src/views/mobile/transactions/EditPage.vue | 4 +++- 14 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/core/setting.ts b/src/core/setting.ts index 9dc4ec8e..128bb0af 100644 --- a/src/core/setting.ts +++ b/src/core/setting.ts @@ -29,6 +29,7 @@ export interface ApplicationSettings extends BaseApplicationSetting { autoUpdateExchangeRatesData: boolean; autoSaveTransactionDraft: string; autoGetCurrentGeoLocation: boolean; + alwaysShowTransactionPicturesInMobileTransactionEditPage: boolean; showAddTransactionButtonInDesktopNavbar: boolean; showAmountInHomePage: boolean; timezoneUsedForStatisticsInHomePage: number; @@ -75,6 +76,7 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = { autoUpdateExchangeRatesData: true, autoSaveTransactionDraft: 'disabled', autoGetCurrentGeoLocation: false, + alwaysShowTransactionPicturesInMobileTransactionEditPage: false, showAddTransactionButtonInDesktopNavbar: true, showAmountInHomePage: true, timezoneUsedForStatisticsInHomePage: TimezoneTypeForStatistics.Default.type, diff --git a/src/locales/de.json b/src/locales/de.json index 3bf7abcb..1a5911f1 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Entwurf automatisch speichern", "Show Confirmation Every Time": "Bestätigung jedes mal anzeigen", "Automatically Add Geolocation": "Geolocation automatisch hinzufügen", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Wechselkursdatenseite", "Exchange Rate": "Wechselkurs", "Enable Animation": "Animation aktivieren", diff --git a/src/locales/en.json b/src/locales/en.json index 316098ec..d7302734 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Automatically Save Draft", "Show Confirmation Every Time": "Show Confirmation Every Time", "Automatically Add Geolocation": "Automatically Add Geolocation", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Exchange Rates Data Page", "Exchange Rate": "Exchange Rate", "Enable Animation": "Enable Animation", diff --git a/src/locales/es.json b/src/locales/es.json index 3a73db82..9864b4bb 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Guardar borrador automáticamente", "Show Confirmation Every Time": "Mostrar confirmación cada vez", "Automatically Add Geolocation": "Agregar geolocalización automáticamente", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Página de datos de tipos de cambio", "Exchange Rate": "Tipo de cambio", "Enable Animation": "Habilitar animación", diff --git a/src/locales/it.json b/src/locales/it.json index 2290740f..617c7c8f 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Salva automaticamente bozza", "Show Confirmation Every Time": "Mostra conferma ogni volta", "Automatically Add Geolocation": "Aggiungi automaticamente geolocalizzazione", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Pagina dati tassi di cambio", "Exchange Rate": "Tasso di cambio", "Enable Animation": "Abilita animazione", diff --git a/src/locales/ja.json b/src/locales/ja.json index a458fac3..78c7ce2d 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "下書きの自動保存", "Show Confirmation Every Time": "確認を毎回表示", "Automatically Add Geolocation": "座標を自動的に追加", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "為替レートデータページ", "Exchange Rate": "為替レート", "Enable Animation": "アニメーションの有効", diff --git a/src/locales/ru.json b/src/locales/ru.json index a3ed10da..057e5f8d 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Автоматически сохранять черновик", "Show Confirmation Every Time": "Показывать подтверждение каждый раз", "Automatically Add Geolocation": "Автоматически добавлять геолокацию", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Страница данных о курсах валют", "Exchange Rate": "Курс обмена", "Enable Animation": "Включить анимацию", diff --git a/src/locales/uk.json b/src/locales/uk.json index 000383c7..669df19f 100644 --- a/src/locales/uk.json +++ b/src/locales/uk.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Автоматично зберігати чернетку", "Show Confirmation Every Time": "Показувати підтвердження щоразу", "Automatically Add Geolocation": "Автоматично додавати геолокацію", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Сторінка курсів валют", "Exchange Rate": "Курс обміну", "Enable Animation": "Увімкнути анімацію", diff --git a/src/locales/vi.json b/src/locales/vi.json index b319b657..20f4b083 100644 --- a/src/locales/vi.json +++ b/src/locales/vi.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "Tự động lưu bản nháp", "Show Confirmation Every Time": "Hiển thị xác nhận mỗi lần", "Automatically Add Geolocation": "Tự động thêm vị trí địa lý", + "Always Show Transaction Pictures": "Always Show Transaction Pictures", "Exchange Rates Data Page": "Trang dữ liệu tỷ giá hối đoái", "Exchange Rate": "Tỷ giá hối đoái", "Enable Animation": "Bật hoạt ảnh", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 1dc0f80f..f611be59 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "自动保存草稿", "Show Confirmation Every Time": "每次提示确认", "Automatically Add Geolocation": "自动添加地理位置", + "Always Show Transaction Pictures": "总是显示交易图片", "Exchange Rates Data Page": "汇率数据页面", "Exchange Rate": "汇率", "Enable Animation": "启用动画", diff --git a/src/locales/zh_Hant.json b/src/locales/zh_Hant.json index 28939f41..116127b3 100644 --- a/src/locales/zh_Hant.json +++ b/src/locales/zh_Hant.json @@ -1852,6 +1852,7 @@ "Automatically Save Draft": "自動儲存草稿", "Show Confirmation Every Time": "每次提示確認", "Automatically Add Geolocation": "自動新增地理位置", + "Always Show Transaction Pictures": "總是顯示交易圖片", "Exchange Rates Data Page": "匯率資料頁面", "Exchange Rate": "匯率", "Enable Animation": "啟用動畫", diff --git a/src/stores/setting.ts b/src/stores/setting.ts index e9295d34..c14f4605 100644 --- a/src/stores/setting.ts +++ b/src/stores/setting.ts @@ -54,6 +54,11 @@ export const useSettingsStore = defineStore('settings', () => { appSettings.value.autoGetCurrentGeoLocation = value; } + function setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value: boolean): void { + updateApplicationSettingsValue('alwaysShowTransactionPicturesInMobileTransactionEditPage', value); + appSettings.value.alwaysShowTransactionPicturesInMobileTransactionEditPage = value; + } + function setShowAddTransactionButtonInDesktopNavbar(value: boolean): void { updateApplicationSettingsValue('showAddTransactionButtonInDesktopNavbar', value); appSettings.value.showAddTransactionButtonInDesktopNavbar = value; @@ -171,6 +176,7 @@ export const useSettingsStore = defineStore('settings', () => { setAutoUpdateExchangeRatesData, setAutoSaveTransactionDraft, setAutoGetCurrentGeoLocation, + setAlwaysShowTransactionPicturesInMobileTransactionEditPage, setShowAddTransactionButtonInDesktopNavbar, setShowAmountInHomePage, setTimezoneUsedForStatisticsInHomePage, diff --git a/src/views/mobile/settings/PageSettingsPage.vue b/src/views/mobile/settings/PageSettingsPage.vue index b8efafbb..2a623da7 100644 --- a/src/views/mobile/settings/PageSettingsPage.vue +++ b/src/views/mobile/settings/PageSettingsPage.vue @@ -61,10 +61,16 @@ v-model="autoSaveTransactionDraft"> + {{ tt('Automatically Add Geolocation') }} + + + {{ tt('Always Show Transaction Pictures') }} + + {{ tt('Exchange Rates Data Page') }} @@ -92,11 +98,15 @@ diff --git a/src/views/mobile/transactions/EditPage.vue b/src/views/mobile/transactions/EditPage.vue index 170a6402..8eb9d841 100644 --- a/src/views/mobile/transactions/EditPage.vue +++ b/src/views/mobile/transactions/EditPage.vue @@ -620,7 +620,9 @@ const showScheduledStartDateSheet = ref(false); const showScheduledEndDateSheet = ref(false); const showGeoLocationMapSheet = ref(false); const showTransactionTagSheet = ref(false); -const showTransactionPictures = ref(false); +const showTransactionPictures = ref(pageTypeAndMode?.type === TransactionEditPageType.Transaction + && (pageTypeAndMode?.mode === TransactionEditPageMode.Add || pageTypeAndMode?.mode === TransactionEditPageMode.Edit) + && settingsStore.appSettings.alwaysShowTransactionPicturesInMobileTransactionEditPage); const isDarkMode = computed(() => environmentsStore.framework7DarkMode || false);