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
@@ -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">