boursecu bank logos, delete account & physical receive unit fix

This commit is contained in:
2026-07-02 12:39:33 +02:00
parent a41dd6ef9e
commit 1158694896
18 changed files with 173 additions and 36 deletions
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

+36
View File
@@ -2,10 +2,14 @@ import ayandehLogo from '@/assets/img/banks/ayandeh.png'
import keshavarziLogo from '@/assets/img/banks/keshavarzi.png'
import mellatLogo from '@/assets/img/banks/mellat.png'
import melliLogo from '@/assets/img/banks/melli.png'
import parsiyanLogo from '@/assets/img/banks/parsiyan.png'
import pasargadLogo from '@/assets/img/banks/pasargad.png'
import refahLogo from '@/assets/img/banks/refah.png'
import saderatLogo from '@/assets/img/banks/saderat.png'
import samanLogo from '@/assets/img/banks/saman.png'
import sanatomadanLogo from '@/assets/img/banks/sanatomadan.png'
import sarmayehLogo from '@/assets/img/banks/sarmayeh.png'
import sepahLogo from '@/assets/img/banks/sepah.png'
const BANK_ACCENT_COLORS: Record<string, string> = {
'بانک پاسارگاد': '#1f7a54',
@@ -16,6 +20,7 @@ const BANK_ACCENT_COLORS: Record<string, string> = {
'SAMAN': '#2f63d8',
'بانک پارسیان': '#c9a227',
'پارسیان': '#c9a227',
'PARSIAN': '#c9a227',
'بانک ملی': '#4b5e96',
'ملی': '#4b5e96',
'MELLI': '#4b5e96',
@@ -24,6 +29,12 @@ const BANK_ACCENT_COLORS: Record<string, string> = {
'MELLAT': '#c0392b',
'بانک صادرات': '#1a6fb3',
'صادرات': '#1a6fb3',
'SADERAT': '#1a6fb3',
'بانک صنعت و معدن': '#8b6914',
'صنعت و معدن': '#8b6914',
'صنعت معدن': '#8b6914',
'SANATOMADAN': '#8b6914',
'SANAT_MADAN': '#8b6914',
'بانک آینده': '#2b2f6b',
'آینده': '#2b2f6b',
'AYANDEH': '#2b2f6b',
@@ -36,6 +47,9 @@ const BANK_ACCENT_COLORS: Record<string, string> = {
'بانک سرمایه': '#c0392b',
'سرمایه': '#c0392b',
'SARMAYEH': '#c0392b',
'بانک سپه': '#e85d04',
'سپه': '#e85d04',
'SEPAH': '#e85d04',
}
const BANK_LOGOS: Record<string, string> = {
@@ -63,6 +77,20 @@ const BANK_LOGOS: Record<string, string> = {
'بانک سرمایه': sarmayehLogo,
'سرمایه': sarmayehLogo,
'SARMAYEH': sarmayehLogo,
'بانک پارسیان': parsiyanLogo,
'پارسیان': parsiyanLogo,
'PARSIAN': parsiyanLogo,
'بانک صادرات': saderatLogo,
'صادرات': saderatLogo,
'SADERAT': saderatLogo,
'بانک صنعت و معدن': sanatomadanLogo,
'صنعت و معدن': sanatomadanLogo,
'صنعت معدن': sanatomadanLogo,
'SANATOMADAN': sanatomadanLogo,
'SANAT_MADAN': sanatomadanLogo,
'بانک سپه': sepahLogo,
'سپه': sepahLogo,
'SEPAH': sepahLogo,
}
const BANK_PERSIAN_NAMES: Record<string, string> = {
@@ -76,6 +104,7 @@ const BANK_PERSIAN_NAMES: Record<string, string> = {
SARMAYEH: 'بانک سرمایه',
PARSIAN: 'بانک پارسیان',
SADERAT: 'بانک صادرات',
SEPAH: 'بانک سپه',
'بانک پاسارگاد': 'بانک پاسارگاد',
'پاسارگاد': 'بانک پاسارگاد',
'بانک سامان': 'بانک سامان',
@@ -96,6 +125,13 @@ const BANK_PERSIAN_NAMES: Record<string, string> = {
'پارسیان': 'بانک پارسیان',
'بانک صادرات': 'بانک صادرات',
'صادرات': 'بانک صادرات',
'بانک صنعت و معدن': 'بانک صنعت و معدن',
'صنعت و معدن': 'بانک صنعت و معدن',
'صنعت معدن': 'بانک صنعت و معدن',
SANATOMADAN: 'بانک صنعت و معدن',
SANAT_MADAN: 'بانک صنعت و معدن',
'بانک سپه': 'بانک سپه',
'سپه': 'بانک سپه',
}
export function formatShebaForDisplay(value?: string | number | null): string {
@@ -25,7 +25,7 @@
</div>
<div>{{ tx.title }}</div>
</div>
<div>{{ tx.gold * -1 }} عدد</div>
<div>{{ tx.gold * -1 }} {{ getProductQuantityUnit(tx.product) }}</div>
</div>
</div>
</div>
@@ -49,6 +49,7 @@
import type { Physicalreceive } from '@/models/physicalreceive'
import { toJalali } from '@/utils/useDateTime'
import { getProductDisplayImage } from '@/utils/productAssets'
import { getProductQuantityUnit } from '@/utils/productDealMethod'
interface Prop {
item: Physicalreceive
@@ -16,10 +16,11 @@
<div class="products-mobile-root__tabs">
<ARadioGroup
v-model:value="activekey"
size="large"
button-style="solid"
@change="changeTab"
v-model:value="activekey"
class="products-mobile-root__tab-group"
size="small"
button-style="solid"
@change="changeTab"
>
<ARadioButton class="cats" value="همه">همه</ARadioButton>
<ARadioButton
@@ -96,9 +97,30 @@ const storeClosedMessage = computed(() => getStoreClosedMessage())
display: flex;
justify-content: center;
width: 100%;
padding: 1.25rem 0.75rem 0.75rem;
padding: 0.625rem 0.5rem 0.5rem;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
.products-mobile-root__tab-group {
display: inline-flex;
flex-wrap: nowrap;
max-width: 100%;
}
.products-mobile-root__tab-group :deep(.ant-radio-button-wrapper) {
height: auto;
min-height: 2rem;
padding: 0.375rem 0.625rem;
font-size: 0.75rem;
font-weight: 600;
line-height: 1.3;
white-space: nowrap;
}
.products-mobile-root__scroll {
@@ -29,16 +29,28 @@
<Teleport to="body">
<div v-if="isOpen && items.length" class="boursecu-bank-picker__overlay" @click="close">
<div class="boursecu-bank-picker__sheet" @click.stop>
<div
v-for="card in items"
:key="card.id"
class="boursecu-bank-picker__sheet-item"
:class="{ 'boursecu-bank-picker__sheet-item--active': card.id === selectedId }"
>
<button
v-for="card in items"
:key="card.id"
type="button"
class="boursecu-bank-picker__sheet-item"
:class="{ 'boursecu-bank-picker__sheet-item--active': card.id === selectedId }"
class="boursecu-bank-picker__sheet-select"
@click="selectCard(card.id)"
>
<BoursecuBankAccountOption :card="card" />
</button>
<button
type="button"
class="boursecu-bank-picker__delete"
aria-label="حذف حساب"
@click.stop="requestDelete(card)"
>
<BasicIcon icon="vuesax-linear:trash" size="18" />
</button>
</div>
</div>
</div>
</Teleport>
@@ -49,22 +61,34 @@
حساب بانکی ثبت نشده است
</div>
<div v-else class="boursecu-bank-picker__list">
<button
<div
v-for="card in items"
:key="card.id"
type="button"
class="boursecu-bank-picker__list-item"
:class="{ 'boursecu-bank-picker__list-item--active': card.id === selectedId }"
@click="selectCard(card.id)"
>
<BoursecuBankAccountOption :card="card" />
<BasicIcon
v-if="card.id === selectedId"
icon="vuesax-linear:arrow-up-2"
size="18"
class="boursecu-bank-picker__list-chevron"
/>
</button>
<button
type="button"
class="boursecu-bank-picker__list-select"
@click="selectCard(card.id)"
>
<BoursecuBankAccountOption :card="card" />
<BasicIcon
v-if="card.id === selectedId"
icon="vuesax-linear:arrow-up-2"
size="18"
class="boursecu-bank-picker__list-chevron"
/>
</button>
<button
type="button"
class="boursecu-bank-picker__delete"
aria-label="حذف حساب"
@click.stop="requestDelete(card)"
>
<BasicIcon icon="vuesax-linear:trash" size="18" />
</button>
</div>
</div>
</template>
</div>
@@ -75,6 +99,8 @@ import { computed, ref, watch } from 'vue'
import { onClickOutside } from '@vueuse/core'
import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
import type { Card } from '@/models/wallet'
import { deleteCard } from '@/api/wallet'
import { confirmDeleteItem } from '@/utils/useConfirm'
import BoursecuBankAccountOption from './BoursecuBankAccountOption.vue'
const props = withDefaults(
@@ -89,6 +115,7 @@ const props = withDefaults(
const emit = defineEmits<{
'update:id': [value: number | string | undefined]
'add-account': []
'card-deleted': []
}>()
const rootRef = ref<HTMLElement | null>(null)
@@ -133,6 +160,16 @@ function selectCard(cardId?: number) {
isOpen.value = false
}
function requestDelete(card: Card) {
if (card.id == null) {
return
}
confirmDeleteItem('این حساب بانکی', card.id, deleteCard, () => {
emit('card-deleted')
})
}
if (props.variant === 'mobile') {
onClickOutside(rootRef, close)
}
@@ -242,14 +279,11 @@ watch(isOpen, (open) => {
}
.boursecu-bank-picker__sheet-item {
appearance: none;
display: flex;
align-items: center;
gap: 8px;
width: 100%;
border: none;
border-radius: 12px;
background: transparent;
padding: 10px 12px;
cursor: pointer;
text-align: right;
transition: background-color 0.15s ease;
&--active,
@@ -258,6 +292,39 @@ watch(isOpen, (open) => {
}
}
.boursecu-bank-picker__sheet-select {
appearance: none;
flex: 1;
min-width: 0;
border: none;
background: transparent;
padding: 10px 0 10px 12px;
cursor: pointer;
text-align: right;
}
.boursecu-bank-picker__delete {
appearance: none;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 36px;
height: 36px;
margin-inline-end: 8px;
border: none;
border-radius: 10px;
background: transparent;
color: #dc2626;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
&:hover {
background: rgba(220, 38, 38, 0.08);
color: #b91c1c;
}
}
.boursecu-bank-picker--desktop {
gap: 0;
flex: 1;
@@ -274,18 +341,11 @@ watch(isOpen, (open) => {
}
.boursecu-bank-picker__list-item {
appearance: none;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
border: none;
gap: 8px;
width: 100%;
border-radius: 12px;
background: transparent;
padding: 10px 12px;
cursor: pointer;
text-align: right;
transition: background-color 0.15s ease;
&--active {
@@ -297,6 +357,22 @@ watch(isOpen, (open) => {
}
}
.boursecu-bank-picker__list-select {
appearance: none;
flex: 1;
min-width: 0;
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
border: none;
border-radius: 12px;
background: transparent;
padding: 10px 0 10px 12px;
cursor: pointer;
text-align: right;
}
.boursecu-bank-picker__list-chevron {
flex-shrink: 0;
color: #6b7280;
@@ -165,6 +165,7 @@
variant="desktop"
:items="cardItems"
@add-account="showAddCard = true"
@card-deleted="getCards"
/>
<div v-else-if="cardItems.length > 0" class="dwallet-cards">
@@ -40,6 +40,7 @@
:items="cardItems"
class="mb-4"
@add-account="showAddCard = true"
@card-deleted="getCards"
/>
<div class="border-gray-200 border-1 rounded-xl p-5 trans h-40 relative">