From e8c394d71a58dc527d89bf05ccf55bc7468c5fb0 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Wed, 1 Jul 2026 12:22:43 +0200 Subject: [PATCH] fixed card display &... --- src/utils/bankBranding.ts | 7 +- src/utils/productAssets.ts | 6 +- .../components/TransactionDetailPanel.vue | 51 +++- .../components/BoursecuBankAccountPicker.vue | 221 +++++++++++++----- .../base/wallet/desktop/DesktopWalletView.vue | 13 +- .../wallet/desktop/styles/desktop-wallet.less | 21 ++ .../base/wallet/mobile/MobileWalletView.vue | 1 + 7 files changed, 256 insertions(+), 64 deletions(-) diff --git a/src/utils/bankBranding.ts b/src/utils/bankBranding.ts index c4b1b78..4d223a8 100644 --- a/src/utils/bankBranding.ts +++ b/src/utils/bankBranding.ts @@ -56,6 +56,11 @@ export function getBankMonogram(bankName?: string): string { return 'بانک' } - const normalized = bankName.replace(/^بانک\s+/u, '').trim() + const trimmed = bankName.trim() + if (/^[A-Za-z]/u.test(trimmed)) { + return trimmed.replace(/[^A-Za-z]/g, '').slice(0, 2).toUpperCase() || 'BN' + } + + const normalized = trimmed.replace(/^بانک\s+/u, '').trim() return normalized.slice(0, 2) || 'بانک' } diff --git a/src/utils/productAssets.ts b/src/utils/productAssets.ts index 605a8ca..e617968 100644 --- a/src/utils/productAssets.ts +++ b/src/utils/productAssets.ts @@ -524,14 +524,14 @@ export function enrichInventoryCardsWithCatalog { + return cards.map((card) => { const fromCatalog = catalog.find((product) => product.id === card.product_id) if (!fromCatalog) { return card } - return { - ...card, + return { + ...card, file: card.file ?? fromCatalog.file ?? null, } }) diff --git a/src/views/base/transactions/components/TransactionDetailPanel.vue b/src/views/base/transactions/components/TransactionDetailPanel.vue index aeecf6d..351fc70 100644 --- a/src/views/base/transactions/components/TransactionDetailPanel.vue +++ b/src/views/base/transactions/components/TransactionDetailPanel.vue @@ -13,8 +13,16 @@ ریال -
-
+
+
{{ getTransactionTradePriceLabel(tradeProduct) }} حین معامله:
@@ -22,8 +30,13 @@ ریال
-
-
+
+
مقدار {{ tradeProductLabel }} مبادله شده:
-
-
{{ formatGoldAmount(item.gold) }}
+
+ +
{{ formatGoldAmount(item.gold) }}
{{ item.unit }}
resolveTransactionTradeProduct(props.item)) const tradeProductLabel = computed( () => (tradeProduct.value?.title ?? '').trim() || getMeltedGoldTradeLabel(), ) +const tradeProductImage = computed(() => + getProductDisplayImage(props.item.product ?? tradeProduct.value ?? props.item.wallet?.product ?? null), +) const metalWalletProduct = computed(() => { if (props.item.order && tradeProduct.value?.title) { return tradeProduct.value @@ -145,3 +167,20 @@ const showMetalWalletBalance = computed( || Math.abs(Number(props.item.balance_gold) || 0) > 0, ) + + diff --git a/src/views/base/wallet/components/BoursecuBankAccountPicker.vue b/src/views/base/wallet/components/BoursecuBankAccountPicker.vue index 9c04c8c..e6b12f7 100644 --- a/src/views/base/wallet/components/BoursecuBankAccountPicker.vue +++ b/src/views/base/wallet/components/BoursecuBankAccountPicker.vue @@ -1,56 +1,90 @@ @@ -153,24 +210,38 @@ onClickOutside(rootRef, () => { text-align: center; font-size: 0.875rem; color: #6b7280; + + &--desktop { + padding: 24px 0; + } } -.boursecu-bank-picker__dropdown { - position: absolute; - top: calc(100% + 8px); - right: 0; - left: 0; - z-index: 30; +.boursecu-bank-picker__overlay { + position: fixed; + inset: 0; + z-index: 5200; + display: flex; + align-items: center; + justify-content: center; + padding: 1.25rem; + background: rgba(15, 23, 42, 0.28); + backdrop-filter: blur(2px); +} + +.boursecu-bank-picker__sheet { + width: min(100%, 22rem); + max-height: min(70vh, 28rem); + overflow-y: auto; display: flex; flex-direction: column; - gap: 4px; - padding: 8px; + gap: 6px; + padding: 10px; border-radius: 16px; background: #fff; - box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); + box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16); } -.boursecu-bank-picker__option { +.boursecu-bank-picker__sheet-item { appearance: none; width: 100%; border: none; @@ -180,10 +251,54 @@ onClickOutside(rootRef, () => { cursor: pointer; text-align: right; transition: background-color 0.15s ease; + + &--active, + &:hover { + background: #eceff1; + } } -.boursecu-bank-picker__option--active, -.boursecu-bank-picker__option:hover { - background: #eceff1; +.boursecu-bank-picker--desktop { + gap: 0; + flex: 1; + min-height: 0; +} + +.boursecu-bank-picker__list { + display: flex; + flex-direction: column; + gap: 4px; + padding: 0 24px 24px; + overflow-y: auto; + flex: 1; +} + +.boursecu-bank-picker__list-item { + appearance: none; + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + border: none; + border-radius: 12px; + background: transparent; + padding: 10px 12px; + cursor: pointer; + text-align: right; + transition: background-color 0.15s ease; + + &--active { + background: #eceff1; + } + + &:hover:not(&--active) { + background: #f8fafc; + } +} + +.boursecu-bank-picker__list-chevron { + flex-shrink: 0; + color: #6b7280; } diff --git a/src/views/base/wallet/desktop/DesktopWalletView.vue b/src/views/base/wallet/desktop/DesktopWalletView.vue index 1a74021..2ee6eaa 100644 --- a/src/views/base/wallet/desktop/DesktopWalletView.vue +++ b/src/views/base/wallet/desktop/DesktopWalletView.vue @@ -131,7 +131,15 @@

{{ isBoursecu ? 'حساب‌های بانکی' : 'کارت‌های بانکی' }}

+
+

واریز به

+

هیچ کارتی یافت نشد

@@ -152,6 +162,7 @@ diff --git a/src/views/base/wallet/desktop/styles/desktop-wallet.less b/src/views/base/wallet/desktop/styles/desktop-wallet.less index a19ae73..881ba23 100644 --- a/src/views/base/wallet/desktop/styles/desktop-wallet.less +++ b/src/views/base/wallet/desktop/styles/desktop-wallet.less @@ -210,6 +210,27 @@ margin: 0; } + &__subtitle { + margin: 0; + padding: 0 24px 8px; + font-size: 13px; + font-weight: 600; + color: #6b7280; + text-align: right; + } + + &__add-link { + appearance: none; + border: none; + background: transparent; + padding: 0; + font-size: 14px; + font-weight: 700; + color: #2563eb; + cursor: pointer; + font-family: inherit; + } + &__scroll { flex: 1; overflow-y: auto; diff --git a/src/views/base/wallet/mobile/MobileWalletView.vue b/src/views/base/wallet/mobile/MobileWalletView.vue index 88cf978..c26e261 100644 --- a/src/views/base/wallet/mobile/MobileWalletView.vue +++ b/src/views/base/wallet/mobile/MobileWalletView.vue @@ -32,6 +32,7 @@