fix(withdraw): compact mobile receipt preview and deposit action buttons

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-09 11:25:41 +03:30
co-authored by Cursor
parent e0e2b6daa5
commit a778aad7bc
2 changed files with 130 additions and 35 deletions
@@ -6,7 +6,7 @@
<div class="flex w-full items-center justify-between gap-3"> <div class="flex w-full items-center justify-between gap-3">
<span class="min-w-0 truncate">{{ sheetTitle }}</span> <span class="min-w-0 truncate">{{ sheetTitle }}</span>
<div class="flex shrink-0 items-center gap-2"> <div class="flex shrink-0 items-center gap-2">
<template v-if="isPendingDepositRequest(row)"> <template v-if="isPendingDepositRequest(row) && !isMobile">
<MobileIconButton <MobileIconButton
plain plain
icon="vuesax-linear:tick-circle" icon="vuesax-linear:tick-circle"
@@ -131,38 +131,40 @@
full-width full-width
:value="row.reject_reason" :value="row.reject_reason"
/> />
<div v-if="row.receipt_url" class="col-span-2 py-2"> <div v-if="row.receipt_url" class="col-span-2 py-1 min-w-0">
<div class="text-xs text-gray-500 mb-1">فیش واریزی:</div> <div class="text-xs text-gray-500 mb-1.5">فیش واریزی (برای بزرگنمایی لمس کنید)</div>
<a-image <div class="withdraw-mobile-receipt">
:src="row.receipt_url" <a-image
:height="120" :src="row.receipt_url"
class="rounded-lg object-contain border max-w-full" class="withdraw-mobile-receipt__img"
alt="فیش واریزی" alt="فیش واریزی"
/> />
</div>
</div> </div>
</MobileInfoGrid> </MobileInfoGrid>
<div v-if="isPendingDepositRequest(row)" class="mt-4 flex gap-2"> <div
<BaseButton v-if="isPendingDepositRequest(row)"
type="primary" class="withdraw-mobile-actions"
class="flex-1 !bg-emerald-600 hover:!bg-emerald-700 !border-emerald-600 text-white" >
@click="$emit('approveDeposit', row)" <div class="withdraw-mobile-actions__grid">
> <BaseButton
<template #icon> type="primary"
<BaseIcon icon="vuesax-linear:tick-circle" size="16" /> class="!bg-emerald-600 hover:!bg-emerald-700 !border-emerald-600 text-white"
</template> @click="$emit('approveDeposit', row)"
تایید واریز >
</BaseButton> <template #icon>
<BaseButton <BaseIcon icon="vuesax-linear:tick-circle" size="16" />
danger </template>
class="flex-1" تایید واریز
@click="$emit('rejectDeposit', row)" </BaseButton>
> <BaseButton danger @click="$emit('rejectDeposit', row)">
<template #icon> <template #icon>
<BaseIcon icon="vuesax-linear:close-circle" size="16" /> <BaseIcon icon="vuesax-linear:close-circle" size="16" />
</template> </template>
رد واریز رد واریز
</BaseButton> </BaseButton>
</div>
</div> </div>
</template> </template>
</MobileDetailSheet> </MobileDetailSheet>
@@ -270,3 +272,58 @@ function amountIconColor(row: Withdraw) {
return '#b45309' return '#b45309'
} }
</script> </script>
<style scoped>
.withdraw-mobile-receipt {
width: 100%;
max-width: 100%;
padding: 0.5rem;
border-radius: 0.5rem;
border: 1px solid var(--admin-border, #e5e7eb);
background: var(--admin-bg-muted, #f9fafb);
display: flex;
justify-content: center;
align-items: center;
}
.withdraw-mobile-receipt :deep(.ant-image) {
width: 100%;
max-width: 100%;
display: flex;
justify-content: center;
}
.withdraw-mobile-receipt :deep(.ant-image-img) {
width: auto !important;
max-width: 100% !important;
max-height: 9rem !important;
height: auto !important;
object-fit: contain;
}
.withdraw-mobile-actions {
position: sticky;
bottom: 0;
z-index: 2;
margin-top: 0.75rem;
padding-top: 0.75rem;
padding-bottom: calc(0.25rem + env(safe-area-inset-bottom));
background: var(--admin-bg-elevated, #fff);
border-top: 1px solid var(--admin-border, #e5e7eb);
}
.withdraw-mobile-actions__grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
width: 100%;
}
.withdraw-mobile-actions__grid :deep(.ant-btn) {
min-height: 2.5rem;
width: 100%;
padding-inline: 0.5rem;
font-size: 0.8125rem;
line-height: 1.25rem;
}
</style>
+43 -5
View File
@@ -100,7 +100,7 @@
v-model:visible="approveDepositModalVisible" v-model:visible="approveDepositModalVisible"
width="28rem" width="28rem"
title="تایید واریز وجه به کیف پول" title="تایید واریز وجه به کیف پول"
wrap-class-name="withdraw-stack-modal" wrap-class-name="withdraw-stack-modal withdraw-deposit-modal"
:loading="depositActionLoading" :loading="depositActionLoading"
@ok="handleApproveDeposit" @ok="handleApproveDeposit"
@close="approveDepositModalVisible = false" @close="approveDepositModalVisible = false"
@@ -117,12 +117,11 @@
</div> </div>
</div> </div>
<div v-if="selectedDepositRecord.receipt_url" class="rounded border p-2 text-center bg-gray-50"> <div v-if="selectedDepositRecord.receipt_url" class="withdraw-receipt-preview rounded border p-2 text-center bg-gray-50">
<div class="text-xs text-gray-500 mb-2">تصویر فیش واریزی (جهت بزرگنمایی روی عکس کلیک کنید):</div> <div class="text-xs text-gray-500 mb-2">تصویر فیش واریزی (جهت بزرگنمایی روی عکس کلیک کنید):</div>
<a-image <a-image
:src="selectedDepositRecord.receipt_url" :src="selectedDepositRecord.receipt_url"
:height="150" class="withdraw-receipt-preview__img"
class="rounded object-contain mx-auto max-w-full"
alt="فیش واریز" alt="فیش واریز"
/> />
</div> </div>
@@ -152,7 +151,7 @@
v-model:visible="rejectDepositModalVisible" v-model:visible="rejectDepositModalVisible"
width="26rem" width="26rem"
title="رد درخواست واریز" title="رد درخواست واریز"
wrap-class-name="withdraw-stack-modal" wrap-class-name="withdraw-stack-modal withdraw-deposit-modal"
:loading="depositActionLoading" :loading="depositActionLoading"
@ok="handleRejectDeposit" @ok="handleRejectDeposit"
@close="rejectDepositModalVisible = false" @close="rejectDepositModalVisible = false"
@@ -529,4 +528,43 @@ async function handleRejectDeposit() {
.withdraw-stack-modal { .withdraw-stack-modal {
z-index: 1100 !important; z-index: 1100 !important;
} }
.withdraw-receipt-preview :deep(.ant-image) {
width: 100%;
display: flex;
justify-content: center;
}
.withdraw-receipt-preview :deep(.ant-image-img) {
width: auto !important;
max-width: 100% !important;
max-height: 9.5rem !important;
height: auto !important;
object-fit: contain;
margin-inline: auto;
}
@media (max-width: 767.98px) {
.withdraw-deposit-modal .ant-modal {
max-width: calc(100vw - 1rem) !important;
margin: 0.5rem auto !important;
padding-bottom: 0;
}
.withdraw-deposit-modal .ant-modal-body #body {
max-height: min(70vh, 520px);
}
.withdraw-deposit-modal .ant-modal-footer {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
}
.withdraw-deposit-modal .ant-modal-footer .ant-btn {
margin: 0 !important;
width: 100%;
}
}
</style> </style>